]> source.dussan.org Git - nextcloud-server.git/commitdiff
Take setting default value out of loop
authorBart Visscher <bartv@thisnet.nl>
Fri, 30 Sep 2011 23:14:09 +0000 (01:14 +0200)
committerBart Visscher <bartv@thisnet.nl>
Mon, 3 Oct 2011 18:42:47 +0000 (20:42 +0200)
apps/calendar/templates/part.eventform.php

index 4c34b3e1fcc02cc316ee1c0912f8dff3f7f527be..8588b9168f7bb03bee5e60c1cda4e831b4661662 100644 (file)
@@ -12,8 +12,8 @@
                        <td>
                        <select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
                                <?php
+                               if (!isset($_['categories'])) {$_['categories'] = array();}
                                foreach($_['category_options'] as $category){
-                                       if (!isset($_['categories'])) {$_['categories'] = array();}
                                        echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
                                }
                                ?>
@@ -22,8 +22,8 @@
                        <td>
                        <select style="width:140px;" name="calendar">
                                <?php
+                               if (!isset($_['calendar'])) {$_['calendar'] = false;}
                                foreach($_['calendar_options'] as $calendar){
-                                       if (!isset($_['calendar'])) {$_['calendar'] = false;}
                                        echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
                                }
                                ?>