|
@@ -193,7 +193,7 @@ function template_generic_menu_dropdown_above()
|
|
|
<div id="admin_content">';
|
|
|
|
|
|
// It's possible that some pages have their own tabs they wanna force...
|
|
|
- if (!empty($context['tabs']))
|
|
|
+// if (!empty($context['tabs']))
|
|
|
template_generic_menu_tabs($menu_context);
|
|
|
}
|
|
|
|
|
@@ -223,49 +223,52 @@ function template_generic_menu_tabs(&$menu_context)
|
|
|
template_admin_quick_search();
|
|
|
|
|
|
// Exactly how many tabs do we have?
|
|
|
- foreach ($context['tabs'] as $id => $tab)
|
|
|
+ if (!empty($context['tabs']))
|
|
|
{
|
|
|
- // Can this not be accessed?
|
|
|
- if (!empty($tab['disabled']))
|
|
|
+ foreach ($context['tabs'] as $id => $tab)
|
|
|
{
|
|
|
- $tab_context['tabs'][$id]['disabled'] = true;
|
|
|
- continue;
|
|
|
- }
|
|
|
+ // Can this not be accessed?
|
|
|
+ if (!empty($tab['disabled']))
|
|
|
+ {
|
|
|
+ $tab_context['tabs'][$id]['disabled'] = true;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
- // Did this not even exist - or do we not have a label?
|
|
|
- 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'];
|
|
|
+ // Did this not even exist - or do we not have a label?
|
|
|
+ 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'];
|
|
|
|
|
|
- // Has a custom URL defined in the main admin structure?
|
|
|
- if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
|
|
|
- $tab_context['tabs'][$id]['url'] = $tab['url'];
|
|
|
+ // Has a custom URL defined in the main admin structure?
|
|
|
+ if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
|
|
|
+ $tab_context['tabs'][$id]['url'] = $tab['url'];
|
|
|
|
|
|
- // Any additional paramaters for the url?
|
|
|
- if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
|
|
|
- $tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
|
|
|
+ // Any additional paramaters for the url?
|
|
|
+ if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
|
|
|
+ $tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
|
|
|
|
|
|
- // Has it been deemed selected?
|
|
|
- if (!empty($tab['is_selected']))
|
|
|
- $tab_context['tabs'][$id]['is_selected'] = true;
|
|
|
+ // Has it been deemed selected?
|
|
|
+ if (!empty($tab['is_selected']))
|
|
|
+ $tab_context['tabs'][$id]['is_selected'] = true;
|
|
|
|
|
|
- // Does it have its own help?
|
|
|
- if (!empty($tab['help']))
|
|
|
- $tab_context['tabs'][$id]['help'] = $tab['help'];
|
|
|
+ // Does it have its own help?
|
|
|
+ if (!empty($tab['help']))
|
|
|
+ $tab_context['tabs'][$id]['help'] = $tab['help'];
|
|
|
|
|
|
- // Is this the last one?
|
|
|
- if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
|
|
|
- $tab_context['tabs'][$id]['is_last'] = true;
|
|
|
- }
|
|
|
+ // Is this the last one?
|
|
|
+ if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
|
|
|
+ $tab_context['tabs'][$id]['is_last'] = true;
|
|
|
+ }
|
|
|
|
|
|
- // Find the selected tab
|
|
|
- foreach ($tab_context['tabs'] as $sa => $tab)
|
|
|
- {
|
|
|
- if (!empty($tab['is_selected']) || (isset($menu_context['current_subsection']) && $menu_context['current_subsection'] == $sa))
|
|
|
+ // Find the selected tab
|
|
|
+ foreach ($tab_context['tabs'] as $sa => $tab)
|
|
|
{
|
|
|
- $selected_tab = $tab;
|
|
|
- $tab_context['tabs'][$sa]['is_selected'] = true;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -291,7 +294,8 @@ function template_generic_menu_tabs(&$menu_context)
|
|
|
</div>';
|
|
|
|
|
|
// Shall we use the tabs? Yes, it's the only known way!
|
|
|
- echo '
|
|
|
+ if (!empty($selected_tab['description']) || !empty($tab_context['description']))
|
|
|
+ echo '
|
|
|
<p class="description">
|
|
|
', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
|
|
|
</p>';
|
|
@@ -301,24 +305,27 @@ function template_generic_menu_tabs(&$menu_context)
|
|
|
<div id="adm_submenus">
|
|
|
<ul class="dropmenu">';
|
|
|
|
|
|
- // Print out all the items in this tab.
|
|
|
- foreach ($tab_context['tabs'] as $sa => $tab)
|
|
|
+ // Print out all the items in this tab (if any).
|
|
|
+ if (!empty($context['tabs']))
|
|
|
{
|
|
|
- if (!empty($tab['disabled']))
|
|
|
- continue;
|
|
|
-
|
|
|
- if (!empty($tab['is_selected']))
|
|
|
+ foreach ($tab_context['tabs'] as $sa => $tab)
|
|
|
{
|
|
|
- echo '
|
|
|
+ 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 '
|
|
|
+ }
|
|
|
+ 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>';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// the end of tabs
|