Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2013-01-21 21:56:21 +01:00
commit 045faa7261

View File

@ -72,7 +72,7 @@ if (isset($_REQUEST['createview'])) {
$view_columns = explode(',', $_REQUEST['view']['column_names']);
}
$column_map = PMA_getColumnMap($_REQUEST['view']['as'], $view_columns);
$column_map = PMA_getColumnMap($_REQUEST['view']['as'], $view_columns);
$pma_tranformation_data = PMA_getExistingTranformationData($GLOBALS['db']);
if ($pma_tranformation_data !== false) {
@ -143,90 +143,92 @@ $url_params['reload'] = 1;
/**
* Displays the page
*/
?>
<!-- CREATE VIEW options -->
<div id="div_view_options">
<form method="post" action="view_create.php">
<?php echo PMA_generate_common_hidden_inputs($url_params); ?>
<fieldset>
<legend><?php echo __('Create view') . PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_VIEW'); ?></legend>
<table class="rte_table">
<tr><td><label for="or_replace">OR REPLACE</label></td>
<td><input type="checkbox" name="view[or_replace]" id="or_replace"
<?php if ($view['or_replace']) { ?>
checked="checked"
<?php } ?>
value="1" />
</td>
</tr>
<tr>
<td><label for="algorithm">ALGORITHM</label></td>
<td><select name="view[algorithm]" id="algorithm">
<?php
foreach ($view_algorithm_options as $option) {
echo '<option value="' . htmlspecialchars($option) . '"';
if ($view['algorithm'] === $option) {
echo 'selected="selected"';
}
echo '>' . htmlspecialchars($option) . '</option>';
}
?>
</select>
</td>
</tr>
<tr><td><?php echo __('VIEW name'); ?></td>
<td><input type="text" size="20" name="view[name]" onfocus="this.select()"
value="<?php echo htmlspecialchars($view['name']); ?>" />
</td>
</tr>
<tr><td><?php echo __('Column names'); ?></td>
<td><input type="text" maxlength="100" size="50" name="view[column_names]"
onfocus="this.select()"
value="<?php echo htmlspecialchars($view['column_names']); ?>" />
</td>
</tr>
<tr><td>AS</td>
<td>
<textarea name="view[as]" rows="<?php echo $cfg['TextareaRows']; ?>"
cols="<?php echo $cfg['TextareaCols']; ?>"
dir="<?php echo $text_dir; ?>"<?php
if ($GLOBALS['cfg']['TextareaAutoSelect'] || true) {
echo ' onclick="selectContent(this, sql_box_locked, true)"';
}
?>><?php echo htmlspecialchars($view['as']); ?></textarea>
</td>
</tr>
<tr><td>WITH</td>
<td>
<?php
foreach ($view_with_options as $option) {
echo '<input type="checkbox" name="view[with][]"';
if (in_array($option, $view['with'])) {
echo ' checked="checked"';
}
echo ' id="view_with_' . str_replace(' ', '_', htmlspecialchars($option)) . '"';
echo ' value="' . htmlspecialchars($option) . '" />';
echo '<label for="view_with_' . str_replace(' ', '_', htmlspecialchars($option)) . '">&nbsp;';
echo htmlspecialchars($option) . '</label><br />';
}
?>
</td>
</tr>
</table>
</fieldset>
<?php
if ($GLOBALS['is_ajax_request'] != true) {
?>
<fieldset class="tblFooters">
<input type="submit" name="createview" value="<?php echo __('Go'); ?>" />
</fieldset>
<?php
} else {
?>
<input type="hidden" name="createview" value="1" />
<input type="hidden" name="ajax_request" value="1" />
<?php
$htmlString = '<!-- CREATE VIEW options -->'
. '<div id="div_view_options">'
. '<form method="post" action="view_create.php">'
. PMA_generate_common_hidden_inputs($url_params)
. '<fieldset>'
. '<legend>' . __('Create view')
. PMA_Util::showMySQLDocu('SQL-Syntax', 'CREATE_VIEW') . '</legend>'
. '<table class="rte_table">'
. '<tr><td><label for="or_replace">OR REPLACE</label></td>'
. '<td><input type="checkbox" name="view[or_replace]" id="or_replace"';
if ($view['or_replace']) {
$htmlString .= ' checked="checked"';
}
$htmlString .= ' value="1" />'
. '</td>'
. '</tr>'
. '<tr>'
. '<td><label for="algorithm">ALGORITHM</label></td>'
. '<td><select name="view[algorithm]" id="algorithm">';
foreach ($view_algorithm_options as $option) {
$htmlString .= '<option value="' . htmlspecialchars($option) . '"';
if ($view['algorithm'] === $option) {
$htmlString .= ' selected="selected"';
}
?>
</form>
</div>
$htmlString .= '>' . htmlspecialchars($option) . '</option>';
}
$htmlString .= '</select>'
. '</td>'
. '</tr>'
. '<tr><td>' . __('VIEW name') . '</td>'
. '<td><input type="text" size="20" name="view[name]" onfocus="this.select()"'
. ' value="' . htmlspecialchars($view['name']) . '" />'
. '</td>'
. '</tr>'
. '<tr><td>' . __('Column names') . '</td>'
. '<td><input type="text" maxlength="100" size="50" name="view[column_names]"'
. ' onfocus="this.select()"'
. ' value="' . htmlspecialchars($view['column_names']) . '" />'
. '</td>'
. '</tr>'
. '<tr><td>AS</td>'
. '<td>'
. '<textarea name="view[as]" rows="' . $cfg['TextareaRows'] . '"'
. ' cols="' . $cfg['TextareaCols'] . '"'
. ' dir="' . $text_dir . '"';
if ($GLOBALS['cfg']['TextareaAutoSelect'] || true) {
$htmlString .= ' onclick="selectContent(this, sql_box_locked, true)"';
}
$htmlString .= '>' . htmlspecialchars($view['as']) . '</textarea>'
. '</td>'
. '</tr>'
. '<tr><td>WITH</td>'
. '<td>';
foreach ($view_with_options as $option) {
$htmlString .= '<input type="checkbox" name="view[with][]"';
if (in_array($option, $view['with'])) {
$htmlString .= ' checked="checked"';
}
$htmlString .= ' id="view_with_'
. str_replace(' ', '_', htmlspecialchars($option)) . '"'
. ' value="' . htmlspecialchars($option) . '" />'
. '<label for="view_with_' . str_replace(' ', '_', htmlspecialchars($option))
. '">&nbsp;'
. htmlspecialchars($option) . '</label><br />';
}
$htmlString .= '</td>'
. '</tr>'
. '</table>'
. '</fieldset>';
if ($GLOBALS['is_ajax_request'] != true) {
$htmlString .= '<fieldset class="tblFooters">'
. '<input type="submit" name="createview" value="' . __('Go') . '" />'
. '</fieldset>';
} else {
$htmlString .= '<input type="hidden" name="createview" value="1" />'
. '<input type="hidden" name="ajax_request" value="1" />';
}
$htmlString .= '</form>'
. '</div>';
echo $htmlString;