New function PMA_buttonOrImage to display button or image to submit form and not to duplicate code on all places.
This commit is contained in:
@@ -2278,6 +2278,32 @@ if (typeof(document.getElementById) != 'undefined'
|
||||
return preg_replace('|\s?AND$|', '', $uva_condition);
|
||||
} // end function
|
||||
|
||||
/**
|
||||
* Function to generate unique condition for specified row.
|
||||
*
|
||||
* @param string name of button element
|
||||
* @param string class of button element
|
||||
* @param string name of image element
|
||||
* @param string text to display
|
||||
* @param string image to display
|
||||
*
|
||||
* @access public
|
||||
* @author Michal Cihar (michal@cihar.com)
|
||||
*/
|
||||
function PMA_buttonOrImage($button_name, $button_class, $image_name, $text, $image) {
|
||||
global $pmaThemeImage, $propicon;
|
||||
|
||||
/* Opera has trouble with <input type="image"> */
|
||||
/* IE has trouble with <button> */
|
||||
if (PMA_USR_BROWSER_AGENT != 'IE') {
|
||||
echo '<button class="' . $button_class . '" type="submit" name="' . $button_name . '" value="' . $text . '" title="' . $text . '">' . "\n"
|
||||
. '<img src="' . $pmaThemeImage . $image . '" title="' . $text . '" alt="' . $text . '" width="16" height="16" />' . (($propicon == 'both') ? ' ' . $text : '') . "\n"
|
||||
. '</button>' . "\n";
|
||||
} else {
|
||||
echo '<input type="image" name="' . $image_name . '" value="' .$text . '" title="' . $text . '" src="' . $pmaThemeImage . $image . '" />' . (($propicon == 'both') ? ' ' . $text : '') . "\n";
|
||||
}
|
||||
} // end function
|
||||
|
||||
} // end if: minimal common.lib needed?
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user