function template_category() { global $context, $scripturl; if (!empty($context['TPortal']['clist'])) { $buts = array(); foreach ($context['TPortal']['clist'] as $cats) { $buts[$cats['id']] = array('text' => 'catlist' . $cats['id'], 'image' => 'blank.gif', 'lang' => false, 'url' => $scripturl . '?cat=' . $cats['id'], 'active' => false); if ($cats['selected']) { $buts[$cats['id']]['active'] = true; } } echo '<div style="overflow: hidden;">', tp_template_button_strip($buts, 'top'), '</div>'; } $category = $context['TPortal']['category']; // get the grids $grid = tp_grids(); // fallback if (!isset($category['options']['catlayout'])) { $category['options']['catlayout'] = 1; } // any pageindex? if (!empty($context['TPortal']['pageindex'])) { echo ' <div class="tp_pageindex_upper">', $context['TPortal']['pageindex'], '</div>'; } // any child categories? if (!empty($context['TPortal']['category']['children'])) { category_childs(); } render_template_layout($grid[$category['options']['layout']]['code'], 'category_'); // any pageindex? if (!empty($context['TPortal']['pageindex'])) { echo ' <div class="tp_pageindex_lower">', $context['TPortal']['pageindex'], '</div>'; } }
function template_subtab_above() { global $context, $txt; if (isset($context['TPortal']['subtabs']) && sizeof($context['TPortal']['subtabs']) > 1) { echo ' <div class="tborder" style="margin-bottom: 0.5em;"> <div class="cat_bar"> <h3 class="catbg">' . $txt['tp-menus'] . '</h3> </div> <div style="padding: 2px; overflow: hidden;">'; tp_template_button_strip($context['TPortal']['subtabs']); echo ' </div> </div>'; } }