Merge remote-tracking branch 'origin/pull/11995'

This commit is contained in:
Michal Čihař 2016-02-22 08:27:21 +01:00
commit a7ebe79d29
17 changed files with 46 additions and 163 deletions

View File

@ -4834,23 +4834,23 @@ class DisplayResults
. '<i style="margin-left: 2em">' . __('With selected:') . '</i>' . "\n";
$links_html .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_change',
'submit_mult', 'mult_submit',
__('Edit'), 'b_edit.png', 'edit'
);
$links_html .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_copy',
'submit_mult', 'mult_submit',
__('Copy'), 'b_insrow.png', 'copy'
);
$links_html .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_delete',
'submit_mult', 'mult_submit',
$delete_text, 'b_drop.png', 'delete'
);
if ($analyzed_sql_results['querytype'] == 'SELECT') {
$links_html .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
'submit_mult', 'mult_submit',
__('Export'), 'b_tblexport.png', 'export'
);
}

View File

@ -68,17 +68,6 @@ class Scripts
continue;
}
$include = true;
if ($value['conditional_ie'] !== false
&& PMA_USR_BROWSER_AGENT === 'IE'
) {
if ($value['conditional_ie'] === true) {
$include = true;
} else if ($value['conditional_ie'] == PMA_USR_BROWSER_VER) {
$include = true;
} else {
$include = false;
}
}
if ($include) {
$scripts[] = "scripts%5B%5D=" . $value['filename'];
}
@ -117,8 +106,6 @@ class Scripts
* Adds a new file to the list of scripts
*
* @param string $filename The name of the file to include
* @param bool $conditional_ie Whether to wrap the script tag in
* conditional comments for IE
* @param bool $before_statics Whether this dynamic script should be
* included before the static ones
*
@ -126,7 +113,6 @@ class Scripts
*/
public function addFile(
$filename,
$conditional_ie = false,
$before_statics = false
) {
$hash = md5($filename);
@ -138,7 +124,6 @@ class Scripts
$this->_files[$hash] = array(
'has_onload' => $has_onload,
'filename' => $filename,
'conditional_ie' => $conditional_ie,
'before_statics' => $before_statics
);
}
@ -147,15 +132,13 @@ class Scripts
* Add new files to the list of scripts
*
* @param array $filelist The array of file names
* @param bool $conditional_ie Whether to wrap the script tag in
* conditional comments for IE
*
* @return void
*/
public function addFiles($filelist, $conditional_ie = false)
public function addFiles($filelist)
{
foreach ($filelist as $filename) {
$this->addFile($filename, $conditional_ie);
$this->addFile($filename);
}
}
@ -226,13 +209,11 @@ class Scripts
if (strpos($file['filename'], "?") !== false) {
continue;
}
$retval[] = array(
'name' => $file['filename'],
'fire' => $file['has_onload']
);
if (! $file['conditional_ie'] || PMA_USR_BROWSER_AGENT == 'IE') {
$retval[] = array(
'name' => $file['filename'],
'fire' => $file['has_onload']
);
}
}
return $retval;
}

View File

