source: branches/2.0/plugins/admin_multi_view/is_admin.inc.php @ 16930

Last change on this file since 16930 was 4209, checked in by rvelices, 15 years ago

merge -r4208 fro; trunk
admin multi view plugin : new option "do not save page visits to history table"

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
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    list($user['template'], $user['theme']) = explode('/', $theme);
14    unset( $user['admin_template'], $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_no_history', 0 ))
29  {
30    add_event_handler( 'pwg_log_allowed', create_function( '', 'return false;' ) );
31  }
32}
33
34add_event_handler('loc_end_page_header', 'multiview_loc_end_page_header');
35
36function multiview_loc_end_page_header()
37{
38  global $template;
39  $my_root_url = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';
40  $js =
41'<script type="text/javascript">
42var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
43if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/))
44{
45  theController.location = "'.$my_root_url.'controller.php";
46}
47</script>';
48
49  $template->append( 'head_elements', $js );
50}
51?>
Note: See TracBrowser for help on using the repository browser.