Elgg  Version 2.3
save.php
Go to the documentation of this file.
1 <?php
18 $guid = get_input('guid');
19 $params = get_input('params');
20 $default_widgets = get_input('default_widgets', 0);
21 $context = get_input('context');
22 $title = get_input('title');
23 
24 if ($default_widgets) {
25  elgg_push_context('default_widgets');
26 }
27 elgg_push_context('widgets');
28 
30 if ($widget && $widget->saveSettings($params)) {
31  if ($title && $title != $widget->title) {
32  $widget->title = $title;
33  $widget->save();
34  }
35 
36  elgg_set_page_owner_guid($widget->getContainerGUID());
37  if ($context) {
39  }
40 
41  echo elgg_view('object/widget/elements/content', ['entity' => $widget]);
42 
43  if ($context) {
45  }
46 
47 } else {
48  register_error(elgg_echo('widgets:save:failure'));
49 }
50 
51 // widgets context
53 
54 if ($default_widgets) {
56 }
57 
$default_widgets
Definition: save.php:20
$params
Definition: save.php:15
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$guid
Definition: save.php:61
$context
Definition: save.php:21
$widget
Definition: save.php:29
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:425
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:72
$title
Definition: save.php:22
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
const REFERER
Definition: elgglib.php:2123
elgg_pop_context()
Removes and returns the top context string from the stack.
Definition: pageowner.php:225
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:215
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:399
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:204