PMA_getHtmlForChangeDatabaseCharset function implementation

This commit is contained in:
Thilina Buddika 2012-07-23 06:01:47 +05:30
parent a80dfa751a
commit c7ee4b3ccd
2 changed files with 52 additions and 36 deletions

View File

@ -430,46 +430,24 @@ if (!$is_information_schema) {
echo PMA_getHtmlForRenameDatabase();
}
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_information_schema
&& (PMA_DRIZZLE || $db != 'mysql')
) {
echo PMA_getHtmlForDropDatabaseLink();
}
/**
* Copy database
*/
echo PMA_getHtmlForCopyDatabase();
// Drop link if allowed
// Don't even try to drop information_schema. You won't be able to. Believe me. You won't.
// Don't allow to easily drop mysql database, RFE #1327514.
if (($is_superuser || $GLOBALS['cfg']['AllowUserDropDatabase'])
&& ! $db_is_information_schema
&& (PMA_DRIZZLE || $db != 'mysql')
) {
echo PMA_getHtmlForDropDatabaseLink();
}
/**
* Copy database
*/
echo PMA_getHtmlForCopyDatabase();
/**
* Change database charset
*/
echo '<div class="operations_half_width"><form id="change_db_charset_form" ';
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax" ';
}
echo 'method="post" action="db_operations.php">'
. PMA_generate_common_hidden_inputs($db, $table)
. '<fieldset>' . "\n"
. ' <legend>';
if ($cfg['PropertiesIconic']) {
echo $common_functions->getImage('s_asci.png');
}
echo ' <label for="select_db_collation">' . __('Collation') . ':</label>' . "\n"
. ' </legend>' . "\n"
. PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION, 'db_collation',
'select_db_collation', $db_collation, false, 3
)
. '</fieldset>'
. '<fieldset class="tblFooters">'
. ' <input type="submit" name="submitcollation"'
. ' value="' . __('Go') . '" />' . "\n"
. '</fieldset>' . "\n"
. '</form></div>' . "\n";
echo PMA_getHtmlForChangeDatabaseCharset();
if ($num_tables > 0
&& ! $cfgRelation['allworks']

View File

@ -204,4 +204,42 @@ function PMA_getHtmlForCopyDatabase()
return $html_output;
}
/**
* Get HTML snippet for change database charset
*
* @return string $html_output
*/
function PMA_getHtmlForChangeDatabaseCharset()
{
$html_output = '<div class="operations_half_width"><form id="change_db_charset_form" ';
if ($GLOBALS['cfg']['AjaxEnable']) {
$html_output .= ' class="ajax" ';
}
$html_output .= 'method="post" action="db_operations.php">';
$html_output .= PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']);
$html_output .= '<fieldset>' . "\n"
. ' <legend>';
if ($GLOBALS['cfg']['PropertiesIconic']) {
$html_output .= PMA_CommonFunctions::getInstance()->getImage('s_asci.png');
}
$html_output .= '<label for="select_db_collation">' . __('Collation') . ':</label>' . "\n"
. '</legend>' . "\n"
. PMA_generateCharsetDropdownBox(
PMA_CSDROPDOWN_COLLATION, 'db_collation',
'select_db_collation',
(isset ($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : ''),
false, 3
)
. '</fieldset>'
. '<fieldset class="tblFooters">'
. '<input type="submit" name="submitcollation"'
. ' value="' . __('Go') . '" />' . "\n"
. '</fieldset>' . "\n"
. '</form></div>' . "\n";
return $html_output;
}
?>