functions.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?php
  2. /*
  3. * functions.php
  4. *
  5. * Copyright (c) 2001 Michal Szczotka <michal@tuxy.org>
  6. * Licensed under the GNU GPL. For full terms see the file COPYING.
  7. *
  8. * miscelenous functions.
  9. *
  10. * $Id$
  11. */
  12. function calendar_header() {
  13. //Add Second layer ofCalendar links to upper menu
  14. global $color,$year,$day,$month;
  15. echo "<TABLE BGCOLOR=\"$color[0]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>".
  16. "<TR><TD ALIGN=left WIDTH=\"100%\">";
  17. displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
  18. echo "&nbsp;&nbsp\n";
  19. displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
  20. echo "&nbsp;&nbsp\n";
  21. // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
  22. // echo "&nbsp;&nbsp\n";
  23. echo '</TD></TR>';
  24. }
  25. function select_option_length($selected) {
  26. $eventlength = array(
  27. "0" => _("0 min."),
  28. "15" => _("15 min."),
  29. "30" => _("35 min."),
  30. "45" => _("45 min."),
  31. "60" => _("1 hr."),
  32. "90" => _("1.5 hr."),
  33. "120" => _("2 hr."),
  34. "150" => _("2.5 hr."),
  35. "180" => _("3 hr."),
  36. "210" => _("3.5 hr."),
  37. "240" => _("4 hr."),
  38. "300" => _("5 hr."),
  39. "360" => _("6 hr.")
  40. );
  41. while( $bar = each($eventlength)) {
  42. if($selected==$bar[key]){
  43. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  44. } else {
  45. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  46. }
  47. }
  48. }
  49. function select_option_minute($selected) {
  50. $eventminute = array(
  51. "00"=>"00",
  52. "05"=>"05",
  53. "10"=>"10",
  54. "15"=>"15",
  55. "20"=>"20",
  56. "25"=>"25",
  57. "30"=>"30",
  58. "35"=>"35",
  59. "40"=>"40",
  60. "45"=>"45",
  61. "50"=>"50",
  62. "55"=>"55"
  63. );
  64. while ( $bar = each($eventminute)) {
  65. if ($selected==$bar[key]){
  66. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  67. } else {
  68. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  69. }
  70. }
  71. }
  72. function select_option_hour($selected) {
  73. for ($i=0;$i<24;$i++){
  74. ($i<10)? $ih = "0" . $i : $ih = $i;
  75. if ($ih==$selected){
  76. echo " <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
  77. } else {
  78. echo " <OPTION VALUE=\"$ih\">$i</OPTION>\n";
  79. }
  80. }
  81. }
  82. function select_option_priority($selected) {
  83. $eventpriority = array(
  84. "0" => _("Normal"),
  85. "1" => _("High"),
  86. );
  87. while( $bar = each($eventpriority)) {
  88. if($selected==$bar[key]){
  89. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  90. } else {
  91. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  92. }
  93. }
  94. }
  95. function select_option_year($selected) {
  96. for ($i=1902;$i<2038;$i++){
  97. if ($i==$selected){
  98. echo " <OPTION VALUE=\"$i\" SELECTED>$i</OPTION>\n";
  99. } else {
  100. echo " <OPTION VALUE=\"$i\">$i</OPTION>\n";
  101. }
  102. }
  103. }
  104. function select_option_month($selected) {
  105. for ($i=1;$i<13;$i++){
  106. $im=date('m',mktime(0,0,0,$i,1,1));
  107. $is = substr( _( date('F',mktime(0,0,0,$i,1,1)) ), 0, 3 );
  108. if ($im==$selected){
  109. echo " <OPTION VALUE=\"$im\" SELECTED>$is</OPTION>\n";
  110. } else {
  111. echo " <OPTION VALUE=\"$im\">$is</OPTION>\n";
  112. }
  113. }
  114. }
  115. function select_option_day($selected) {
  116. for ($i=1;$i<32;$i++){
  117. ($i<10)? $ih="0".$i : $ih=$i;
  118. if ($i==$selected){
  119. echo " <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
  120. } else {
  121. echo " <OPTION VALUE=\"$ih\">$i</OPTION>\n";
  122. }
  123. }
  124. }
  125. ?>