Elgg  Version 1.11
settings.php
Go to the documentation of this file.
1 <?php
8 $widget = elgg_extract('widget', $vars);
9 
10 // not using elgg_view_form() so that we can detect if the form is empty
11 $form_body = elgg_view('forms/widgets/save', $vars);
12 if (!$form_body) {
13  return true;
14 }
15 
16 $additional_class = preg_replace('/[^a-z0-9-]/i', '-', "elgg-form-widgets-save-{$widget->handler}");
17 
18 $form = elgg_view('input/form', array(
19  'action' => 'action/widgets/save',
20  'body' => $form_body,
21  'class' => "elgg-form-widgets-save $additional_class",
22 ));
23 ?>
24 
25 <div class="elgg-widget-edit" id="widget-edit-<?php echo $widget->guid; ?>">
26  <?php echo $form; ?>
27 </div>
$widget
Elgg widget edit settings.
Definition: settings.php:8
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
fieldset div
Definition: admin.php:470
$vars['type']
Definition: settings.php:5
$form
Definition: settings.php:18
if(!$form_body) $additional_class
Definition: settings.php:16
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$form_body
Definition: settings.php:11