histogram: Make histograms crash less
[ninja.git] / application / views / user / settings.php
blob55ccebe891746116ccac0d2c87b78f451f133d26
1 <?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
2 <?php
4 if (!empty($widgets)) {
5 foreach ($widgets as $widget) {
6 echo $widget;
10 echo '<div>';
11 if (!empty($updated_str)) {
12 echo '<div id="saved_msg">'.html::image($this->add_path('/icons/16x16/shield-ok.png'),array('alt' => '', 'style' => 'margin-bottom: -3px; margin-right: 4px')).$updated_str.'</div><br />';
15 echo "<h1>".$title."</h1><br />";
17 if ($is_admin) {
18 echo '<div style="padding-bottom:20px">'.help::render('edit_menu').' &nbsp;'.
19 html::anchor(Router::$controller.'/menu_edit', _('Edit user menu')).'</div>';
22 if (Auth::instance()->authorized_for('own_user_change_password')) {
23 echo '<div>'.html::anchor('change_password', _('Change Password')).'</div><br />';
26 if (!empty($available_setting_sections)) {
28 echo form::open('user/save', array('id' => 'user_settings'));
29 foreach ($available_setting_sections as $name => $setting_key) { ?>
30 <div id="settings_<?php echo $name ?>">
31 <table>
32 <tr>
33 <th colspan="2">
34 <?php if(isset($sub_headings[$setting_key])) { ?>
35 <a target=_blank href="<?php echo $sub_headings[$setting_key][0]; ?>" title="<?php echo $sub_headings[$setting_key][1]; ?>"><span class="icon-12 x12-help"></span> <?php echo $name ?></a>
36 <?php } else { ?>
37 <?php echo $name ?>
38 <?php } ?>
39 </th>
40 </tr>
41 <?php
42 $i = 0;
43 foreach ($settings[$setting_key] as $setting_name => $cfgkey) {
44 $i++;
45 $fieldname = str_replace('.', '_99_', $cfgkey[0]);
46 echo '<tr class="'.($i%2 == 0 ? 'odd' : 'even').'"><td style="width: 200px">'.help::render($cfgkey[0])." &nbsp; <label for='$fieldname'>$setting_name</label></td><td>";
48 switch($cfgkey[1]) {
49 case 'int': case 'string':
50 echo form::input($fieldname, $current_values[$cfgkey[0]]);
51 break;
52 case 'textarea':
53 echo form::textarea($fieldname, $current_values[$cfgkey[0]], 'rows="6"');
54 break;
55 case 'bool':
56 echo form::radio($fieldname, 1, isset($current_values[$cfgkey[0]]) && $current_values[$cfgkey[0]]!=false ? true:false, 'id="radio_on_'.$fieldname.'"').' <label for="radio_on_'.$fieldname.'">'._('On').'</label> &nbsp;';
57 echo form::radio($fieldname, 0, isset($current_values[$cfgkey[0]]) && $current_values[$cfgkey[0]]!=false ? false:true, 'id="radio_off_'.$fieldname.'"').' <label for="radio_off_'.$fieldname.'">'._('Off').'</label>';
58 break;
60 case 'select':
61 if (isset($cfgkey[2]) && is_array($cfgkey[2])) {
62 echo form::dropdown($fieldname, $cfgkey[2], $current_values[$cfgkey[0]]);
64 break;
66 echo '</td></tr>';
69 </table><br />
70 </div>
71 <?php
73 echo form::submit('save_config', _('Save'));
74 echo form::close();
75 }?>
76 <br />
78 </div>