Elgg  Version 2.3
default_widgets.php
Go to the documentation of this file.
1 <?php
9 elgg_push_context('default_widgets');
10 $widget_context = get_input('widget_context');
11 $list = elgg_trigger_plugin_hook('get_list', 'default_widgets', null, array());
12 
13 // default to something if we can
14 if (!$widget_context && $list) {
15  $widget_context = $list[0]['widget_context'];
16 }
17 
19 $tabs = array();
20 foreach ($list as $info) {
21  $url = "admin/appearance/default_widgets?widget_context={$info['widget_context']}";
22  $selected = false;
23  if ($widget_context == $info['widget_context']) {
24  $selected = true;
26  }
27 
28  $tabs[] = array(
29  'title' => $info['name'],
30  'url' => $url,
31  'selected' => $selected
32  );
33 }
34 
35 $tabs_vars = array(
36  'tabs' => $tabs
37 );
38 
39 echo elgg_view('navigation/tabs', $tabs_vars);
40 
41 echo elgg_view('output/longtext', array('value' => elgg_echo('admin:default_widgets:instructions')));
42 
43 if (!$current_info) {
44  $content = elgg_echo('admin:default_widgets:unknown_type');
45 } else {
46  // default widgets are owned and saved to the site.
48  elgg_push_context($current_info['widget_context']);
49 
50  $default_widgets_input = elgg_view('input/hidden', array(
51  'name' => 'default_widgets',
52  'value' => 1
53  ));
54 
55  $params = array(
56  'content' => $default_widgets_input,
57  'num_columns' => $current_info['widget_columns'],
58  );
59 
62 }
64 
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
foreach($list as $info) $tabs_vars
elgg_view_layout($layout_name, $vars=array())
Displays a layout with optional parameters.
Definition: views.php:689
$content
if($screenshots) $info
Definition: details.php:58
$url
Definition: exceptions.php:24
elgg_set_page_owner_guid($guid)
Set the guid of the entity that owns this page.
Definition: pageowner.php:72
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
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_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Definition: elgglib.php:826
if(!$widget_context &&$list) $current_info
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
$default_widgets_input
$widget_context