Dotclear


Ignore:
Timestamp:
07/13/11 14:36:14 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
default
Message:

Menus d'accès rapide en combo

Location:
plugins/userPref
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/userPref/_define.php

    r464 r589  
    1616     /* Description*/         "Manage every user preference directive", 
    1717     /* Author */             "Franck Paul", 
    18      /* Version */            '0.1' 
     18     /* Version */            '0.2' 
    1919); 
    2020?> 
  • plugins/userPref/index.php

    r582 r589  
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1313 
     14# Local navigation 
     15if (!empty($_POST['gp_nav'])) { 
     16     http::redirect($p_url.$_POST['gp_nav']); 
     17     exit; 
     18} 
     19if (!empty($_POST['lp_nav'])) { 
     20     http::redirect($p_url.$_POST['lp_nav']); 
     21     exit; 
     22} 
     23 
    1424# Local prefs update 
    1525if (!empty($_POST['s']) && is_array($_POST['s'])) 
     
    8696     table.prefs { border: 1px solid #999; margin-bottom: 2em; } 
    8797     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; } 
    8999  </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> 
    90114</head> 
    91115 
     
    103127 
    104128<div id="local" class="multi-part" title="<?php echo __('user preferences'); ?>"> 
    105 <form action="plugin.php" method="post"> 
    106129 
    107130<?php  
    108  
    109 $table_header = '<table class="prefs"><caption>%s</caption>'. 
     131$table_header = '<table class="prefs" id="%s"><caption>%s</caption>'. 
    110132'<thead>'. 
    111133'<tr>'."\n". 
     
    120142 
    121143$prefs = array(); 
    122  
    123144foreach ($core->auth->user_prefs->dumpWorkspaces() as $ws => $workspace) { 
    124145     foreach ($workspace->dumpPrefs() as $k => $v) { 
     
    126147     } 
    127148} 
    128  
    129149ksort($prefs); 
    130  
    131150if (count($prefs) > 0) { 
    132      echo '<ul class="submenu">'; 
     151     $ws_combo = array(); 
    133152     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 
    139168foreach ($prefs as $ws => $s) 
    140169{ 
    141170     ksort($s); 
    142      echo sprintf($table_header,$ws); 
     171     echo sprintf($table_header,'l_'.$ws,$ws); 
    143172     foreach ($s as $k => $v) 
    144173     { 
     
    156185 
    157186<div id="global" class="multi-part" title="<?php echo __('global preferences'); ?>"> 
    158 <form action="plugin.php" method="post"> 
    159187 
    160188<?php 
     
    170198 
    171199if (count($prefs) > 0) { 
    172      echo '<ul class="submenu">'; 
     200     $ws_combo = array(); 
    173201     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 
    179217foreach ($prefs as $ws => $s) 
    180218{ 
    181219     ksort($s); 
    182      echo sprintf($table_header,$ws); 
     220     echo sprintf($table_header,'g_'.$ws,$ws); 
    183221     foreach ($s as $k => $v) 
    184222     { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map