From: cash Date: Sat, 12 Nov 2011 19:28:52 +0000 (-0500) Subject: added better plugin skeleton and added documentation to some of the examples X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=76bea966f7f93e719ccbf6e2350f647636d4da2a;p=lorea%2Felgg.git added better plugin skeleton and added documentation to some of the examples --- diff --git a/documentation/examples/actions/basic.php b/documentation/examples/actions/basic.php new file mode 100644 index 000000000..926e11b79 --- /dev/null +++ b/documentation/examples/actions/basic.php @@ -0,0 +1,22 @@ +annotate('rating', $rating); + +system_message(elgg_echo('rating:success')); +forward(REFERER); diff --git a/documentation/examples/actions/manual_tokens.php b/documentation/examples/actions/manual_tokens.php deleted file mode 100644 index 8dcf61fb1..000000000 --- a/documentation/examples/actions/manual_tokens.php +++ /dev/null @@ -1,6 +0,0 @@ -getSubtype(); + if ($object instanceof ElggObject) { + $subtype = $object->getSubtype(); - switch($subtype) { + switch ($subtype) { case 'blog': case 'thewire': case 'pages': + // prevent these object subtypes from being saved or changed return false; default: return true; @@ -21,4 +28,3 @@ function example_event_handler($event, $type, $params) { return true; } - diff --git a/documentation/examples/events/basic.php b/documentation/examples/events/basic.php index 91704e60b..ca2762344 100644 --- a/documentation/examples/events/basic.php +++ b/documentation/examples/events/basic.php @@ -1,13 +1,17 @@ "Blog", + * into the $mapping array so that it looks like: + * 'blog' => "Rantings", + * + * Follow this pattern for any other string you want to change. Make sure this + * plugin is lower in the plugin list than any plugin that it is modifying. + * + * If you want to add languages other than English, name the file according to + * the language's ISO 639-1 code: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes + */ + +$mapping = array( + 'string:here' => 'Display string here', +); + +add_translation('en', $mapping); diff --git a/documentation/examples/plugins/skeleton/manifest.xml b/documentation/examples/plugins/manifest.xml similarity index 100% rename from documentation/examples/plugins/skeleton/manifest.xml rename to documentation/examples/plugins/manifest.xml diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php new file mode 100644 index 000000000..e69de29bb diff --git a/documentation/examples/plugins/views/default/.gitignore b/documentation/examples/plugins/views/default/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/documentation/stubs/config.php b/documentation/info/config.php similarity index 100% rename from documentation/stubs/config.php rename to documentation/info/config.php diff --git a/documentation/examples/plugins/manifest_options/manifest.xml b/documentation/info/manifest.xml similarity index 100% rename from documentation/examples/plugins/manifest_options/manifest.xml rename to documentation/info/manifest.xml