Menu.php 22 KB

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