File: functions.php

package info (click to toggle)
squirrelmail 1%3A1.2.6-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,300 kB
  • ctags: 4,949
  • sloc: php: 21,297; perl: 2,538; sh: 350; ansic: 122; makefile: 69
file content (146 lines) | stat: -rw-r--r-- 4,054 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/*
 *  functions.php
 *
 *  Copyright (c) 2001 Michal Szczotka <michal@tuxy.org>
 *  Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 *  miscelenous functions.
 *
 * $Id: functions.php,v 1.3 2002/01/24 09:16:40 philippe_mingo Exp $
 */


function calendar_header() {
    //Add Second layer ofCalendar links to upper menu
    global $color,$year,$day,$month;

    echo "<TABLE BGCOLOR=\"$color[0]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>".
         "<TR><TD ALIGN=left WIDTH=\"100%\">";

    displayInternalLink("plugins/calendar/calendar.php?year=$year&month=$month",_("Month View"),"right");
    echo "&nbsp;&nbsp\n";
    displayInternalLink("plugins/calendar/day.php?year=$year&month=$month&day=$day",_("Day View"),"right");
    echo "&nbsp;&nbsp\n";
    // displayInternalLink("plugins/calendar/event_create.php?year=$year&month=$month&day=$day",_("Add Event"),"right");
    // echo "&nbsp;&nbsp\n";
    echo '</TD></TR>';

}

function select_option_length($selected) {

    $eventlength = array(
        "0" => _("0 min."),
        "15" => _("15 min."),
        "30" => _("35 min."),
        "45" => _("45 min."),
        "60" => _("1 hr."),
        "90" => _("1.5 hr."),
        "120" => _("2 hr."),
        "150" => _("2.5 hr."),
        "180" => _("3 hr."),
        "210" => _("3.5 hr."),
        "240" => _("4 hr."),
        "300" => _("5 hr."),
        "360" => _("6 hr.")
    );

    while( $bar = each($eventlength)) {
        if($selected==$bar[key]){
                echo "        <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
        } else {
                echo "        <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
        }
    }
}

function select_option_minute($selected) {
    $eventminute = array(
    "00"=>"00",
    "05"=>"05",
    "10"=>"10",
    "15"=>"15",
    "20"=>"20",
    "25"=>"25",
    "30"=>"30",
    "35"=>"35",
    "40"=>"40",
    "45"=>"45",
    "50"=>"50",
    "55"=>"55"
    );

    while ( $bar = each($eventminute)) {
        if ($selected==$bar[key]){
                echo "        <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
        } else {
                echo "        <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
        }
    }
}

function select_option_hour($selected) {

    for ($i=0;$i<24;$i++){
        ($i<10)? $ih = "0" . $i : $ih = $i;
        if ($ih==$selected){
            echo "            <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
        } else {
            echo "            <OPTION VALUE=\"$ih\">$i</OPTION>\n";
        }
    }
}

function select_option_priority($selected) {
    $eventpriority = array(
        "0" => _("Normal"),
        "1" => _("High"),
    );

    while( $bar = each($eventpriority)) {
        if($selected==$bar[key]){
                echo "        <OPTION VALUE=\"".$bar[key]."\" SELECTED>".$bar[value]."</OPTION>\n";
        } else {
                echo "        <OPTION VALUE=\"".$bar[key]."\">".$bar[value]."</OPTION>\n";
        }
    }
}

function select_option_year($selected) {

    for ($i=1902;$i<2038;$i++){
        if ($i==$selected){
            echo "            <OPTION VALUE=\"$i\" SELECTED>$i</OPTION>\n";
        } else {
            echo "            <OPTION VALUE=\"$i\">$i</OPTION>\n";
        }
    }
}

function select_option_month($selected) {

    for ($i=1;$i<13;$i++){
        $im=date('m',mktime(0,0,0,$i,1,1));
        $is = substr( _( date('F',mktime(0,0,0,$i,1,1)) ), 0, 3 );
        if ($im==$selected){
            echo "            <OPTION VALUE=\"$im\" SELECTED>$is</OPTION>\n";
        } else {
            echo "            <OPTION VALUE=\"$im\">$is</OPTION>\n";
        }
    }
}

function select_option_day($selected) {

    for ($i=1;$i<32;$i++){
        ($i<10)? $ih="0".$i : $ih=$i;
        if ($i==$selected){
            echo "            <OPTION VALUE=\"$ih\" SELECTED>$i</OPTION>\n";
        } else {
            echo "            <OPTION VALUE=\"$ih\">$i</OPTION>\n";
        }
    }
}

?>