diff --git a/changelog.php b/changelog.php index c216c7fe3d..5066ffe03e 100644 --- a/changelog.php +++ b/changelog.php @@ -49,6 +49,7 @@ $tracker_url_bug = 'https://sourceforge.net/p/phpmyadmin/bugs/\\1/'; $tracker_url_rfe = 'https://sourceforge.net/p/phpmyadmin/feature-requests/\\1/'; $tracker_url_patch = 'https://sourceforge.net/p/phpmyadmin/patches/\\1/'; $github_url = 'https://github.com/phpmyadmin/phpmyadmin/'; +$faq_url = 'http://docs.phpmyadmin.net/en/latest/faq.html'; $replaces = array( '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@' @@ -80,7 +81,7 @@ $replaces = array( // FAQ entries '/FAQ ([0-9]+)\.([0-9a-z]+)/i' - => 'FAQ \\1.\\2', + => 'FAQ \\1.\\2', // linking bugs '/bug\s*#?([0-9]{6,})/i' diff --git a/db_tracking.php b/db_tracking.php index 73ecd5b23c..b849928843 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -97,11 +97,7 @@ if ($GLOBALS['dbi']->numRows($all_tables_result) > 0) { __('Delete tracking data for this table') ); } - if (in_array( - $GLOBALS['cfg']['ActionLinksMode'], - array('text', 'both') - ) - ) { + if (PMA_Util::showText('ActionLinksMode')) { $drop_image_or_text .= __('Drop'); } diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 5ff12d60f1..b5685337ee 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -539,11 +539,7 @@ class PMA_DisplayResults $caption_output .= $caption; } - if (in_array( - $GLOBALS['cfg']['TableNavigationLinksMode'], - array('text', 'both') - ) - ) { + if (PMA_Util::showText('TableNavigationLinksMode')) { $caption_output .= ' ' . $title; } $title_output = ' title="' . $title . '"'; diff --git a/libraries/Menu.class.php b/libraries/Menu.class.php index 050b0040b2..ad5eb52e17 100644 --- a/libraries/Menu.class.php +++ b/libraries/Menu.class.php @@ -178,7 +178,7 @@ class PMA_Menu $item = ''; - if (in_array($GLOBALS['cfg']['TabsMode'], array('text', 'both'))) { + if (PMA_Util::showText('TabsMode')) { $item .= '%4$s: '; } $item .= '%3$s'; diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 8c690247ae..b5e276921e 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -98,6 +98,18 @@ class PMA_Util return in_array($GLOBALS['cfg'][$value], array('icons', 'both')); } + /** + * Checks whether configuration value tells to show text. + * + * @param string $value Configuration option name + * + * @return boolean Whether to show text. + */ + public static function showText($value) + { + return in_array($GLOBALS['cfg'][$value], array('text', '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. @@ -121,10 +133,7 @@ class PMA_Util $include_icon = true; } if ($force_text - || in_array( - $GLOBALS['cfg'][$control_param], - array('text', 'both') - ) + || self::showText($control_param) ) { $include_text = true; } diff --git a/libraries/display_structure.lib.php b/libraries/display_structure.lib.php index 601c48fb0b..0a92e30f6e 100644 --- a/libraries/display_structure.lib.php +++ b/libraries/display_structure.lib.php @@ -21,10 +21,7 @@ if (! defined('PHPMYADMIN')) { $HideStructureActions = ''; -if (in_array( - $GLOBALS['cfg']['ActionLinksMode'], - array('text', 'both') - ) +if (PMA_Util::showText('ActionLinksMode') && $GLOBALS['cfg']['HideStructureActions'] === true ) { $HideStructureActions .= ' HideStructureActions'; diff --git a/tbl_tracking.php b/tbl_tracking.php index e1ebb55e75..a6a5ac9ca9 100644 --- a/tbl_tracking.php +++ b/tbl_tracking.php @@ -528,16 +528,12 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) { // Prepare delete link content here $drop_image_or_text = ''; - if ('icons' == $GLOBALS['cfg']['ActionsLinksMode']) { + if (PMA_Util::showIcons('ActionsLinksMode')) { $drop_image_or_text .= PMA_Util::getImage( 'b_drop.png', __('Delete tracking data row from report') ); } - if (in_array( - $GLOBALS['cfg']['ActionLinksMode'], - array('text', 'both') - ) - ) { + if (PMA_Util::showText('ActionLinksMode')) { $drop_image_or_text .= __('Delete'); } diff --git a/test/libraries/PMA_mime_test.php b/test/libraries/PMA_mime_test.php index 144cde20fc..b58d8c026f 100644 --- a/test/libraries/PMA_mime_test.php +++ b/test/libraries/PMA_mime_test.php @@ -12,6 +12,11 @@ require_once 'libraries/mime.lib.php'; +/** + * Test for mime detection. + * + * @package PhpMyAdmin-test + */ class PMA_MIME_Test extends PHPUnit_Framework_TestCase { /**