@ -429,20 +429,6 @@ class Theme
return $retval;
}
/**
* Remove filter for IE.
*
* @return string CSS code.
*/
function getCssIEClearFilter()
{
return PMA_USR_BROWSER_AGENT == 'IE'
&& PMA_USR_BROWSER_VER >= 6
&& PMA_USR_BROWSER_VER <= 8
? 'filter: none'
: '';
}
/**
* Gets currently configured font size.
*
@ -491,15 +477,6 @@ class Theme
// Opera 11.10
$result[] = 'background: -o-linear-gradient(top, #'
. $start_color . ', #' . $end_color . ');';
// IE 6-8
if (PMA_USR_BROWSER_AGENT == 'IE'
&& PMA_USR_BROWSER_VER >= 6
&& PMA_USR_BROWSER_VER <= 8
) {
$result[] = 'filter: '
. 'progid:DXImageTransform.Microsoft.gradient(startColorstr="#'
. $start_color . '", endColorstr="#' . $end_color . '");';
}
return implode("\n", $result);
}
}

View File

@ -2374,7 +2374,6 @@ class Util
*
* @param string $button_name name of button element
* @param string $button_class class of button or image element
* @param string $image_name name of image element
* @param string $text text to display
* @param string $image image to display
* @param string $value value
@ -2384,36 +2383,21 @@ class Util
* @access public
*/
public static function getButtonOrImage(
$button_name, $button_class, $image_name, $text, $image, $value = ''
$button_name, $button_class, $text, $image, $value = ''
) {
if ($value == '') {
$value = $text;
}
if ($GLOBALS['cfg']['ActionLinksMode'] == 'text') {
return ' <input type="submit" name="' . $button_name . '"'
. ' value="' . htmlspecialchars($value) . '"'
. ' title="' . htmlspecialchars($text) . '" />' . "\n";
}
/* Opera has trouble with <input type="image"> */
/* IE (before version 9) has trouble with <button> */
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER < 9) {
return '<input type="image" name="' . $image_name
. '" class="' . $button_class
. '" value="' . htmlspecialchars($value)
. '" title="' . htmlspecialchars($text)
. '" src="' . $GLOBALS['pmaThemeImage'] . $image . '" />'
. ($GLOBALS['cfg']['ActionLinksMode'] == 'both'
? '&nbsp;' . htmlspecialchars($text)
: '') . "\n";
} else {
return '<button class="' . $button_class . '" type="submit"'
. ' name="' . $button_name . '" value="' . htmlspecialchars($value)
. '" title="' . htmlspecialchars($text) . '">' . "\n"
. self::getIcon($image, $text)
. '</button>' . "\n";
}
return '<button class="' . $button_class . '" type="submit"'
. ' name="' . $button_name . '" value="' . htmlspecialchars($value)
. '" title="' . htmlspecialchars($text) . '">' . "\n"
. self::getIcon($image, $text)
. '</button>' . "\n";
} // end function
/**
@ -4983,4 +4967,3 @@ class Util
return $result;
}
}

View File

@ -1188,11 +1188,10 @@ function PMA_getCentralColumnsTableFooter($pmaThemeImage, $text_dir)
);
$html_output .= Util::getButtonOrImage(
'edit_central_columns', 'mult_submit change_central_columns',
'submit_mult_change', __('Edit'), 'b_edit.png', 'edit central columns'
__('Edit'), 'b_edit.png', 'edit central columns'
);
$html_output .= Util::getButtonOrImage(
'delete_central_columns', 'mult_submit',
'submit_mult_central_columns_remove',
__('Delete'), 'b_drop.png',
'remove_from_central_columns'
);

View File

@ -383,7 +383,6 @@ class ServerDatabasesController extends Controller
$html .= Util::getButtonOrImage(
'',
'mult_submit' . ' ajax',
'drop_selected_dbs',
__('Drop'), 'b_deltbl.png'
);

View File

@ -569,18 +569,6 @@ function PMA_noCacheHeader()
'Cache-Control: no-store, no-cache, must-revalidate,'
. ' pre-check=0, post-check=0, max-age=0'
);
if (PMA_USR_BROWSER_AGENT == 'IE') {
/* On SSL IE sometimes fails with:
*
* Internet Explorer was not able to open this Internet site. The
* requested site is either unavailable or cannot be found. Please
* try again later.
*
* Adding Pragma: public fixes this.
*/
header('Pragma: public');
return;
}
header('Pragma: no-cache'); // HTTP/1.0
// test case: exporting a database into a .gz file with Safari

View File

