aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJason Oster <parasytic@users.sourceforge.net>2009-07-07 14:48:28 +0000
committerJason Oster <parasytic@users.sourceforge.net>2009-07-07 14:48:28 +0000
commitf36d3298f0401e4fb1ca131d18d51d3d47e39818 (patch)
tree46c674f1774b120741ea173c4706f581cbd7dccf /functions
parent710abd276f9720e6e5b049c64d0aac5a2cc198d5 (diff)
downloadphpicalendar-f36d3298f0401e4fb1ca131d18d51d3d47e39818.tar.gz
phpicalendar-f36d3298f0401e4fb1ca131d18d51d3d47e39818.tar.bz2
phpicalendar-f36d3298f0401e4fb1ca131d18d51d3d47e39818.zip
HTML/CSS template rewrites, nice-title integration, XSS fixes, version bump
Diffstat (limited to 'functions')
-rw-r--r--functions/calendar_functions.php1
-rw-r--r--functions/date_functions.php6
-rw-r--r--functions/event.js4
-rw-r--r--functions/template.php42
4 files changed, 39 insertions, 14 deletions
diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php
index 80bab71..3cd17e4 100644
--- a/functions/calendar_functions.php
+++ b/functions/calendar_functions.php
@@ -264,7 +264,6 @@ function display_ical_list($cals, $pick=FALSE) {
$return .= "<option value=\"$cal_encoded_tmp\">$cal_displayname_tmp</option>\n";
}
} else {
- $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp);
if ($cal_encoded_tmp == $cal || $cal_encoded_tmp == urldecode($cal)) {
$return .= "<option value=\"$current_view.php?cal=$cal_encoded_tmp&amp;getdate=$getdate\" selected=\"selected\">$cal_displayname_tmp</option>";
} else {
diff --git a/functions/date_functions.php b/functions/date_functions.php
index 4751ad2..0aeef60 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -234,6 +234,8 @@ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $lin
$full_event_text = $event_text;
$event_text = strip_tags($event_text, '<b><i><u><img>');
}
+
+ if (!empty($link_class)) $link_class = ' class="'.$link_class.'"';
if (!empty($event_text)) {
$title = strip_tags(str_replace("<br />","\n",$title));
@@ -254,10 +256,10 @@ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $lin
document.popup_data[$popup_data_index] = eventData;
// --></script>";
- $return .= '<a class="'.$link_class.'" title="'.$title.'" href="#" onclick="openEventWindow('.$popup_data_index.'); return false;">';
+ $return .= '<a'.$link_class.' title="'.$title.'" href="#" onclick="openEventWindow('.$popup_data_index.'); return false;">';
$popup_data_index++;
} else {
- $return .= '<a class="'.$link_class.'" title="'.$title.'" href="'.$res[1].'">';
+ $return .= '<a'.$link_class.' title="'.$title.'" href="'.$res[1].'">';
}
$return .= $pre_text.$event_text.$post_text.'</a>'."\n";
}
diff --git a/functions/event.js b/functions/event.js
index 9020de9..13aa609 100644
--- a/functions/event.js
+++ b/functions/event.js
@@ -11,7 +11,7 @@ function openEventWindow(num) {
form.elements.event_data.value = data.event_data;
// open a new window
- var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275');
+ var w = window.open('', 'Popup', 'scrollbars=yes,width=550,height=350');
form.target = 'Popup';
form.submit();
}
@@ -36,7 +36,7 @@ function openTodoInfo(num) {
form.elements.todo_data.value = data.todo_data;
// open a new window
- var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275');
+ var w = window.open('', 'Popup', 'scrollbars=yes,width=550,height=350');
form.target = 'Popup';
form.submit();
}
diff --git a/functions/template.php b/functions/template.php
index cc80925..9ce5124 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -253,7 +253,7 @@ class Page {
}#end draw_search
function draw_week($template_p) {
- global $phpiCal_config, $start_week_time, $getdate, $cal, $master_array, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $timeFormat_small;
+ global $phpiCal_config, $start_week_time, $getdate, $cal, $master_array, $dateFormat_week_list, $current_view, $day_array, $timeFormat;
// Figure out colspans and initialize weekarray
$thisdate = $start_week_time;
@@ -306,6 +306,10 @@ class Page {
while ($day < $phpiCal_config->week_length){
$colspan = 0;
$replace .= $loop_begin; # <td>
+
+ if ($weekarray[$day] == $getdate) $replace = str_replace('{TODAY}', "rowToday", $replace);
+ $replace = str_replace('{TODAY}', "rowOff", $replace);
+
if(array_search($weekarray[$day], $allday_uids)){
$uid = array_search($weekarray[$day], $allday_uids);
unset($allday_uids[$uid]);
@@ -464,9 +468,14 @@ class Page {
} else {
$class = '';
$dayborder = 0;
- }
+ }
+ $tclass = $class;
+ if ($thisday == $getdate) {
+ if ($tclass) $tclass = ' class="weekborder weektoday"';
+ else $tclass = ' class="weektoday"';
+ }
$drawWidth = 1;
- $weekdisplay .= '<td colspan="' . $nbrGridCols[$thisday] . '" ' . $class . '>&nbsp;</td>'."\n";
+ $weekdisplay .= '<td colspan="' . $nbrGridCols[$thisday] . '"' . $tclass . '>&nbsp;</td>'."\n";
} else {
# have events
$emptyWidth = $nbrGridCols[$thisday];
@@ -478,13 +487,18 @@ class Page {
switch ($el["state"]) {
case "begin":
if ($ended_counter) {
- $weekdisplay .= '<td colspan="' . $ended_counter . '" '.$class.'>&nbsp;</td>';
+ $tclass = $class;
+ if ($thisday == $getdate) {
+ if ($tclass) $tclass = ' class="weekborder weektoday"';
+ else $tclass = ' class="weektoday"';
+ }
+ $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '>&nbsp;</td>';
$ended_counter = 0;
}
$event_length[$thisday][$i]["state"] = "started";
$uid = $event_length[$thisday][$i]["key"];
$event_start = $this_time_arr[$uid]['start_unixtime'];
- $event_start = date ($timeFormat_small, $event_start);
+ $event_start = date ($timeFormat, $event_start);
$event_calno = $this_time_arr[$uid]['calnumber'];
$event_status = strtolower($this_time_arr[$uid]['status']);
$event_recur = $this_time_arr[$uid]['recur'];
@@ -510,7 +524,12 @@ class Page {
break;
case "started":
if ($ended_counter) {
- $weekdisplay .= '<td colspan="' . $ended_counter . '" '.$class.'>&nbsp;</td>';
+ $tclass = $class;
+ if ($thisday == $getdate) {
+ if ($tclass) $tclass = ' class="weekborder weektoday"';
+ else $tclass = ' class="weektoday"';
+ }
+ $weekdisplay .= '<td colspan="' . $ended_counter . '"' . $tclass . '>&nbsp;</td>';
$ended_counter = 0;
}
break;
@@ -528,7 +547,12 @@ class Page {
$emptyWidth += $ended_counter;
//fill empty space on the right
if ($emptyWidth > 0) {
- $weekdisplay .= "<td colspan=\"" . $emptyWidth . "\" $class>&nbsp;</td>\n";
+ $tclass = $class;
+ if ($thisday == $getdate) {
+ if ($tclass) $tclass = ' class="weekborder weektoday"';
+ else $tclass = ' class="weektoday"';
+ }
+ $weekdisplay .= "<td colspan=\"" . $emptyWidth . "\"$tclass>&nbsp;</td>\n";
}
while (isset($event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"]) && $event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"] == "ended") {
array_pop($event_length[$thisday]);
@@ -981,7 +1005,7 @@ class Page {
$start2 = date($timeFormat_small, $val['start_unixtime']);
if ($type == 'large') {
$switch['EVENT'] .= '<div class="V9"><img src="templates/'.$phpiCal_config->template.'/images/monthdot_'.$event_calno.'.gif" alt="" width="9" height="9" border="0" />';
- $switch['EVENT'] .= openevent($daylink, $cal_time, $uid, $val, $phpiCal_config->month_event_lines, 10, 'ps3', "$start2 ").'';
+ $switch['EVENT'] .= openevent($daylink, $cal_time, $uid, $val, $phpiCal_config->month_event_lines, 10, 'ps3', "<span style=\"font-weight: bold;\">$start2</span> ");
$switch['EVENT'] .= (isset($val['location']) && $val['location'] != '' && $phpiCal_config->month_locations == 'yes') ? "<br />".$val['location']."<br />" : '';
$switch['EVENT'] .= '</div>';
} else {
@@ -1033,7 +1057,7 @@ class Page {
}
function monthbottom() {
- global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $timeFormat_small, $dateFormat_week_list, $lang;
+ global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $dateFormat_week_list, $lang;
preg_match("!<\!-- loop showbottomevents_odd on -->(.*)<\!-- loop showbottomevents_odd off -->!Uis", $this->page, $match1);
preg_match("!<\!-- loop showbottomevents_even on -->(.*)<\!-- loop showbottomevents_even off -->!Uis", $this->page, $match2);

© 2014-2022 Faster IT GmbH | imprint | privacy policy