private function _getTableTabs()
{
$db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($this->_db);
$tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)->isView();
$updatable_view = false;
if ($tbl_is_view) {
$updatable_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)->isUpdatableView();
}
$is_superuser = $GLOBALS['dbi']->isSuperuser();
$isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant') || $GLOBALS['dbi']->isUserType('create');
$tabs = array();
$tabs['browse']['icon'] = 'b_browse.png';
$tabs['browse']['text'] = __('Browse');
$tabs['browse']['link'] = 'sql.php';
$tabs['browse']['args']['pos'] = 0;
$tabs['structure']['icon'] = 'b_props.png';
$tabs['structure']['link'] = 'tbl_structure.php';
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['active'] = in_array(basename($GLOBALS['PMA_PHP_SELF']), array('tbl_structure.php', 'tbl_relation.php'));
$tabs['sql']['icon'] = 'b_sql.png';
$tabs['sql']['link'] = 'tbl_sql.php';
$tabs['sql']['text'] = __('SQL');
$tabs['search']['icon'] = 'b_search.png';
$tabs['search']['text'] = __('Search');
$tabs['search']['link'] = 'tbl_select.php';
$tabs['search']['active'] = in_array(basename($GLOBALS['PMA_PHP_SELF']), array('tbl_select.php', 'tbl_zoom_select.php', 'tbl_find_replace.php'));
if (!$db_is_system_schema && (!$tbl_is_view || $updatable_view)) {
$tabs['insert']['icon'] = 'b_insrow.png';
$tabs['insert']['link'] = 'tbl_change.php';
$tabs['insert']['text'] = __('Insert');
}
$tabs['export']['icon'] = 'b_tblexport.png';
$tabs['export']['link'] = 'tbl_export.php';
$tabs['export']['args']['single_table'] = 'true';
$tabs['export']['text'] = __('Export');
/**
* Don't display "Import" for views and information_schema
*/
if (!$tbl_is_view && !$db_is_system_schema) {
$tabs['import']['icon'] = 'b_tblimport.png';
$tabs['import']['link'] = 'tbl_import.php';
$tabs['import']['text'] = __('Import');
}
if (($is_superuser || $isCreateOrGrantUser) && !$db_is_system_schema) {
$tabs['privileges']['link'] = 'server_privileges.php';
$tabs['privileges']['args']['checkprivsdb'] = $this->_db;
$tabs['privileges']['args']['checkprivstable'] = $this->_table;
// stay on table view
$tabs['privileges']['args']['viewing_mode'] = 'table';
$tabs['privileges']['text'] = __('Privileges');
$tabs['privileges']['icon'] = 's_rights.png';
}
/**
* Don't display "Operations" for views and information_schema
*/
if (!$tbl_is_view && !$db_is_system_schema) {
$tabs['operation']['icon'] = 'b_tblops.png';
$tabs['operation']['link'] = 'tbl_operations.php';
$tabs['operation']['text'] = __('Operations');
}
/**
* Views support a limited number of operations
*/
if ($tbl_is_view && !$db_is_system_schema) {
$tabs['operation']['icon'] = 'b_tblops.png';
$tabs['operation']['link'] = 'view_operations.php';
$tabs['operation']['text'] = __('Operations');
}
if (Tracker::isActive() && !$db_is_system_schema) {
$tabs['tracking']['icon'] = 'eye.png';
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['link'] = 'tbl_tracking.php';
}
if (!$db_is_system_schema && Util::currentUserHasPrivilege('TRIGGER', $this->_db, $this->_table) && !$tbl_is_view) {
$tabs['triggers']['link'] = 'tbl_triggers.php';
$tabs['triggers']['text'] = __('Triggers');
$tabs['triggers']['icon'] = 'b_triggers.png';
}
return $tabs;
}