functions.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 html_tag( 'table', '', '', $color[0], 'border="0" width="100%" cellspacing="0" cellpadding="2"' ) .
  16. html_tag( 'tr' ) .
  17. html_tag( 'td', '', 'left', '', 'width="100%"' );
  18. displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
  19. echo "&nbsp;&nbsp\n";
  20. displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
  21. echo "&nbsp;&nbsp\n";
  22. // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
  23. // echo "&nbsp;&nbsp\n";
  24. echo '</td></tr>';
  25. }
  26. function select_option_length($selected) {
  27. $eventlength = array(
  28. "0" => _("0 min."),
  29. "15" => _("15 min."),
  30. "30" => _("35 min."),
  31. "45" => _("45 min."),
  32. "60" => _("1 hr."),
  33. "90" => _("1.5 hr."),
  34. "120" => _("2 hr."),
  35. "150" => _("2.5 hr."),
  36. "180" => _("3 hr."),
  37. "210" => _("3.5 hr."),
  38. "240" => _("4 hr."),
  39. "300" => _("5 hr."),
  40. "360" => _("6 hr.")
  41. );
  42. while( $bar = each($eventlength)) {
  43. if($selected==$bar[key]){
  44. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  45. } else {
  46. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  47. }
  48. }
  49. }
  50. function select_option_minute($selected) {
  51. $eventminute = array(
  52. "00"=>"00",
  53. "05"=>"05",
  54. "10"=>"10",
  55. "15"=>"15",
  56. "20"=>"20",
  57. "25"=>"25",
  58. "30"=>"30",
  59. "35"=>"35",
  60. "40"=>"40",
  61. "45"=>"45",
  62. "50"=>"50",
  63. "55"=>"55"
  64. );
  65. while ( $bar = each($eventminute)) {
  66. if ($selected==$bar[key]){
  67. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  68. } else {
  69. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  70. }
  71. }
  72. }
  73. function select_option_hour($selected) {
  74. for ($i=0;$i<24;$i++){
  75. ($i<10)? $ih = "0" . $i : $ih = $i;
  76. if ($ih==$selected){
  77. echo " <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
  78. } else {
  79. echo " <OPTION VALUE=\"$ih\">$i</OPTION>\n";
  80. }
  81. }
  82. }
  83. function select_option_priority($selected) {
  84. $eventpriority = array(
  85. "0" => _("Normal"),
  86. "1" => _("High"),
  87. );
  88. while( $bar = each($eventpriority)) {
  89. if($selected==$bar[key]){
  90. echo " <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
  91. } else {
  92. echo " <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
  93. }
  94. }
  95. }
  96. function select_option_year($selected) {
  97. for ($i=1902;$i<2038;$i++){
  98. if ($i==$selected){
  99. echo " <OPTION VALUE=\"$i\" SELECTED>$i</OPTION>\n";
  100. } else {
  101. echo " <OPTION VALUE=\"$i\">$i</OPTION>\n";
  102. }
  103. }
  104. }
  105. function select_option_month($selected) {
  106. for ($i=1;$i<13;$i++){
  107. $im=date('m',mktime(0,0,0,$i,1,1));
  108. $is = substr( _( date('F',mktime(0,0,0,$i,1,1)) ), 0, 3 );
  109. if ($im==$selected){
  110. echo " <OPTION VALUE=\"$im\" SELECTED>$is</OPTION>\n";
  111. } else {
  112. echo " <OPTION VALUE=\"$im\">$is</OPTION>\n";
  113. }
  114. }
  115. }
  116. function select_option_day($selected) {
  117. for ($i=1;$i<32;$i++){
  118. ($i<10)? $ih="0".$i : $ih=$i;
  119. if ($i==$selected){
  120. echo " <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
  121. } else {
  122. echo " <OPTION VALUE=\"$ih\">$i</OPTION>\n";
  123. }
  124. }
  125. }
  126. ?>