optional auto-select

This commit is contained in:
Marc Delisle
2002-08-15 17:32:14 +00:00
parent b2ee62d970
commit 591c729ad6
2 changed files with 6 additions and 2 deletions

View File

@@ -336,6 +336,7 @@ $cfg['TextareaCols'] = 40; // textarea size (columns) in edit m
// (this value will be emphasized (*2) for sql // (this value will be emphasized (*2) for sql
// query textareas) // query textareas)
$cfg['TextareaRows'] = 7; // textarea size (rows) in edit mode $cfg['TextareaRows'] = 7; // textarea size (rows) in edit mode
$cfg['TextareaAutoSelect'] = TRUE; // autoselect when clicking in the textarea of the querybox
$cfg['LimitChars'] = 50; // max field data length in browse mode $cfg['LimitChars'] = 50; // max field data length in browse mode
$cfg['ModifyDeleteAtLeft'] = TRUE; // show edit/delete links on left side of browse $cfg['ModifyDeleteAtLeft'] = TRUE; // show edit/delete links on left side of browse
// (or at the top with vertical browse) // (or at the top with vertical browse)

View File

@@ -81,8 +81,11 @@ for ($i = 0 ; $i < $fields_cnt; $i++) {
<input type="button" name="insert" value="<?php echo($strInsert); ?>" onclick="sqlform.sql_query.value = sqlform.sql_query.value + sqlform.dummy.value" /> <input type="button" name="insert" value="<?php echo($strInsert); ?>" onclick="sqlform.sql_query.value = sqlform.sql_query.value + sqlform.dummy.value" />
<br /> <br />
<div style="margin-bottom: 5px"> <div style="margin-bottom: 5px">
<textarea name="sql_query" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>" <textarea name="sql_query" rows="<?php echo $cfg['TextareaRows']; ?>" cols="<?php echo $cfg['TextareaCols'] * 2; ?>" wrap="virtual" dir="<?php echo $text_dir; ?>"<?php
onfocus="if (typeof(document.layers) == 'undefined' || typeof(textarea_selected) == 'undefined') {textarea_selected = 1; this.form.elements['sql_query'].select();}"> if ($cfg['TextareaAutoSelect']) {
echo "\n" . ' onfocus="if (typeof(document.layers) == \'undefined\' || typeof(textarea_selected) == \'undefined\') {textarea_selected = 1; this.form.elements[\'sql_query\'].select();}"';
}
?>>
<?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE 1'); ?> <?php echo ((!empty($query_to_display)) ? htmlspecialchars($query_to_display) : 'SELECT * FROM ' . PMA_backquote($table) . ' WHERE 1'); ?>
</textarea><br /> </textarea><br />
<input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />&nbsp; <input type="checkbox" name="show_query" value="1" id="checkbox_show_query" checked="checked" />&nbsp;