functions.php 4.1 KB

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