diff options
33 files changed, 253 insertions, 118 deletions
@@ -6,13 +6,13 @@ phpMyAdmin - ChangeLog - bug #3970 Pressing enter in the filter field reloads page - bug #3984 Cannot insert in this table (PHP < 5.4) - bug #3989 Reloading privileges does not update the interface +- bug #3960 NavigationBarIconic config not honored 4.0.4.0 (2013-06-17) - bug #3959 Using DefaultTabDatabase in NavigationTree for Database Click - bug #3961 Avoid Suhosin warning when in simulation mode - bug #3897 Row Statistics and Space usage bugs - bug #3966 Only display "table has no unique column" message when applicable -- bug #3960 NavigationBarIconic config not honored - bug #3965 Default language wrong with zh-TW - bug #3921 Call to undefined function PMA_isSuperuser() if default server is not set diff --git a/db_tracking.php b/db_tracking.php index e95a7e0a5f..39eed84ee3 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -91,14 +91,20 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { // Print out information about versions $drop_image_or_text = ''; - if (true == $GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $drop_image_or_text .= PMA_Util::getImage( 'b_drop.png', __('Delete tracking data for this table') ); } - if ('both' === $GLOBALS['cfg']['PropertiesIconic'] - || false === $GLOBALS['cfg']['PropertiesIconic'] + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('text', 'both') + ) ) { $drop_image_or_text .= __('Drop'); } diff --git a/doc/config.rst b/doc/config.rst index 2b9ced27b8..6099d80c3d 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -1481,14 +1481,13 @@ Database structure Browse mode ----------- -.. config:option:: $cfg['NavigationBarIconic'] +.. config:option:: $cfg['TableNavigationLinksMode'] :type: string - :default: true + :default: ``'icons'`` - Defines whether navigation bar buttons contain text or symbols only. A - value of true displays icons, false displays text and 'both' displays - both icons and text. + Defines whether the table navigation links contain ``'icons'``, ``'text'`` + or ``'both'``. .. config:option:: $cfg['ShowAll'] @@ -1672,15 +1671,22 @@ Export and import settings Tabs display settings --------------------- -.. config:option:: $cfg['PropertiesIconic'] +.. config:option:: $cfg['TabsMode'] + + :type: string + :default: ``'both'`` + + Defines whether the menu tabs contain ``'icons'``, ``'text'`` or ``'both'``. + +.. config:option:: $cfg['ActionLinksMode'] :type: string :default: ``'both'`` - If set to ``true``, will display icons instead of text for db and table + If set to ``icons``, will display icons instead of text for db and table properties links (like :guilabel:`Browse`, :guilabel:`Select`, - :guilabel:`Insert`, ...) and for the menu tabs. Can be set to ``'both'`` - if you want icons AND text. When set to ``false``, will only show text. + :guilabel:`Insert`, ...). Can be set to ``'both'`` + if you want icons AND text. When set to ``text``, will only show text. .. config:option:: $cfg['PropertiesNumColumns'] diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 35dd112eaf..1c8360bca9 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -535,14 +535,18 @@ class PMA_DisplayResults ) { $caption_output = ''; - // for true or 'both' - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $caption_output .= $caption; } - // for false or 'both' - if (($GLOBALS['cfg']['NavigationBarIconic'] === false) - || ($GLOBALS['cfg']['NavigationBarIconic'] === self::POSITION_BOTH) + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('text', 'both') + ) ) { $caption_output .= ' ' . $title; } @@ -2553,7 +2557,7 @@ class PMA_DisplayResults // We need to copy the value // or else the == 'both' check will always return true - if ($GLOBALS['cfg']['PropertiesIconic'] === self::POSITION_BOTH) { + if ($GLOBALS['cfg']['ActionLinksMode'] === self::POSITION_BOTH) { $iconic_spacer = '<div class="nowrap">'; } else { $iconic_spacer = ''; diff --git a/libraries/Footer.class.php b/libraries/Footer.class.php index a0d14ad525..1bf725f868 100644 --- a/libraries/Footer.class.php +++ b/libraries/Footer.class.php @@ -131,7 +131,11 @@ class PMA_Footer $retval .= '<div id="selflink" class="print_ignore">'; $retval .= '<a href="' . $url . '"' . ' title="' . __('Open new phpMyAdmin window') . '" target="_blank">'; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TabsMode'], + array('icons', 'both') + ) + ) { $retval .= PMA_Util::getImage( 'window-new.png', __('Open new phpMyAdmin window') diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index ac5042b282..4123c7a51f 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -129,13 +129,22 @@ class PMA_Menu $separator = "<span class='separator item'> ยป</span>"; $item = '<a href="%1$s?%2$s" class="item">'; - if ($GLOBALS['cfg']['NavigationBarIconic'] !== true) { + + if (in_array( + $GLOBALS['cfg']['TabsMode'], + array('text', 'both') + ) + ) { $item .= '%4$s: '; } $item .= '%3$s</a>'; $retval .= "<div id='floating_menubar'></div>"; $retval .= "<div id='serverinfo'>"; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TabsMode'], + array('icons', 'both') + ) + ) { $retval .= PMA_Util::getImage( 's_host.png', '', @@ -152,7 +161,11 @@ class PMA_Menu if (strlen($this->_db)) { $retval .= $separator; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TabsMode'], + array('icons', 'both') + ) + ) { $retval .= PMA_Util::getImage( 's_db.png', '', @@ -174,7 +187,11 @@ class PMA_Menu include './libraries/tbl_info.inc.php'; $retval .= $separator; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TabsMode'], + array('icons', 'both') + ) + ) { $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 0cc8684e9e..1abe8717b2 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -89,26 +89,37 @@ class PMA_Util /** * Returns an HTML IMG tag for a particular icon from a theme, * which may be an actual file or an icon from a sprite. - * This function takes into account the PropertiesIconic + * This function takes into account the ActionLinksMode * configuration setting and wraps the image tag in a span tag. * - * @param string $icon name of icon file - * @param string $alternate alternate text - * @param boolean $force_text whether to force alternate text to be displayed - * @param boolean $menu_icon whether this icon is for the menu bar or not + * @param string $icon name of icon file + * @param string $alternate alternate text + * @param boolean $force_text whether to force alternate text to be displayed + * @param boolean $menu_icon whether this icon is for the menu bar or not + * @param string $control_param which directive controls the display * * @return string an html snippet */ - public static function getIcon($icon, $alternate = '', $force_text = false, - $menu_icon = false + public static function getIcon( + $icon, $alternate = '', $force_text = false, + $menu_icon = false, $control_param = 'ActionLinksMode' ) { - // $cfg['PropertiesIconic'] is true or both - $include_icon = ($GLOBALS['cfg']['PropertiesIconic'] !== false); - // $cfg['PropertiesIconic'] is false or both - // OR we have no $include_icon - $include_text = ($force_text - || ($GLOBALS['cfg']['PropertiesIconic'] !== true)); - + $include_icon = $include_text = false; + if (in_array( + $GLOBALS['cfg'][$control_param], + array('icons', 'both') + ) + ) { + $include_icon = true; + } + if ($force_text + || in_array( + $GLOBALS['cfg'][$control_param], + array('text', 'both') + ) + ) { + $include_text = true; + } // Sometimes use a span (we rely on this in js/sql.js). But for menu bar // we don't need a span $button = $menu_icon ? '' : '<span class="nowrap">'; @@ -1800,7 +1811,13 @@ class PMA_Util // avoid generating an alt tag, because it only illustrates // the text that follows and if browser does not display // images, the text is duplicated - $tab['text'] = self::getIcon($tab['icon'], $tab['text'], false, true); + $tab['text'] = self::getIcon( + $tab['icon'], + $tab['text'], + false, + true, + 'TabsMode' + ); } elseif (empty($tab['text'])) { // check to not display an empty link-text @@ -1914,7 +1931,7 @@ class PMA_Util $displayed_message = ''; // Add text if not already added if (stristr($message, '<img') - && (! $strip_img || ($GLOBALS['cfg']['PropertiesIconic'] === true)) + && (! $strip_img || ($GLOBALS['cfg']['ActionLinksMode'] == 'icons')) && (strip_tags($message) == $message) ) { $displayed_message = '<span>' @@ -2344,7 +2361,7 @@ class PMA_Util $value = $text; } - if ($GLOBALS['cfg']['PropertiesIconic'] === false) { + if ($GLOBALS['cfg']['ActionLinksMode'] == 'text') { return ' <input type="submit" name="' . $button_name . '"' .' value="' . htmlspecialchars($value) . '"' .' title="' . htmlspecialchars($text) . '" />' . "\n"; @@ -2358,7 +2375,7 @@ class PMA_Util . '" value="' . htmlspecialchars($value) . '" title="' . htmlspecialchars($text) . '" src="' . $GLOBALS['pmaThemeImage']. $image . '" />' - . ($GLOBALS['cfg']['PropertiesIconic'] === 'both' + . ($GLOBALS['cfg']['ActionLinksMode'] == 'both' ? ' ' . htmlspecialchars($text) : '') . "\n"; } else { @@ -2545,8 +2562,11 @@ class PMA_Util // Move to the beginning or to the previous page if ($pos > 0) { - // patch #474210 - part 1 - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $caption1 = '<<'; $caption2 = ' < '; $title1 = ' title="' . _pgettext('First page', 'Begin') . '"'; @@ -2583,7 +2603,11 @@ class PMA_Util $list_navigator_html .= '</form>'; if ($pos + $max_count < $count) { - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $caption3 = ' > '; $caption4 = '>>'; $title3 = ' title="' . _pgettext('Next page', 'Next') . '"'; diff --git a/libraries/config.default.php b/libraries/config.default.php index 0b2512641a..544e2f4e40 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -974,12 +974,12 @@ $cfg['HideStructureActions'] = true; */ /** - * Use icons instead of text for the navigation bar buttons - * and on right panel top menu (server db table) (true|false|'both') + * Use icons instead of text for the navigation bar buttons (table browse) + * ('text'|'icons'|'both') * - * @global string $cfg['NavigationBarIconic'] + * @global string $cfg['TableNavigationLinksMode'] */ -$cfg['NavigationBarIconic'] = true; +$cfg['TableNavigationLinksMode'] = 'icons'; /** * Defines whether a user should be displayed a "show all (records)" @@ -1149,11 +1149,18 @@ $cfg['CompressOnFly'] = true; */ /** - * Use icons instead of text for the table display of a database (true|false|'both') + * How to display the menu tabs ('icons'|'text'|'both') * - * @global boolean $cfg['PropertiesIconic'] + * @global boolean $cfg['TabsMode'] */ -$cfg['PropertiesIconic'] = 'both'; +$cfg['TabsMode'] = 'both'; + +/** + * How to display various action links ('icons'|'text'|'both') + * + * @global boolean $cfg['ActionLinksMode'] + */ +$cfg['ActionLinksMode'] = 'both'; /** * How many columns should be used for table display of a database? diff --git a/libraries/config.values.php b/libraries/config.values.php index b38526cf7c..5d51b9d577 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -45,10 +45,10 @@ $cfg_db['NavigationTreeDefaultTabTable'] = array( ); $cfg_db['NavigationTreeDbSeparator'] = 'short_string'; $cfg_db['NavigationTreeTableSeparator'] = 'short_string'; -$cfg_db['NavigationBarIconic'] = array( - true => __('Yes'), - false => __('No'), - 'both' => __('Both') +$cfg_db['TableNavigationLinksMode'] = array( + 'icons' => __('Icons'), + 'text' => __('Text'), + 'both' => __('Both') ); $cfg_db['Order'] = array('ASC', 'DESC', 'SMART'); $cfg_db['RowActionLinks'] = array( @@ -60,10 +60,15 @@ $cfg_db['RowActionLinks'] = array( $cfg_db['ProtectBinary'] = array(false, 'blob', 'noblob', 'all'); $cfg_db['DefaultDisplay'] = array('horizontal', 'vertical', 'horizontalflipped'); $cfg_db['CharEditing'] = array('input', 'textarea'); -$cfg_db['PropertiesIconic'] = array( - true => __('Yes'), - false => __('No'), - 'both' => __('Both') +$cfg_db['TabsMode'] = array( + 'icons' => __('Icons'), + 'text' => __('Text'), + 'both' => __('Both') +); +$cfg_db['ActionLinksMode'] = array( + 'icons' => __('Icons'), + 'text' => __('Text'), + 'both' => __('Both') ); $cfg_db['GridEditing'] = array( 'click' => __('Click'), diff --git a/libraries/config/FormDisplay.class.php b/libraries/config/FormDisplay.class.php index ee86f5384d..447a34bc5f 100644 --- a/libraries/config/FormDisplay.class.php +++ b/libraries/config/FormDisplay.class.php @@ -571,14 +571,6 @@ class FormDisplay } break; case 'select': - // special treatment for NavigationBarIconic and PropertiesIconic - if ($key === 'NavigationBarIconic' - || $key === 'PropertiesIconic' - ) { - if ($_POST[$key] !== 'both') { - settype($_POST[$key], 'boolean'); - } - } $successfully_validated = $this->_validateSelect( $_POST[$key], $form->getOptionValueList($system_path) diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 988c2eb578..42d72835cc 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -321,8 +321,8 @@ $strConfigRowActionLinks_desc = __('These are Edit, Copy and Delete links'); $strConfigRowActionLinks_name = __('Where to show the table row links'); $strConfigNaturalOrder_desc = __('Use natural order for sorting table and database names'); $strConfigNaturalOrder_name = __('Natural order'); -$strConfigNavigationBarIconic_desc = __('Use only icons, only text or both'); -$strConfigNavigationBarIconic_name = __('Iconic navigation bar'); +$strConfigTableNavigationLinksMode_desc = __('Use only icons, only text or both'); +$strConfigTableNavigationLinksMode_name = __('Table navigation bar'); $strConfigOBGzip_desc = __('use GZip output buffering for increased speed in HTTP transfers'); $strConfigOBGzip_name = __('GZip output buffering'); $strConfigOrder_desc = __('[kbd]SMART[/kbd] - i.e. descending order for columns of type TIME, DATE, DATETIME and TIMESTAMP, ascending order otherwise'); @@ -335,8 +335,10 @@ $strConfigServerLibraryDifference_DisableWarning_desc = __('Disable the default $strConfigServerLibraryDifference_DisableWarning_name = __('Server/library difference warning'); $strConfigReservedWordDisableWarning_desc = __('Disable the default warning that is displayed on the Structure page if column names in a table are reserved MySQL words'); $strConfigReservedWordDisableWarning_name = __('MySQL reserved word warning'); -$strConfigPropertiesIconic_desc = __('Use only icons, only text or both'); -$strConfigPropertiesIconic_name = __('Iconic table operations'); +$strConfigTabsMode_desc = __('Use only icons, only text or both'); +$strConfigTabsMode_name = __('How to display the menu tabs'); +$strConfigActionLinksMode_desc = __('Use only icons, only text or both'); +$strConfigActionLinksMode_name = __('How to display various action links'); $strConfigProtectBinary_desc = __('Disallow BLOB and BINARY columns from editing'); $strConfigProtectBinary_name = __('Protect binary columns'); $strConfigQueryHistoryDB_desc = __('Enable if you want DB-based query history (requires phpMyAdmin configuration storage). If disabled, this utilizes JS-routines to display query history (lost by window close).'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 4a9cb1b48e..bb712cabca 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -191,7 +191,7 @@ $forms['Main_panel']['DbStructure'] = array( $forms['Main_panel']['TableStructure'] = array( 'HideStructureActions'); $forms['Main_panel']['Browse'] = array( - 'NavigationBarIconic', + 'TableNavigationLinksMode', 'ShowAll', 'MaxRows', 'Order', @@ -221,7 +221,8 @@ $forms['Main_panel']['Edit'] = array( 'ForeignKeyDropdownOrder', 'ForeignKeyMaxLimit'); $forms['Main_panel']['Tabs'] = array( - 'PropertiesIconic', + 'TabsMode', + 'ActionLinksMode', 'DefaultTabServer', 'DefaultTabDatabase', 'DefaultTabTable', diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php index e2d2bda03f..eeacd1c79a 100644 --- a/libraries/config/user_preferences.forms.php +++ b/libraries/config/user_preferences.forms.php @@ -105,8 +105,8 @@ $forms['Main_panel']['DbStructure'] = array( $forms['Main_panel']['TableStructure'] = array( 'HideStructureActions'); $forms['Main_panel']['Browse'] = array( - 'NavigationBarIconic', - 'PropertiesIconic', + 'TableNavigationLinksMode', + 'ActionLinksMode', 'ShowAll', 'MaxRows', 'Order', @@ -129,6 +129,7 @@ $forms['Main_panel']['Edit'] = array( 'ForeignKeyDropdownOrder', 'ForeignKeyMaxLimit'); $forms['Main_panel']['Tabs'] = array( + 'TabsMode', 'DefaultTabServer', 'DefaultTabDatabase', 'DefaultTabTable'); diff --git a/libraries/display_create_table.lib.php b/libraries/display_create_table.lib.php index eb803cc443..2575163393 100644 --- a/libraries/display_create_table.lib.php +++ b/libraries/display_create_table.lib.php @@ -40,7 +40,11 @@ $is_create_table_priv = true; <fieldset> <legend> <?php -if ($GLOBALS['cfg']['PropertiesIconic']) { +if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) +) { echo PMA_Util::getImage('b_newtbl.png'); } echo __('Create table'); diff --git a/libraries/navigation/NavigationHeader.class.php b/libraries/navigation/NavigationHeader.class.php index b1513d2c03..68f8d6d506 100644 --- a/libraries/navigation/NavigationHeader.class.php +++ b/libraries/navigation/NavigationHeader.class.php @@ -166,9 +166,9 @@ class PMA_NavigationHeader */ private function _links() { - $iconicNav = $GLOBALS['cfg']['NavigationBarIconic']; - $showIcon = $iconicNav === true || $iconicNav === 'both'; - $showText = $iconicNav === false || $iconicNav === 'both'; + // always iconic + $showIcon = true; + $showText = false; $retval = '<!-- LINKS START -->'; $retval .= '<div id="leftframelinks">'; diff --git a/libraries/navigation/NavigationTree.class.php b/libraries/navigation/NavigationTree.class.php index d92c694f82..40900cb09b 100644 --- a/libraries/navigation/NavigationTree.class.php +++ b/libraries/navigation/NavigationTree.class.php @@ -576,7 +576,11 @@ class PMA_NavigationTree $groups[$key]->separator = $node->separator; $groups[$key]->separator_depth = $node->separator_depth - 1; $groups[$key]->icon = ''; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $groups[$key]->icon = PMA_Util::getImage( 'b_group.png' ); @@ -899,7 +903,11 @@ class PMA_NavigationTree if ($node->type == Node::CONTAINER) { $retval .= "<i>"; } - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { $retval .= "<div class='block'>"; if (isset($node->links['icon'])) { $args = array(); diff --git a/libraries/operations.lib.php b/libraries/operations.lib.php index 94be5a2ebd..155eed0529 100644 --- a/libraries/operations.lib.php +++ b/libraries/operations.lib.php @@ -25,7 +25,11 @@ function PMA_getHtmlForDatabaseComment($db) . PMA_generate_common_hidden_inputs($db) . '<fieldset>' . '<legend>'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= '<img class="icon ic_b_comment" ' . 'src="themes/dot.gif" alt="" />'; } @@ -69,7 +73,11 @@ function PMA_getHtmlForRenameDatabase($db) . '<fieldset>' . '<legend>'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= PMA_Util::getImage('b_edit.png'); } $html_output .= __('Rename database to') . ':' @@ -113,7 +121,11 @@ function PMA_getHtmlForDropDatabaseLink($db) $html_output = '<div class="operations_half_width">' . '<fieldset class="caution">'; $html_output .= '<legend>'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= PMA_Util::getImage('b_deltbl.png'); } $html_output .= __('Remove database') @@ -169,7 +181,11 @@ function PMA_getHtmlForCopyDatabase($db) $html_output .= '<fieldset>' . '<legend>'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= PMA_Util::getImage('b_edit.png'); } $html_output .= __('Copy database to') . ':' @@ -234,7 +250,11 @@ function PMA_getHtmlForChangeDatabaseCharset($db, $table) $html_output .= '<fieldset>' . "\n" . ' <legend>'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= PMA_Util::getImage('s_asci.png'); } $html_output .= '<label for="select_db_collation">' . __('Collation') @@ -269,7 +289,11 @@ function PMA_getHtmlForExportRelationalSchemaView($url_query) { $html_output = '<div class="operations_full_width">' . '<fieldset><a href="schema_edit.php?' . $url_query . '">'; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .= PMA_Util::getImage( 'b_edit.png' ); diff --git a/libraries/schema/User_Schema.class.php b/libraries/schema/User_Schema.class.php index 95321b3d6c..a7e802aa14 100644 --- a/libraries/schema/User_Schema.class.php +++ b/libraries/schema/User_Schema.class.php @@ -407,7 +407,11 @@ class PMA_User_Schema <legend> <?php echo PMA_generate_common_hidden_inputs($db); - if ($cfg['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { echo PMA_Util::getImage('b_views.png'); } echo __('Display relational schema'); diff --git a/libraries/sql_query_form.lib.php b/libraries/sql_query_form.lib.php index bf2e81cca0..edb96a9f51 100644 --- a/libraries/sql_query_form.lib.php +++ b/libraries/sql_query_form.lib.php @@ -285,7 +285,11 @@ function PMA_sqlQueryFormInsert( } echo '</select>' . "\n" .'<div id="tablefieldinsertbuttoncontainer">' . "\n"; - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { echo '<input type="button" class="button" name="insert" value="<<"' .' onclick="insertValueQuery()"' .' title="' . __('Insert') . '" />' . "\n"; diff --git a/libraries/structure.lib.php b/libraries/structure.lib.php index e6d76dd837..bed7869ef2 100644 --- a/libraries/structure.lib.php +++ b/libraries/structure.lib.php @@ -1191,7 +1191,11 @@ function PMA_getHtmlForTableStructureHeader( if (PMA_DRIZZLE) { $colspan -= 2; } - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $colspan--; } $html_output .= '<th colspan="' . $colspan . '" ' @@ -1546,7 +1550,11 @@ function PMA_getHtmlForAddColumn($columns_list) $GLOBALS['db'], $GLOBALS['table'] ); - if ($GLOBALS['cfg']['PropertiesIconic']) { + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('icons', 'both') + ) + ) { $html_output .=PMA_Util::getImage( 'b_insrow.png', __('Add column') diff --git a/server_binlog.php b/server_binlog.php index 20f9070a66..8c82d5f25b 100644 --- a/server_binlog.php +++ b/server_binlog.php @@ -137,7 +137,11 @@ if ($pos > 0) { echo '<a href="server_binlog.php' . PMA_generate_common_url($this_url_params) . '"'; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { echo ' title="' . _pgettext('Previous page', 'Previous') . '">'; } else { echo '>' . _pgettext('Previous page', 'Previous'); @@ -170,7 +174,11 @@ if ($num_rows >= $GLOBALS['cfg']['MaxRows']) { $this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows']; echo ' - <a href="server_binlog.php' . PMA_generate_common_url($this_url_params) . '"'; - if ($GLOBALS['cfg']['NavigationBarIconic']) { + if (in_array( + $GLOBALS['cfg']['TableNavigationLinksMode'], + array('icons', 'both') + ) + ) { echo ' title="' . _pgettext('Next page', 'Next') . '">'; } else { echo '>' . _pgettext('Next page', 'Next'); diff --git a/server_databases.php b/server_databases.php index 0cda459aff..cf2aadf94b 100644 --- a/server_databases.php +++ b/server_databases.php @@ -233,8 +233,9 @@ if ($databases_count > 0) { } if ($is_superuser && ! PMA_DRIZZLE) { - echo ' <th>' . ($cfg['PropertiesIconic'] ? '' : __('Action')) . "\n" - . ' </th>' . "\n"; + echo ' <th>' + . ($cfg['ActionLinksMode'] == 'icons' ? '' : __('Action')) . "\n" + . ' </th>' . "\n"; } echo '</tr>' . "\n" . '</thead>' . "\n" diff --git a/tbl_structure.php b/tbl_structure.php index 1999883ce2..5e8e7ced5c 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -219,7 +219,10 @@ $hidden_titles = PMA_getHiddenTitlesArray(); $HideStructureActions = ''; -if ($GLOBALS['cfg']['PropertiesIconic'] !== true +if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('text', 'both') + ) && $GLOBALS['cfg']['HideStructureActions'] === true ) { $HideStructureActions .= ' HideStructureActions'; diff --git a/tbl_tracking.php b/tbl_tracking.php index e0fdb22af7..c1ae531dac 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -526,13 +526,15 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { // Prepare delete link content here $drop_image_or_text = ''; - if (true == $GLOBALS['cfg']['PropertiesIconic']) { + if ('icons' == $GLOBALS['cfg']['ActionsLinksMode']) { $drop_image_or_text .= PMA_Util::getImage( 'b_drop.png', __('Delete tracking data row from report') ); } - if ('both' === $GLOBALS['cfg']['PropertiesIconic'] - || false === $GLOBALS['cfg']['PropertiesIconic'] + if (in_array( + $GLOBALS['cfg']['ActionLinksMode'], + array('text', 'both') + ) ) { $drop_image_or_text .= __('Delete'); } diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index 681862890b..7b19086d0e 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -353,7 +353,7 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase public function testGetTableNavigationButton( $caption, $title, $pos, $html_sql_query, $output ) { - $GLOBALS['cfg']['NavigationBarIconic'] = true; + $GLOBALS['cfg']['TableNavigationLinksMode'] = 'icons'; $_SESSION[' PMA_token '] = 'token'; $this->assertEquals( @@ -831,7 +831,7 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase public function testGetEditLink( $edit_url, $class, $edit_str, $where_clause, $where_clause_html, $output ) { - $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; $this->assertEquals( @@ -883,7 +883,7 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase public function testGetCopyLink( $copy_url, $copy_str, $where_clause, $where_clause_html, $class, $output ) { - $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; $this->assertEquals( @@ -933,7 +933,7 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase public function testGetDeleteLink( $del_url, $del_str, $js_conf, $class, $output ) { - $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $GLOBALS['cfg']['LinkLengthLimit'] = 1000; $this->assertEquals( diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php index 2a18bfcb79..1fd4699e25 100644 --- a/test/classes/PMA_Footer_test.php +++ b/test/classes/PMA_Footer_test.php @@ -134,7 +134,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase public function testGetSelfLink() { - $GLOBALS['cfg']['NavigationBarIconic'] = false; + $GLOBALS['cfg']['TabsMode'] = 'text'; $GLOBALS['cfg']['ServerDefault'] = 1; $this->assertEquals( @@ -156,7 +156,7 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase public function testGetSelfLinkWithImage() { - $GLOBALS['cfg']['NavigationBarIconic'] = true; + $GLOBALS['cfg']['TabsMode'] = 'icons'; $GLOBALS['cfg']['ServerDefault'] = 1; $_SESSION['PMA_Theme'] = new PMA_Theme(); $GLOBALS['pmaThemeImage'] = 'image'; diff --git a/test/classes/PMA_Menu_test.php b/test/classes/PMA_Menu_test.php index 3183ab5cbb..5089124f47 100644 --- a/test/classes/PMA_Menu_test.php +++ b/test/classes/PMA_Menu_test.php @@ -44,7 +44,7 @@ class PMA_Menu_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg']['ServerDefault'] = 1; $GLOBALS['lang'] = 'en'; $GLOBALS['cfg']['Server']['verbose'] = 'verbose host'; - $GLOBALS['cfg']['NavigationBarIconic'] = 'both'; + $GLOBALS['cfg']['TableNavigationLinksMode'] = 'both'; $_SESSION['PMA_Theme'] = new PMA_Theme(); $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath(); $GLOBALS['pmaThemeImage'] = 'theme/'; diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index bf87b5b9cc..e10b93b237 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -40,7 +40,7 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase $_SESSION[' PMA_token '] = 'token'; $GLOBALS['cfg']['MySQLManualType'] = 'viewable'; $GLOBALS['cfg']['MySQLManualBase'] = 'http://dev.mysql.com/doc/refman'; - $GLOBALS['cfg']['PropertiesIconic'] = 'both'; + $GLOBALS['cfg']['ActionLinksMode'] = 'both'; $_SESSION['PMA_Theme'] = new PMA_Theme(); $GLOBALS['pmaThemeImage'] = 'themes/dot.gif'; $GLOBALS['is_ajax_request'] = false; diff --git a/test/libraries/PMA_build_html_for_db_test.php b/test/libraries/PMA_build_html_for_db_test.php index 22dd1dc6fe..03dd3b5c8a 100644 --- a/test/libraries/PMA_build_html_for_db_test.php +++ b/test/libraries/PMA_build_html_for_db_test.php @@ -42,7 +42,7 @@ class PMA_build_html_for_db_test extends PHPUnit_Framework_TestCase $GLOBALS['PMA_Types'] = new PMA_Types_MySQL(); $_SESSION['PMA_Theme'] = new PMA_Theme(); - $GLOBALS['cfg']['PropertiesIconic'] = true; + $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath(); $GLOBALS['pmaThemeImage'] = 'theme/'; diff --git a/test/libraries/PMA_operations_test.php b/test/libraries/PMA_operations_test.php index 5701257f19..bc9bff644d 100644 --- a/test/libraries/PMA_operations_test.php +++ b/test/libraries/PMA_operations_test.php @@ -42,7 +42,7 @@ class PMA_Operations_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg'] = array( 'MySQLManualType' => 'none', 'ServerDefault' => 1, - 'PropertiesIconic' => true, + 'ActionLinksMode' => 'icons', ); $GLOBALS['server'] = 1; } diff --git a/test/libraries/PMA_transformation_test.php b/test/libraries/PMA_transformation_test.php index 44bb1c8fde..1c8c5be09c 100644 --- a/test/libraries/PMA_transformation_test.php +++ b/test/libraries/PMA_transformation_test.php @@ -38,7 +38,7 @@ class PMA_Transformation_Test extends PHPUnit_Framework_TestCase $GLOBALS['cfg'] = array( 'MySQLManualType' => 'none', 'ServerDefault' => 1, - 'PropertiesIconic' => true, + 'ActionLinksMode' => 'icons', ); $GLOBALS['server'] = 1; $GLOBALS['cfg']['Server']['pmadb'] = 'pmadb'; diff --git a/test/libraries/common/PMA_buildActionTitles_test.php b/test/libraries/common/PMA_buildActionTitles_test.php index 30fd4e1b52..55a32a1537 100644 --- a/test/libraries/common/PMA_buildActionTitles_test.php +++ b/test/libraries/common/PMA_buildActionTitles_test.php @@ -20,7 +20,7 @@ class PMA_buildActionTitles_test extends PHPUnit_Framework_TestCase function setup() { $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme'); - $GLOBALS['cfg'] = array('PropertiesIconic' => 'both'); + $GLOBALS['cfg'] = array('ActionLinksMode' => 'both'); $GLOBALS['pmaThemeImage'] = 'theme/'; } diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php index 781af64532..038dcd5312 100644 --- a/test/libraries/common/PMA_getIcon_test.php +++ b/test/libraries/common/PMA_getIcon_test.php @@ -20,9 +20,9 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase $_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme'); } - function testGetIconWithoutPropertiesIconic() + function testGetIconWithoutActionLinksMode() { - $GLOBALS['cfg']['PropertiesIconic'] = false; + $GLOBALS['cfg']['ActionLinksMode'] = 'text'; $this->assertEquals( '<span class="nowrap"></span>', @@ -30,9 +30,9 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase ); } - function testGetIconWithPropertiesIconic() + function testGetIconWithActionLinksMode() { - $GLOBALS['cfg']['PropertiesIconic'] = true; + $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $this->assertEquals( '<span class="nowrap"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_comment" /></span>', @@ -42,7 +42,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase function testGetIconAlternate() { - $GLOBALS['cfg']['PropertiesIconic'] = true; + $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $alternate_text = 'alt_str'; $this->assertEquals( @@ -54,7 +54,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase function testGetIconWithForceText() { - $GLOBALS['cfg']['PropertiesIconic'] = true; + $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $alternate_text = 'alt_str'; // Here we are checking for an icon embeded inside a span (i.e not a menu |