histogram: Make histograms crash less
[ninja.git] / application / views / user / edit_menu.php
blob07d037e0e792afc992079815dd67db11bab83a34
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
3 echo form::open('user/menu_edit', array('id' => 'editmenu_form', 'method' => 'get')); ?>
4 <div class="left">
5 <div>
6 <p><?php echo html::anchor(Router::$controller, _('Back')) ?></p>
7 <h3><?php echo _('Edit user menu') ?></h3>
8 </div>
9 <?php
10 if ($groups) { ?>
11 <label><?php echo _('Group').': '; ?>
12 <?php echo form::dropdown(array('name' => 'usergroup', 'id' => 'usergroup', 'style' => 'padding-right:10px'), array_merge(array('' => _('Select group')), array_combine(array_keys($groups), array_keys($groups))), $selected_group); ?></label>
13 <?php
14 } else {
15 echo _("No limited users found in the system so there's nothing we can do here.");
17 echo form::close();
19 if (isset($selected_group) && !empty($selected_group)) {
20 echo '<br /><p style="padding-top:5px">'.$description.'</p>';
21 echo form::open('user/menu_update');
22 echo form::hidden('group', $selected_group);
24 <table style="width:250px;padding-top:10px;">
25 <tr>
26 <th><?php echo _('Menu item') ?></th>
27 <th><?php echo sprintf(_('Remove for users in %s'), $selected_group) ?></th>
28 </tr><?php
29 foreach ($sections as $section) {
30 $section_str = 'section_'.$section;
31 if (isset($menu[$section_str]) && !empty($menu[$section_str])) {
32 echo '<tr><td colspan="2"><li style="list-style-type:square">
33 <cite>'.html::specialchars($menu_items[$section_str]).'</cite>
34 </li></td></tr>'."\n";
36 foreach ($menu[$section_str] as $pages) {
37 if (!isset($menu_items[$pages])) {
38 continue;
41 if ((isset($remove_items[$section]) && in_array($pages, $remove_items[$section])) || !isset($menu_base[$menu_items[$section_str]][$menu_items[$pages]])) {
42 # removed items - dim out
43 $url = $all_items[$menu_items[$section_str]][$menu_items[$pages]];
44 $title = $menu_items[$pages];
46 $icon = 'icons/menu/'.$url[1];
47 /* By some reason, icons names containing . is treated as non-tiled images in menues... otherwise icons is avalible as .png */
48 if( false === strpos($icon,'.') ) $icon .= '.png';
50 echo '<tr style="color:#c0c0c0" id="'.$pages.'"><td style="border-bottom:1px dotted black"><li style="list-style-type:none">'.
51 html::image($this->add_path($icon),array('title' => html::specialchars($title), 'alt' => html::specialchars($title), 'style' => 'padding-right:5px')).
52 ' '.html::specialchars($title).'</li></td>'."\n";
53 echo '<td>'.form::checkbox(array('name' => 'remove_items['.$section.'][]', 'id' => 'checkbox_'.$pages, 'class' => 'menubox'), $pages, true).'</td></tr>';
54 } else {
55 # visible items
56 $cb_settings = array('name' => 'remove_items['.$section.'][]', 'id' => 'checkbox_'.$pages, 'class' => 'menubox');
58 # check if anything should be disabled
59 if (isset($untouchable_items) && is_array($untouchable_items) && in_array($pages, $untouchable_items)) {
60 $cb_settings['disabled'] = 1;
62 $url = $menu_base[$menu_items[$section_str]][$menu_items[$pages]];
63 $title = $menu_items[$pages];
65 $icon = 'icons/menu/'.$url[1];
66 /* By some reason, icons names containing . is treated as non-tiled images in menues... otherwise icons is avalible as .png */
67 if( false === strpos($icon,'.') ) $icon .= '.png';
69 echo '<tr id="'.$pages.'"><td style="border-bottom:1px dotted black"><li style="list-style-type:none">'.
70 html::image($this->add_path($icon),array('title' => html::specialchars($title), 'alt' => html::specialchars($title), 'style' => 'padding-right:5px')).
71 ' '.html::specialchars($title).'</li></td>'."\n";
72 echo '<td>'.form::checkbox($cb_settings, $pages).'</td></tr>';
76 } ?>
77 <tr>
78 <td colspan="2"><br />
79 <?php echo form::submit('s1', _('Save')) ?>
80 </td>
81 </tr>
82 </table>
83 <br />
84 <?php echo form::close();
85 } ?>
86 </div>