diff options
Diffstat (limited to 'documentation')
32 files changed, 508 insertions, 206 deletions
diff --git a/documentation/coding_standards/best_practices.txt b/documentation/coding_standards/best_practices.txt new file mode 100644 index 000000000..df04aa845 --- /dev/null +++ b/documentation/coding_standards/best_practices.txt @@ -0,0 +1,60 @@ +*** CODING BEST PRACTICES *** + +The following best practices make code easier to read, easier to maintain, +and easier to debug. Consistent use of these guidelines means less guess +work for developers, which means happier, more productive developers. + +* Adhere to "Don't Repeat Yourself" (DRY) principles of code design and + organization. If you are copy-and-pasting code YOU ARE DOING SOMETHING WRONG. + If you find a block of code that you want to use multiple times, make a + function. If you find views that are identical except for a single value, + pull it out into a generic view that takes an option. + +* Whitespace is free. Don't be afraid to use it to separate blocks of code. + Use a single space to separate function params and string concatenation. + +* Use self-documenting variable names. $group_guids is better than $array. + +* Use "positive" variable names. Prefer `$enable = true` to `$disable = false`. + +* Functions returning an array should return an empty array instead of FALSE + on no results. + +* Functions not throwing an exception on error should return FALSE upon + failure. + +* Functions returning only boolean should be prefaced with is_ or has_ (eg, + elgg_is_logged_in(), elgg_has_access_to_entity()). + +* Ternary syntax is acceptable for single-line, non-embedded statements. + +* Use comments effectively. Good comments describe the "why." Good code + describes the "how." Ex: + Not a very useful comment: + + // increment $i only when the entity is marked as active. + foreach($entities as $entity) { + if ($entity->active == TRUE) { + $i++; + } + } + + Useful comment: + + // find the next index for inserting a new active entity. + foreach($entities as $entity) { + if ($entity->active == TRUE) { + $i++; + } + } + +* Use commit messages effectively. Be concise and meaningful. Ex: + Not meaningful: + Small fix to groups. + + Meaningful: + Fixes #1234: Added missing ) that caused a WSOD on group profile page + when logged out. + +* Commit effectively: Err on the side of atomic commits. One revision with + many changes is scary. diff --git a/documentation/coding_standards/css_coding_standards.txt b/documentation/coding_standards/css_coding_standards.txt new file mode 100644 index 000000000..195ca345b --- /dev/null +++ b/documentation/coding_standards/css_coding_standards.txt @@ -0,0 +1,67 @@ +*** CSS CODING STANDARDS *** + +* Use shorthand where possible: + Bad: + background-color: #333333; + background-image: url(...); + background-repeat: repeat-x; + background-position: left 10px; + padding: 2px 9px 2px 9px; + + Good: + background: #333 url(...) repeat-x left 10px; + padding: 2px 9px; + +* Use hyphens as separators in classes/ids, not underscores: + Bad: + .example_class + + Good: + .example-class + +* One property per line + Bad: + color: white;font-size: smaller; + + Good: + color: white; + font-size: smaller; + +* Property declarations should be spaced like so: `property: value;` + Bad: + color:value; + color :value; + color : value; + + Good: + color: value; + +* Group vendor-prefixes for the same property together: +* Longest vendor-prefixed version first: +* Always include non-vendor-prefixed version: +* Put an extra newline between vendor-prefixed groups and other properties: + Bad: + -moz-border-radius: 5px; + border: 1px solid #999999; + -webkit-border-radius: 5px; + width: auto; + + Good: + border: 1px solid #999999; + + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + + width: auto; + +* Group declarations of subproperties: + Bad: + background-color: white; + color: #0054A7; + background-position: 2px -257px; + + Good: + background-color: white; + background-position: 2px -257px; + color: #0054A7; diff --git a/documentation/coding_standards/deprecation.txt b/documentation/coding_standards/deprecation.txt new file mode 100644 index 000000000..370090138 --- /dev/null +++ b/documentation/coding_standards/deprecation.txt @@ -0,0 +1,36 @@ +*** DEPRECATING APIs *** + +Occasionally, functions and classes must be deprecated in favor of newer +replacements. Since 3rd party plugin authors rely on a consistent API, +backward compatibility must be maintained, but will not be maintained +indefinitely as plugin authors are expected to properly update their +plugins. In order to maintain backward compatibility, deprecated APIs will +follow these guidelines: + +* Incompatible API changes cannot occur between bugfix versions + (1.6.0 - 1.6.1). + +* API changes between minor versions (1.6 - 1.7) must maintain backward + compatibility for at least 2 minor versions. (1.7 and 1.8. See + procedures, below.) + +* Bugfixes that change the API cannot be included in bugfix versions. + +* API changes between major versions (1.0 - 2.0) can occur without regard to + backward compatibility. + +The procedure for deprecating an API is as follows: + +* The first minor version (1.7) with a deprecated API must include a wrapper + function/class (or otherwise appropriate means) to maintain backward + compatibility, including any bugs in the original function/class. + This compatibility layer uses elgg_deprecated_notice('...', 1.7) to log + that the function is deprecated. + +* The second minor version (1.8) maintains the backward compatibility + layer, but elgg_deprecated_notice() will produce a visible warning. + +* The third minor version (1.9) removes the compatibility layer. Any use of + the deprecated API should be corrected before this. + +The general timeline for two minor releases is 8 to 12 months. diff --git a/documentation/coding_standards/html_best_practices.txt b/documentation/coding_standards/html_best_practices.txt new file mode 100644 index 000000000..ac2338a77 --- /dev/null +++ b/documentation/coding_standards/html_best_practices.txt @@ -0,0 +1 @@ +*** HTML BEST PRACTICES *** diff --git a/documentation/coding_standards/javascript_best_practices.txt b/documentation/coding_standards/javascript_best_practices.txt new file mode 100644 index 000000000..9ec1d0a19 --- /dev/null +++ b/documentation/coding_standards/javascript_best_practices.txt @@ -0,0 +1 @@ +*** JAVASCRIPT BEST PRACTICES *** diff --git a/documentation/coding_standards/javascript_coding_standards.txt b/documentation/coding_standards/javascript_coding_standards.txt new file mode 100644 index 000000000..9939e80ab --- /dev/null +++ b/documentation/coding_standards/javascript_coding_standards.txt @@ -0,0 +1,13 @@ +*** JAVASCRIPT CODING STANDARDS *** + +* Same formatting standards as PHP. + +* All functions should be in the elgg namespace. + +* Function expressions should end with a semi-colon: + + elgg.ui.toggles = function(event) { + event.preventDefault(); + $(target).slideToggle('medium'); + }; + diff --git a/documentation/coding_standards/php_best_practices.txt b/documentation/coding_standards/php_best_practices.txt new file mode 100644 index 000000000..9e4c63483 --- /dev/null +++ b/documentation/coding_standards/php_best_practices.txt @@ -0,0 +1 @@ +*** PHP BEST PRACTICES *** diff --git a/documentation/coding_standards/php_coding_standards.txt b/documentation/coding_standards/php_coding_standards.txt new file mode 100644 index 000000000..b7adc5dd9 --- /dev/null +++ b/documentation/coding_standards/php_coding_standards.txt @@ -0,0 +1,55 @@ +*** PHP CODING STANDARDS *** + +These are the coding standards for Elgg. All core development and bundled +plugins are required to be in this format. Plugin developers are strongly +encouraged to adopt these standards. + +* Unix line endings. + +* Hard tabs, 4 character tab spacing. + +* No PHP shortcut tags ( <? or <?= or <% ). + +* PHPDoc comments on functions and classes (all methods; declared properties + when appropriate). + +* Mandatory wrapped {}s around any code blocks. + Bad: + if (true) + foreach($arr as $elem) + echo $elem; + + Good: + if (true) { + foreach ($arr as $elem) { + echo $elem; + } + } + +* Name standalone functions using underscore_character(). + +* Name classes using CamelCase() and methods using lowerCamelCase(). + +* Name globals and constants in ALL_CAPS (ACCESS_FRIENDS, $CONFIG). + +* Use underscores / camel case to separate standard English words in + functions, classes, and methods. (get_default_site(), ElggUser->isLoggedIn()). + +* Space functions like_this($required, $optional = TRUE). + +* Space keywords and constructs like this: if (FALSE) { ... }. + +* Correctly use spaces, quotes, and {}s in strings: + Bad (hard to read, misuse of quotes and {}s): + echo 'Hello, '.$name."! How is your {$time_of_day}?"; + + Good: + echo "Hello, $name! How is your $time_of_day?"; + +* Line lengths should be reasonable. If you are writing lines over 100 + characters on a line, please revise the code. + +* Use // or /* */ when commenting. + +* No closing PHP tag (?>) at EOF unless after a heredoc. (Avoids problems with + trailing whitespace. Required after heredoc by PHP.) 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 @@ +<?php +/** + * Demonstrates adding an annotation through an action + * + * This action adds a rating annotation to an entity. If this was coming from + * a five-star rating tool, the rating would be a number between 0 and 5. The + * GUID of the entity being rating is also submitted to the action. + */ + +$rating = get_input('rating'); +$guid = get_input('guid'); + +$entity = get_entity($guid); +if (!$entity) { + register_error(elgg_echo('rating:failure')); + forward(REFERER); +} + +$entity->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 @@ -<?php - -$ts = time(); -$token = generate_action_token($ts); - -var_dump($ts, $token); diff --git a/documentation/examples/events/advanced.php b/documentation/examples/events/advanced.php index 22a407579..73edea9da 100644 --- a/documentation/examples/events/advanced.php +++ b/documentation/examples/events/advanced.php @@ -1,10 +1,13 @@ <?php +/** + * This snippets demonstrates how returning false changes the normal operation + * of Elgg. + */ elgg_register_event_handler('create', 'object', 'example_event_handler'); -function example_event_handler($event, $type, $params) { +function example_event_handler($event, $type, $object) { // Don't allow any non-admin users to create objects // Returning false from this function will halt the creation of the object. return elgg_is_admin_logged_in(); } - diff --git a/documentation/examples/events/all.php b/documentation/examples/events/all.php index 238178312..0ad02c1d4 100644 --- a/documentation/examples/events/all.php +++ b/documentation/examples/events/all.php @@ -1,17 +1,24 @@ <?php +/** + * If you register an 'all' string for the event name, the handler function will + * be called for all events with that name, regardless of event type. The same + * can be done for the event type argument. Registering 'all' for both + * argyuments results in a handler being called for every event. + */ elgg_register_event_handler('all', 'object', 'example_event_handler'); // This function will be called for any event of type 'object' -function example_event_handler($event, $type, $params) { +function example_event_handler($event, $type, $object) { // check what sort of object is passed - if ($params instanceof ElggObject) { - $subtype = $params->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 @@ <?php +/** + * This snippet demonstrates how to register for an event. It dumps the + * parameters that the handler receives to the screen. The third argument + * of the handler function is an object that is related to the event. For + * the 'init', 'system' eveny, it is null. + */ elgg_register_event_handler('init', 'system', 'example_event_handler'); -function example_event_handler($event, $type, $params) { +function example_event_handler($event, $type, $object) { var_dump($event); - var_dump($object_type); - var_dump($params); + var_dump($type); + var_dump($object); return true; } - - diff --git a/documentation/examples/events/emit.php b/documentation/examples/events/emit.php deleted file mode 100644 index b917c6dc0..000000000 --- a/documentation/examples/events/emit.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -$params = new ElggObject(); -elgg_trigger_event('test', 'example', $params); - -// handlers would be registered by saying -elgg_register_event_handler('test', 'example', 'example_event_handler'); diff --git a/documentation/examples/events/trigger.php b/documentation/examples/events/trigger.php new file mode 100644 index 000000000..6ce3a76f0 --- /dev/null +++ b/documentation/examples/events/trigger.php @@ -0,0 +1,11 @@ +<?php +/** + * These two snippets demonstrates triggering an event and how to register for + * that event. + */ + +$object = new ElggObject(); +elgg_trigger_event('test', 'example', $object); + +// elsewhere a handler could be registered by saying +elgg_register_event_handler('test', 'example', 'example_event_handler'); diff --git a/documentation/examples/hooks/advanced.php b/documentation/examples/hooks/advanced.php new file mode 100644 index 000000000..ca036c46a --- /dev/null +++ b/documentation/examples/hooks/advanced.php @@ -0,0 +1,28 @@ +<?php +/** + * This snippet demonstrates how to change the value of a hook. The content + * passed into the hook is 'This is some Sample Content.'. After the two hook + * handlers are done, the new content is 'This is some $@mple Content.'. + */ + +// the output:page hook is triggered by elgg_view_page(). +elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler', 600); +elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler_2', 601); + +function example_plugin_hook_handler($hook, $type, $value, $params) { + // change a to @ + $value = str_replace('a', '@', $value); + + return $value; +} + +function example_plugin_hook_handler_2($hook, $type, $value, $params) { + // change S to $ + $value = str_replace('S', '$', $value); + + return $value; +} + +$content = 'This is some Sample Content.'; + +echo elgg_view_page('Title', $content); diff --git a/documentation/examples/hooks/register/all.php b/documentation/examples/hooks/all.php index 0ff19bc86..76b562335 100644 --- a/documentation/examples/hooks/register/all.php +++ b/documentation/examples/hooks/all.php @@ -1,4 +1,8 @@ <?php +/** + * This snippet demonstrates how to register for multiple hooks with the same + * type. + */ elgg_register_plugin_hook_handler('all', 'system', 'example_plugin_hook_handler'); diff --git a/documentation/examples/hooks/basic.php b/documentation/examples/hooks/basic.php index 71076ee96..734d9e884 100644 --- a/documentation/examples/hooks/basic.php +++ b/documentation/examples/hooks/basic.php @@ -1,34 +1,17 @@ <?php +/** + * The handler for a plugin hook receives information about the hook (name and + * type), the current value for the hook, and parameters related to the hook. + */ -elgg_register_plugin_hook_handler('get_items', 'example', 'example_plugin_hook'); -elgg_register_plugin_hook_handler('get_items', 'example', 'example_plugin_hook_2'); +elgg_register_plugin_hook_handler('forward', '404', 'example_plugin_hook_handler'); -$params = array('username' => 'Joe'); -$items = elgg_trigger_plugin_hook('get_items', 'example', $params, $default); +function example_plugin_hook_handler($hook, $type, $value, $params) { + var_dump($hook); + var_dump($type); + var_dump($value); + var_dump($params); -var_dump($items); - -function example_plugin_hook($hook, $type, $value, $params) { - if (is_array($value)) { - $value[] = "Hook Value 1"; - $value[] = "Hook Value 2"; - } - - return $value; -} - -function example_plugin_hook_2($hook, $type, $value, $params) { - $username = isset($params['username']) ? $params['username'] : NULL; - if (is_array($value)) { - switch($username) { - case 'Joe': - $value[] = "Joe's item"; - break; - case 'John': - $value[] = "Joe's item"; - break; - } - } - - return $value; + // we are not changing $value so return null + return null; } diff --git a/documentation/examples/hooks/register/advanced.php b/documentation/examples/hooks/register/advanced.php deleted file mode 100644 index e3951c19c..000000000 --- a/documentation/examples/hooks/register/advanced.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -// the output:page hook is triggered by elgg_view_page(). -elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler', 600); -elgg_register_plugin_hook_handler('output', 'page', 'example_plugin_hook_handler_2', 601); - -function example_plugin_hook_handler($event, $type, $value, $params) { - // change A to @ - $value = str_replace('A', '@', $value); - - return $value; -} - -function example_plugin_hook_handler_2($event, $type, $value, $params) { - // change S to $ - $value = str_replace('S', '$', $value); - - return $value; -} - -$content = 'This is some Sample Content.'; - -echo elgg_view_page('Title', $content);
\ No newline at end of file diff --git a/documentation/examples/hooks/register/basic.php b/documentation/examples/hooks/register/basic.php deleted file mode 100644 index 20493e200..000000000 --- a/documentation/examples/hooks/register/basic.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -elgg_register_plugin_hook_handler('forward', 'system', 'example_plugin_hook_handler'); - -function example_plugin_hook_handler($event, $type, $value, $params) { - var_dump($event); - var_dump($type); - var_dump($value); - var_dump($params); - - return true; -} - - diff --git a/documentation/examples/hooks/register/emit.php b/documentation/examples/hooks/register/emit.php deleted file mode 100644 index 8382d72ca..000000000 --- a/documentation/examples/hooks/register/emit.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -// @todo this is an event, not a hook -elgg_register_event_handler('test', 'example', 'example_init_system_callback'); - -$params = new ElggObject(); -elgg_trigger_event('test', 'example', $params); diff --git a/documentation/examples/hooks/trigger.php b/documentation/examples/hooks/trigger.php new file mode 100644 index 000000000..4216fd6c0 --- /dev/null +++ b/documentation/examples/hooks/trigger.php @@ -0,0 +1,14 @@ +<?php +/** + * The current value for the hook is passed into the trigger function. Handlers + * can change this value. In this snippet, we check if the value of true was + * changed by the handler functions. + */ + +$result = elgg_trigger_plugin_hook('get_status', 'example', null, true); + +if ($result) { + var_dump('Plugin hook says ok!'); +} else { + var_dump('Plugin hook says no.'); +} diff --git a/documentation/examples/hooks/trigger/advanced.php b/documentation/examples/hooks/trigger/advanced.php deleted file mode 100644 index 5901a06e0..000000000 --- a/documentation/examples/hooks/trigger/advanced.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -$default = array('Entry 1', 'Entry 2', 'Entry 3'); - -$menu = elgg_trigger_plugin_hook('get_menu_items', 'menu', null, $default); - -foreach ($menu as $item) { - var_dump($item); -} diff --git a/documentation/examples/hooks/trigger/basic.php b/documentation/examples/hooks/trigger/basic.php deleted file mode 100644 index ea27a8a98..000000000 --- a/documentation/examples/hooks/trigger/basic.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -$result = elgg_trigger_plugin_hook('get_status', 'example', null, true); - -if ($result) { - var_dump('Plugin hook says ok!'); -} else { - var_dump('Plugin hook says no.'); -} 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/actions/.gitignore b/documentation/examples/plugins/actions/.gitignore new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ 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/manifest.xml b/documentation/examples/plugins/manifest.xml index 1602a7358..e31624432 100644 --- a/documentation/examples/plugins/manifest.xml +++ b/documentation/examples/plugins/manifest.xml @@ -1,99 +1,18 @@ <?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> + <author>My Name</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> + <description>This is a description of my plugin and its features.</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> + <copyright>(C) My Name or Company 2012</copyright> + <license>GNU General Public License version 2</license> <requires> <type>elgg_release</type> - <version>1.8-svn</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> - - <on_enable>setup_function</on_enable> - <on_disable>teardown_function</on_disable> - <admin_interface>simple</admin_interface> - - <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> + <version>1.8</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> + <category>communication</category> </plugin_manifest> diff --git a/documentation/examples/plugins/start.php b/documentation/examples/plugins/start.php new file mode 100644 index 000000000..3af50ce38 --- /dev/null +++ b/documentation/examples/plugins/start.php @@ -0,0 +1,22 @@ +<?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 + + // Register a script to handle (usually) a POST request (an action) + $base_dir = elgg_get_plugins_path() . 'my_plugin/actions/my_plugin'; + elgg_register_action('my_plugin', "$base_dir/my_action.php"); + + // Extend the main CSS file + elgg_extend_view('css/elgg', 'my_plugin/css'); + + // Add a menu item to the main site menu + $item = new ElggMenuItem('my_plugin', elgg_echo('my_plugin:menu'), 'my_url'); + elgg_register_menu_item('site', $item); +} 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 diff --git a/documentation/stubs/config.php b/documentation/info/config.php index 19e76c8ae..b45428477 100644 --- a/documentation/stubs/config.php +++ b/documentation/info/config.php @@ -218,11 +218,11 @@ $CONFIG->dataroot; $CONFIG->simplecache_enabled; /** - * Is view paths cache enabled + * Is the system cache enabled * - * @global string $CONFIG->viewpath_cache_enabled + * @global string $CONFIG->system_cache_enabled */ -$CONFIG->viewpath_cache_enabled; +$CONFIG->system_cache_enabled; /** * The site description from the current site object. diff --git a/documentation/info/manifest.xml b/documentation/info/manifest.xml new file mode 100644 index 000000000..4fd4be8ce --- /dev/null +++ b/documentation/info/manifest.xml @@ -0,0 +1,98 @@ +<?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> + <repository>https://github.com/Elgg/Elgg</repository> + <bugtracker>https://github.com/Elgg/Elgg/issues</bugtracker> + <donations>http://elgg.org/supporter.php</donations> + <copyright>(C) Elgg 2011</copyright> + <license>GNU General 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> |
