Changeset 12102


Ignore:
Timestamp:
Sep 8, 2011, 12:03:04 PM (9 years ago)
Author:
plg
Message:

bug 2434 fixed: try to stay on the same page when changing admin colors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r11368 r12102  
    6666  conf_update_param('admin_theme', $new_admin_theme);
    6767
    68   redirect('admin.php');
     68  $url_params = array();
     69  foreach (array('page', 'tab', 'section') as $url_param)
     70  {
     71    if (isset($_GET[$url_param]))
     72    {
     73      $url_params[] = $url_param.'='.$_GET[$url_param];
     74    }
     75  }
     76 
     77  $redirect_url = 'admin.php';
     78  if (count($url_params) > 0)
     79  {
     80    $redirect_url.= '?'.implode('&', $url_params);
     81  }
     82
     83  redirect($redirect_url);
    6984}
    7085
     
    8297// | Variables init                                                        |
    8398// +-----------------------------------------------------------------------+
     99
     100$change_theme_url = PHPWG_ROOT_PATH.'admin.php?';
     101$test_get = $_GET;
     102unset($test_get['page']);
     103unset($test_get['section']);
     104unset($test_get['tag']);
     105if (count($test_get) == 0)
     106{
     107  $change_theme_url.= str_replace('&', '&', $_SERVER['QUERY_STRING']).'&';
     108}
     109$change_theme_url.= 'change_theme=1';
    84110
    85111// ?page=plugin-community-pendings is an clean alias of
     
    162188    'U_PLUGINS'=> $link_start.'plugins',
    163189    'U_ADD_PHOTOS' => $link_start.'photos_add',
    164     'U_CHANGE_THEME' => PHPWG_ROOT_PATH.'admin.php?change_theme=1',
     190    'U_CHANGE_THEME' => $change_theme_url,
    165191    'U_PENDING_COMMENTS' => $link_start.'comments',
    166192    'U_UPDATES' => $link_start.'updates',
Note: See TracChangeset for help on using the changeset viewer.