@ -23,11 +23,7 @@ function PMA_getHtmlForChangePassword($mode, $username, $hostname)
* autocomplete feature of IE kills the "onchange" event handler and it
* must be replaced by the "onpropertychange" one in this case
*/
$chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE'
&& PMA_USR_BROWSER_VER >= 5
&& PMA_USR_BROWSER_VER < 7)
? 'onpropertychange'
: 'onchange';
$chg_evt_handler = 'onchange';
$is_privileges = basename($_SERVER['SCRIPT_NAME']) === 'server_privileges.php';

View File

@ -145,11 +145,11 @@ function PMA_RTE_getList($type, $items)
$GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], 'rteListForm'
);
$retval .= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
'submit_mult', 'mult_submit',
__('Export'), 'b_export.png', 'export'
);
$retval .= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_drop',
'submit_mult', 'mult_submit',
__('Drop'), 'b_drop.png', 'drop'
);
$retval .= '</div>';

View File

@ -2509,7 +2509,7 @@ function PMA_getHtmlForSpecificDbPrivileges($db)
$GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], "usersForm"
);
$html_output .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
'submit_mult', 'mult_submit',
__('Export'), 'b_tblexport.png', 'export'
);
@ -2588,7 +2588,7 @@ function PMA_getHtmlForSpecificTablePrivileges($db, $table)
$GLOBALS['pmaThemeImage'], $GLOBALS['text_dir'], "usersForm"
);
$html_output .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
'submit_mult', 'mult_submit',
__('Export'), 'b_tblexport.png', 'export'
);
@ -3604,7 +3604,7 @@ function PMA_getUsersOverview($result, $db_rights, $pmaThemeImage, $text_dir)
. Util::getWithSelected($pmaThemeImage, $text_dir, "usersForm") . "\n";
$html_output .= Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_export',
'submit_mult', 'mult_submit',
__('Export'), 'b_tblexport.png', 'export'
);
$html_output .= '<input type="hidden" name="initial" '

View File

@ -359,7 +359,7 @@ function PMA_getHtmlForTableVersionDetails(
"versionsForm"
);
$html .= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_delete_version',
'submit_mult', 'mult_submit',
__('Delete version'), 'b_drop.png', 'delete_version'
);
@ -1492,7 +1492,7 @@ function PMA_displayUntrackedTables(
"untrackedForm"
);
echo PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_track',
'submit_mult', 'mult_submit',
__('Track table'), 'eye.png', 'track'
);
?>
@ -1712,7 +1712,7 @@ function PMA_displayTrackedTables(
"trackedForm"
);
echo PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_delete_tracking',
'submit_mult', 'mult_submit',
__('Delete tracking'), 'b_drop.png', 'delete_tracking'
);
?>

View File

@ -14,21 +14,14 @@
define('PMA_MINIMUM_COMMON', true);
require_once 'libraries/common.inc.php';
// MSIE 6 (at least some unpatched versions) has problems loading CSS
// when zlib_compression is on
if (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER == '6'
&& (ini_get('zlib.output_compression'))
) {
@ini_set('zlib.output_compression', 'Off');
} else {
$buffer = OutputBuffering::getInstance();
$buffer->start();
register_shutdown_function(
function () {
echo OutputBuffering::getInstance()->getContents();
}
);
}
$buffer = OutputBuffering::getInstance();
$buffer->start();
register_shutdown_function(
function () {
echo OutputBuffering::getInstance()->getContents();
}
);
// Send correct type:
header('Content-Type: text/css; charset=UTF-8');

View File

@ -111,12 +111,7 @@ $_form_params = PMA_getFormParametersForInsertForm(
*/
// autocomplete feature of IE kills the "onchange" event handler and it
// must be replaced by the "onpropertychange" one in this case
$chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE'
&& PMA_USR_BROWSER_VER >= 5
&& PMA_USR_BROWSER_VER < 7
)
? 'onpropertychange'
: 'onchange';
$chg_evt_handler = 'onchange';
// Had to put the URI because when hosted on an https server,
// some browsers send wrongly this form to the http server.

View File

