Changed the button elements to input elements to workaround IE bug.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 7 Nov 2008 15:52:22 +0000 (15:52 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 7 Nov 2008 15:52:22 +0000 (15:52 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/extensions/wrreport@313 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrreport.body.php

index 18ddb945a7fa5ca36d890ae6fc3f7b1246fb6df5..7a8a5b30119ce6b58b39748cc4c9d65e6d2f8068 100644 (file)
@@ -94,10 +94,16 @@ function wrReportFormRender($hide_save_button = TRUE, $page_title = NULL, $date_
        $description_html = htmlspecialchars($description);
 
        // Buttons
-       $buttons = '<button name="action" type="submit" value="preview">Vorschau';
-       if ($hide_save_button) $buttons .= ' &amp; Speichern';
-       $buttons .= '</button>';
-       if (!$hide_save_button) $buttons .= '<button name="action" type="submit" value="store">Speichern</button>';
+       // I would like to do it this way, but due to a bug of internet explorer, the <button> element is not useable.
+       //   $buttons = '<button name="action" type="submit" value="preview">Vorschau';
+       //   if ($hide_save_button) $buttons .= ' &amp; Speichern';
+       //   $buttons .= '</button>';
+       //   if (!$hide_save_button) $buttons .= '<button name="action" type="submit" value="store">Speichern</button>';
+       // Workaround: User <input type="submit"/>
+       $buttons = '<input name="preview" type="submit" value="Vorschau';
+       if ($hide_save_button) $buttons .= ' &amp; Speichern'; 
+       $buttons .= '" /> ';
+       if (!$hide_save_button) $buttons .= '<input name="store" type="submit" value="Speichern"/>';
 
        $form = <<<EOT
 <form action="/wiki/Spezial:Bahnberichte" method="post">
@@ -309,7 +315,11 @@ class WrReport extends SpecialPage {
 
                // Get request data
                $action = $wgRequest->getText('action');
-               if ($action === '')  $action = 'view';
+               if (!$action) {
+                       if ($wgRequest->getVal('preview')) $action = 'preview';
+                       elseif ($wgRequest->getVal('store')) $action = 'store';
+                       else $action = 'view';
+               }
                if ($override_action) $action = $override_action;
 
                // Show error message