Changeset 15150


Ignore:
Timestamp:
May 20, 2012, 3:10:53 PM (9 years ago)
Author:
mistic100
Message:

add link to purge templates

Location:
trunk/plugins/admin_multi_view
Files:
3 edited

Legend:

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

    r8126 r15150  
    104104}
    105105
     106if ( isset($_GET['purge_template']) )
     107{
     108  pwg_set_session_var( 'purge_template', 1 );
     109  $refresh_main = true;
     110}
     111
    106112$my_url = get_root_url().'plugins/'.basename(dirname(__FILE__)).'/'.basename(__FILE__);
    107113
     
    239245</table>
    240246<?php echo implode( "<br/>\n", array($show_queries_html, $debug_l10n_html, $debug_template_html, $template_combine_files_html, $no_history_html) ); ?>
     247<br/><a href="<?php echo $my_url; ?>?purge_template">Purge compiled templates</a>
    241248
    242249<script type="text/javascript">
  • trunk/plugins/admin_multi_view/is_admin.inc.php

    r8012 r15150  
    2828  if (!pwg_get_session_var( 'multiview_template_combine_files', 1 ))
    2929    $conf['template_combine_files'] = false;
    30                 if (pwg_get_session_var( 'multiview_no_history', 0 ))
     30  if (pwg_get_session_var( 'multiview_no_history', 0 ))
     31    add_event_handler( 'pwg_log_allowed', create_function( '', 'return false;' ) );
     32
     33  if (pwg_get_session_var( 'purge_template', 0 ))
    3134  {
    32     add_event_handler( 'pwg_log_allowed', create_function( '', 'return false;' ) );
     35    global $template;
     36    $template->delete_compiled_templates();
     37    FileCombiner::clear_combined_files();
     38    pwg_unset_session_var( 'purge_template' );
    3339  }
    3440}
     
    4248  $js =
    4349'<script type="text/javascript">
    44 var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
     50var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=230,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
    4551if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/))
    4652{
  • trunk/plugins/admin_multi_view/main.inc.php

    r12922 r15150  
    3131*/
    3232
    33 add_event_handler('user_init', 'multiview_user_init' );
     33add_event_handler('init', 'multiview_user_init' );
    3434
    3535function multiview_user_init()
Note: See TracChangeset for help on using the changeset viewer.