...) * * @uses PMA_showHint() * @uses $GLOBALS['cfg']['PropertiesNumColumns'] * @uses $GLOBALS['is_show_stats'] * @uses $GLOBALS['colspan_for_structure'] * @uses PMA_SortableTableHeader() * @param boolean $db_is_information_schema * @param boolean $replication */ function PMA_TableHeader($db_is_information_schema = false, $replication = false) { $cnt = 0; // Let's count the columns... if ($db_is_information_schema) { $action_colspan = 3; } else { $action_colspan = 6; } echo '' . "\n" .'' . "\n" .'' . "\n" .' ' . "\n"; if ($replication) { echo ' '; } echo ' ' // larger values are more interesting so default sort order is DESC .' ' . "\n"; if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) { echo ' ' . "\n"; $cnt++; echo ' ' . "\n"; $cnt++; } if ($GLOBALS['is_show_stats']) { // larger values are more interesting so default sort order is DESC echo ' ' . "\n" // larger values are more interesting so default sort order is DESC . ' ' . "\n"; $cnt += 2; } echo '' . "\n"; echo '' . "\n"; echo '' . "\n"; $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3; } // end function PMA_TableHeader() /** * Creates a clickable column header for table information * * @param string title to use for the link * @param string corresponds to sortable data name mapped in libraries/db_info.inc.php * @param string initial sort order * @returns string link to be displayed in the table header */ function PMA_SortableTableHeader($title, $sort, $initial_sort_order = 'ASC') { // Set some defaults $requested_sort = 'table'; $requested_sort_order = $future_sort_order = $initial_sort_order; // If the user requested a sort if (isset($_REQUEST['sort'])) { $requested_sort = $_REQUEST['sort']; if (isset($_REQUEST['sort_order'])) { $requested_sort_order = $_REQUEST['sort_order']; } } $order_img = ''; $order_link_params = array(); $order_link_params['title'] = __('Sort'); // If this column was requested to be sorted. if ($requested_sort == $sort) { if ($requested_sort_order == 'ASC') { $future_sort_order = 'DESC'; // current sort order is ASC $order_img = ' '. __('Ascending') . ''; // but on mouse over, show the reverse order (DESC) $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }'; // on mouse out, show current sort order (ASC) $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }'; } else { $future_sort_order = 'ASC'; // current sort order is DESC $order_img = ' '. __('Descending') . ''; // but on mouse over, show the reverse order (ASC) $order_link_params['onmouseover'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_asc.png\'; }'; // on mouse out, show current sort order (DESC) $order_link_params['onmouseout'] = 'if(document.getElementById(\'sort_arrow\')){ document.getElementById(\'sort_arrow\').src=\'' . $GLOBALS['pmaThemeImage'] . 's_desc.png\'; }'; } } $_url_params = array( 'db' => $_REQUEST['db'], ); $url = 'db_structure.php'.PMA_generate_common_url($_url_params); // We set the position back to 0 every time they sort. $url .= "&pos=0&sort=$sort&sort_order=$future_sort_order"; return PMA_linkOrButton($url, $title . $order_img, $order_link_params); } // end function PMA_SortableTableHeader() ?>
' . PMA_SortableTableHeader(__('Table'), 'table') . '' . "\n" .' ' . __('Replication') . "\n" .' ' . "\n" .' ' . __('Action') . "\n" .' ' . PMA_SortableTableHeader(__('Rows'), 'records', 'DESC') .PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]'))) . "\n" .' ' . PMA_SortableTableHeader(__('Type'), 'type') . '' . PMA_SortableTableHeader(__('Collation'), 'collation') . '' . PMA_SortableTableHeader(__('Size'), 'size', 'DESC') . '' . PMA_SortableTableHeader(__('Overhead'), 'overhead', 'DESC') . '