Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor display_create_table.lib.php #704

Merged
merged 1 commit into from Sep 19, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
64 changes: 40 additions & 24 deletions libraries/display_create_table.lib.php
Expand Up @@ -35,29 +35,45 @@

$is_create_table_priv = true;

?>
<form id="create_table_form_minimal" method="post" action="tbl_create.php">
<fieldset>
<legend>
<?php
if (PMA_Util::showIcons('ActionLinksMode')) {
echo PMA_Util::getImage('b_newtbl.png');
/**
* Returns the html for create table.
*
* @param string $db database name
*
* @return string
*/
function PMA_getHtmlForCreateTable($db)
{
$html = '<form id="create_table_form_minimal" method="post" '
. 'action="tbl_create.php">';
$html .= '<fieldset>';
$html .= '<legend>';

if (PMA_Util::showIcons('ActionLinksMode')) {
$html .= PMA_Util::getImage('b_newtbl.png');
}
$html .= __('Create table');

$html .= ' </legend>';
$html .= PMA_URL_getHiddenInputs($db);
$html .= '<div class="formelement">';
$html .= __('Name') . ":";
$html .= ' <input type="text" name="table" maxlength="64" '
. 'size="30" required />';
$html .= ' </div>';
$html .= ' <div class="formelement">';
$html .= __('Number of columns') . ":";
$html .= ' <input type="number" min="1" name="num_fields" size="2" />';
$html .= ' </div>';
$html .= ' <div class="clearfloat"></div>';
$html .= '</fieldset>';
$html .= '<fieldset class="tblFooters">';
$html .= ' <input type="submit" value="' . __('Go') . '" />';
$html .= '</fieldset>';
$html .= '</form>';

return $html;
}
echo __('Create table');

echo PMA_getHtmlForCreateTable($db);
?>
</legend>
<?php echo PMA_URL_getHiddenInputs($db); ?>
<div class="formelement">
<?php echo __('Name'); ?>:
<input type="text" name="table" maxlength="64" size="30" required />
</div>
<div class="formelement">
<?php echo __('Number of columns'); ?>:
<input type="number" min="1" name="num_fields" size="2" />
</div>
<div class="clearfloat"></div>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?php echo __('Go'); ?>" />
</fieldset>
</form>