source: trunk/plugins/admin_multi_view/is_admin.inc.php @ 8012

Revision 8012, 1.7 KB checked in by rvelices, 9 years ago (diff)

combined script now really merges files
added option $conftemplate_combine_files by default true to enable/disable file combining

  • Property svn:eol-style set to LF
Line 
1<?php
2if (! defined('MULTIVIEW_CONTROLLER') )
3{
4  global $user;
5  $view_as = pwg_get_session_var( 'multiview_as', 0 );
6  if ($view_as)
7  {
8    $user = build_user( $view_as, true);
9  }
10  $theme = pwg_get_session_var( 'multiview_theme', '' );
11  if ( !empty($theme) )
12  {
13    $user['theme'] = $theme;
14    unset($user['admin_theme']);
15  }
16  $lang = pwg_get_session_var( 'multiview_lang', '' );
17  if ( !empty($lang) )
18  {
19    $user['language'] = $lang;
20  }
21  global $conf;
22  if (pwg_get_session_var( 'multiview_show_queries', 0 ))
23    $conf['show_queries'] = true;
24  if (pwg_get_session_var( 'multiview_debug_l10n', 0 ))
25    $conf['debug_l10n'] = true;
26  if (pwg_get_session_var( 'multiview_debug_template', 0 ))
27    $conf['debug_template'] = true;
28  if (!pwg_get_session_var( 'multiview_template_combine_files', 1 ))
29    $conf['template_combine_files'] = false;
30                if (pwg_get_session_var( 'multiview_no_history', 0 ))
31  {
32    add_event_handler( 'pwg_log_allowed', create_function( '', 'return false;' ) );
33  }
34}
35
36add_event_handler('loc_end_page_header', 'multiview_loc_end_page_header');
37
38function multiview_loc_end_page_header()
39{
40  global $template;
41  $my_root_url = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';
42  $js =
43'<script type="text/javascript">
44var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
45if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/))
46{
47  theController.location = "'.$my_root_url.'controller.php";
48}
49</script>';
50
51  $template->append( 'head_elements', $js );
52}
53?>
Note: See TracBrowser for help on using the repository browser.