Changeset 782:01efbf050a8a for plugins/userPref
- Timestamp:
- 12/06/11 11:43:14 (14 years ago)
- Branch:
- formfilters
- Parents:
- 781:b509ac00bf4a (diff), 779:58c45f1b96e5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/userPref/index.php
r589 r782 128 128 <div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 129 129 130 <?php 130 <?php 131 131 $table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 132 132 '<thead>'. … … 142 142 143 143 $prefs = array(); 144 144 145 foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 145 146 foreach ($workspace->dumpPrefs() as $k => $v) { -
plugins/userPref/index.php
r457 r782 4 4 # This file is part of Dotclear 2. 5 5 # 6 # Copyright (c) 2003-201 0Olivier Meunier & Association Dotclear6 # Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear 7 7 # Licensed under the GPL version 2.0 license. 8 8 # See LICENSE file or … … 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 12 if (!defined('DC_CONTEXT_ADMIN')) { return; } 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 } 13 23 14 24 # Local prefs update … … 72 82 return 73 83 '<tr>'. 74 '<t h scope="row"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></th>'.84 '<td scope="raw"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'. 75 85 '<td>'.$field.'</td>'. 76 86 '<td>'.$s['type'].'</td>'. … … 84 94 <?php echo dcPage::jsPageTabs($part); ?> 85 95 <style type="text/css"> 86 .ws-name { background: #ccc; color: #000; padding-top: 0.3em; padding-bottom: 0.3em; font-size: 1.1em; } 96 table.prefs { border: 1px solid #999; margin-bottom: 2em; } 97 table.prefs th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; } 98 p.anchor-nav {float: right; } 87 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> 88 114 </head> 89 115 … … 98 124 } 99 125 ?> 100 <h2><?php echo html::escapeHTML($core->auth->userID()); ?> › user:preferences</h2>126 <h2><?php echo html::escapeHTML($core->auth->userID()); ?> › <span class="page-title">user:preferences</span></h2> 101 127 102 128 <div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 103 <form action="plugin.php" method="post"> 104 <table> 105 <caption><?php echo __('Local user preferences list'); ?></caption> 106 <thead> 107 <tr> 108 <th scope="col" class="nowrap">Pref ID</th> 109 <th scope="col"><?php echo __('Value'); ?></th> 110 <th scope="col"><?php echo __('Type'); ?></th> 111 <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 112 </tr> 113 </thead> 114 <tbody> 115 <?php 129 130 <?php 131 $table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 132 '<thead>'. 133 '<tr>'."\n". 134 ' <th class="nowrap">Setting ID</th>'."\n". 135 ' <th>'.__('Value').'</th>'."\n". 136 ' <th>'.__('Type').'</th>'."\n". 137 ' <th class="maximalx">'.__('Description').'</th>'."\n". 138 '</tr>'."\n". 139 '</thead>'."\n". 140 '<tbody>'; 141 $table_footer = '</tbody></table>'; 142 116 143 $prefs = array(); 117 144 … … 121 148 } 122 149 } 123 124 150 ksort($prefs); 125 151 if (count($prefs) > 0) { 152 $ws_combo = array(); 153 foreach ($prefs as $ws => $s) { 154 $ws_combo[$ws] = '#l_'.$ws; 155 } 156 echo 157 '<form action="plugin.php" method="post">'. 158 '<p class="anchor-nav">'. 159 '<label for="lp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('lp_nav',$ws_combo). 160 ' <input type="submit" value="'.__('Ok').'" id="lp_submit" />'. 161 '<input type="hidden" name="p" value="aboutConfig" />'. 162 $core->formNonce().'</p></form>'; 163 } 164 ?> 165 166 <form action="plugin.php" method="post"> 167 168 <?php 126 169 foreach ($prefs as $ws => $s) 127 170 { 128 171 ksort($s); 129 echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 130 172 echo sprintf($table_header,'l_'.$ws,$ws); 131 173 foreach ($s as $k => $v) 132 174 { 133 175 echo prefLine($k,$v,$ws,'s',!$v['global']); 134 176 } 135 } 136 ?> 137 </tbody>138 </table> 177 echo $table_footer; 178 } 179 ?> 180 139 181 <p><input type="submit" value="<?php echo __('Save'); ?>" /> 140 182 <input type="hidden" name="p" value="userPref" /> … … 144 186 145 187 <div id="global" class="multi-part" title="<?php echo __('global preferences'); ?>"> 146 <form action="plugin.php" method="post"> 147 <table> 148 <caption><?php echo __('Global user preferences list'); ?></caption> 149 <thead> 150 <tr> 151 <th scope="col" class="nowrap">Pref ID</th> 152 <th scope="col"><?php echo __('Value'); ?></th> 153 <th scope="col"><?php echo __('Type'); ?></th> 154 <th scope="col" class="maximal"><?php echo __('Description'); ?></th> 155 </tr> 156 </thead> 157 <tbody> 188 158 189 <?php 159 190 $prefs = array(); … … 167 198 ksort($prefs); 168 199 200 if (count($prefs) > 0) { 201 $ws_combo = array(); 202 foreach ($prefs as $ws => $s) { 203 $ws_combo[$ws] = '#g_'.$ws; 204 } 205 echo 206 '<form action="plugin.php" method="post">'. 207 '<p class="anchor-nav">'. 208 '<label for="gp_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gp_nav',$ws_combo). 209 ' <input type="submit" value="'.__('Ok').'" id="gp_submit" />'. 210 '<input type="hidden" name="p" value="aboutConfig" />'. 211 $core->formNonce().'</p></form>'; 212 } 213 ?> 214 215 <form action="plugin.php" method="post"> 216 217 <?php 169 218 foreach ($prefs as $ws => $s) 170 219 { 171 220 ksort($s); 172 echo '<tr><th scope="row" colspan="4" class="ws-name">workspace: <strong>'.$ws.'</strong></th></tr>'; 173 221 echo sprintf($table_header,'g_'.$ws,$ws); 174 222 foreach ($s as $k => $v) 175 223 { 176 224 echo prefLine($k,$v,$ws,'gs',false); 177 225 } 178 } 179 ?> 180 </tbody>181 </table> 226 echo $table_footer; 227 } 228 ?> 229 182 230 <p><input type="submit" value="<?php echo __('Save'); ?>" /> 183 231 <input type="hidden" name="p" value="userPref" />
Note: See TracChangeset
for help on using the changeset viewer.