Elgg  Version 1.11
save.php
Go to the documentation of this file.
1 <?php
18 elgg_set_context('widgets');
19 
20 $guid = get_input('guid');
21 $params = get_input('params');
22 $default_widgets = get_input('default_widgets', 0);
23 $context = get_input('context');
24 $title = get_input('title');
25 
27 if ($widget && $widget->saveSettings($params)) {
28  if ($title && $title != $widget->title) {
29  $widget->title = $title;
30  $widget->save();
31  }
32 
33  elgg_set_page_owner_guid($widget->getContainerGUID());
34  if ($context) {
36  }
37 
38  if (!$default_widgets) {
39  if (elgg_view_exists("widgets/$widget->handler/content")) {
40  $view = "widgets/$widget->handler/content";
41  } else {
42  elgg_deprecated_notice("widgets use content as the display view", 1.8);
43  $view = "widgets/$widget->handler/view";
44  }
45  echo elgg_view($view, array('entity' => $widget));
46  }
47 } else {
48  register_error(elgg_echo('widgets:save:failure'));
49 }
50 
$view
Definition: crop.php:68
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
$default_widgets
Definition: save.php:22
$params
Definition: save.php:15
$guid
Definition: save.php:62
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:318
$context
Definition: save.php:23
$widget
Definition: save.php:26
elgg forward
Meant to mimic the php forward() function by simply redirecting the user to another page...
Definition: elgglib.js:419
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:73
$title
Definition: save.php:24
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_set_context($context)
Sets the page context.
Definition: pageowner.php:201
elgg echo
Translates a string.
Definition: languages.js:43
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1006
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
elgg_push_context($context)
Push a context onto the top of the stack.
Definition: pageowner.php:224
elgg register_error
Wrapper function for system_messages.
Definition: elgglib.js:383
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:382