|
@@ -26,34 +26,6 @@ function createMenu($menuData, $menuOptions = array())
|
|
|
{
|
|
|
global $context, $settings, $options, $txt, $modSettings, $scripturl, $smcFunc, $user_info, $sourcedir, $options;
|
|
|
|
|
|
- // First are we toggling use of the side bar generally?
|
|
|
- if (isset($_GET['togglebar']) && !$user_info['is_guest'])
|
|
|
- {
|
|
|
- // Save the new dropdown menu state.
|
|
|
- $smcFunc['db_insert']('replace',
|
|
|
- '{db_prefix}themes',
|
|
|
- array('id_member' => 'int', 'id_theme' => 'int', 'variable' => 'string-255', 'value' => 'string-65534'),
|
|
|
- array(
|
|
|
- array(
|
|
|
- $user_info['id'],
|
|
|
- $settings['theme_id'],
|
|
|
- 'use_sidebar_menu',
|
|
|
- empty($options['use_sidebar_menu']) ? '1' : '0',
|
|
|
- ),
|
|
|
- ),
|
|
|
- array('id_member', 'id_theme', 'variable')
|
|
|
- );
|
|
|
-
|
|
|
- // Clear the theme settings cache for this user.
|
|
|
- $themes = explode(',', $modSettings['knownThemes']);
|
|
|
- foreach ($themes as $theme)
|
|
|
- cache_put_data('theme_settings-' . $theme . ':' . $user_info['id'], null, 60);
|
|
|
-
|
|
|
- // Redirect as this seems to work best.
|
|
|
- $redirect_url = isset($menuOptions['toggle_redirect_url']) ? $menuOptions['toggle_redirect_url'] : 'action=' . (isset($_GET['action']) ? $_GET['action'] : 'admin') . ';area=' . (isset($_GET['area']) ? $_GET['area'] : 'index') . ';sa=' . (isset($_GET['sa']) ? $_GET['sa'] : 'settings') . (isset($_GET['u']) ? ';u=' . $_GET['u'] : '') . ';' . $context['session_var'] . '=' . $context['session_id'];
|
|
|
- redirectexit($redirect_url);
|
|
|
- }
|
|
|
-
|
|
|
// Work out where we should get our images from.
|
|
|
$context['menu_image_path'] = file_exists($settings['theme_dir'] . '/images/admin/change_menu.png') ? $settings['images_url'] . '/admin' : $settings['default_images_url'] . '/admin';
|
|
|
|
|
@@ -235,9 +207,6 @@ function createMenu($menuData, $menuOptions = array())
|
|
|
// Should we use a custom base url, or use the default?
|
|
|
$menu_context['base_url'] = isset($menuOptions['base_url']) ? $menuOptions['base_url'] : $scripturl . '?action=' . $menu_context['current_action'];
|
|
|
|
|
|
- // What about the toggle url?
|
|
|
- $menu_context['toggle_url'] = isset($menuOptions['toggle_url']) ? $menuOptions['toggle_url'] : $menu_context['base_url'] . (!empty($menu_context['current_area']) ? ';area=' . $menu_context['current_area'] : '') . (!empty($menu_context['current_subsection']) ? ';sa=' . $menu_context['current_subsection'] : '') . $menu_context['extra_parameters'] . ';togglebar';
|
|
|
-
|
|
|
// If there are sections quickly goes through all the sections to check if the base menu has an url
|
|
|
if (!empty($menu_context['current_section']))
|
|
|
{
|