ManageCalendar.template.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines
  7. * @copyright 2014 Simple Machines and individual contributors
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. // Editing or adding holidays.
  13. function template_edit_holiday()
  14. {
  15. global $context, $scripturl, $txt, $modSettings;
  16. // Show a form for all the holiday information.
  17. echo '
  18. <div id="admincenter">
  19. <form action="', $scripturl, '?action=admin;area=managecalendar;sa=editholiday" method="post" accept-charset="', $context['character_set'], '">
  20. <div class="cat_bar">
  21. <h3 class="catbg">', $context['page_title'], '</h3>
  22. </div>
  23. <div class="windowbg">
  24. <div class="content">
  25. <dl class="settings">
  26. <dt class="small_caption">
  27. <strong>', $txt['holidays_title_label'], ':</strong>
  28. </dt>
  29. <dd class="small_caption">
  30. <input type="text" name="title" value="', $context['holiday']['title'], '" size="55" maxlength="60">
  31. </dd>
  32. <dt class="small_caption">
  33. <strong>', $txt['calendar_year'], '</strong>
  34. </dt>
  35. <dd class="small_caption">
  36. <select name="year" id="year" onchange="generateDays();">
  37. <option value="0000"', $context['holiday']['year'] == '0000' ? ' selected' : '', '>', $txt['every_year'], '</option>';
  38. // Show a list of all the years we allow...
  39. for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++)
  40. echo '
  41. <option value="', $year, '"', $year == $context['holiday']['year'] ? ' selected' : '', '>', $year, '</option>';
  42. echo '
  43. </select>&nbsp;
  44. ', $txt['calendar_month'], '&nbsp;
  45. <select name="month" id="month" onchange="generateDays();">';
  46. // There are 12 months per year - ensure that they all get listed.
  47. for ($month = 1; $month <= 12; $month++)
  48. echo '
  49. <option value="', $month, '"', $month == $context['holiday']['month'] ? ' selected' : '', '>', $txt['months'][$month], '</option>';
  50. echo '
  51. </select>&nbsp;
  52. ', $txt['calendar_day'], '&nbsp;
  53. <select name="day" id="day" onchange="generateDays();">';
  54. // This prints out all the days in the current month - this changes dynamically as we switch months.
  55. for ($day = 1; $day <= $context['holiday']['last_day']; $day++)
  56. echo '
  57. <option value="', $day, '"', $day == $context['holiday']['day'] ? ' selected' : '', '>', $day, '</option>';
  58. echo '
  59. </select>
  60. </dd>
  61. </dl>
  62. <hr class="hrcolor">';
  63. if ($context['is_new'])
  64. echo '
  65. <input type="submit" value="', $txt['holidays_button_add'], '" class="button_submit">';
  66. else
  67. echo '
  68. <input type="submit" name="edit" value="', $txt['holidays_button_edit'], '" class="button_submit">
  69. <input type="submit" name="delete" value="', $txt['holidays_button_remove'], '" class="button_submit">
  70. <input type="hidden" name="holiday" value="', $context['holiday']['id'], '">';
  71. echo '
  72. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  73. </div>
  74. </div>
  75. </form>
  76. </div>';
  77. }
  78. ?>