From c7ef93621e50dc3d6ded212e076de510ec2a263f Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 15 Apr 2010 02:34:52 +0000 Subject: Updated ECML docs. Removed the _ as a valid keyword character (it looks funny). Added the media sites in start.php. Fixed bug that prevented [[view]] from working. Consequently, [[view]] now requires a src="" attribute. git-svn-id: http://code.elgg.org/elgg/trunk@5740 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/ecml/ecml_functions.php | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'mod/ecml/ecml_functions.php') diff --git a/mod/ecml/ecml_functions.php b/mod/ecml/ecml_functions.php index f0dcafa24..e818a8f99 100644 --- a/mod/ecml/ecml_functions.php +++ b/mod/ecml/ecml_functions.php @@ -42,9 +42,11 @@ function ecml_parse_view_match($matches) { break; case 'view': - // parses this into an acceptable array for $vars. - $info = ecml_keywords_parse_view_params($params_string); - $content = elgg_view($info['view'], $info['vars']); + // src is a required attribute of view + $vars = ecml_keywords_tokenize_params($params_string); + $vars['ecml_keyword'] = $keyword; + $vars['ecml_params_string'] = $params_string; + $content = elgg_view($vars['src'], $vars); break; @@ -165,28 +167,6 @@ function ecml_keywords_tokenize_params($string) { // return $params; } -/** - * Extract the view and vars for view: keyword - * - * @param $string - * @return array views, vars - */ -function ecml_keywords_parse_view_params($string) { - $vars = ecml_keywords_tokenize_params($string); - - // the first element key is the view - $var_keys = array_keys($vars); - $view = $var_keys[0]; - - $info = array( - 'view' => $view, - 'vars' => $vars - ); - - return $info; - -} - /** * Returns an options array suitable for using in elgg_get_entities() * -- cgit v1.2.3