The branch, master has been updated
via 4fb5b65fd2a2e740842fd0592ebd698d46f46c8b (commit)
from 7a07c42de50c1f23bec33fc82b98179e4c452f26 (commit)
- Log -----------------------------------------------------------------
commit 4fb5b65fd2a2e740842fd0592ebd698d46f46c8b
Author: Michal Čihař <mcihar(a)suse.cz>
Date: Thu Aug 4 13:47:44 2011 +0200
Remove unused parameter $container from PMA_getIcon
-----------------------------------------------------------------------
Summary of changes:
db_operations.php | 2 +-
libraries/common.lib.php | 37 +++++++-------
libraries/display_tbl.lib.php | 20 ++++----
tbl_structure.php | 50 ++++++++++----------
.../common/PMA_buildActionTitles_test.php | 34 +++++++-------
test/libraries/common/PMA_getIcon_test.php | 23 ++-------
6 files changed, 76 insertions(+), 90 deletions(-)
diff --git a/db_operations.php b/db_operations.php
index 2382389..6b40947 100644
--- a/db_operations.php
+++ b/db_operations.php
@@ -359,7 +359,7 @@ if (!$is_information_schema) {
<?php echo PMA_generate_common_hidden_inputs($db); ?>
<fieldset>
<legend>
- <?php echo PMA_getIcon('b_comment.png', __('Database comment: '), false, true); ?>
+ <?php echo PMA_getIcon('b_comment.png', __('Database comment: '), true); ?>
</legend>
<input type="text" name="comment" class="textfield" size="30"
value="<?php
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index fec1c86..fa95d86 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -74,12 +74,11 @@ function PMA_pow($base, $exp, $use_function = false)
*
* @param string $icon name of icon file
* @param string $alternate alternate text
- * @param boolean $container include in container
* @param boolean $force_text whether to force alternate text to be displayed
* @param boolean $noSprite If true, the image source will be not replaced with a CSS Sprite
* @return html img tag
*/
-function PMA_getIcon($icon, $alternate = '', $container = false, $force_text = false, $noSprite = false)
+function PMA_getIcon($icon, $alternate = '', $force_text = false, $noSprite = false)
{
$include_icon = false;
$include_text = false;
@@ -2889,23 +2888,23 @@ function PMA_selectUploadFile($import_list, $uploaddir) {
function PMA_buildActionTitles() {
$titles = array();
- $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'), true);
- $titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'), true);
- $titles['Search'] = PMA_getIcon('b_select.png', __('Search'), true);
- $titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'), true);
- $titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'), true);
- $titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'), true);
- $titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'), true);
- $titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
- $titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'), true);
- $titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'), true);
- $titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'), true);
- $titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'), true);
- $titles['NoEdit'] = PMA_getIcon('bd_edit.png', __('Edit'), true);
- $titles['Export'] = PMA_getIcon('b_export.png', __('Export'), true);
- $titles['NoExport'] = PMA_getIcon('bd_export.png', __('Export'), true);
- $titles['Execute'] = PMA_getIcon('b_nextpage.png', __('Execute'), true);
- $titles['NoExecute'] = PMA_getIcon('bd_nextpage.png', __('Execute'), true);
+ $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'));
+ $titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'));
+ $titles['Search'] = PMA_getIcon('b_select.png', __('Search'));
+ $titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'));
+ $titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'));
+ $titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'));
+ $titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'));
+ $titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'));
+ $titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'));
+ $titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'));
+ $titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'));
+ $titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'));
+ $titles['NoEdit'] = PMA_getIcon('bd_edit.png', __('Edit'));
+ $titles['Export'] = PMA_getIcon('b_export.png', __('Export'));
+ $titles['NoExport'] = PMA_getIcon('bd_export.png', __('Export'));
+ $titles['Execute'] = PMA_getIcon('b_nextpage.png', __('Execute'));
+ $titles['NoExecute'] = PMA_getIcon('bd_nextpage.png', __('Execute'));
return $titles;
}
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index b29b36a..5243dff 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1301,8 +1301,8 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$edit_url = 'tbl_change.php' . PMA_generate_common_url($_url_params + array('default_action' => 'update'));
$copy_url = 'tbl_change.php' . PMA_generate_common_url($_url_params + array('default_action' => 'insert'));
- $edit_str = PMA_getIcon('b_edit.png', __('Edit'), true);
- $copy_str = PMA_getIcon('b_insrow.png', __('Copy'), true);
+ $edit_str = PMA_getIcon('b_edit.png', __('Edit'));
+ $copy_str = PMA_getIcon('b_insrow.png', __('Copy'));
// Class definitions required for inline editing jQuery scripts
$edit_anchor_class = "edit_row_anchor";
@@ -1337,7 +1337,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$js_conf = 'DELETE FROM ' . PMA_jsFormat($db) . '.' . PMA_jsFormat($table)
. ' WHERE ' . PMA_jsFormat($where_clause, false)
. ($clause_is_unique ? '' : ' LIMIT 1');
- $del_str = PMA_getIcon('b_drop.png', __('Delete'), true);
+ $del_str = PMA_getIcon('b_drop.png', __('Delete'));
} elseif ($is_display['del_lnk'] == 'kp') { // kill process case
$_url_params = array(
@@ -1356,7 +1356,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
$del_url = 'sql.php' . PMA_generate_common_url($_url_params);
$del_query = 'KILL ' . $row[0];
$js_conf = 'KILL ' . $row[0];
- $del_str = PMA_getIcon('b_drop.png', __('Kill'), true);
+ $del_str = PMA_getIcon('b_drop.png', __('Kill'));
} // end if (1.2.2)
// 1.3 Displays the links at left if required
@@ -2438,14 +2438,14 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
echo PMA_linkOrButton(
'sql.php' . $url_query,
- PMA_getIcon('b_print.png', __('Print view'), false, true),
+ PMA_getIcon('b_print.png', __('Print view')),
'', true, true, 'print_view') . "\n";
if ($_SESSION['tmp_user_values']['display_text']) {
$_url_params['display_text'] = 'F';
echo PMA_linkOrButton(
'sql.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_print.png', __('Print view (with full texts)'), false, true),
+ PMA_getIcon('b_print.png', __('Print view (with full texts)')),
'', true, true, 'print_view') . "\n";
unset($_url_params['display_text']);
}
@@ -2487,13 +2487,13 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
echo PMA_linkOrButton(
'tbl_export.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_tblexport.png', __('Export'), false, true),
+ PMA_getIcon('b_tblexport.png', __('Export')),
'', true, true, '') . "\n";
// show chart
echo PMA_linkOrButton(
'tbl_chart.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_chart.png', __('Display chart'), false, true),
+ PMA_getIcon('b_chart.png', __('Display chart')),
'', true, true, '') . "\n";
// show GIS chart
@@ -2508,7 +2508,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
if ($geometry_found) {
echo PMA_linkOrButton(
'tbl_gis_visualization.php' . PMA_generate_common_url($_url_params),
- PMA_getIcon('b_globe.gif', __('Visualize GIS data'), false, true),
+ PMA_getIcon('b_globe.gif', __('Visualize GIS data')),
'', true, true, '') . "\n";
}
}
@@ -2528,7 +2528,7 @@ function PMA_displayResultsOperations($the_disp_mode, $analyzed_sql) {
if (! isset($analyzed_sql[0]['queryflags']['procedure'])) {
echo PMA_linkOrButton(
'view_create.php' . $url_query,
- PMA_getIcon('b_views.png', __('Create view'), false, true),
+ PMA_getIcon('b_views.png', __('Create view')),
'', true, true, '') . "\n";
}
if ($header_shown) {
diff --git a/tbl_structure.php b/tbl_structure.php
index a4e9692..77e9b39 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -149,34 +149,34 @@ $analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($show_create_table));
*/
// action titles (image or string)
$titles = array();
-$titles['Change'] = PMA_getIcon('b_edit.png', __('Change'), true);
-$titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
-$titles['NoDrop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
-$titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'), true);
-$titles['Index'] = PMA_getIcon('b_index.png', __('Index'), true);
-$titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'), true);
-$titles['Spatial'] = PMA_getIcon('b_spatial.png', __('Spatial'), true);
-$titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'), true);
-$titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'), true);
-$titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'), true);
-$titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'), true);
-$titles['NoSpatial'] = PMA_getIcon('bd_spatial.png', __('Spatial'), true);
-$titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'), true);
-$titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true);
+$titles['Change'] = PMA_getIcon('b_edit.png', __('Change'));
+$titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'));
+$titles['NoDrop'] = PMA_getIcon('b_drop.png', __('Drop'));
+$titles['Primary'] = PMA_getIcon('b_primary.png', __('Primary'));
+$titles['Index'] = PMA_getIcon('b_index.png', __('Index'));
+$titles['Unique'] = PMA_getIcon('b_unique.png', __('Unique'));
+$titles['Spatial'] = PMA_getIcon('b_spatial.png', __('Spatial'));
+$titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Fulltext'));
+$titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Primary'));
+$titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Index'));
+$titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Unique'));
+$titles['NoSpatial'] = PMA_getIcon('bd_spatial.png', __('Spatial'));
+$titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Fulltext'));
+$titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'));
// hidden action titles (image and string)
$hidden_titles = array();
-$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), false, true);
-$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Add primary key'), false, true);
-$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Add primary key'), false, true);
-$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Add index'), false, true);
-$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Add index'), false, true);
-$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Add unique index'), false, true);
-$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Add unique index'), false, true);
-$hidden_titles['Spatial'] = PMA_getIcon('b_spatial.png', __('Add SPATIAL index'), false, true);
-$hidden_titles['NoSpatial'] = PMA_getIcon('bd_spatial.png', __('Add SPATIAL index'), false, true);
-$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Add FULLTEXT index'), false, true);
-$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Add FULLTEXT index'), false, true);
+$hidden_titles['BrowseDistinctValues'] = PMA_getIcon('b_browse.png', __('Browse distinct values'), true);
+$hidden_titles['Primary'] = PMA_getIcon('b_primary.png', __('Add primary key'), true);
+$hidden_titles['NoPrimary'] = PMA_getIcon('bd_primary.png', __('Add primary key'), true);
+$hidden_titles['Index'] = PMA_getIcon('b_index.png', __('Add index'), true);
+$hidden_titles['NoIndex'] = PMA_getIcon('bd_index.png', __('Add index'), true);
+$hidden_titles['Unique'] = PMA_getIcon('b_unique.png', __('Add unique index'), true);
+$hidden_titles['NoUnique'] = PMA_getIcon('bd_unique.png', __('Add unique index'), true);
+$hidden_titles['Spatial'] = PMA_getIcon('b_spatial.png', __('Add SPATIAL index'), true);
+$hidden_titles['NoSpatial'] = PMA_getIcon('bd_spatial.png', __('Add SPATIAL index'), true);
+$hidden_titles['IdxFulltext'] = PMA_getIcon('b_ftext.png', __('Add FULLTEXT index'), true);
+$hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Add FULLTEXT index'), true);
/**
* Displays the table structure ('show table' works correct since 3.23.03)
diff --git a/test/libraries/common/PMA_buildActionTitles_test.php b/test/libraries/common/PMA_buildActionTitles_test.php
index 6f23544..f6579da 100644
--- a/test/libraries/common/PMA_buildActionTitles_test.php
+++ b/test/libraries/common/PMA_buildActionTitles_test.php
@@ -24,23 +24,23 @@ class PMA_buildActionTitles_test extends PHPUnit_Framework_TestCase{
function testBuildActionTitles(){
$titles = array();
- $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'), true);
- $titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'), true);
- $titles['Search'] = PMA_getIcon('b_select.png', __('Search'), true);
- $titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'), true);
- $titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'), true);
- $titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'), true);
- $titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'), true);
- $titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'), true);
- $titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'), true);
- $titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'), true);
- $titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'), true);
- $titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'), true);
- $titles['NoEdit'] = PMA_getIcon('bd_edit.png', __('Edit'), true);
- $titles['Export'] = PMA_getIcon('b_export.png', __('Export'), true);
- $titles['NoExport'] = PMA_getIcon('bd_export.png', __('Export'), true);
- $titles['Execute'] = PMA_getIcon('b_nextpage.png', __('Execute'), true);
- $titles['NoExecute'] = PMA_getIcon('bd_nextpage.png', __('Execute'), true);
+ $titles['Browse'] = PMA_getIcon('b_browse.png', __('Browse'));
+ $titles['NoBrowse'] = PMA_getIcon('bd_browse.png', __('Browse'));
+ $titles['Search'] = PMA_getIcon('b_select.png', __('Search'));
+ $titles['NoSearch'] = PMA_getIcon('bd_select.png', __('Search'));
+ $titles['Insert'] = PMA_getIcon('b_insrow.png', __('Insert'));
+ $titles['NoInsert'] = PMA_getIcon('bd_insrow.png', __('Insert'));
+ $titles['Structure'] = PMA_getIcon('b_props.png', __('Structure'));
+ $titles['Drop'] = PMA_getIcon('b_drop.png', __('Drop'));
+ $titles['NoDrop'] = PMA_getIcon('bd_drop.png', __('Drop'));
+ $titles['Empty'] = PMA_getIcon('b_empty.png', __('Empty'));
+ $titles['NoEmpty'] = PMA_getIcon('bd_empty.png', __('Empty'));
+ $titles['Edit'] = PMA_getIcon('b_edit.png', __('Edit'));
+ $titles['NoEdit'] = PMA_getIcon('bd_edit.png', __('Edit'));
+ $titles['Export'] = PMA_getIcon('b_export.png', __('Export'));
+ $titles['NoExport'] = PMA_getIcon('bd_export.png', __('Export'));
+ $titles['Execute'] = PMA_getIcon('b_nextpage.png', __('Execute'));
+ $titles['NoExecute'] = PMA_getIcon('bd_nextpage.png', __('Execute'));
$this->assertEquals($titles, PMA_buildActionTitles());
diff --git a/test/libraries/common/PMA_getIcon_test.php b/test/libraries/common/PMA_getIcon_test.php
index ab21651..7567207 100644
--- a/test/libraries/common/PMA_getIcon_test.php
+++ b/test/libraries/common/PMA_getIcon_test.php
@@ -21,17 +21,17 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{
$this->assertEquals(
'<span class="nowrap"></span>',
- PMA_getIcon('b_comment.png')
+ PMA_getIcon('b_comment.png')
);
}
function testGetIconWithPropertiesIconic(){
-
+
$GLOBALS['cfg']['PropertiesIconic'] = true;
$this->assertEquals(
'<span class="nowrap"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_comment" /></span>',
- PMA_getIcon('b_comment.png')
+ PMA_getIcon('b_comment.png')
);
}
@@ -47,20 +47,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{
);
}
- function testGetIconWithContainer(){
-
- $GLOBALS['cfg']['PropertiesIconic'] = true;
- $alternate_text = 'alt_str';
-
- $this->assertEquals(
- '<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text
- . '" class="icon ic_b_comment" /></span>',
- PMA_getIcon('b_comment.png', $alternate_text, true)
- );
-
- }
-
- function testGetIconWithContainerAndForceText(){
+ function testGetIconWithForceText(){
$GLOBALS['cfg']['PropertiesIconic'] = true;
$alternate_text = 'alt_str';
@@ -68,7 +55,7 @@ class PMA_getIcon_test extends PHPUnit_Framework_TestCase{
$this->assertEquals(
'<span class="nowrap"><img src="themes/dot.gif" title="' . $alternate_text . '" alt="' . $alternate_text
. '" class="icon ic_b_comment" /> ' . $alternate_text . '</span>',
- PMA_getIcon('b_comment.png', $alternate_text, true, true)
+ PMA_getIcon('b_comment.png', $alternate_text, true)
);
}
hooks/post-receive
--
phpMyAdmin