@ -1,31 +1,31 @@
<div class="print_ignore" >
<?= PMA\libraries\Util::getWithSelected($pmaThemeImage, $text_dir, "fieldsForm") ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_browse',
'submit_mult', 'mult_submit',
__('Browse'), 'b_browse.png', 'browse'
) ?>
<?php if (! $tbl_is_view && ! $db_is_system_schema): ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit change_columns_anchor ajax',
'submit_mult_change', __('Change'), 'b_edit.png', 'change'
__('Change'), 'b_edit.png', 'change'
) ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_drop',
'submit_mult', 'mult_submit',
__('Drop'), 'b_drop.png', 'drop'
) ?>
<?php if ('ARCHIVE' != $tbl_storage_engine): ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_primary',
'submit_mult', 'mult_submit',
__('Primary'), 'b_primary.png', 'primary'
) ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_unique',
'submit_mult', 'mult_submit',
__('Unique'), 'b_unique.png', 'unique'
) ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_index',
'submit_mult', 'mult_submit',
__('Index'), 'b_index.png', 'index'
) ?>
@ -34,19 +34,19 @@
|| $tbl_storage_engine == 'ARIA'
|| $tbl_storage_engine == 'MARIA')): ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_fulltext',
'submit_mult', 'mult_submit',
__('Fulltext'), 'b_ftext.png', 'ftext'
) ?>
<?php endif; ?>
<?php if ($GLOBALS['cfgRelation']['centralcolumnswork']): ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_central_columns_add',
'submit_mult', 'mult_submit',
__('Add to central columns'), 'centralColumns_add.png',
'add_to_central_columns'
) ?>
<?= PMA\libraries\Util::getButtonOrImage(
'submit_mult', 'mult_submit', 'submit_mult_central_columns_remove',
'submit_mult', 'mult_submit',
__('Remove from central columns'), 'centralColumns_delete.png',
'remove_from_central_columns'
) ?>

View File

@ -90,8 +90,7 @@ class ScriptsTest extends PMATestCase
array(
array(
'has_onload' => false,
'filename' => 'common.js',
'conditional_ie' => false
'filename' => 'common.js'
)
)
)
@ -187,7 +186,6 @@ $(function() {});
$hash => array(
'has_onload' => 1,
'filename' => 'common.js',
'conditional_ie' => false,
'before_statics' => false
)
);
@ -198,15 +196,6 @@ $(function() {});
$this->object
);
// Add same script file again w/
// conditional_ie true
$this->object->addFile($file, true);
// No change in _files as file was already added
$this->assertAttributeEquals(
$_files,
'_files',
$this->object
);
}
/**
@ -225,17 +214,15 @@ $(function() {});
'd7716810d825f4b55d18727c3ccb24e6' => array(
'has_onload' => 1,
'filename' => 'common.js',
'conditional_ie' => true,
'before_statics' => false
),
'347a57484fcd6ea6d8a125e6e1d31f78' => array(
'has_onload' => 1,
'filename' => 'sql.js',
'conditional_ie' => true,
'before_statics' => false
),
);
$this->object->addFiles($filenames, true);
$this->object->addFiles($filenames);
$this->assertAttributeEquals(
$_files,
'_files',

View File

@ -331,19 +331,6 @@ class ThemeTest extends PMATestCase
);
}
/**
* Test for getCssIEClearFilter
*
* @return void
*/
public function testGetCssIEClearFilter()
{
$this->assertEquals(
$this->object->getCssIEClearFilter(),
''
);
}
/**
* Test for getFontSize
*

View File

@ -542,7 +542,6 @@ button.mult_submit {
table tr.odd th,
.odd {
background: #fff;
<?php echo $_SESSION['PMA_Theme']->getCssIEClearFilter(); ?>
}
/* even items 2,4,6,8,... */
@ -550,7 +549,6 @@ table tr.odd th,
table tr.even th,
.even {
background: #DFDFDF;
<?php echo $_SESSION['PMA_Theme']->getCssIEClearFilter(); ?>
}
/* odd table rows 1,3,5,7,... */