@@ -24,11 +24,12 @@ discard block |
||
24 | 24 | <h3 class="catbg">', $txt['paid_' . $context['action_type'] . '_subscription'], '</h3> |
25 | 25 | </div>'; |
26 | 26 | |
27 | - if (!empty($context['disable_groups'])) |
|
28 | - echo ' |
|
27 | + if (!empty($context['disable_groups'])) { |
|
28 | + echo ' |
|
29 | 29 | <div class="information"> |
30 | 30 | <span class="alert">', $txt['paid_mod_edit_note'], '</span> |
31 | 31 | </div>'; |
32 | + } |
|
32 | 33 | |
33 | 34 | echo ' |
34 | 35 | <div class="windowbg2"> |
@@ -69,9 +70,10 @@ discard block |
||
69 | 70 | <option value="0"', $context['sub']['prim_group'] == 0 ? ' selected' : '', '>', $txt['paid_mod_no_group'], '</option>'; |
70 | 71 | |
71 | 72 | // Put each group into the box. |
72 | - foreach ($context['groups'] as $id => $name) |
|
73 | - echo ' |
|
73 | + foreach ($context['groups'] as $id => $name) { |
|
74 | + echo ' |
|
74 | 75 | <option value="', $id, '"', $context['sub']['prim_group'] == $id ? ' selected' : '', '>', $name, '</option>'; |
76 | + } |
|
75 | 77 | |
76 | 78 | echo ' |
77 | 79 | </select> |
@@ -83,12 +85,13 @@ discard block |
||
83 | 85 | <dd>'; |
84 | 86 | |
85 | 87 | // Put a checkbox in for each group |
86 | - foreach ($context['groups'] as $id => $name) |
|
87 | - echo ' |
|
88 | + foreach ($context['groups'] as $id => $name) { |
|
89 | + echo ' |
|
88 | 90 | <label for="addgroup_', $id, '"> |
89 | 91 | <input type="checkbox" id="addgroup_', $id, '" name="addgroup[', $id, ']"', in_array($id, $context['sub']['add_groups']) ? ' checked' : '', !empty($context['disable_groups']) ? ' disabled' : '', '> |
90 | 92 | <span class="smalltext">', $name, '</span> |
91 | 93 | </label><br>'; |
94 | + } |
|
92 | 95 | |
93 | 96 | echo ' |
94 | 97 | </dd> |
@@ -238,8 +241,8 @@ discard block |
||
238 | 241 | <dl class="settings">'; |
239 | 242 | |
240 | 243 | // Do we need a username? |
241 | - if ($context['action_type'] == 'add') |
|
242 | - echo ' |
|
244 | + if ($context['action_type'] == 'add') { |
|
245 | + echo ' |
|
243 | 246 | <dt> |
244 | 247 | <strong>', $txt['paid_username'], ':</strong><br> |
245 | 248 | <span class="smalltext">', $txt['one_username'], '</span> |
@@ -247,6 +250,7 @@ discard block |
||
247 | 250 | <dd> |
248 | 251 | <input type="text" name="name" id="name_control" value="', $context['sub']['username'], '" size="30"> |
249 | 252 | </dd>'; |
253 | + } |
|
250 | 254 | |
251 | 255 | echo ' |
252 | 256 | <dt> |
@@ -264,9 +268,10 @@ discard block |
||
264 | 268 | <select name="year" id="year" onchange="generateDays();">'; |
265 | 269 | |
266 | 270 | // Show a list of all the years we allow... |
267 | - for ($year = 2005; $year <= 2030; $year++) |
|
268 | - echo ' |
|
271 | + for ($year = 2005; $year <= 2030; $year++) { |
|
272 | + echo ' |
|
269 | 273 | <option value="', $year, '"', $year == $context['sub']['start']['year'] ? ' selected' : '', '>', $year, '</option>'; |
274 | + } |
|
270 | 275 | |
271 | 276 | echo ' |
272 | 277 | </select> |
@@ -274,9 +279,10 @@ discard block |
||
274 | 279 | <select name="month" id="month" onchange="generateDays();">'; |
275 | 280 | |
276 | 281 | // There are 12 months per year - ensure that they all get listed. |
277 | - for ($month = 1; $month <= 12; $month++) |
|
278 | - echo ' |
|
282 | + for ($month = 1; $month <= 12; $month++) { |
|
283 | + echo ' |
|
279 | 284 | <option value="', $month, '"', $month == $context['sub']['start']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
285 | + } |
|
280 | 286 | |
281 | 287 | echo ' |
282 | 288 | </select> |
@@ -284,9 +290,10 @@ discard block |
||
284 | 290 | <select name="day" id="day">'; |
285 | 291 | |
286 | 292 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
287 | - for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) |
|
288 | - echo ' |
|
293 | + for ($day = 1; $day <= $context['sub']['start']['last_day']; $day++) { |
|
294 | + echo ' |
|
289 | 295 | <option value="', $day, '"', $day == $context['sub']['start']['day'] ? ' selected' : '', '>', $day, '</option>'; |
296 | + } |
|
290 | 297 | |
291 | 298 | echo ' |
292 | 299 | </select> |
@@ -298,9 +305,10 @@ discard block |
||
298 | 305 | <select name="yearend" id="yearend" onchange="generateDays(\'end\');">'; |
299 | 306 | |
300 | 307 | // Show a list of all the years we allow... |
301 | - for ($year = 2005; $year <= 2030; $year++) |
|
302 | - echo ' |
|
308 | + for ($year = 2005; $year <= 2030; $year++) { |
|
309 | + echo ' |
|
303 | 310 | <option value="', $year, '"', $year == $context['sub']['end']['year'] ? ' selected' : '', '>', $year, '</option>'; |
311 | + } |
|
304 | 312 | |
305 | 313 | echo ' |
306 | 314 | </select> |
@@ -308,9 +316,10 @@ discard block |
||
308 | 316 | <select name="monthend" id="monthend" onchange="generateDays(\'end\');">'; |
309 | 317 | |
310 | 318 | // There are 12 months per year - ensure that they all get listed. |
311 | - for ($month = 1; $month <= 12; $month++) |
|
312 | - echo ' |
|
319 | + for ($month = 1; $month <= 12; $month++) { |
|
320 | + echo ' |
|
313 | 321 | <option value="', $month, '"', $month == $context['sub']['end']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>'; |
322 | + } |
|
314 | 323 | |
315 | 324 | echo ' |
316 | 325 | </select> |
@@ -318,9 +327,10 @@ discard block |
||
318 | 327 | <select name="dayend" id="dayend">'; |
319 | 328 | |
320 | 329 | // This prints out all the days in the current month - this changes dynamically as we switch months. |
321 | - for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) |
|
322 | - echo ' |
|
330 | + for ($day = 1; $day <= $context['sub']['end']['last_day']; $day++) { |
|
331 | + echo ' |
|
323 | 332 | <option value="', $day, '"', $day == $context['sub']['end']['day'] ? ' selected' : '', '>', $day, '</option>'; |
333 | + } |
|
324 | 334 | |
325 | 335 | echo ' |
326 | 336 | </select> |
@@ -359,8 +369,8 @@ discard block |
||
359 | 369 | <div class="windowbg"> |
360 | 370 | <ul>'; |
361 | 371 | |
362 | - foreach ($context['pending_payments'] as $id => $payment) |
|
363 | - echo ' |
|
372 | + foreach ($context['pending_payments'] as $id => $payment) { |
|
373 | + echo ' |
|
364 | 374 | <li> |
365 | 375 | ', $payment['desc'], ' |
366 | 376 | <span class="floatleft"> |
@@ -370,6 +380,7 @@ discard block |
||
370 | 380 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;lid=', $context['log_id'], ';pending=', $id, ';remove">', $txt['pending_payments_remove'], '</a> |
371 | 381 | </span> |
372 | 382 | </li>'; |
383 | + } |
|
373 | 384 | |
374 | 385 | echo ' |
375 | 386 | </ul> |
@@ -394,12 +405,12 @@ discard block |
||
394 | 405 | <h3 class="catbg">', $txt['subscriptions'], '</h3> |
395 | 406 | </div>'; |
396 | 407 | |
397 | - if (empty($context['subscriptions'])) |
|
398 | - echo ' |
|
408 | + if (empty($context['subscriptions'])) { |
|
409 | + echo ' |
|
399 | 410 | <div class="information"> |
400 | 411 | ', $txt['paid_subs_none'], ' |
401 | 412 | </div>'; |
402 | - else |
|
413 | + } else |
|
403 | 414 | { |
404 | 415 | echo ' |
405 | 416 | <div class="information"> |
@@ -410,8 +421,9 @@ discard block |
||
410 | 421 | foreach ($context['subscriptions'] as $id => $subscription) |
411 | 422 | { |
412 | 423 | // Ignore the inactive ones... |
413 | - if (empty($subscription['active'])) |
|
414 | - continue; |
|
424 | + if (empty($subscription['active'])) { |
|
425 | + continue; |
|
426 | + } |
|
415 | 427 | |
416 | 428 | echo ' |
417 | 429 | <div class="cat_bar"> |
@@ -421,9 +433,10 @@ discard block |
||
421 | 433 | <p><strong>', $subscription['name'], '</strong></p> |
422 | 434 | <p class="smalltext">', $subscription['desc'], '</p>'; |
423 | 435 | |
424 | - if (!$subscription['flexible']) |
|
425 | - echo ' |
|
436 | + if (!$subscription['flexible']) { |
|
437 | + echo ' |
|
426 | 438 | <div><strong>', $txt['paid_duration'], ':</strong> ', $subscription['length'], '</div>'; |
439 | + } |
|
427 | 440 | |
428 | 441 | if ($context['user']['is_owner']) |
429 | 442 | { |
@@ -436,24 +449,25 @@ discard block |
||
436 | 449 | <select name="cur[', $subscription['id'], ']">'; |
437 | 450 | |
438 | 451 | // Print out the costs for this one. |
439 | - foreach ($subscription['costs'] as $duration => $value) |
|
440 | - echo ' |
|
452 | + foreach ($subscription['costs'] as $duration => $value) { |
|
453 | + echo ' |
|
441 | 454 | <option value="', $duration, '">', sprintf($modSettings['paid_currency_symbol'], $value), '/', $txt[$duration], '</option>'; |
455 | + } |
|
442 | 456 | |
443 | 457 | echo ' |
444 | 458 | </select>'; |
445 | - } |
|
446 | - else |
|
447 | - echo ' |
|
459 | + } else { |
|
460 | + echo ' |
|
448 | 461 | ', sprintf($modSettings['paid_currency_symbol'], $subscription['costs']['fixed']); |
462 | + } |
|
449 | 463 | |
450 | 464 | echo ' |
451 | 465 | <hr> |
452 | 466 | <input type="submit" name="sub_id[', $subscription['id'], ']" value="', $txt['paid_order'], '" class="button">'; |
453 | - } |
|
454 | - else |
|
455 | - echo ' |
|
467 | + } else { |
|
468 | + echo ' |
|
456 | 469 | <a href="', $scripturl, '?action=admin;area=paidsubscribe;sa=modifyuser;sid=', $subscription['id'], ';uid=', $context['member']['id'], (empty($context['current'][$subscription['id']]) ? '' : ';lid=' . $context['current'][$subscription['id']]['id']), '">', empty($context['current'][$subscription['id']]) ? $txt['paid_admin_add'] : $txt['paid_edit_subscription'], '</a>'; |
470 | + } |
|
457 | 471 | |
458 | 472 | echo ' |
459 | 473 | </div><!-- .windowbg -->'; |
@@ -480,18 +494,19 @@ discard block |
||
480 | 494 | </thead> |
481 | 495 | <tbody>'; |
482 | 496 | |
483 | - if (empty($context['current'])) |
|
484 | - echo ' |
|
497 | + if (empty($context['current'])) { |
|
498 | + echo ' |
|
485 | 499 | <tr class="windowbg"> |
486 | 500 | <td colspan="4"> |
487 | 501 | ', $txt['paid_none_yet'], ' |
488 | 502 | </td> |
489 | 503 | </tr>'; |
504 | + } |
|
490 | 505 | |
491 | 506 | foreach ($context['current'] as $sub) |
492 | 507 | { |
493 | - if (!$sub['hide']) |
|
494 | - echo ' |
|
508 | + if (!$sub['hide']) { |
|
509 | + echo ' |
|
495 | 510 | <tr class="windowbg"> |
496 | 511 | <td> |
497 | 512 | ', (allowedTo('admin_forum') ? '<a href="' . $scripturl . '?action=admin;area=paidsubscribe;sa=modifyuser;lid=' . $sub['id'] . '">' . $sub['name'] . '</a>' : $sub['name']), ' |
@@ -502,6 +517,7 @@ discard block |
||
502 | 517 | <td>', $sub['start'], '</td> |
503 | 518 | <td>', $sub['end'], '</td> |
504 | 519 | </tr>'; |
520 | + } |
|
505 | 521 | } |
506 | 522 | |
507 | 523 | echo ' |
@@ -553,15 +569,17 @@ discard block |
||
553 | 569 | ', $gateway['desc'], '<br> |
554 | 570 | <form action="', $gateway['form'], '" method="post">'; |
555 | 571 | |
556 | - if (!empty($gateway['javascript'])) |
|
557 | - echo ' |
|
572 | + if (!empty($gateway['javascript'])) { |
|
573 | + echo ' |
|
558 | 574 | <script> |
559 | 575 | ', $gateway['javascript'], ' |
560 | 576 | </script>'; |
577 | + } |
|
561 | 578 | |
562 | - foreach ($gateway['hidden'] as $name => $value) |
|
563 | - echo ' |
|
579 | + foreach ($gateway['hidden'] as $name => $value) { |
|
580 | + echo ' |
|
564 | 581 | <input type="hidden" id="', $gateway['id'], '_', $name, '" name="', $name, '" value="', $value, '">'; |
582 | + } |
|
565 | 583 | |
566 | 584 | echo ' |
567 | 585 | <br> |