Elgg  Version 1.11
tools.php
Go to the documentation of this file.
1 <?php
9 // Only logged in users
11 
12 // Make sure we don't open a security hole ...
13 if ((!elgg_get_page_owner_entity()) || (!elgg_get_page_owner_entity()->canEdit())) {
14  register_error(elgg_echo('noaccess'));
15  forward('/');
16 }
17 
18 $plugin_id = get_input("plugin_id");
19 
20 if (empty($plugin_id)) {
21  register_error(elgg_echo('ElggPlugin:MissingID'));
23 }
24 
26 
27 if (!$plugin) {
28  register_error(elgg_echo('PluginException:InvalidID', array($plugin_id)));
30 }
31 
32 if (elgg_language_key_exists($plugin_id . ':usersettings:title')) {
33  $title = elgg_echo($plugin_id . ':usersettings:title');
34 } else {
35  $title = $plugin->getManifest()->getName();
36 }
37 
38 $content = elgg_view_form('plugins/usersettings/save', array(), array('entity' => $plugin));
39 
40 $params = array(
41  'content' => $content,
42  'title' => $title,
43 );
44 $body = elgg_view_layout('one_sidebar', $params);
45 
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_language_key_exists($key, $language= 'en')
Check if a give language key exists.
Definition: languages.php:249
$params
Definition: tools.php:40
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
$body
Definition: tools.php:44
$title
Definition: save.php:24
if(empty($plugin_id)) $plugin
Definition: tools.php:25
if((!elgg_get_page_owner_entity())||(!elgg_get_page_owner_entity() ->canEdit())) $plugin_id
Definition: tools.php:18
elgg_gatekeeper()
Used at the top of a page to mark it as logged in users only.
Definition: pagehandler.php:58
$content
Definition: tools.php:38
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
const REFERER
Definition: elgglib.php:1995
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:53
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:622
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383
elgg_view_page($title, $body, $page_shell= 'default', $vars=array())
Assembles and outputs a full page.
Definition: views.php:437
elgg_view_form($action, $form_vars=array(), $body_vars=array())
Definition: views.php:1313
elgg_get_plugin_from_id($plugin_id)
Returns an object with the path $path.
Definition: plugins.php:97