]> git.joonet.de Git - adminer.git/commitdiff
Automatically select name for trigger
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 30 Jun 2008 11:57:47 +0000 (11:57 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 30 Jun 2008 11:57:47 +0000 (11:57 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@425 7c3ca157-0c34-0410-bff1-cbf682f78f5c

trigger.inc.php

index c49fff59ecaa2ba2b9cdca21fbfa09192c527df2..936b73270dd9b26f7c1473127ba80b11a51aa42f 100644 (file)
@@ -32,15 +32,15 @@ if ($_POST) {
        }
        $result->free();
 } else {
-       $row = array();
+       $row = array("Trigger" => "$_GET[trigger]_bi");
 }
 ?>
 
 <form action="" method="post" id="form">
 <table border="0" cellspacing="0" cellpadding="2">
+<tr><th><?php echo lang('Time'); ?></th><td><select name="Timing" onchange="if (/^<?php echo htmlspecialchars(preg_quote($_GET["trigger"], "/")); ?>_[ba][iud]$/.test(this.form['Trigger'].value)) this.form['Trigger'].value = '<?php echo htmlspecialchars(addcslashes($_GET["trigger"], "\r\n'\\")); ?>_' + this.value.charAt(0).toLowerCase() + this.form['Event'].value.charAt(0).toLowerCase();"><?php echo optionlist($trigger_time, $row["Timing"]); ?></select></td></tr>
+<tr><th><?php echo lang('Event'); ?></th><td><select name="Event" onchange="this.form['Timing'].onchange();"><?php echo optionlist($trigger_event, $row["Event"]); ?></select></td></tr>
 <tr><th><?php echo lang('Name'); ?></th><td><input name="Trigger" value="<?php echo htmlspecialchars($row["Trigger"]); ?>" maxlength="64" /></td></tr>
-<tr><th><?php echo lang('Time'); ?></th><td><select name="Timing"><?php echo optionlist($trigger_time, $row["Timing"]); ?></select></td></tr>
-<tr><th><?php echo lang('Event'); ?></th><td><select name="Event"><?php echo optionlist($trigger_event, $row["Event"]); ?></select></td></tr>
 </table>
 <p><textarea name="Statement" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["Statement"]); ?></textarea></p>
 <p>