Changeset 589:026ba1d1eb58 for plugins/userPref
- Timestamp:
- 07/13/11 14:36:14 (14 years ago)
- Branch:
- default
- Location:
- plugins/userPref
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/userPref/_define.php
r464 r589 16 16 /* Description*/ "Manage every user preference directive", 17 17 /* Author */ "Franck Paul", 18 /* Version */ '0. 1'18 /* Version */ '0.2' 19 19 ); 20 20 ?> -
plugins/userPref/index.php
r582 r589 12 12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 13 13 14 # Local navigation 15 if (!empty($_POST['gp_nav'])) { 16 http::redirect($p_url.$_POST['gp_nav']); 17 exit; 18 } 19 if (!empty($_POST['lp_nav'])) { 20 http::redirect($p_url.$_POST['lp_nav']); 21 exit; 22 } 23 14 24 # Local prefs update 15 25 if (!empty($_POST['s']) && is_array($_POST['s'])) … … 86 96 table.prefs { border: 1px solid #999; margin-bottom: 2em; } 87 97 table.prefs th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; } 88 ul.submenu {float: right; border: 1px solid #ccc; padding-right: 1em; padding-left: 1.5em; margin-top:0.5em; margin-bottom:0.5em; }98 p.anchor-nav {float: right; } 89 99 </style> 100 <script type="text/javascript"> 101 //<![CDATA[ 102 $(function() { 103 $("#gp_submit").hide(); 104 $("#lp_submit").hide(); 105 $("#gp_nav").change(function() { 106 window.location = $("#gp_nav option:selected").val(); 107 }) 108 $("#lp_nav").change(function() { 109 window.location = $("#lp_nav option:selected").val(); 110 }) 111 }); 112 //]]> 113 </script> 90 114 </head> 91 115 … … 103 127 104 128 <div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 105 <form action="plugin.php" method="post">106 129 107 130 <?php 108 109 $table_header = '<table class="prefs"><caption>%s</caption>'. 131 $table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 110 132 '<thead>'. 111 133 '<tr>'."\n". … … 120 142 121 143 $prefs = array(); 122 123 144 foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 124 145 foreach ($workspace->dumpPrefs() as $k => $v) { … … 126 147 } 127 148 } 128 129 149 ksort($prefs); 130 131 150 if (count($prefs) > 0) { 132 echo '<ul class="submenu">';151 $ws_combo = array(); 133 152 foreach ($prefs as $ws => $s) { 134 echo '<li><a href="#l_'.$ws.'">'.$ws.'</a></li>'; 135 } 136 echo '</ul>'; 137 } 138 153 $ws_combo[$ws] = '#l_'.$ws; 154 } 155 echo 156 '<form action="plugin.php" method="post">'. 157 '<p class="anchor-nav">'. 158 '<label for="lp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('lp_nav',$ws_combo). 159 ' <input type="submit" value="'.__('Ok').'" id="lp_submit" />'. 160 '<input type="hidden" name="p" value="aboutConfig" />'. 161 $core->formNonce().'</p></form>'; 162 } 163 ?> 164 165 <form action="plugin.php" method="post"> 166 167 <?php 139 168 foreach ($prefs as $ws => $s) 140 169 { 141 170 ksort($s); 142 echo sprintf($table_header, $ws);171 echo sprintf($table_header,'l_'.$ws,$ws); 143 172 foreach ($s as $k => $v) 144 173 { … … 156 185 157 186 <div id="global" class="multi-part" title="<?php echo __('global preferences'); ?>"> 158 <form action="plugin.php" method="post">159 187 160 188 <?php … … 170 198 171 199 if (count($prefs) > 0) { 172 echo '<ul class="submenu">';200 $ws_combo = array(); 173 201 foreach ($prefs as $ws => $s) { 174 echo '<li><a href="#g_'.$ws.'">'.$ws.'</a></li>'; 175 } 176 echo '</ul>'; 177 } 178 202 $ws_combo[$ws] = '#g_'.$ws; 203 } 204 echo 205 '<form action="plugin.php" method="post">'. 206 '<p class="anchor-nav">'. 207 '<label for="gp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gp_nav',$ws_combo). 208 ' <input type="submit" value="'.__('Ok').'" id="gp_submit" />'. 209 '<input type="hidden" name="p" value="aboutConfig" />'. 210 $core->formNonce().'</p></form>'; 211 } 212 ?> 213 214 <form action="plugin.php" method="post"> 215 216 <?php 179 217 foreach ($prefs as $ws => $s) 180 218 { 181 219 ksort($s); 182 echo sprintf($table_header, $ws);220 echo sprintf($table_header,'g_'.$ws,$ws); 183 221 foreach ($s as $k => $v) 184 222 {
Note: See TracChangeset
for help on using the changeset viewer.