Exemplo n.º 1
0
function template_generic_menu_sidebar_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    echo '
	<div id="amenu">
		<ul class="dropmenu submenu">';
    // What one are we rendering?
    $context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
    $menu_context =& $context['menu_data_' . $context['cur_menu_id']];
    foreach ($menu_context['sections'] as $section) {
        // Show the section header - and pump up the line spacing for readability.
        echo '
			<li>
				<span id="aa', $section['id'], '" class="firstlevel" onclick="subMenu(\'ad_' . $section['id'] . '\',\'asubmenus\',\'submenu\');">', $section['title'], '&nbsp;<span class="icon-angle-down more_menus"></span>
			</li>';
    }
    echo '
		</ul>
		<div id="asubmenus" class="submenuitems">';
    foreach ($menu_context['sections'] as $section) {
        // Show the section header - and pump up the line spacing for readability.
        echo '
			<ul class="dropmenu submenu" id="ad_' . $section['id'] . '" style="display: none;">';
        // For every area of this section show a link to that area (bold if it's currently selected.)
        foreach ($section['areas'] as $i => $area) {
            // Not supposed to be printed?
            if (empty($area['label'])) {
                continue;
            }
            // Is this the current area, or just some area?
            if ($i == $menu_context['current_area']) {
                echo '
				<li><a class="active firstlevel" href="', isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i, $menu_context['extra_parameters'], '">', $area['label'], '</a></li>';
                if (empty($context['tabs'])) {
                    $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
                }
            } else {
                echo '
				<li><a class="firstlevel" href="', isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i, $menu_context['extra_parameters'], '">', $area['label'], '</a></li>';
            }
        }
        echo '	
			</ul>';
        $firstSection = false;
    }
    // This is where the actual "main content" area for the admin section starts.
    echo '
		</div>
	</div>
	<div class="admbody">
		<div id="inner_admbody">';
    // If there are any "tabs" setup, this is the place to shown them.
    if (!empty($context['tabs']) && empty($context['force_disable_tabs'])) {
        template_generic_menu_tabs($menu_context);
    }
}
Exemplo n.º 2
0
function template_generic_menu_dropdown_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // Which menu are we rendering?
    $context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
    $menu_context =& $context['menu_data_' . $context['cur_menu_id']];
    if (!empty($menu_context['can_toggle_drop_down'])) {
        echo '
	<a href="', $menu_context['toggle_url'], '"><img id="menu_toggle" src="', $context['menu_image_path'], '/change_menu', $context['right_to_left'] ? '2' : '', '.png" alt="*" /></a>';
    }
    echo '
<div id="admin_menu">
	<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';
    // Main areas first.
    foreach ($menu_context['sections'] as $section) {
        if ($section['id'] == $menu_context['current_section']) {
            echo '
			<li><a class="active firstlevel" href="#"><span class="firstlevel">', $section['title'], '</span></a>
				<ul>';
        } else {
            echo '
			<li><a class="firstlevel" href="#"><span class="firstlevel">', $section['title'], '</span></a>
				<ul>';
        }
        // For every area of this section show a link to that area (bold if it's currently selected.)
        $additional_items = 0;
        foreach ($section['areas'] as $i => $area) {
            // Not supposed to be printed?
            if (empty($area['label'])) {
                continue;
            }
            echo '
					<li', ++$additional_items > 6 ? ' class="additional_items"' : '', '>';
            // Is this the current area, or just some area?
            if ($i == $menu_context['current_area']) {
                echo '
						<a class="chosen" href="', isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i, $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';
                if (empty($context['tabs'])) {
                    $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
                }
            } else {
                echo '
						<a href="', isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i, $menu_context['extra_parameters'], '"><span>', $area['icon'], $area['label'], !empty($area['subsections']) ? '...' : '', '</span></a>';
            }
            // Is there any subsections?
            $additional_items_sub = 0;
            if (!empty($area['subsections'])) {
                echo '
						<ul>';
                foreach ($area['subsections'] as $sa => $sub) {
                    if (!empty($sub['disabled'])) {
                        continue;
                    }
                    $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
                    echo '
							<li', ++$additional_items_sub > 6 ? ' class="additional_items"' : '', '>
								<a ', !empty($sub['selected']) ? 'class="active" ' : '', 'href="', $url, $menu_context['extra_parameters'], '"><span>', $sub['label'], '</span></a>
							</li>';
                }
                echo '
						</ul>';
            }
            echo '
					</li>';
        }
        echo '
				</ul>
			</li>';
    }
    echo '
	</ul>
</div>';
    // This is the main table - we need it so we can keep the content to the right of it.
    echo '
<div id="admin_content">';
    // It's possible that some pages have their own tabs they wanna force...
    if (!empty($context['tabs'])) {
        template_generic_menu_tabs($menu_context);
    }
}
Exemplo n.º 3
0
function template_generic_menu_dropdown_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;
    // Which menu are we rendering?
    $context['cur_menu_id'] = isset($context['cur_menu_id']) ? $context['cur_menu_id'] + 1 : 1;
    $menu_context =& $context['menu_data_' . $context['cur_menu_id']];
    echo '
<div id="admin_menu">';
    echo '
	<ul class="dropmenu" id="dropdown_menu_', $context['cur_menu_id'], '">';
    // Main areas first.
    foreach ($menu_context['sections'] as $section) {
        echo '
			<li ', !empty($section['areas']) ? 'class="subsections"' : '', '><a class="', !empty($section['selected']) ? 'active ' : '', '" href="', $section['url'], $menu_context['extra_parameters'], '">', $section['title'], '</a>
				<ul>';
        // For every area of this section show a link to that area (bold if it's currently selected.)
        // @todo Code for additional_items class was deprecated and has been removed. Suggest following up in Sources if required.
        foreach ($section['areas'] as $i => $area) {
            // Not supposed to be printed?
            if (empty($area['label'])) {
                continue;
            }
            echo '
					<li', !empty($area['subsections']) ? ' class="subsections"' : '', '>';
            echo '
						<a ', !empty($area['selected']) ? 'class="chosen" ' : '', 'href="', isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i, $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], '</a>';
            // Is this the current area, or just some area?
            if (!empty($area['selected']) && empty($context['tabs'])) {
                $context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
            }
            // Are there any subsections?
            if (!empty($area['subsections'])) {
                echo '
						<ul>';
                foreach ($area['subsections'] as $sa => $sub) {
                    if (!empty($sub['disabled'])) {
                        continue;
                    }
                    $url = isset($sub['url']) ? $sub['url'] : (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i) . ';sa=' . $sa;
                    echo '
							<li ', !empty($area['subsections']) ? ' class="subsections"' : '', '>
								<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', 'href="', $url, $menu_context['extra_parameters'], '">', $sub['label'], '</a>
							</li>';
                }
                echo '
						</ul>';
            }
            echo '
					</li>';
        }
        echo '
				</ul>
			</li>';
    }
    echo '
	</ul>
</div>';
    // This is the main table - we need it so we can keep the content to the right of it.
    echo '
<div id="admin_content">';
    // It's possible that some pages have their own tabs they wanna force...
    if (!empty($context['tabs'])) {
        template_generic_menu_tabs($menu_context);
    }
}