From 43f62a08e490728dc5505e6288188b166cc7e15f Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 3 Jun 2010 15:37:23 +0000 Subject: Added entity keyword to ECML. (NB: The old entity keyword is now entity_list) git-svn-id: http://code.elgg.org/elgg/trunk@6343 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/ecml/README.txt | 2 +- mod/ecml/ecml_functions.php | 6 ++++-- mod/ecml/start.php | 3 ++- mod/ecml/views/default/ecml/keywords/entity.php | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 mod/ecml/views/default/ecml/keywords/entity.php diff --git a/mod/ecml/README.txt b/mod/ecml/README.txt index 63a9aacdc..7d59d6dbc 100644 --- a/mod/ecml/README.txt +++ b/mod/ecml/README.txt @@ -191,7 +191,7 @@ CONTENTS: view object/blog: ...logic... - elgg_view('blog/blog', array('blog' => $blog); + echo elgg_view('blog/blog', array('blog' => $blog); ...logic... elgg_view_comments($blog); diff --git a/mod/ecml/ecml_functions.php b/mod/ecml/ecml_functions.php index 7a30cde16..eba8460b2 100644 --- a/mod/ecml/ecml_functions.php +++ b/mod/ecml/ecml_functions.php @@ -30,7 +30,7 @@ function ecml_parse_view_match($matches) { } switch ($keyword) { - case 'entity': + case 'entity_list': $options = ecml_keywords_parse_entity_params($params_string); // must use this lower-level function because I missed refactoring // the list entity functions for relationships. @@ -61,6 +61,8 @@ function ecml_parse_view_match($matches) { } // if nothing matched return the original string. + // @todo this might be undesirable. will show ugly code everywhere + // if you delete a file or something. if (!$content) { $content = $matches[0]; } @@ -219,4 +221,4 @@ function ecml_is_valid_keyword($keyword, $view = NULL) { } return $r; -} \ No newline at end of file +} diff --git a/mod/ecml/start.php b/mod/ecml/start.php index c0ce1d4d6..d2adeca63 100644 --- a/mod/ecml/start.php +++ b/mod/ecml/start.php @@ -149,7 +149,8 @@ function ecml_keyword_hook($hook, $type, $value, $params) { 'blip.tv', 'dailymotion', 'livevideo', - 'redlasso' + 'redlasso', + 'entity' ); foreach ($keywords as $keyword) { diff --git a/mod/ecml/views/default/ecml/keywords/entity.php b/mod/ecml/views/default/ecml/keywords/entity.php new file mode 100644 index 000000000..47d0244cb --- /dev/null +++ b/mod/ecml/views/default/ecml/keywords/entity.php @@ -0,0 +1,22 @@ + $entity->getURL(), + 'title' => $entity->title, + 'text' => "getIcon('tiny')}>" . $entity->title + )); +} else { + echo elgg_echo('ecml:entity:invalid'); +} \ No newline at end of file -- cgit v1.2.3