Elgg  Version 1.11
save.php
Go to the documentation of this file.
1 <?php
6 // @todo Could probably make this number configurable
8 
9 // get site menu items
11 $menu = $menu['site'];
13 $menu = $builder->getMenu('name');
14 $menu_items = $menu['default'];
15 
16 $featured_menu_names = elgg_get_config('site_featured_menu_names');
17 
18 $dropdown_values = array();
19 foreach ($menu_items as $item) {
20  $dropdown_values[$item->getName()] = $item->getText();
21 }
22 $dropdown_values[' '] = elgg_echo('none');
23 
24 ?>
25 <div class="elgg-module elgg-module-inline">
26  <div class="elgg-head">
27  <h3><?php echo elgg_echo('admin:menu_items:configure'); ?></h3>
28  </div>
29  <div class="elgg-body">
30 <?php
31 echo elgg_view('output/longtext', array(
32  'value' => elgg_echo("admin:menu_items:description")
33 ));
34 
35 for ($i=0; $i<$num_featured_items; $i++) {
36  if ($featured_menu_names && array_key_exists($i, $featured_menu_names)) {
37  $current_value = $featured_menu_names[$i];
38  } else {
39  $current_value = ' ';
40  }
41 
42  echo elgg_view('input/select', array(
43  'options_values' => $dropdown_values,
44  'name' => 'featured_menu_names[]',
45  'value' => $current_value
46  ));
47 }
48 ?>
49  </div>
50 </div>
51 
52 <div class="elgg-module elgg-module-inline">
53  <div class="elgg-head">
54  <h3><?php echo elgg_echo('admin:add_menu_item'); ?></h3>
55  </div>
56  <div class="elgg-body">
57 <?php
58 echo elgg_view('output/longtext', array(
59  'value' => elgg_echo("admin:add_menu_item:description")
60 ));
61 
62 $custom_items = elgg_get_config('site_custom_menu_items');
63 
64 $name_str = elgg_echo('name');
65 $url_str = elgg_echo('admin:plugins:label:website');
66 
67 echo '<ul class="elgg-list elgg-list-simple">';
68 
69 if (is_array($custom_items)) {
70  foreach ($custom_items as $title => $url) {
71  $name_input = elgg_view('input/text', array(
72  'name' => 'custom_menu_titles[]',
73  'value' => $title
74  ));
75 
76  $url_input = elgg_view('input/text', array(
77  'name' => 'custom_menu_urls[]',
78  'value' => $url
79  ));
80 
81  echo "<li>$name_str: $name_input $url_str: $url_input $delete</li>";
82  }
83 }
84 
85 $new = elgg_echo('new');
86 $name_input = elgg_view('input/text', array(
87  'name' => 'custom_menu_titles[]',
88 ));
89 
90 $url_input = elgg_view('input/text', array(
91  'name' => 'custom_menu_urls[]',
92 ));
93 
94 echo "<li class='custom_menuitem'>$name_str: $name_input $url_str: $url_input</li>
95 </ul>";
96 
97 ?>
98  </div>
99 </div>
100 <?php
101 
102 echo elgg_view('input/submit', array('value' => elgg_echo('save')));
$dropdown_values
Definition: save.php:18
elgg_get_config($name, $site_guid=0)
Get an Elgg configuration value.
$custom_items
Definition: save.php:62
$name_input
Definition: save.php:86
$url_input
Definition: save.php:90
$num_featured_items
Form body for setting up site menu.
Definition: save.php:7
fieldset div
Definition: admin.php:470
$name_str
Definition: save.php:64
$url
Definition: exceptions.php:24
$title
Definition: save.php:24
$featured_menu_names
Definition: save.php:16
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$menu_items
Definition: save.php:14
if(is_array($custom_items)) $new
Definition: save.php:85
$item
Definition: item.php:12
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
$menu
Definition: save.php:10
$builder
Definition: save.php:12
$url_str
Definition: save.php:65
h3
Definition: admin.php:85