'; else echo '
'; // Show the title of the table (if any). if (!empty($cur_list['title'])) echo '

', $cur_list['title'], '

'; // This is for the old style menu with the arrows "> Test | Test 1" if (empty($settings['use_tabs']) && isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top')) template_create_list_menu($cur_list['list_menu'], 'top'); if (isset($cur_list['additional_rows']['after_title'])) { echo '
'; template_additional_rows('after_title', $cur_list); echo '
'; } if (isset($cur_list['additional_rows']['top_of_list'])) template_additional_rows('top_of_list', $cur_list); if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers'])) { echo '
'; // Show the page index (if this list doesn't intend to show all items). if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) echo '
', $cur_list['page_index'], '
'; if (isset($cur_list['additional_rows']['above_column_headers'])) template_additional_rows('above_column_headers', $cur_list); echo '
'; } echo ' '; // Show the column headers. $header_count = count($cur_list['headers']); if (!($header_count < 2 && empty($cur_list['headers'][0]['label']))) { echo ' '; // Loop through each column and add a table header. $i = 0; foreach ($cur_list['headers'] as $col_header) { $i ++; if ($i === 1) $col_header['class'] = empty($col_header['class']) ? 'first_th' : 'first_th ' . $col_header['class']; elseif ($i === $header_count) $col_header['class'] = empty($col_header['class']) ? 'last_th' : 'last_th ' . $col_header['class']; echo ' '; } echo ' '; } echo ' '; // Show a nice message informing there are no items in this list. if (empty($cur_list['rows']) && !empty($cur_list['no_items_label'])) echo ' '; // Show the list rows. elseif (!empty($cur_list['rows'])) { $alternate = false; foreach ($cur_list['rows'] as $id => $row) { echo ' '; foreach ($row['data'] as $row_data) echo ' ', $row_data['value'], ''; echo ' '; $alternate = !$alternate; } } echo '
', empty($col_header['href']) ? '' : '', empty($col_header['label']) ? ' ' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '' : ' '), '
', $cur_list['no_items_label'], '
'; if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['below_table_data'])) { echo '
'; // Show the page index (if this list doesn't intend to show all items). if (!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) echo '
', $cur_list['page_index'], '
'; if (isset($cur_list['additional_rows']['below_table_data'])) template_additional_rows('below_table_data', $cur_list); echo '
'; } if (isset($cur_list['additional_rows']['bottom_of_list'])) template_additional_rows('bottom_of_list', $cur_list); if (isset($cur_list['form'])) { foreach ($cur_list['form']['hidden_fields'] as $name => $value) echo ' '; echo '
'; } else echo '
'; // Tabs at the bottom. Usually bottom alligned. if (!empty($settings['use_tabs']) && isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom')) template_create_list_menu($cur_list['list_menu'], 'bottom'); if (isset($cur_list['javascript'])) echo ' '; } function template_additional_rows($row_position, $cur_list) { global $context, $settings, $options; foreach ($cur_list['additional_rows'][$row_position] as $row) echo '
', $row['value'], '
'; } function template_create_list_menu($list_menu, $direction = 'top') { global $context, $settings; /** // This is use if you want your generic lists to have tabs. $cur_list['list_menu'] = array( // This is the style to use. Tabs or Buttons (Text 1 | Text 2). // By default tabs are selected if not set. // The main difference between tabs and buttons is that tabs get highlighted if selected. // If style is set to buttons and use tabs is diabled then we change the style to old styled tabs. 'style' => 'tabs', // The posisiton of the tabs/buttons. Left or Right. By default is set to left. 'position' => 'left', // This is used by the old styled menu. We *need* to know the total number of columns to span. 'columns' => 0, // This gives you the option to show tabs only at the top, bottom or both. // By default they are just shown at the top. 'show_on' => 'top', // Links. This is the core of the array. It has all the info that we need. 'links' => array( 'name' => array( // This will tell use were to go when they click it. 'href' => $scripturl . '?action=theaction', // The name that you want to appear for the link. 'label' => $txt['name'], // If we use tabs instead of buttons we highlight the current tab. // Must use conditions to determine if its selected or not. 'is_selected' => isset($_REQUEST['name']), ), ), ); */ // Are we using right-to-left orientation? $first = $context['right_to_left'] ? 'last' : 'first'; $last = $context['right_to_left'] ? 'first' : 'last'; // Tabs take preference over buttons in certain cases. if (empty($settings['use_tabs']) && $list_menu['style'] == 'button') $list_menu['style'] = 'tabs'; if (!isset($list_menu['style']) || isset($list_menu['style']) && $list_menu['style'] == 'tabs') { if (!empty($settings['use_tabs'])) { echo ' ', $list_menu['position'] == 'right' ? ' ' : '', ' ', $list_menu['position'] == 'left' ? ' ' : '', '
  '; foreach ($list_menu['links'] as $link) { if ($link['is_selected']) echo ' '; else echo ' '; } echo '
   ', $link['label'], '   ', $link['label'], '  
 
'; } else { echo ' '; $links = array(); foreach ($list_menu['links'] as $link) $links[] = ($link['is_selected'] ? '> ' : '') . '' . $link['label'] . ''; echo ' ', implode(' | ', $links), ' '; } } elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons') { $links = array(); foreach ($list_menu['links'] as $link) $links[] = '' . $link['label'] . ''; echo ' ', $list_menu['position'] == 'right' ? ' ' : '', ' ', $list_menu['position'] == 'left' ? ' ' : '', '
 
  ', implode('  |  ', $links), '  
 
'; } } ?>