diff options
Diffstat (limited to 'documentation/examples/plugins')
-rw-r--r-- | documentation/examples/plugins/README.txt | 5 | ||||
-rw-r--r-- | documentation/examples/plugins/actions/.gitignore (renamed from documentation/examples/plugins/skeleton/start.php) | 0 | ||||
-rw-r--r-- | documentation/examples/plugins/languages/en.php | 24 | ||||
-rw-r--r-- | documentation/examples/plugins/manifest.xml (renamed from documentation/examples/plugins/skeleton/manifest.xml) | 2 | ||||
-rw-r--r-- | documentation/examples/plugins/manifest_options/manifest.xml | 95 | ||||
-rw-r--r-- | documentation/examples/plugins/start.php | 12 | ||||
-rw-r--r-- | documentation/examples/plugins/views/default/.gitignore | 0 |
7 files changed, 42 insertions, 96 deletions
diff --git a/documentation/examples/plugins/README.txt b/documentation/examples/plugins/README.txt new file mode 100644 index 000000000..704f56598 --- /dev/null +++ b/documentation/examples/plugins/README.txt @@ -0,0 +1,5 @@ +Plugin Skeleton +========================= +This directory includes a plugin skeleton to be used as the starting point when +creating a new plugin. Just create a new directory in /mod/ and copy the files +and directories into it. Then update the manifest and start coding.
\ No newline at end of file diff --git a/documentation/examples/plugins/skeleton/start.php b/documentation/examples/plugins/actions/.gitignore index e69de29bb..e69de29bb 100644 --- a/documentation/examples/plugins/skeleton/start.php +++ b/documentation/examples/plugins/actions/.gitignore diff --git a/documentation/examples/plugins/languages/en.php b/documentation/examples/plugins/languages/en.php new file mode 100644 index 000000000..35f838560 --- /dev/null +++ b/documentation/examples/plugins/languages/en.php @@ -0,0 +1,24 @@ +<?php +/** + * The core language file is in /languages/en.php and each plugin has its + * language files in a languages directory. To change a string, copy the + * mapping into this file. + * + * For example, to change the blog Tools menu item + * from "Blog" to "Rantings", copy this pair: + * 'blog' => "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 index febe71999..e31624432 100644 --- a/documentation/examples/plugins/skeleton/manifest.xml +++ b/documentation/examples/plugins/manifest.xml @@ -6,7 +6,7 @@ <description>This is a description of my plugin and its features.</description> <website>http://www.elgg.org/</website> <copyright>(C) My Name or Company 2012</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> <type>elgg_release</type> diff --git a/documentation/examples/plugins/manifest_options/manifest.xml b/documentation/examples/plugins/manifest_options/manifest.xml deleted file mode 100644 index 48a5a9558..000000000 --- a/documentation/examples/plugins/manifest_options/manifest.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"> - <name>My Plugin</name> - <author>Elgg</author> - <version>1.0</version> - <blurb>A concise description.</blurb> - <description>This is a longer, more interesting description of my plugin, its features, and other important information.</description> - <website>http://www.elgg.org/</website> - <copyright>(C) Elgg 2010</copyright> - <license>GNU Public License version 2</license> - - <requires> - <type>elgg_version</type> - <version>2009030802</version> - </requires> - - <requires> - <type>elgg_release</type> - <version>1.8</version> - </requires> - - <screenshot> - <description>An example screenshot</description> - <path>graphics/plugin_ss1.png</path> - </screenshot> - - <screenshot> - <description>Another screenshot</description> - <path>graphics/plugin_ss2.png</path> - </screenshot> - - <category>admin</category> - <category>api</category> - - <requires> - <type>php_extension</type> - <name>gd</name> - </requires> - - <requires> - <type>php_ini</type> - <name>short_open_tag</name> - <value>off</value> - </requires> - - <requires> - <type>php_extension</type> - <name>made_up</name> - <version>1.0</version> - </requires> - - <requires> - <type>plugin</type> - <name>fake_plugin</name> - <version>1.0</version> - </requires> - - <requires> - <type>plugin</type> - <name>profile</name> - <version>1.0</version> - </requires> - - <requires> - <type>plugin</type> - <name>profile_api</name> - <version>1.3</version> - <comparison>lt</comparison> - </requires> - - <requires> - <type>priority</type> - <priority>after</priority> - <plugin>blog</plugin> - </requires> - - <conflicts> - <type>plugin</type> - <name>profile_api</name> - <version>1.0</version> - </conflicts> - - <provides> - <type>plugin</type> - <name>profile_api</name> - <version>1.3</version> - </provides> - - <provides> - <type>php_extension</type> - <name>curl</name> - <version>1.0</version> - </provides> - -</plugin_manifest> diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php new file mode 100644 index 000000000..ea1e894b2 --- /dev/null +++ b/documentation/examples/plugins/start.php @@ -0,0 +1,12 @@ +<?php +/** + * Describe plugin here + */ + +elgg_register_event_handler('init', 'system', 'my_plugin_init'); + +function my_plugin_init() { + // Rename this function based on the name of your plugin and update the + // elgg_register_event_handler() call accordingly + +} diff --git a/documentation/examples/plugins/views/default/.gitignore b/documentation/examples/plugins/views/default/.gitignore new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/documentation/examples/plugins/views/default/.gitignore |