aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2007-05-19 16:18:13 +0000
committerJim Hu <jimhu@users.sourceforge.net>2007-05-19 16:18:13 +0000
commitcc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44 (patch)
treeb58eecf29add350a9be0399f874c640c9a3acc04 /functions
parentd2594889e58f17893f8a7dc4477b1723a6faf391 (diff)
downloadphpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.tar.gz
phpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.tar.bz2
phpicalendar-cc3fc71a8aca6cbd6c6263b9b4e08eaebaa52a44.zip
fix bug 1641928 change todo popup to be like event popup
Diffstat (limited to 'functions')
-rw-r--r--functions/event.js27
-rw-r--r--functions/template.php13
2 files changed, 31 insertions, 9 deletions
diff --git a/functions/event.js b/functions/event.js
index 6895626..9020de9 100644
--- a/functions/event.js
+++ b/functions/event.js
@@ -23,16 +23,29 @@ function EventData(date, time, uid, cpath, event_data) {
this.cpath = cpath;
this.event_data = event_data;
}
+//-->
+</script>
+<script language="JavaScript" type="text/javascript">
+<!--
+
+function openTodoInfo(num) {
+ // populate the hidden form
+ var data = document.todo_popup_data[num];
+ var form = document.forms.todoPopupForm;
-function openTodoInfo(vtodo_array) {
- var windowW = 460;
- var windowH = 275;
- var url = "includes/todo.php?vtodo_array="+vtodo_array;
- options = "scrollbars=yes,width="+windowW+",height="+windowH;
- info = window.open(url, "Popup", options);
- info.focus();
+ form.elements.todo_data.value = data.todo_data;
+
+ // open a new window
+ var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275');
+ form.target = 'Popup';
+ form.submit();
+}
+function TodoData(todo_data,todo_text) {
+ this.todo_data = todo_data;
+ this.todo_text = todo_text;
}
document.popup_data = new Array();
+document.todo_popup_data = new Array();
//-->
</script>
diff --git a/functions/template.php b/functions/template.php
index 62c9edc..1353f75 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -779,7 +779,7 @@ class Page {
$important = trim($match2[1]);
$normal = trim($match3[1]);
$nugget2 = '';
-
+ $todo_popup_data_index = 0;
if (is_array($master_array['-2'])) {
foreach ($master_array['-2'] as $vtodo_times) {
foreach ($vtodo_times as $val) {
@@ -805,8 +805,17 @@ class Page {
'start_date' => $start_date,
'status' => $status,
'vtodo_text' => $vtodo_text);
+ $vtodo_array = base64_encode(urlencode(serialize($vtodo_array)));
+ $todo = "
+ <script language=\"Javascript\" type=\"text/javascript\"><!--
+ var todoData = new TodoData('$vtodo_array','$vtodo_text');
+ document.todo_popup_data[$todo_popup_data_index] = todoData;
+ // --></script>";
- $vtodo_array = base64_encode(serialize($vtodo_array));
+ $todo .= '<a class="psf" title="'.$title.'" href="#" onclick="openTodoInfo('.$todo_popup_data_index.'); return false;">';
+ $todo_popup_data_index++;
+ $vtodo_array = $todo;
+
$vtodo_text = word_wrap(strip_tags(str_replace('<br />',' ',$vtodo_text), '<b><i><u>'), 21, $tomorrows_events_lines);
$data = array ('{VTODO_TEXT}', '{VTODO_ARRAY}');
$rep = array ($vtodo_text, $vtodo_array);

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