Ignore:
Timestamp:
Mar 13, 2010, 1:39:25 PM (15 years ago)
Author:
patdenice
Message:

Feature 1502: Fix admin multi view plugin.

Location:
trunk/plugins/admin_multi_view
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/admin_multi_view/controller.php

    r4208 r5128  
    129129// +-----------------------------------------------------------------------+
    130130// | templates                                                             |
    131 $my_template = '';
     131$my_theme = '';
    132132$themes_html='<select onchange="document.location = this.options[this.selectedIndex].value;">';
    133 foreach (get_pwg_themes() as $pwg_template)
    134 {
    135   $selected = $pwg_template == pwg_get_session_var( 'multiview_theme', $view_as_user['template'].'/'.$view_as_user['theme'] ) ? 'selected="selected"' : '';
    136   $my_template = $selected == '' ? $my_template : $view_as_user['template'].'/theme/'.$view_as_user['theme'];
     133foreach (get_pwg_themes() as $pwg_theme)
     134{
     135  $selected = $pwg_theme == pwg_get_session_var( 'multiview_theme', $view_as_user['theme'] ) ? 'selected="selected"' : '';
     136  $my_theme = $selected == '' ? $my_theme : 'themes/'.$view_as_user['theme'];
    137137  $themes_html .=
    138138    '<option value="'
    139     .$my_url.'?theme='.$pwg_template
     139    .$my_url.'?theme='.$pwg_theme
    140140    .'" '.$selected.'>'
    141     .$pwg_template
     141    .$pwg_theme
    142142    .'</option>';
    143143}
     
    207207<?php
    208208// Controller will be displayed  with  the **real admin template** (without Any if it has been removed)
    209 if ( $my_template !== '') {
    210   $my_template = get_root_url().'template/'.$my_template.'/theme.css';
    211   echo '<link rel="stylesheet" type="text/css" href="' . $my_template .'">';
     209if ( $my_theme !== '') {
     210  $my_theme = get_root_url().$my_theme.'/theme.css';
     211  echo '<link rel="stylesheet" type="text/css" href="' . $my_theme .'">';
    212212}
    213213?>
  • trunk/plugins/admin_multi_view/is_admin.inc.php

    r4208 r5128  
    1111  if ( !empty($theme) )
    1212  {
    13     list($user['template'], $user['theme']) = explode('/', $theme);
    14     unset( $user['admin_template'], $user['admin_theme']);
     13    $user['theme'] = $theme;
     14    unset($user['admin_theme']);
    1515  }
    1616  $lang = pwg_get_session_var( 'multiview_lang', '' );
Note: See TracChangeset for help on using the changeset viewer.