Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12243/functions
Modified Files:
template.php
Log Message:
Start of admin wiring. Removed unneeded things from print.
Index: template.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** template.php 23 May 2004 23:54:42 -0000 1.48
--- template.php 24 May 2004 01:39:42 -0000 1.49
***************
*** 15,18 ****
--- 15,58 ----
}
+ function draw_admin() {
+ global $template, $getdate, $cal, $master_array, $is_loged_in;
+
+ if ($is_loged_in == TRUE) {
+ // Print Calendar Checkboxes
+ $COLUMNS_TO_PRINT = 3;
+ $column = 1;
+ $filelist = availableCalendarNames('', '', '', true);
+ foreach ($filelist as $file) {
+ if ($column > $COLUMNS_TO_PRINT) {
+ $delete_table .= '</tr>';
+ $column = 1;
+ }
+ if ($column == 1) {
+ $delete_table .= '<tr>';
+ }
+
+ $cal_filename_tmp = substr($file,0,-4);
+ $cal_tmp = urlencode($file);
+ $cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp);
+
+ $delete_table .= '<td align="left"><input name="delete_calendar[]" value="'.$cal_tmp.'" type="checkbox" />'.$cal_displayname_tmp.'</td>';
+
+ $column++;
+ }
+ // Print remaining empty columns if necessary
+ $number_of_columns = count($filelist);
+ while (gettype($number_of_columns/$COLUMNS_TO_PRINT) != "integer") {
+ $delete_table .= '<td> </td>';
+ $number_of_columns++;
+ }
+
+ $this->page = str_replace('{DELETE_TABLE}', $delete_table, $this->page);
+ } else {
+ $this->page = preg_replace('!<\!-- switch logged_in on -->(.*)<\!-- switch logged_in off -->!is', '', $this->page);
+ $this->page = preg_replace('!<\!-- switch logged_in2 on -->(.*)<\!-- switch logged_in2 off -->!is', '', $this->page);
+ }
+
+ }
+
function draw_print($template_p) {
global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day, $printview, $dateFormat_day, $timeFormat, $week_start, $week_end, $lang;
|