diff options
author | mistic100 <mistic@piwigo.org> | 2012-05-20 13:10:53 +0000 |
---|---|---|
committer | mistic100 <mistic@piwigo.org> | 2012-05-20 13:10:53 +0000 |
commit | 7f0e4a62f66fc169d11890c96417b91d4eb4503b (patch) | |
tree | e66378001b418202b33261a6d9d81660ba52427a | |
parent | b527f0ccc24a5fe7b16c07d70d05ba2338962bd0 (diff) |
add link to purge templates
git-svn-id: http://piwigo.org/svn/trunk@15150 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | plugins/admin_multi_view/controller.php | 7 | ||||
-rw-r--r-- | plugins/admin_multi_view/is_admin.inc.php | 12 | ||||
-rw-r--r-- | plugins/admin_multi_view/main.inc.php | 2 |
3 files changed, 17 insertions, 4 deletions
diff --git a/plugins/admin_multi_view/controller.php b/plugins/admin_multi_view/controller.php index 2c61a9bc6..ec9119162 100644 --- a/plugins/admin_multi_view/controller.php +++ b/plugins/admin_multi_view/controller.php @@ -103,6 +103,12 @@ if ( isset($_GET['no_history']) ) $refresh_main = true; } +if ( isset($_GET['purge_template']) ) +{ + pwg_set_session_var( 'purge_template', 1 ); + $refresh_main = true; +} + $my_url = get_root_url().'plugins/'.basename(dirname(__FILE__)).'/'.basename(__FILE__); // +-----------------------------------------------------------------------+ @@ -238,6 +244,7 @@ if (window.opener==null) { <tr><td>Lang</td><td><?php echo $lang_html; ?></td></tr> </table> <?php echo implode( "<br/>\n", array($show_queries_html, $debug_l10n_html, $debug_template_html, $template_combine_files_html, $no_history_html) ); ?> +<br/><a href="<?php echo $my_url; ?>?purge_template">Purge compiled templates</a> <script type="text/javascript"> <?php diff --git a/plugins/admin_multi_view/is_admin.inc.php b/plugins/admin_multi_view/is_admin.inc.php index df9e91276..d348641f3 100644 --- a/plugins/admin_multi_view/is_admin.inc.php +++ b/plugins/admin_multi_view/is_admin.inc.php @@ -27,9 +27,15 @@ if (! defined('MULTIVIEW_CONTROLLER') ) $conf['debug_template'] = true; if (!pwg_get_session_var( 'multiview_template_combine_files', 1 )) $conf['template_combine_files'] = false; - if (pwg_get_session_var( 'multiview_no_history', 0 )) - { + if (pwg_get_session_var( 'multiview_no_history', 0 )) add_event_handler( 'pwg_log_allowed', create_function( '', 'return false;' ) ); + + if (pwg_get_session_var( 'purge_template', 0 )) + { + global $template; + $template->delete_compiled_templates(); + FileCombiner::clear_combined_files(); + pwg_unset_session_var( 'purge_template' ); } } @@ -41,7 +47,7 @@ function multiview_loc_end_page_header() $my_root_url = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/'; $js = '<script type="text/javascript"> -var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no"); +var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=230,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no"); if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/)) { theController.location = "'.$my_root_url.'controller.php"; diff --git a/plugins/admin_multi_view/main.inc.php b/plugins/admin_multi_view/main.inc.php index 7514091bc..ffeec4bcd 100644 --- a/plugins/admin_multi_view/main.inc.php +++ b/plugins/admin_multi_view/main.inc.php @@ -30,7 +30,7 @@ Author: Piwigo team Author URI: http://piwigo.org */ -add_event_handler('user_init', 'multiview_user_init' ); +add_event_handler('init', 'multiview_user_init' ); function multiview_user_init() { |