@@ -53,14 +53,17 @@ discard block |
||
| 53 | 53 | <div class="icon-polls"></div> |
| 54 | 54 | <h2><?php p($l->t('No existing polls.')); ?></h2> |
| 55 | 55 | </div> |
| 56 | - <?php else : ?> |
|
| 56 | + <?php else { |
|
| 57 | + : ?> |
|
| 57 | 58 | <div class="table has-controls"> |
| 58 | 59 | <div class ="row table-header"> |
| 59 | 60 | |
| 60 | 61 | <div class="wrapper group-master"> |
| 61 | 62 | <div class="wrapper group-1"> |
| 62 | 63 | <div class="wrapper group-1-1"> |
| 63 | - <div class="column name"> <?php p($l->t('Title')); ?></div> |
|
| 64 | + <div class="column name"> <?php p($l->t('Title')); |
|
| 65 | +} |
|
| 66 | +?></div> |
|
| 64 | 67 | <div class="column description"></div> |
| 65 | 68 | </div> |
| 66 | 69 | <div class="wrapper group-1-2"> |
@@ -83,7 +86,9 @@ discard block |
||
| 83 | 86 | |
| 84 | 87 | <?php foreach ($_['polls'] as $poll) : ?> |
| 85 | 88 | <?php |
| 86 | - if (!userHasAccess($poll, $userId)) continue; |
|
| 89 | + if (!userHasAccess($poll, $userId)) { |
|
| 90 | + continue; |
|
| 91 | + } |
|
| 87 | 92 | // direct url to poll |
| 88 | 93 | $pollUrl = $urlGenerator->linkToRouteAbsolute('polls.page.goto_poll', array('hash' => $poll->getHash())); |
| 89 | 94 | $owner = $poll->getOwner(); |
@@ -259,12 +264,15 @@ discard block |
||
| 259 | 264 | if (strpos($item, 'group_') == 0) { |
| 260 | 265 | $grp = substr($item, 6); |
| 261 | 266 | foreach ($user_groups as $user_group) { |
| 262 | - if ($user_group == $grp) return true; |
|
| 267 | + if ($user_group == $grp) { |
|
| 268 | + return true; |
|
| 269 | + } |
|
| 263 | 270 | } |
| 264 | - } |
|
| 265 | - else if (strpos($item, 'user_') == 0) { |
|
| 271 | + } else if (strpos($item, 'user_') == 0) { |
|
| 266 | 272 | $usr = substr($item, 5); |
| 267 | - if ($usr == $userId) return true; |
|
| 273 | + if ($usr == $userId) { |
|
| 274 | + return true; |
|
| 275 | + } |
|
| 268 | 276 | } |
| 269 | 277 | } |
| 270 | 278 | return false; |
@@ -80,8 +80,11 @@ discard block |
||
| 80 | 80 | <span> |
| 81 | 81 | <?php if ($isUpdate): ?> |
| 82 | 82 | <?php p($l->t('Edit poll') . ' ' . $poll->getTitle()); ?> |
| 83 | - <?php else: ?> |
|
| 84 | - <?php p($l->t('Create new poll')); ?> |
|
| 83 | + <?php else { |
|
| 84 | + : ?> |
|
| 85 | + <?php p($l->t('Create new poll')); |
|
| 86 | +} |
|
| 87 | +?> |
|
| 85 | 88 | <?php endif; ?> |
| 86 | 89 | </span> |
| 87 | 90 | </div> |
@@ -91,11 +94,20 @@ discard block |
||
| 91 | 94 | <?php if ($isUpdate): ?> |
| 92 | 95 | <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.update_poll')); ?>" method="POST"> |
| 93 | 96 | <input type="hidden" name="pollId" value="<?php p($poll->getId()); ?>" /> |
| 94 | - <?php else: ?> |
|
| 95 | - <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.insert_poll')); ?>" method="POST"> |
|
| 97 | + <?php else { |
|
| 98 | + : ?> |
|
| 99 | + <form name="finish_poll" action="<?php p($urlGenerator->linkToRoute('polls.page.insert_poll')); |
|
| 100 | +} |
|
| 101 | +?>" method="POST"> |
|
| 96 | 102 | <?php endif; ?> |
| 97 | - <input type="hidden" name="chosenDates" id="chosenDates" value="<?php if (isset($chosen)) p($chosen); ?>" /> |
|
| 98 | - <input type="hidden" name="expireTs" id="expireTs" value="<?php if (isset($expireTs)) p($expireTs); ?>" /> |
|
| 103 | + <input type="hidden" name="chosenDates" id="chosenDates" value="<?php if (isset($chosen)) { |
|
| 104 | + p($chosen); |
|
| 105 | +} |
|
| 106 | +?>" /> |
|
| 107 | + <input type="hidden" name="expireTs" id="expireTs" value="<?php if (isset($expireTs)) { |
|
| 108 | + p($expireTs); |
|
| 109 | +} |
|
| 110 | +?>" /> |
|
| 99 | 111 | <input type="hidden" name="userId" id="userId" value="<?php p($userId); ?>" /> |
| 100 | 112 | |
| 101 | 113 | <header class="row"> |
@@ -104,22 +116,40 @@ discard block |
||
| 104 | 116 | <div class="new_poll row"> |
| 105 | 117 | <div class="col-50"> |
| 106 | 118 | <label for="pollTitle" class="input_title"><?php p($l->t('Title')); ?></label> |
| 107 | - <input type="text" class="input_field" id="pollTitle" name="pollTitle" value="<?php if (isset($title)) p($title); ?>" /> |
|
| 119 | + <input type="text" class="input_field" id="pollTitle" name="pollTitle" value="<?php if (isset($title)) { |
|
| 120 | + p($title); |
|
| 121 | +} |
|
| 122 | +?>" /> |
|
| 108 | 123 | <label for="pollDesc" class="input_title"><?php p($l->t('Description')); ?></label> |
| 109 | - <textarea class="input_field" id="pollDesc" name="pollDesc"><?php if (isset($desc)) p($desc); ?></textarea> |
|
| 124 | + <textarea class="input_field" id="pollDesc" name="pollDesc"><?php if (isset($desc)) { |
|
| 125 | + p($desc); |
|
| 126 | +} |
|
| 127 | +?></textarea> |
|
| 110 | 128 | |
| 111 | 129 | <label class="input_title"><?php p($l->t('Access')); ?></label> |
| 112 | 130 | |
| 113 | - <input type="radio" name="accessType" id="private" value="registered" class="radio" <?php if (!$isUpdate || $access == 'registered') print_unescaped('checked'); ?> /> |
|
| 131 | + <input type="radio" name="accessType" id="private" value="registered" class="radio" <?php if (!$isUpdate || $access == 'registered') { |
|
| 132 | + print_unescaped('checked'); |
|
| 133 | +} |
|
| 134 | +?> /> |
|
| 114 | 135 | <label for="private"><?php p($l->t('Registered users only')); ?></label> |
| 115 | 136 | |
| 116 | - <input type="radio" name="accessType" id="hidden" value="hidden" class="radio" <?php if ($isUpdate && $access == 'hidden') print_unescaped('checked'); ?> /> |
|
| 137 | + <input type="radio" name="accessType" id="hidden" value="hidden" class="radio" <?php if ($isUpdate && $access == 'hidden') { |
|
| 138 | + print_unescaped('checked'); |
|
| 139 | +} |
|
| 140 | +?> /> |
|
| 117 | 141 | <label for="hidden"><?php p($l->t('hidden')); ?></label> |
| 118 | 142 | |
| 119 | - <input type="radio" name="accessType" id="public" value="public" class="radio" <?php if ($isUpdate && $access == 'public') print_unescaped('checked'); ?> /> |
|
| 143 | + <input type="radio" name="accessType" id="public" value="public" class="radio" <?php if ($isUpdate && $access == 'public') { |
|
| 144 | + print_unescaped('checked'); |
|
| 145 | +} |
|
| 146 | +?> /> |
|
| 120 | 147 | <label for="public"><?php p($l->t('Public access')); ?></label> |
| 121 | 148 | |
| 122 | - <input type="radio" name="accessType" id="select" value="select" class="radio" <?php if ($isUpdate && $access == 'select') print_unescaped('checked'); ?>> |
|
| 149 | + <input type="radio" name="accessType" id="select" value="select" class="radio" <?php if ($isUpdate && $access == 'select') { |
|
| 150 | + print_unescaped('checked'); |
|
| 151 | +} |
|
| 152 | +?>> |
|
| 123 | 153 | <label for="select"><?php p($l->t('Select')); ?></label> |
| 124 | 154 | <span id="id_label_select">...</span> |
| 125 | 155 | |
@@ -135,9 +165,12 @@ discard block |
||
| 135 | 165 | </div> |
| 136 | 166 | </div> |
| 137 | 167 | |
| 138 | - <input type="hidden" name="accessValues" id="accessValues" value="<?php if ($isUpdate && $access == 'select') p($accessTypes) ?>" /> |
|
| 168 | + <input type="hidden" name="accessValues" id="accessValues" value="<?php if ($isUpdate && $access == 'select') { |
|
| 169 | + p($accessTypes) ?>" /> |
|
| 139 | 170 | |
| 140 | - <input id="isAnonymous" name="isAnonymous" type="checkbox" class="checkbox" <?php $isAnonymous ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); ?> /> |
|
| 171 | + <input id="isAnonymous" name="isAnonymous" type="checkbox" class="checkbox" <?php $isAnonymous ? print_unescaped('value="true" checked') : print_unescaped('value="false"'); |
|
| 172 | +} |
|
| 173 | +?> /> |
|
| 141 | 174 | <label for="isAnonymous" class="input_title"><?php p($l->t('Anonymous')) ?></label> |
| 142 | 175 | |
| 143 | 176 | <div id="anonOptions" style="display:none;"> |
@@ -153,20 +186,32 @@ discard block |
||
| 153 | 186 | </div> |
| 154 | 187 | <div class="col-50"> |
| 155 | 188 | |
| 156 | - <input type="radio" name="pollType" id="event" value="event" class="radio" <?php if (!$isUpdate || $poll->getType() == '0') print_unescaped('checked'); ?> /> |
|
| 189 | + <input type="radio" name="pollType" id="event" value="event" class="radio" <?php if (!$isUpdate || $poll->getType() == '0') { |
|
| 190 | + print_unescaped('checked'); |
|
| 191 | +} |
|
| 192 | +?> /> |
|
| 157 | 193 | <label for="event"><?php p($l->t('Event schedule')); ?></label> |
| 158 | 194 | |
| 159 | 195 | <!-- TODO texts to db --> |
| 160 | - <input type="radio" name="pollType" id="text" value="text" class="radio" <?php if ($isUpdate && $poll->getType() == '1') print_unescaped('checked'); ?>> |
|
| 196 | + <input type="radio" name="pollType" id="text" value="text" class="radio" <?php if ($isUpdate && $poll->getType() == '1') { |
|
| 197 | + print_unescaped('checked'); |
|
| 198 | +} |
|
| 199 | +?>> |
|
| 161 | 200 | <label for="text"><?php p($l->t('Text based')); ?></label> |
| 162 | 201 | |
| 163 | - <div id="date-select-container" <?php if ($isUpdate && $poll->getType() == '1') print_unescaped('style="display:none;"'); ?> > |
|
| 202 | + <div id="date-select-container" <?php if ($isUpdate && $poll->getType() == '1') { |
|
| 203 | + print_unescaped('style="display:none;"'); |
|
| 204 | +} |
|
| 205 | +?> > |
|
| 164 | 206 | <label for="datetimepicker" class="input_title"><?php p($l->t('Dates')); ?></label> |
| 165 | 207 | <input id="datetimepicker" type="text" /> |
| 166 | 208 | <table id="selected-dates-table" class="choices"> |
| 167 | 209 | </table> |
| 168 | 210 | </div> |
| 169 | - <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() == '0') print_unescaped('style="display:none;"'); ?> > |
|
| 211 | + <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() == '0') { |
|
| 212 | + print_unescaped('style="display:none;"'); |
|
| 213 | +} |
|
| 214 | +?> > |
|
| 170 | 215 | <label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label> |
| 171 | 216 | <div class="input-group"> |
| 172 | 217 | <input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" /> |
@@ -182,8 +227,11 @@ discard block |
||
| 182 | 227 | <div class="form-actions"> |
| 183 | 228 | <?php if ($isUpdate): ?> |
| 184 | 229 | <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Update poll')); ?>" /> |
| 185 | - <?php else: ?> |
|
| 186 | - <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Create poll')); ?>" /> |
|
| 230 | + <?php else { |
|
| 231 | + : ?> |
|
| 232 | + <input type="submit" id="submit_finish_poll" class="button btn primary" value="<?php p($l->t('Create poll')); |
|
| 233 | +} |
|
| 234 | +?>" /> |
|
| 187 | 235 | <?php endif; ?> |
| 188 | 236 | <a href="<?php p($urlGenerator->linkToRoute('polls.page.index')); ?>" id="submit_cancel_poll" class="button"><?php p($l->t('Cancel')); ?></a> |
| 189 | 237 | </div> |
@@ -323,7 +323,10 @@ discard block |
||
| 323 | 323 | </form> |
| 324 | 324 | <?php if (User::isLoggedIn()) : ?> |
| 325 | 325 | <span class="notification"> |
| 326 | - <input type="checkbox" id="check_notif" class="checkbox" <?php if ($notification != null) print_unescaped(' checked'); ?> /> |
|
| 326 | + <input type="checkbox" id="check_notif" class="checkbox" <?php if ($notification != null) { |
|
| 327 | + print_unescaped(' checked'); |
|
| 328 | +} |
|
| 329 | +?> /> |
|
| 327 | 330 | <label for="check_notif"><?php p($l->t('Receive notification email on activity')); ?></label> |
| 328 | 331 | </span> |
| 329 | 332 | <?php endif; ?> |
@@ -355,8 +358,11 @@ discard block |
||
| 355 | 358 | <a href="<?php p($urlGenerator->linkToRouteAbsolute('core.login.showLoginForm')); ?>"><?php p($l->t('Login')); ?></a> |
| 356 | 359 | <?php p($l->t('or')); ?> |
| 357 | 360 | <?php print_unescaped('<th id="id_ac_detected" class="external current-user"><input type="text" name="user_name_comm" id="user_name_comm" placeholder="' . $l->t('Your name here') . '" /></th>'); ?> |
| 358 | - <?php else: ?> |
|
| 359 | - <?php p($l->t('Logged in as') . ' ' . $userId); ?> |
|
| 361 | + <?php else { |
|
| 362 | + : ?> |
|
| 363 | + <?php p($l->t('Logged in as') . ' ' . $userId); |
|
| 364 | +} |
|
| 365 | +?> |
|
| 360 | 366 | <?php endif; ?> |
| 361 | 367 | <textarea id="commentBox" name="commentBox"></textarea> |
| 362 | 368 | <p> |
@@ -390,8 +396,11 @@ discard block |
||
| 390 | 396 | </div> |
| 391 | 397 | </div> |
| 392 | 398 | <?php endforeach; ?> |
| 393 | - <?php else : ?> |
|
| 394 | - <?php p($l->t('No comments yet. Be the first.')); ?> |
|
| 399 | + <?php else { |
|
| 400 | + : ?> |
|
| 401 | + <?php p($l->t('No comments yet. Be the first.')); |
|
| 402 | +} |
|
| 403 | +?> |
|
| 395 | 404 | <?php endif; ?> |
| 396 | 405 | </div> |
| 397 | 406 | </div> |