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/aboutConfig
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/aboutConfig/_define.php

    r464 r589  
    1616     /* Description*/         "Manage every blog configuration directive", 
    1717     /* Author */             "Olivier Meunier", 
    18      /* Version */            '0.3' 
     18     /* Version */            '0.4' 
    1919); 
    2020?> 
  • plugins/aboutConfig/index.php

    r582 r589  
    1212if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    1313 
     14# Local navigation 
     15if (!empty($_POST['gs_nav'])) { 
     16     http::redirect($p_url.$_POST['gs_nav']); 
     17     exit; 
     18} 
     19if (!empty($_POST['ls_nav'])) { 
     20     http::redirect($p_url.$_POST['ls_nav']); 
     21     exit; 
     22} 
     23 
    1424# Local settings update 
    1525if (!empty($_POST['s']) && is_array($_POST['s'])) 
     
    90100  table.settings { border: 1px solid #999; margin-bottom: 2em; } 
    91101  table.settings th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; } 
    92   ul.submenu {float: right; border: 1px solid #ccc; padding-right: 1em; padding-left: 1.5em; margin-top:0.5em; margin-bottom:0.5em; } 
     102  p.anchor-nav {float: right; } 
    93103  </style> 
     104     <script type="text/javascript"> 
     105     //<![CDATA[ 
     106     $(function() { 
     107          $("#gs_submit").hide(); 
     108          $("#ls_submit").hide(); 
     109          $("#gs_nav").change(function() { 
     110               window.location = $("#gs_nav option:selected").val(); 
     111          }) 
     112          $("#ls_nav").change(function() { 
     113               window.location = $("#ls_nav option:selected").val(); 
     114          }) 
     115     }); 
     116     //]]> 
     117     </script> 
    94118</head> 
    95119 
     
    107131 
    108132<div id="local" class="multi-part" title="<?php echo __('blog settings'); ?>"> 
    109 <form action="plugin.php" method="post"> 
    110133 
    111134<?php  
    112  
    113135$table_header = '<table class="settings" id="%s"><caption>%s</caption>'. 
    114136'<thead>'. 
     
    124146 
    125147$settings = array(); 
    126  
    127148foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) { 
    128149     foreach ($namespace->dumpSettings() as $k => $v) { 
     
    130151     } 
    131152} 
    132  
    133153ksort($settings); 
    134  
    135154if (count($settings) > 0) { 
    136      echo '<ul class="submenu">'; 
     155     $ns_combo = array(); 
    137156     foreach ($settings as $ns => $s) { 
    138           echo '<li><a href="#l_'.$ns.'">'.$ns.'</a></li>'; 
    139      } 
    140      echo '</ul>'; 
    141 } 
    142  
     157          $ns_combo[$ns] = '#l_'.$ns; 
     158     } 
     159     echo  
     160          '<form action="plugin.php" method="post">'. 
     161          '<p class="anchor-nav">'. 
     162          '<label for="ls_nav" class="classic">'.__('Goto:').'</label> '.form::combo('ls_nav',$ns_combo). 
     163          ' <input type="submit" value="'.__('Ok').'" id="ls_submit" />'. 
     164          '<input type="hidden" name="p" value="aboutConfig" />'. 
     165          $core->formNonce().'</p></form>'; 
     166} 
     167?> 
     168 
     169<form action="plugin.php" method="post"> 
     170 
     171<?php 
    143172foreach ($settings as $ns => $s) 
    144173{ 
     
    160189 
    161190<div id="global" class="multi-part" title="<?php echo __('global settings'); ?>"> 
    162 <form action="plugin.php" method="post"> 
     191 
    163192<?php 
    164193$settings = array(); 
     
    173202 
    174203if (count($settings) > 0) { 
    175      echo '<ul class="submenu">'; 
     204     $ns_combo = array(); 
    176205     foreach ($settings as $ns => $s) { 
    177           echo '<li><a href="#g_'.$ns.'">'.$ns.'</a></li>'; 
    178      } 
    179      echo '</ul>'; 
    180 } 
    181  
     206          $ns_combo[$ns] = '#g_'.$ns; 
     207     } 
     208     echo  
     209          '<form action="plugin.php" method="post">'. 
     210          '<p class="anchor-nav">'. 
     211          '<label for="gs_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gs_nav',$ns_combo). 
     212          ' <input type="submit" value="'.__('Ok').'" id="gs_submit" />'. 
     213          '<input type="hidden" name="p" value="aboutConfig" />'. 
     214          $core->formNonce().'</p></form>'; 
     215} 
     216?> 
     217 
     218<form action="plugin.php" method="post"> 
     219 
     220<?php 
    182221foreach ($settings as $ns => $s) 
    183222{ 
Note: See TracChangeset for help on using the changeset viewer.

Sites map