1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: 254: 255: 256: 257: 258: 259: 260: 261: 262: 263: 264: 265: 266: 267: 268: 269: 270: 271:
<?php
function template_generic_menu_dropdown_above()
{
global $context, $txt;
$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 '
<a class="menu_icon mobile_generic_menu_', $context['cur_menu_id'], '"></a>
<div id="genericmenu">
<div id="mobile_generic_menu_', $context['cur_menu_id'], '" class="popup_container">
<div class="popup_window description">
<div class="popup_heading">
', $txt['mobile_user_menu'], '
<a href="javascript:void(0);" class="main_icons hide_popup"></a>
</div>
', template_generic_menu($menu_context), '
</div>
</div>
</div>
<script>
$( ".mobile_generic_menu_', $context['cur_menu_id'], '" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '" ).show();
});
$( ".hide_popup" ).click(function() {
$( "#mobile_generic_menu_', $context['cur_menu_id'], '" ).hide();
});
</script>';
echo '
<div id="admin_content">';
template_generic_menu_tabs($menu_context);
}
function template_generic_menu_dropdown_below()
{
echo '
</div><!-- #admin_content -->';
}
function template_generic_menu(&$menu_context)
{
global $context;
echo '
<div class="generic_menu">
<ul class="dropmenu dropdown_menu_', $context['cur_menu_id'], '">';
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'], !empty($section['amt']) ? ' <span class="amt">' . $section['amt'] . '</span>' : '', '</a>
<ul>';
foreach ($section['areas'] as $i => $area)
{
if (empty($area['label']))
continue;
echo '
<li', !empty($area['subsections']) && empty($area['hide_subsections']) ? ' class="subsections"' : '', '>
<a class="', $area['icon_class'], !empty($area['selected']) ? ' chosen ' : '', '" href="', (isset($area['url']) ? $area['url'] : $menu_context['base_url'] . ';area=' . $i), $menu_context['extra_parameters'], '">', $area['icon'], $area['label'], !empty($area['amt']) ? ' <span class="amt">' . $area['amt'] . '</span>' : '', '</a>';
if (!empty($area['selected']) && empty($context['tabs']))
$context['tabs'] = isset($area['subsections']) ? $area['subsections'] : array();
if (!empty($area['subsections']) && empty($area['hide_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>
<a ', !empty($sub['selected']) ? 'class="chosen" ' : '', ' href="', $url, $menu_context['extra_parameters'], '">', $sub['label'], !empty($sub['amt']) ? ' <span class="amt">' . $sub['amt'] . '</span>' : '', '</a>
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}
echo '
</ul>
</li>';
}
echo '
</ul><!-- .dropmenu -->
</div><!-- .generic_menu -->';
}
function template_generic_menu_tabs(&$menu_context)
{
global $context, $settings, $scripturl, $txt;
$tab_context = &$menu_context['tab_data'];
if (!empty($tab_context['title']))
{
echo '
<div class="cat_bar">', (function_exists('template_admin_quick_search') ? '
<form action="' . $scripturl . '?action=admin;area=search" method="post" accept-charset="' . $context['character_set'] . '">' : ''), '
<h3 class="catbg">';
if (function_exists('template_admin_quick_search'))
template_admin_quick_search();
if (!empty($context['tabs']))
{
foreach ($context['tabs'] as $id => $tab)
{
if (!empty($tab['disabled']))
{
$tab_context['tabs'][$id]['disabled'] = true;
continue;
}
if (!isset($tab_context['tabs'][$id]))
$tab_context['tabs'][$id] = array('label' => $tab['label']);
elseif (!isset($tab_context['tabs'][$id]['label']))
$tab_context['tabs'][$id]['label'] = $tab['label'];
if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
$tab_context['tabs'][$id]['url'] = $tab['url'];
if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
if (!empty($tab['is_selected']))
$tab_context['tabs'][$id]['is_selected'] = true;
if (!empty($tab['help']))
$tab_context['tabs'][$id]['help'] = $tab['help'];
if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
$tab_context['tabs'][$id]['is_last'] = true;
}
foreach ($tab_context['tabs'] as $sa => $tab)
{
if (!empty($tab['is_selected']) || (isset($menu_context['current_subsection']) && $menu_context['current_subsection'] == $sa))
{
$selected_tab = $tab;
$tab_context['tabs'][$sa]['is_selected'] = true;
}
}
}
if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']) || !empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
{
if (!empty($selected_tab['icon_class']) || !empty($tab_context['icon_class']))
echo '
<span class="', !empty($selected_tab['icon_class']) ? $selected_tab['icon_class'] : $tab_context['icon_class'], ' icon"></span>';
elseif (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
echo '
<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon">';
if (!empty($selected_tab['help']) || !empty($tab_context['help']))
echo '
<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><span class="main_icons help" title="', $txt['help'], '"></span></a>';
echo $tab_context['title'];
}
else
echo '
', $tab_context['title'];
echo '
</h3>', (function_exists('template_admin_quick_search') ? '
</form>' : ''), '
</div><!-- .cat_bar -->';
}
if (!empty($selected_tab['description']) || !empty($tab_context['description']))
echo '
<p class="information">
', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
</p>';
if (!empty($context['tabs']))
{
echo '
<div id="adm_submenus">
<ul class="dropmenu">';
foreach ($tab_context['tabs'] as $sa => $tab)
{
if (!empty($tab['disabled']))
continue;
if (!empty($tab['is_selected']))
echo '
<li>
<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
</li>';
else
echo '
<li>
<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
</li>';
}
echo '
</ul>
</div><!-- #adm_submenus -->';
}
}
?>