diff --git a/js/functions.js b/js/functions.js index ed7613415a..a6c131a394 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4928,7 +4928,7 @@ function PMA_getImage(image, alternate, attributes) { // this is private alt: '', title: '', - src: '', + src: 'themes/dot.gif', }, attr: function (name, value) { if (value == undefined) { @@ -4969,11 +4969,9 @@ function PMA_getImage(image, alternate, attributes) { } else { retval.attr('title', escapeHtml(alternate)); } - // it's an image file - retval.attr( - 'src', - pmaThemeImage + image - ); + // set css classes + var klass = image.replace('.gif', '').replace('.png', ''); + retval.attr('class', 'icon ic_' + klass); // set all other attrubutes for (var i in attributes) { if (i == 'src') { diff --git a/libraries/classes/Theme.php b/libraries/classes/Theme.php index 965d507114..acb1cd6d9a 100644 --- a/libraries/classes/Theme.php +++ b/libraries/classes/Theme.php @@ -78,7 +78,8 @@ class Theme 'rte', 'codemirror', 'jqplot', - 'resizable-menu' + 'resizable-menu', + 'icons', ); /** diff --git a/libraries/classes/Util.php b/libraries/classes/Util.php index 2f538dc863..5ca4136711 100644 --- a/libraries/classes/Util.php +++ b/libraries/classes/Util.php @@ -122,6 +122,13 @@ class Util $url = './themes/pmahomme/' . $image; } + $class = str_replace(array('.gif','.png'), '', $image); + if (isset($attributes['class'])) { + $attributes['class'] = "icon ic_$class " . $attributes['class']; + } else { + $attributes['class'] = "icon ic_$class"; + } + // set all other attributes $attr_str = ''; foreach ($attributes as $key => $value) { @@ -145,8 +152,8 @@ class Util } // generate the IMG tag - $template = '%s'; - $retval = sprintf($template, $url, $title, $alt, $attr_str); + $template = '%s'; + $retval = sprintf($template, $title, $alt, $attr_str); return $retval; } diff --git a/test/classes/Config/FormDisplayTemplateTest.php b/test/classes/Config/FormDisplayTemplateTest.php index e536601290..74e61fbeca 100644 --- a/test/classes/Config/FormDisplayTemplateTest.php +++ b/test/classes/Config/FormDisplayTemplateTest.php @@ -177,8 +177,8 @@ class FormDisplayTemplateTest extends TestCase ); $this->assertContains( - 'Open new phpMyAdmin window', + . 'class="icon ic_window-new" />', $this->_callPrivateFunction( '_getSelfLink', array( diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index 911ae1520c..75e4f2adf3 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -1413,8 +1413,8 @@ class InsertEditTest extends TestCase $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $GLOBALS['cfg']['LinkLengthLimit'] = 2; $this->assertContains( - 'Edit/Insert' + 'Edit/Insert' . '', InsertEdit::getHtmlForGisDataTypes() ); diff --git a/test/classes/MessageTest.php b/test/classes/MessageTest.php index 885aab9bf7..95a1ab3d96 100644 --- a/test/classes/MessageTest.php +++ b/test/classes/MessageTest.php @@ -542,7 +542,7 @@ class MessageTest extends PmaTestCase $this->object->setMessage('Test Message'); $this->expectOutputString( - '
' + '
' . 'Test Message
' ); $this->object->display(); @@ -559,7 +559,7 @@ class MessageTest extends PmaTestCase { $this->object->setMessage('Test Message'); $this->assertEquals( - '
' + '
' . 'Test Message
', $this->object->getDisplay() ); @@ -587,18 +587,18 @@ class MessageTest extends PmaTestCase return array( array( 1, - '
1 row affected.
' + '
1 row affected.
' ), array( 2, - '
2 rows affected.
' + '
2 rows affected.
' ), array( 10000, - '
10000 rows affected.
' + '
10000 rows affected.
' ) ); } @@ -632,18 +632,18 @@ class MessageTest extends PmaTestCase return array( array( 1, - '
' - . ' 1 row inserted.
' + '
1 row inserted.
' ), array( 2, - '
' - . ' 2 rows inserted.
' + '
2 rows inserted.
' ), array( 100000, - '
' - . ' 100000 rows inserted.
' + '
100000 rows inserted.
' ) ); } @@ -677,18 +677,18 @@ class MessageTest extends PmaTestCase return array( array( 1, - '
' - . ' 1 row deleted.
' + '
1 row deleted.
' ), array( 2, - '
' - . ' 2 rows deleted.
' + '
2 rows deleted.
' ), array( 500000, - '
' - . ' 500000 rows deleted.
' + '
500000 rows deleted.
' ) ); } diff --git a/test/classes/Plugins/Auth/AuthenticationConfigTest.php b/test/classes/Plugins/Auth/AuthenticationConfigTest.php index 3e67b001bf..3fe0f16e7d 100644 --- a/test/classes/Plugins/Auth/AuthenticationConfigTest.php +++ b/test/classes/Plugins/Auth/AuthenticationConfigTest.php @@ -117,7 +117,9 @@ class AuthenticationConfigTest extends PmaTestCase $this->assertContains( 'MySQL said: ', + ' target="mysql_doc">' . + 'Documentation', $html ); diff --git a/test/classes/ThemeTest.php b/test/classes/ThemeTest.php index 7210d47dba..da3a275435 100644 --- a/test/classes/ThemeTest.php +++ b/test/classes/ThemeTest.php @@ -148,6 +148,7 @@ class ThemeTest extends PmaTestCase ob_end_clean(); $this->assertTrue($ret); $this->assertContains('FILE: navigation.css.php', $out); + $this->assertContains('.ic_b_bookmark', $out); } /** diff --git a/test/classes/UtilTest.php b/test/classes/UtilTest.php index 5837511f9f..f429cb69de 100644 --- a/test/classes/UtilTest.php +++ b/test/classes/UtilTest.php @@ -1408,7 +1408,7 @@ class UtilTest extends PmaTestCase $GLOBALS['cfg']['ActionLinksMode'] = 'icons'; $this->assertEquals( - '', + '', Util::getIcon('b_comment.png') ); } @@ -1426,9 +1426,9 @@ class UtilTest extends PmaTestCase $alternate_text = 'alt_str'; $this->assertEquals( - '' . $alternate_text
-            . '', + . '" class="icon ic_b_comment" />', Util::getIcon('b_comment.png', $alternate_text) ); } @@ -1448,9 +1448,9 @@ class UtilTest extends PmaTestCase // Here we are checking for an icon embedded inside a span (i.e not a menu // bar icon $this->assertEquals( - '' . $alternate_text
-            . ' ' . $alternate_text . '', + . '" class="icon ic_b_comment" /> ' . $alternate_text . '', Util::getIcon('b_comment.png', $alternate_text, true, false) ); } @@ -2065,7 +2065,7 @@ class UtilTest extends PmaTestCase $GLOBALS['cfg']['ServerDefault'] = 1; $this->assertEquals( - 'Documentation', + 'Documentation', Util::showDocu('page', 'anchor') ); } @@ -2086,8 +2086,8 @@ class UtilTest extends PmaTestCase $lang = _pgettext('PHP documentation language', 'en'); $expected = '' - . 'Documentation' - . ''; + . ''
+            . __('Documentation') . ''; $this->assertEquals( $expected, Util::showPHPDocu($target) diff --git a/test/selenium/TestBase.php b/test/selenium/TestBase.php index 36391f415f..18321fe53e 100644 --- a/test/selenium/TestBase.php +++ b/test/selenium/TestBase.php @@ -376,7 +376,7 @@ abstract class PMA_SeleniumBase extends PHPUnit_Extensions_Selenium2TestCase public function logOutIfLoggedIn() { if ($this->isLoggedIn()) { - $this->byCssSelector("a.logout")->click(); + $this->byCssSelector("img.icon.ic_s_loggoff")->click(); } }