Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor server privileges #581

Merged
merged 10 commits into from Aug 11, 2013
41 changes: 26 additions & 15 deletions libraries/server_common.lib.php
Expand Up @@ -12,44 +12,55 @@
/** /**
* Returns the html for the sub-page heading * Returns the html for the sub-page heading
* *
* @param string $type Sub page type * @param string $type Sub page type
* @param string $link Link to the official MySQL documentation * @param string $link Link to the official MySQL documentation
* @param bool $is_image Display image or icon, true: image, false: icon
* *
* @return string * @return string
*/ */
function PMA_getHtmlForSubPageHeader($type, $link='') function PMA_getHtmlForSubPageHeader($type, $link='', $is_image=true)
{ {
//array contains Sub page icon and text //array contains Sub page icon and text
$header = array(); $header = array();


$header['variables']['icon'] = 's_vars.png'; $header['variables']['image'] = 's_vars.png';
$header['variables']['text'] = __('Server variables and settings'); $header['variables']['text'] = __('Server variables and settings');


$header['engines']['icon'] = 'b_engine.png'; $header['engines']['image'] = 'b_engine.png';
$header['engines']['text'] = __('Storage Engines'); $header['engines']['text'] = __('Storage Engines');


$header['plugins']['icon'] = 'b_engine.png'; $header['plugins']['image'] = 'b_engine.png';
$header['plugins']['text'] = __('Plugins'); $header['plugins']['text'] = __('Plugins');


$header['binlog']['icon'] = 's_tbl.png'; $header['binlog']['image'] = 's_tbl.png';
$header['binlog']['text'] = __('Binary log'); $header['binlog']['text'] = __('Binary log');


$header['collations']['icon'] = 's_asci.png'; $header['collations']['image'] = 's_asci.png';
$header['collations']['text'] = __('Character Sets and Collations'); $header['collations']['text'] = __('Character Sets and Collations');


$header['replication']['icon'] = 's_replication.png'; $header['replication']['image'] = 's_replication.png';
$header['replication']['text'] = __('Replication'); $header['replication']['text'] = __('Replication');


$header['database_statistics']['icon'] = 's_db.png'; $header['database_statistics']['image'] = 's_db.png';
$header['database_statistics']['text'] = __('Databases statistics'); $header['database_statistics']['text'] = __('Databases statistics');


$header['databases']['icon'] = 's_db.png'; $header['databases']['image'] = 's_db.png';
$header['databases']['text'] = __('Databases'); $header['databases']['text'] = __('Databases');


$html = '<h2>' . "\n" $header['privileges']['image'] = 'b_usrlist.png';
. PMA_Util::getImage($header[$type]['icon']) $header['privileges']['text'] = __('Privileges');
. ' ' . $header[$type]['text'] . "\n"
. $link . '</h2>' . "\n"; if ($is_image) {
$html = '<h2>' . "\n"
. PMA_Util::getImage($header[$type]['image'])
. ' ' . $header[$type]['text'] . "\n"
. $link . '</h2>' . "\n";
} else {
$html = '<h2>' . "\n"
. PMA_Util::getIcon($header[$type]['image'])
. ' ' . $header[$type]['text'] . "\n"
. $link . '</h2>' . "\n";
}
return $html; return $html;
} }


Expand Down