";
- if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
+ if (PMA_Util::showIcons('TabsMode')) {
$retval .= PMA_Util::getImage(
's_host.png',
'',
@@ -201,7 +201,7 @@ class PMA_Menu
if (strlen($this->_db)) {
$retval .= $separator;
- if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
+ if (PMA_Util::showIcons('TabsMode')) {
$retval .= PMA_Util::getImage(
's_db.png',
'',
@@ -223,7 +223,7 @@ class PMA_Menu
include './libraries/tbl_info.inc.php';
$retval .= $separator;
- if (in_array($GLOBALS['cfg']['TabsMode'], array('icons', 'both'))) {
+ if (PMA_Util::showIcons('TabsMode')) {
$icon = $tbl_is_view ? 'b_views.png' : 's_tbl.png';
$retval .= PMA_Util::getImage(
$icon,
diff --git a/libraries/Util.class.php b/libraries/Util.class.php
index ea210f328a..32a65b7326 100644
--- a/libraries/Util.class.php
+++ b/libraries/Util.class.php
@@ -86,6 +86,18 @@ class PMA_Util
return $pow;
}
+ /**
+ * Checks whether configuration value tells to show icons.
+ *
+ * @param string $value Configuration option name
+ *
+ * @return boolean Whether to show icons.
+ */
+ public static function showIcons($value)
+ {
+ return in_array($GLOBALS['cfg'][$value], array('icons', 'both'));
+ }
+
/**
* Returns an HTML IMG tag for a particular icon from a theme,
* which may be an actual file or an icon from a sprite.
@@ -105,11 +117,7 @@ class PMA_Util
$menu_icon = false, $control_param = 'ActionLinksMode'
) {
$include_icon = $include_text = false;
- if (in_array(
- $GLOBALS['cfg'][$control_param],
- array('icons', 'both')
- )
- ) {
+ if (self::showIcons($control_param]) {
$include_icon = true;
}
if ($force_text
@@ -2528,11 +2536,7 @@ class PMA_Util
// Move to the beginning or to the previous page
if ($pos > 0) {
- if (in_array(
- $GLOBALS['cfg']['TableNavigationLinksMode'],
- array('icons', 'both')
- )
- ) {
+ if (self::showIcons('TableNavigationLinksMode')) {
$caption1 = '<<';
$caption2 = ' < ';
$title1 = ' title="' . _pgettext('First page', 'Begin') . '"';
@@ -2569,11 +2573,7 @@ class PMA_Util
$list_navigator_html .= '';
if ($pos + $max_count < $count) {
- if (in_array(
- $GLOBALS['cfg']['TableNavigationLinksMode'],
- array('icons', 'both')
- )
- ) {
+ if ( self::showIcons('TableNavigationLinksMode')) {
$caption3 = ' > ';
$caption4 = '>>';
$title3 = ' title="' . _pgettext('Next page', 'Next') . '"';
diff --git a/libraries/display_create_table.lib.php b/libraries/display_create_table.lib.php
index 2575163393..dcdeca84b7 100644
--- a/libraries/display_create_table.lib.php
+++ b/libraries/display_create_table.lib.php
@@ -40,11 +40,7 @@ $is_create_table_priv = true;