aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--plugins/admin_multi_view/is_admin.inc.php8
-rw-r--r--plugins/admin_multi_view/is_admin_template.inc.php12
-rw-r--r--plugins/admin_multi_view/main.inc.php10
3 files changed, 21 insertions, 9 deletions
diff --git a/plugins/admin_multi_view/is_admin.inc.php b/plugins/admin_multi_view/is_admin.inc.php
index d348641f3..d7eee59e5 100644
--- a/plugins/admin_multi_view/is_admin.inc.php
+++ b/plugins/admin_multi_view/is_admin.inc.php
@@ -29,14 +29,6 @@ if (! defined('MULTIVIEW_CONTROLLER') )
$conf['template_combine_files'] = false;
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' );
- }
}
add_event_handler('loc_end_page_header', 'multiview_loc_end_page_header');
diff --git a/plugins/admin_multi_view/is_admin_template.inc.php b/plugins/admin_multi_view/is_admin_template.inc.php
new file mode 100644
index 000000000..722592d9a
--- /dev/null
+++ b/plugins/admin_multi_view/is_admin_template.inc.php
@@ -0,0 +1,12 @@
+<?php
+if (! defined('MULTIVIEW_CONTROLLER') )
+{
+ if (pwg_get_session_var( 'purge_template', 0 ))
+ {
+ global $template;
+ $template->delete_compiled_templates();
+ FileCombiner::clear_combined_files();
+ pwg_unset_session_var( 'purge_template' );
+ }
+}
+?>
diff --git a/plugins/admin_multi_view/main.inc.php b/plugins/admin_multi_view/main.inc.php
index ffeec4bcd..0c49d2c31 100644
--- a/plugins/admin_multi_view/main.inc.php
+++ b/plugins/admin_multi_view/main.inc.php
@@ -30,7 +30,8 @@ Author: Piwigo team
Author URI: http://piwigo.org
*/
-add_event_handler('init', 'multiview_user_init' );
+add_event_handler('user_init', 'multiview_user_init' );
+add_event_handler('init', 'multiview_init' );
function multiview_user_init()
{
@@ -39,4 +40,11 @@ function multiview_user_init()
include_once( dirname(__FILE__).'/is_admin.inc.php' );
}
+function multiview_init()
+{
+ if (!is_admin())
+ return;
+ include_once( dirname(__FILE__).'/is_admin_template.inc.php' );
+}
+
?>