Ignore:
Timestamp:
May 16, 2007, 7:08:46 AM (18 years ago)
Author:
rvelices
Message:

admin multi view improvement: allow admins to change confshow_queries and confdebug_l10n for their session ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/admin_multi_view/controller.php

    r1912 r2016  
    99  pwg_unset_session_var( 'multiview_theme' );
    1010  pwg_unset_session_var( 'multiview_lang' );
     11  pwg_unset_session_var( 'multiview_show_queries' );
     12  pwg_unset_session_var( 'multiview_debug_l10n' );
    1113?>
    1214<script type="text/javascript">
     
    4446}
    4547
     48if ( isset($_GET['show_queries']) )
     49{
     50  if ( $_GET['show_queries']> 0 )
     51    pwg_set_session_var( 'multiview_show_queries', 1 );
     52  else
     53    pwg_unset_session_var( 'multiview_show_queries' );
     54  $refresh_main = true;
     55}
     56
     57if ( isset($_GET['debug_l10n']) )
     58{
     59  if ( $_GET['debug_l10n']>0 )
     60    pwg_set_session_var( 'multiview_debug_l10n', 1 );
     61  else
     62    pwg_unset_session_var( 'multiview_debug_l10n' );
     63  $refresh_main = true;
     64}
     65
    4666$my_url = get_root_url().'plugins/'.basename(dirname(__FILE__)).'/'.basename(__FILE__);
    4767$my_theme = get_root_url().'template/'.$user['template'].'/theme/'.$user['theme'].'/theme.css';
     
    7292}
    7393$lang_html .= '</select>';
     94
     95$show_queries_html='';
     96if (!$conf['show_queries'])
     97{
     98  $show_queries_html = '<br/>';
     99  if ( !pwg_get_session_var( 'multiview_show_queries', 0 ) )
     100    $show_queries_html.='<a href="'.$my_url.'?show_queries=1">Show SQL queries</a>';
     101  else
     102    $show_queries_html.='<a href="'.$my_url.'?show_queries=0">Hide SQL queries</a>';
     103}
     104
     105$debug_l10n_html='';
     106if (!$conf['show_queries'])
     107{
     108  $debug_l10n_html = '<br/>';
     109  if ( !pwg_get_session_var( 'multiview_debug_l10n', 0 ) )
     110    $debug_l10n_html.='<a href="'.$my_url.'?debug_l10n=1">Debug language</a>';
     111  else
     112    $debug_l10n_html.='<a href="'.$my_url.'?debug_l10n=0">Revert debug language</a>';
     113}
    74114?>
    75115
     
    104144<?php echo $lang_html; ?>
    105145
     146<?php echo $show_queries_html; ?>
     147<?php echo $debug_l10n_html; ?>
    106148
    107149<script type="text/javascript">
Note: See TracChangeset for help on using the changeset viewer.