]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
ECML now only requires a single square bracket.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 16 Apr 2010 15:46:07 +0000 (15:46 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 16 Apr 2010 15:46:07 +0000 (15:46 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5775 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/ecml/README.txt
mod/ecml/languages/en.php
mod/ecml/start.php
mod/ecml/views/default/ecml/help.php

index 67d4522413c9c4668d93e1fd04aa60248bb2f2f4..63a9aacdcc11ce12fd649d0e4038b6ef46979834 100644 (file)
@@ -28,13 +28,13 @@ CONTENTS:
 
 3.  USING ECML KEYWORDS
 
-       All ECML keywords are surrounded by two square brackets: [[ and ]].
+       All ECML keywords are surrounded by square brackets: [ and ].
        Some keywords, like views and entity lists, take optional parameters.
 
        Examples:
-               [[userlist]] -- Display up to 10 newest users.
-               [[youtube src="http://www.youtube.com/watch?v=kCpjgl2baLs"]] -- Embed a YouTube video.
-               [[view src="input/text"]] -- Display a textarea
+               [userlist] -- Display up to 10 newest users.
+               [youtube src="http://www.youtube.com/watch?v=kCpjgl2baLs"] -- Embed a YouTube video.
+               [view src="input/text"] -- Display a textarea
 
 
 3.1  UTILITY KEYWORDS 'entity' AND 'view'
@@ -43,9 +43,9 @@ CONTENTS:
        mainly for embedding content from 3rd party sites, but also include
        two utility views to help non-programmers quickly display content.
 
-       The two utility keywords available are [[entity]] and [[view]].
+       The two utility keywords available are [entity] and [view].
 
-       [[entity]] - Displays a list of entities using similar arguments to the
+       [entity] - Displays a list of entities using similar arguments to the
        elgg_get_entities() function.  See documentation for that function for
        the full list of supported arguments and default values.
 
@@ -53,20 +53,20 @@ CONTENTS:
                * owner: The username owner. (You can still use owner_guid)
 
        Example: Displays a list of all blog posts by the user named 'admin':
-               [[entity type=object subtype=blog owner=admin]]
+               [entity type=object subtype=blog owner=admin]
 
        Example: Displays newest group created:
-               [[entity type=object subtype=group limit=1]]
+               [entity type=object subtype=group limit=1]
 
 
-       [[view]] - Displays a valid Elgg view passing any optional parameters to
+       [view] - Displays a valid Elgg view passing any optional parameters to
        the view.
 
        Example: Display a text input:
-               [[view src="input/text"]]
+               [view src="input/text"]
 
        Example: Display a textarea with a default value:
-               [[view src="input/longtext" value="This is an example of a quoted value!"]]
+               [view src="input/longtext" value="This is an example of a quoted value!"]
 
 
 3.2  EMBEDDED 3RD PARTY MEDIA
@@ -74,10 +74,10 @@ CONTENTS:
        ECML provides support for embedding media from a few of the most common
        media sites:
 
-       * Youtube -- [[youtube src="URL"]]
-       * Vimeo -- [[vimeo src="URL"]]
-       * Slideshare -- [[slideshare id="ID"]] (NB: Use the "wordpress.com" embed
-       link surrounded by two [[s and ]]s.)
+       * Youtube -- [youtube src="URL"]
+       * Vimeo -- [vimeo src="URL"]
+       * Slideshare -- [slideshare id="ID"] (NB: Use the "wordpress.com" embed
+       link)
 
 
 4  CUSTOM ECML KEYWORDS (AKA "THE 'C' in ECML)
@@ -107,7 +107,7 @@ CONTENTS:
 
        How a user will call the keyword:
 
-               [[buttonizer text="This is my button!"]]
+               [buttonizer text="This is my button!"]
 
        How to implement this in a plugin:
 
@@ -118,7 +118,7 @@ CONTENTS:
                                $value['buttonizer'] = array(
                                        'view' => 'buttonizer/ecml/buttonizer',
                                        'description' => 'Makes your text a button!  What could be better?',
-                                       'usage' => 'Use [[buttonizer text="My text"]] to make "My text" a button!'
+                                       'usage' => 'Use [buttonizer text="My text"] to make "My text" a button!'
                                );
 
                                return $value;
@@ -134,11 +134,11 @@ CONTENTS:
 
        This is exactly the same as saying:
 
-               [[view src="buttonizer/ecml/buttonizer" text="This is my button!"]]
+               [view src="buttonizer/ecml/buttonizer" text="This is my button!"]
 
        or even:
 
-               [[view src="input/button" value="This is my button!" type="button"]]
+               [view src="input/button" value="This is my button!" type="button"]
 
        but is much simpler for the user.
 
index 2d1b873ad98d2c95ca2c3761529de61fc8c4235c..2b9b9118b70b89f55a89f96fa37293bcc64d6879 100644 (file)
@@ -19,45 +19,45 @@ $english = array(
 
        // keywords
        'ecml:keywords:desc:entity' => 'Displays a list of any Elgg entity.',
-       'ecml:keywords:usage:entity' => '[[entity]] supports all options in elgg_get_entities()',
+       'ecml:keywords:usage:entity' => '[entity] supports all options in elgg_get_entities()',
 
        'ecml:keywords:desc:view' => 'Displays any Elgg view.',
-       'ecml:keywords:usage:view' => '[[view src="valid/view" arg1=value1 arg2=value2]]',
+       'ecml:keywords:usage:view' => '[view src="valid/view" arg1=value1 arg2=value2]',
 
        'ecml:keywords:desc:googlemaps' => 'Embed a Google Map.',
-       'ecml:keywords:usage:entity' => '[[googlemaps src="URL"]] Use the link code from Google Maps as the src.',
+       'ecml:keywords:usage:entity' => '[googlemaps src="URL"] Use the link code from Google Maps as the src.',
 
        'ecml:keywords:desc:slideshare' => 'Embed a Slideshare slide.',
-       'ecml:keywords:usage:entity' => '[[slideshare id="slideshare_id"]] Use the Wordpress.com embed code, but make sure there are two [s and ]s surrounding it!',
+       'ecml:keywords:usage:entity' => '[slideshare id="slideshare_id"] Use the Wordpress.com embed code.',
 
        'ecml:keywords:desc:vimeo' => 'Embed a Vimeo video.',
-       'ecml:keywords:usage:videmo' => '[[videmo src="URL"]] Use a standard Vimeo URL as the source.',
+       'ecml:keywords:usage:videmo' => '[videmo src="URL"] Use a standard Vimeo URL as the source.',
 
        'ecml:keywords:desc:youtube' => 'Embed a YouTube video.',
-       'ecml:keywords:usage:entity' => '[[youtube src="URL"]] Use a standard YouTube URL as the source.',
+       'ecml:keywords:usage:entity' => '[youtube src="URL"] Use a standard YouTube URL as the source.',
 
 
        // keyword help
        'ecml:keywords_title' => 'Keywords',
        'ecml:keywords_instructions' =>
                'Keywords are replaced with content when viewed.  They must be surrounded by
-               two square brackets ([[ and ]]).  You can build your own or use the ones listed below.
+               square brackets ([ and ]).  You can build your own or use the ones listed below.
                Hover over a keyword to read its description.',
 
        'ecml:keywords_instructions_more' =>
                '
                <p>You can build your own keywords for views and entities.</p>
 
-               <p>[[entity: type=type, subtype=subtype, owner=username, limit=number]]<br />
+               <p>[entity: type=type, subtype=subtype, owner=username, limit=number]<br />
 
                EX: To show 5 blog posts by admin:<br />
-               [[entity: type=object, subtype=blog, owner=admin, limit=5]]</p>
+               [entity: type=object, subtype=blog, owner=admin, limit=5]</p>
 
                <p>You can also specify a valid Elgg view:<br />
-               [[view: elgg_view, name=value]]</p>
+               [view: elgg_view, name=value]</p>
 
                <p>Ex: To show a text input with a default value:<br />
-               [[view: input/text, value=This is a default value]]</p>',
+               [view: input/text, value=This is a default value]</p>',
 
        // admin
        'ecml:admin:admin' => 'ECML Permissions',
index 287bdc730900fdc2f11de3f77e3d3698ccdd5232..941bd90a274ffbaeb02ce54106a656351240cfe8 100644 (file)
@@ -118,9 +118,9 @@ function ecml_admin_page_handler($page) {
 function ecml_parse_view($hook, $entity_type, $return_value, $params) {
        global $CONFIG;
 
-       // give me everything that is not a ], possibly followed by a :, and surrounded by [[ ]]s
+       // give me everything that is not a ], possibly followed by a :, and surrounded by [ ]s
        //$keyword_regex = '/\[\[([a-z0-9_]+):?([^\]]+)?\]\]/';
-       $keyword_regex = '/\[\[([a-z0-9\.]+)([^\]]+)?\]\]/';
+       $keyword_regex = '/\[([a-z0-9\.]+)([^\]]+)?\]/';
        $CONFIG->ecml_current_view = $params['view'];
        $return_value = preg_replace_callback($keyword_regex, 'ecml_parse_view_match', $return_value);
 
@@ -179,4 +179,5 @@ function ecml_views_hook($hook, $type, $value, $params) {
        return $value;
 }
 
-register_elgg_event_handler('init', 'system', 'ecml_init');
\ No newline at end of file
+// be sure to run after other plugins
+register_elgg_event_handler('init', 'system', 'ecml_init', 9999);
\ No newline at end of file
index ed2d1eeece0359cf829e4314ccda78ea32be6a15..2b33f4f7a70991b8df6d2ca682f5a304768216ef 100644 (file)
@@ -18,7 +18,7 @@ $keywords_html = '';
 foreach ($keywords as $keyword => $info) {
        $desc = htmlentities($info['description']);
        $keywords_html .= "
-<dt>[[$keyword]]</dt>
+<dt>[$keyword]</dt>
 <dd>$desc</dd>";
 }