Menu.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. <?php
  2. /* vim: set expandtab sw=4 ts=4 sts=4: */
  3. /**
  4. * Generates and renders the top menu
  5. *
  6. * @package PhpMyAdmin
  7. */
  8. namespace PhpMyAdmin;
  9. use PhpMyAdmin\DatabaseInterface;
  10. use PhpMyAdmin\Relation;
  11. use PhpMyAdmin\Tracker;
  12. use PhpMyAdmin\Url;
  13. use PhpMyAdmin\Util;
  14. /**
  15. * Class for generating the top menu
  16. *
  17. * @package PhpMyAdmin
  18. */
  19. class Menu
  20. {
  21. /**
  22. * Server id
  23. *
  24. * @access private
  25. * @var int
  26. */
  27. private $_server;
  28. /**
  29. * Database name
  30. *
  31. * @access private
  32. * @var string
  33. */
  34. private $_db;
  35. /**
  36. * Table name
  37. *
  38. * @access private
  39. * @var string
  40. */
  41. private $_table;
  42. /**
  43. * @var Relation $relation
  44. */
  45. private $relation;
  46. /**
  47. * Creates a new instance of Menu
  48. *
  49. * @param int $server Server id
  50. * @param string $db Database name
  51. * @param string $table Table name
  52. */
  53. public function __construct($server, $db, $table)
  54. {
  55. $this->_server = $server;
  56. $this->_db = $db;
  57. $this->_table = $table;
  58. $this->relation = new Relation();
  59. }
  60. /**
  61. * Prints the menu and the breadcrumbs
  62. *
  63. * @return void
  64. */
  65. public function display()
  66. {
  67. echo $this->getDisplay();
  68. }
  69. /**
  70. * Returns the menu and the breadcrumbs as a string
  71. *
  72. * @return string
  73. */
  74. public function getDisplay()
  75. {
  76. $retval = $this->_getBreadcrumbs();
  77. $retval .= $this->_getMenu();
  78. return $retval;
  79. }
  80. /**
  81. * Returns hash for the menu and the breadcrumbs
  82. *
  83. * @return string
  84. */
  85. public function getHash()
  86. {
  87. return substr(
  88. md5($this->_getMenu() . $this->_getBreadcrumbs()),
  89. 0,
  90. 8
  91. );
  92. }
  93. /**
  94. * Returns the menu as HTML
  95. *
  96. * @return string HTML formatted menubar
  97. */
  98. private function _getMenu()
  99. {
  100. $url_params = array();
  101. if (strlen($this->_table) > 0) {
  102. $tabs = $this->_getTableTabs();
  103. $url_params['db'] = $this->_db;
  104. $url_params['table'] = $this->_table;
  105. $level = 'table';
  106. } elseif (strlen($this->_db) > 0) {
  107. $tabs = $this->_getDbTabs();
  108. $url_params['db'] = $this->_db;
  109. $level = 'db';
  110. } else {
  111. $tabs = $this->_getServerTabs();
  112. $level = 'server';
  113. }
  114. $allowedTabs = $this->_getAllowedTabs($level);
  115. foreach ($tabs as $key => $value) {
  116. if (! array_key_exists($key, $allowedTabs)) {
  117. unset($tabs[$key]);
  118. }
  119. }
  120. return Util::getHtmlTabs($tabs, $url_params, 'topmenu', true);
  121. }
  122. /**
  123. * Returns a list of allowed tabs for the current user for the given level
  124. *
  125. * @param string $level 'server', 'db' or 'table' level
  126. *
  127. * @return array list of allowed tabs
  128. */
  129. private function _getAllowedTabs($level)
  130. {
  131. $cache_key = 'menu-levels-' . $level;
  132. if (Util::cacheExists($cache_key)) {
  133. return Util::cacheGet($cache_key);
  134. }
  135. $allowedTabs = Util::getMenuTabList($level);
  136. $cfgRelation = $this->relation->getRelationsParam();
  137. if ($cfgRelation['menuswork']) {
  138. $groupTable = Util::backquote($cfgRelation['db'])
  139. . "."
  140. . Util::backquote($cfgRelation['usergroups']);
  141. $userTable = Util::backquote($cfgRelation['db'])
  142. . "." . Util::backquote($cfgRelation['users']);
  143. $sql_query = "SELECT `tab` FROM " . $groupTable
  144. . " WHERE `allowed` = 'N'"
  145. . " AND `tab` LIKE '" . $level . "%'"
  146. . " AND `usergroup` = (SELECT usergroup FROM "
  147. . $userTable . " WHERE `username` = '"
  148. . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "')";
  149. $result = $this->relation->queryAsControlUser($sql_query, false);
  150. if ($result) {
  151. while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
  152. $tabName = mb_substr(
  153. $row['tab'],
  154. mb_strpos($row['tab'], '_') + 1
  155. );
  156. unset($allowedTabs[$tabName]);
  157. }
  158. }
  159. }
  160. Util::cacheSet($cache_key, $allowedTabs);
  161. return $allowedTabs;
  162. }
  163. /**
  164. * Returns the breadcrumbs as HTML
  165. *
  166. * @return string HTML formatted breadcrumbs
  167. */
  168. private function _getBreadcrumbs()
  169. {
  170. $retval = '';
  171. $tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)
  172. ->isView();
  173. if (empty($GLOBALS['cfg']['Server']['host'])) {
  174. $GLOBALS['cfg']['Server']['host'] = '';
  175. }
  176. $server_info = ! empty($GLOBALS['cfg']['Server']['verbose'])
  177. ? $GLOBALS['cfg']['Server']['verbose']
  178. : $GLOBALS['cfg']['Server']['host'];
  179. $server_info .= empty($GLOBALS['cfg']['Server']['port'])
  180. ? ''
  181. : ':' . $GLOBALS['cfg']['Server']['port'];
  182. $separator = "<span class='separator item'>&nbsp;»</span>";
  183. $item = '<a href="%1$s%2$s" class="item">';
  184. if (Util::showText('TabsMode')) {
  185. $item .= '%4$s: ';
  186. }
  187. $item .= '%3$s</a>';
  188. $retval .= "<div id='floating_menubar'></div>";
  189. $retval .= "<div id='serverinfo'>";
  190. if (Util::showIcons('TabsMode')) {
  191. $retval .= Util::getImage(
  192. 's_host',
  193. '',
  194. array('class' => 'item')
  195. );
  196. }
  197. $retval .= sprintf(
  198. $item,
  199. Util::getScriptNameForOption(
  200. $GLOBALS['cfg']['DefaultTabServer'], 'server'
  201. ),
  202. Url::getCommon(),
  203. htmlspecialchars($server_info),
  204. __('Server')
  205. );
  206. if (strlen($this->_db) > 0) {
  207. $retval .= $separator;
  208. if (Util::showIcons('TabsMode')) {
  209. $retval .= Util::getImage(
  210. 's_db',
  211. '',
  212. array('class' => 'item')
  213. );
  214. }
  215. $retval .= sprintf(
  216. $item,
  217. Util::getScriptNameForOption(
  218. $GLOBALS['cfg']['DefaultTabDatabase'], 'database'
  219. ),
  220. Url::getCommon(array('db' => $this->_db)),
  221. htmlspecialchars($this->_db),
  222. __('Database')
  223. );
  224. // if the table is being dropped, $_REQUEST['purge'] is set to '1'
  225. // so do not display the table name in upper div
  226. if (strlen($this->_table) > 0
  227. && ! (isset($_REQUEST['purge']) && $_REQUEST['purge'] == '1')
  228. ) {
  229. $table_class_object = $GLOBALS['dbi']->getTable(
  230. $GLOBALS['db'],
  231. $GLOBALS['table']
  232. );
  233. if ($table_class_object->isView()) {
  234. $tbl_is_view = true;
  235. $show_comment = null;
  236. } else {
  237. $tbl_is_view = false;
  238. $show_comment = $table_class_object->getComment();
  239. }
  240. $retval .= $separator;
  241. if (Util::showIcons('TabsMode')) {
  242. $icon = $tbl_is_view ? 'b_views' : 's_tbl';
  243. $retval .= Util::getImage(
  244. $icon,
  245. '',
  246. array('class' => 'item')
  247. );
  248. }
  249. $retval .= sprintf(
  250. $item,
  251. Util::getScriptNameForOption(
  252. $GLOBALS['cfg']['DefaultTabTable'], 'table'
  253. ),
  254. Url::getCommon(
  255. array(
  256. 'db' => $this->_db, 'table' => $this->_table
  257. )
  258. ),
  259. str_replace(' ', '&nbsp;', htmlspecialchars($this->_table)),
  260. $tbl_is_view ? __('View') : __('Table')
  261. );
  262. /**
  263. * Displays table comment
  264. */
  265. if (! empty($show_comment)
  266. && ! isset($GLOBALS['avoid_show_comment'])
  267. ) {
  268. if (mb_strstr($show_comment, '; InnoDB free')) {
  269. $show_comment = preg_replace(
  270. '@; InnoDB free:.*?$@',
  271. '',
  272. $show_comment
  273. );
  274. }
  275. $retval .= '<span class="table_comment"';
  276. $retval .= ' id="span_table_comment">';
  277. $retval .= sprintf(
  278. __('“%s”'), htmlspecialchars($show_comment)
  279. );
  280. $retval .= '</span>';
  281. } // end if
  282. } else {
  283. // no table selected, display database comment if present
  284. $cfgRelation = $this->relation->getRelationsParam();
  285. // Get additional information about tables for tooltip is done
  286. // in Util::getDbInfo() only once
  287. if ($cfgRelation['commwork']) {
  288. $comment = $this->relation->getDbComment($this->_db);
  289. /**
  290. * Displays table comment
  291. */
  292. if (! empty($comment)) {
  293. $retval .= '<span class="table_comment"'
  294. . ' id="span_table_comment">'
  295. . sprintf(
  296. __('“%s”'),
  297. htmlspecialchars($comment)
  298. )
  299. . '</span>';
  300. } // end if
  301. }
  302. }
  303. }
  304. $retval .= '<div class="clearfloat"></div>';
  305. $retval .= '</div>';
  306. return $retval;
  307. }
  308. /**
  309. * Returns the table tabs as an array
  310. *
  311. * @return array Data for generating table tabs
  312. */
  313. private function _getTableTabs()
  314. {
  315. $db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($this->_db);
  316. $tbl_is_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)
  317. ->isView();
  318. $updatable_view = false;
  319. if ($tbl_is_view) {
  320. $updatable_view = $GLOBALS['dbi']->getTable($this->_db, $this->_table)
  321. ->isUpdatableView();
  322. }
  323. $is_superuser = $GLOBALS['dbi']->isSuperuser();
  324. $isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant')
  325. || $GLOBALS['dbi']->isUserType('create');
  326. $tabs = array();
  327. $tabs['browse']['icon'] = 'b_browse';
  328. $tabs['browse']['text'] = __('Browse');
  329. $tabs['browse']['link'] = 'sql.php';
  330. $tabs['browse']['args']['pos'] = 0;
  331. $tabs['structure']['icon'] = 'b_props';
  332. $tabs['structure']['link'] = 'tbl_structure.php';
  333. $tabs['structure']['text'] = __('Structure');
  334. $tabs['structure']['active'] = in_array(
  335. basename($GLOBALS['PMA_PHP_SELF']),
  336. array('tbl_structure.php', 'tbl_relation.php')
  337. );
  338. $tabs['sql']['icon'] = 'b_sql';
  339. $tabs['sql']['link'] = 'tbl_sql.php';
  340. $tabs['sql']['text'] = __('SQL');
  341. $tabs['search']['icon'] = 'b_search';
  342. $tabs['search']['text'] = __('Search');
  343. $tabs['search']['link'] = 'tbl_select.php';
  344. $tabs['search']['active'] = in_array(
  345. basename($GLOBALS['PMA_PHP_SELF']),
  346. array('tbl_select.php', 'tbl_zoom_select.php', 'tbl_find_replace.php')
  347. );
  348. if (! $db_is_system_schema && (! $tbl_is_view || $updatable_view)) {
  349. $tabs['insert']['icon'] = 'b_insrow';
  350. $tabs['insert']['link'] = 'tbl_change.php';
  351. $tabs['insert']['text'] = __('Insert');
  352. }
  353. $tabs['export']['icon'] = 'b_tblexport';
  354. $tabs['export']['link'] = 'tbl_export.php';
  355. $tabs['export']['args']['single_table'] = 'true';
  356. $tabs['export']['text'] = __('Export');
  357. /**
  358. * Don't display "Import" for views and information_schema
  359. */
  360. if (! $tbl_is_view && ! $db_is_system_schema) {
  361. $tabs['import']['icon'] = 'b_tblimport';
  362. $tabs['import']['link'] = 'tbl_import.php';
  363. $tabs['import']['text'] = __('Import');
  364. }
  365. if (($is_superuser || $isCreateOrGrantUser)
  366. && ! $db_is_system_schema
  367. ) {
  368. $tabs['privileges']['link'] = 'server_privileges.php';
  369. $tabs['privileges']['args']['checkprivsdb'] = $this->_db;
  370. $tabs['privileges']['args']['checkprivstable'] = $this->_table;
  371. // stay on table view
  372. $tabs['privileges']['args']['viewing_mode'] = 'table';
  373. $tabs['privileges']['text'] = __('Privileges');
  374. $tabs['privileges']['icon'] = 's_rights';
  375. }
  376. /**
  377. * Don't display "Operations" for views and information_schema
  378. */
  379. if (! $tbl_is_view && ! $db_is_system_schema) {
  380. $tabs['operation']['icon'] = 'b_tblops';
  381. $tabs['operation']['link'] = 'tbl_operations.php';
  382. $tabs['operation']['text'] = __('Operations');
  383. }
  384. /**
  385. * Views support a limited number of operations
  386. */
  387. if ($tbl_is_view && ! $db_is_system_schema) {
  388. $tabs['operation']['icon'] = 'b_tblops';
  389. $tabs['operation']['link'] = 'view_operations.php';
  390. $tabs['operation']['text'] = __('Operations');
  391. }
  392. if (Tracker::isActive() && ! $db_is_system_schema) {
  393. $tabs['tracking']['icon'] = 'eye';
  394. $tabs['tracking']['text'] = __('Tracking');
  395. $tabs['tracking']['link'] = 'tbl_tracking.php';
  396. }
  397. if (! $db_is_system_schema
  398. && Util::currentUserHasPrivilege(
  399. 'TRIGGER',
  400. $this->_db,
  401. $this->_table
  402. )
  403. && ! $tbl_is_view
  404. ) {
  405. $tabs['triggers']['link'] = 'tbl_triggers.php';
  406. $tabs['triggers']['text'] = __('Triggers');
  407. $tabs['triggers']['icon'] = 'b_triggers';
  408. }
  409. return $tabs;
  410. }
  411. /**
  412. * Returns the db tabs as an array
  413. *
  414. * @return array Data for generating db tabs
  415. */
  416. private function _getDbTabs()
  417. {
  418. $db_is_system_schema = $GLOBALS['dbi']->isSystemSchema($this->_db);
  419. $num_tables = count($GLOBALS['dbi']->getTables($this->_db));
  420. $is_superuser = $GLOBALS['dbi']->isSuperuser();
  421. $isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant')
  422. || $GLOBALS['dbi']->isUserType('create');
  423. /**
  424. * Gets the relation settings
  425. */
  426. $cfgRelation = $this->relation->getRelationsParam();
  427. $tabs = array();
  428. $tabs['structure']['link'] = 'db_structure.php';
  429. $tabs['structure']['text'] = __('Structure');
  430. $tabs['structure']['icon'] = 'b_props';
  431. $tabs['sql']['link'] = 'db_sql.php';
  432. $tabs['sql']['text'] = __('SQL');
  433. $tabs['sql']['icon'] = 'b_sql';
  434. $tabs['search']['text'] = __('Search');
  435. $tabs['search']['icon'] = 'b_search';
  436. $tabs['search']['link'] = 'db_search.php';
  437. if ($num_tables == 0) {
  438. $tabs['search']['warning'] = __('Database seems to be empty!');
  439. }
  440. $tabs['query']['text'] = __('Query');
  441. $tabs['query']['icon'] = 's_db';
  442. $tabs['query']['link'] = 'db_multi_table_query.php';
  443. $tabs['query']['active'] = in_array(
  444. basename($GLOBALS['PMA_PHP_SELF']),
  445. array(
  446. 'db_multi_table_query.php',
  447. 'db_qbe.php',
  448. )
  449. );
  450. if ($num_tables == 0) {
  451. $tabs['query']['warning'] = __('Database seems to be empty!');
  452. }
  453. $tabs['export']['text'] = __('Export');
  454. $tabs['export']['icon'] = 'b_export';
  455. $tabs['export']['link'] = 'db_export.php';
  456. if ($num_tables == 0) {
  457. $tabs['export']['warning'] = __('Database seems to be empty!');
  458. }
  459. if (! $db_is_system_schema) {
  460. $tabs['import']['link'] = 'db_import.php';
  461. $tabs['import']['text'] = __('Import');
  462. $tabs['import']['icon'] = 'b_import';
  463. $tabs['operation']['link'] = 'db_operations.php';
  464. $tabs['operation']['text'] = __('Operations');
  465. $tabs['operation']['icon'] = 'b_tblops';
  466. if (($is_superuser || $isCreateOrGrantUser)) {
  467. $tabs['privileges']['link'] = 'server_privileges.php';
  468. $tabs['privileges']['args']['checkprivsdb'] = $this->_db;
  469. // stay on database view
  470. $tabs['privileges']['args']['viewing_mode'] = 'db';
  471. $tabs['privileges']['text'] = __('Privileges');
  472. $tabs['privileges']['icon'] = 's_rights';
  473. }
  474. $tabs['routines']['link'] = 'db_routines.php';
  475. $tabs['routines']['text'] = __('Routines');
  476. $tabs['routines']['icon'] = 'b_routines';
  477. if (Util::currentUserHasPrivilege('EVENT', $this->_db)) {
  478. $tabs['events']['link'] = 'db_events.php';
  479. $tabs['events']['text'] = __('Events');
  480. $tabs['events']['icon'] = 'b_events';
  481. }
  482. if (Util::currentUserHasPrivilege('TRIGGER', $this->_db)) {
  483. $tabs['triggers']['link'] = 'db_triggers.php';
  484. $tabs['triggers']['text'] = __('Triggers');
  485. $tabs['triggers']['icon'] = 'b_triggers';
  486. }
  487. }
  488. if (Tracker::isActive() && ! $db_is_system_schema) {
  489. $tabs['tracking']['text'] = __('Tracking');
  490. $tabs['tracking']['icon'] = 'eye';
  491. $tabs['tracking']['link'] = 'db_tracking.php';
  492. }
  493. if (! $db_is_system_schema) {
  494. $tabs['designer']['text'] = __('Designer');
  495. $tabs['designer']['icon'] = 'b_relations';
  496. $tabs['designer']['link'] = 'db_designer.php';
  497. $tabs['designer']['id'] = 'designer_tab';
  498. }
  499. if (! $db_is_system_schema
  500. && $cfgRelation['centralcolumnswork']
  501. ) {
  502. $tabs['central_columns']['text'] = __('Central columns');
  503. $tabs['central_columns']['icon'] = 'centralColumns';
  504. $tabs['central_columns']['link'] = 'db_central_columns.php';
  505. }
  506. return $tabs;
  507. }
  508. /**
  509. * Returns the server tabs as an array
  510. *
  511. * @return array Data for generating server tabs
  512. */
  513. private function _getServerTabs()
  514. {
  515. $is_superuser = $GLOBALS['dbi']->isSuperuser();
  516. $isCreateOrGrantUser = $GLOBALS['dbi']->isUserType('grant')
  517. || $GLOBALS['dbi']->isUserType('create');
  518. if (Util::cacheExists('binary_logs')) {
  519. $binary_logs = Util::cacheGet('binary_logs');
  520. } else {
  521. $binary_logs = $GLOBALS['dbi']->fetchResult(
  522. 'SHOW MASTER LOGS',
  523. 'Log_name',
  524. null,
  525. DatabaseInterface::CONNECT_USER,
  526. DatabaseInterface::QUERY_STORE
  527. );
  528. Util::cacheSet('binary_logs', $binary_logs);
  529. }
  530. $tabs = array();
  531. $tabs['databases']['icon'] = 's_db';
  532. $tabs['databases']['link'] = 'server_databases.php';
  533. $tabs['databases']['text'] = __('Databases');
  534. $tabs['sql']['icon'] = 'b_sql';
  535. $tabs['sql']['link'] = 'server_sql.php';
  536. $tabs['sql']['text'] = __('SQL');
  537. $tabs['status']['icon'] = 's_status';
  538. $tabs['status']['link'] = 'server_status.php';
  539. $tabs['status']['text'] = __('Status');
  540. $tabs['status']['active'] = in_array(
  541. basename($GLOBALS['PMA_PHP_SELF']),
  542. array(
  543. 'server_status.php',
  544. 'server_status_advisor.php',
  545. 'server_status_monitor.php',
  546. 'server_status_queries.php',
  547. 'server_status_variables.php',
  548. 'server_status_processes.php'
  549. )
  550. );
  551. if ($is_superuser || $isCreateOrGrantUser) {
  552. $tabs['rights']['icon'] = 's_rights';
  553. $tabs['rights']['link'] = 'server_privileges.php';
  554. $tabs['rights']['text'] = __('User accounts');
  555. $tabs['rights']['active'] = in_array(
  556. basename($GLOBALS['PMA_PHP_SELF']),
  557. array('server_privileges.php', 'server_user_groups.php')
  558. );
  559. $tabs['rights']['args']['viewing_mode'] = 'server';
  560. }
  561. $tabs['export']['icon'] = 'b_export';
  562. $tabs['export']['link'] = 'server_export.php';
  563. $tabs['export']['text'] = __('Export');
  564. $tabs['import']['icon'] = 'b_import';
  565. $tabs['import']['link'] = 'server_import.php';
  566. $tabs['import']['text'] = __('Import');
  567. $tabs['settings']['icon'] = 'b_tblops';
  568. $tabs['settings']['link'] = 'prefs_manage.php';
  569. $tabs['settings']['text'] = __('Settings');
  570. $tabs['settings']['active'] = in_array(
  571. basename($GLOBALS['PMA_PHP_SELF']),
  572. array('prefs_forms.php', 'prefs_manage.php', 'prefs_twofactor.php')
  573. );
  574. if (! empty($binary_logs)) {
  575. $tabs['binlog']['icon'] = 's_tbl';
  576. $tabs['binlog']['link'] = 'server_binlog.php';
  577. $tabs['binlog']['text'] = __('Binary log');
  578. }
  579. if ($is_superuser) {
  580. $tabs['replication']['icon'] = 's_replication';
  581. $tabs['replication']['link'] = 'server_replication.php';
  582. $tabs['replication']['text'] = __('Replication');
  583. }
  584. $tabs['vars']['icon'] = 's_vars';
  585. $tabs['vars']['link'] = 'server_variables.php';
  586. $tabs['vars']['text'] = __('Variables');
  587. $tabs['charset']['icon'] = 's_asci';
  588. $tabs['charset']['link'] = 'server_collations.php';
  589. $tabs['charset']['text'] = __('Charsets');
  590. $tabs['engine']['icon'] = 'b_engine';
  591. $tabs['engine']['link'] = 'server_engines.php';
  592. $tabs['engine']['text'] = __('Engines');
  593. $tabs['plugins']['icon'] = 'b_plugin';
  594. $tabs['plugins']['link'] = 'server_plugins.php';
  595. $tabs['plugins']['text'] = __('Plugins');
  596. return $tabs;
  597. }
  598. /**
  599. * Set current table
  600. *
  601. * @param string $table Current table
  602. *
  603. * @return $this
  604. */
  605. public function setTable($table)
  606. {
  607. $this->_table = $table;
  608. return $this;
  609. }
  610. }