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

Last change on this file since 1900 was 1900, checked in by rub, 17 years ago

Apply property svn:eol-style Value: LF

  • Property svn:eol-style set to LF
File size: 1.2 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  }
15  $lang = pwg_get_session_var( 'multiview_lang', '' );
16  if ( !empty($lang) )
17  {
18    $user['language'] = $lang;
19  }
20}
21
22add_event_handler('loc_end_page_header', 'multiview_loc_end_page_header');
23
24function multiview_loc_end_page_header()
25{
26  global $template;
27  $my_root_url = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/';
28  $js =
29'<script type="text/javascript">
30var theController = window.open("", "mview_controller", "alwaysRaised=yes,dependent=yes,toolbar=no,height=200,width=220,menubar=no,resizable=yes,scrollbars=yes,status=no");
31if ( theController.location.toString()=="about:blank" || !theController.location.toString().match(/^(https?.*\/)controller\.php(\?.+)?$/))
32{
33  theController.location = "'.$my_root_url.'controller.php";
34}
35</script>';
36
37  $template->assign_block_vars( 'head_element', array(
38    'CONTENT' => $js
39      )
40    );
41}
42?>
Note: See TracBrowser for help on using the repository browser.