diff options
author | Chad Little <clittle@users.sourceforge.net> | 2003-05-30 00:45:20 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2003-05-30 00:45:20 +0000 |
commit | 544791f934e723c7393023a576f10ed6a21958ae (patch) | |
tree | 422b12af6e318dde1625edf08e180c1caa7c03d2 | |
parent | 692c1adcc5bd52b8dc501ab2bffadf947d9b452b (diff) | |
download | phpicalendar-544791f934e723c7393023a576f10ed6a21958ae.tar.gz phpicalendar-544791f934e723c7393023a576f10ed6a21958ae.tar.bz2 phpicalendar-544791f934e723c7393023a576f10ed6a21958ae.zip |
Cleaned up look and feel of admin pages, corrected some error_reporting.
-rw-r--r-- | admin.php | 48 | ||||
-rw-r--r-- | functions/admin_functions.php | 14 | ||||
-rw-r--r-- | functions/ical_parser.php | 2 | ||||
-rw-r--r-- | functions/init.inc.php | 2 | ||||
-rw-r--r-- | preferences.php | 8 |
5 files changed, 50 insertions, 24 deletions
@@ -15,6 +15,8 @@ if ($allow_admin != "yes") { if($HTTP_POST_VARS) {extract($HTTP_POST_VARS, EXTR_PREFIX_SAME, "post_");} if($HTTP_GET_VARS) {extract($HTTP_GET_VARS, EXTR_PREFIX_SAME, "get_");} +if (!isset($action)) $action = ''; + // Logout by clearing session variables if ((isset($action)) && ($action == "logout")) { $HTTP_SESSION_VARS['phpical_loggedin'] = FALSE; @@ -57,20 +59,42 @@ else { <table width="640" border="0" cellspacing="0" cellpadding="0" class="calborder"> <tr> <td align="center" valign="middle"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> - <td align="left" width="20" class="navback"> </td> - <td align="center" class="navback" nowrap valign="middle"><font class="H20"><?php echo "$admin_header_lang"; ?></font></td> - <td align="right" width="20" class="navback" nowrap valign="middle"><font class="G10"><?php if ($auth_method != "none" && $is_loged_in == TRUE) { echo "<a href=\"{$HTTP_SERVER_VARS['PHP_SELF']}?action=logout\">{$logout_lang}</a>"; } ?></font> </td> - </tr> - <tr> - <td colspan="3" class="dayborder"><img src="images/spacer.gif" width="1" height="5" alt=" "></td> + <td align="left" width="120" class="navback"><?php echo '<a href="'.BASE.'"><img src="'.BASE.'styles/'.$style_sheet.'/back.gif" alt=" " border="0" align="left"></a>'; ?></td> + <td class="navback"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td align="center" class="navback" nowrap valign="middle"><font class="H20"><?php echo "$admin_header_lang"; ?></font></td> + </tr> + </table> + </td> + <td align="right" width="120" class="navback"> + <table width="120" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td><?php echo '<a class="psf" href="'.BASE.'day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/day_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/week_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/month_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/year_on.gif" alt=" " border="0"></a></td>'; ?> + </tr> + </table> + </td> </tr> + </table> + </td> + </tr> + <tr> + <td class="dayborder"><img src="images/spacer.gif" width="1" height="5" alt=" "></td> + </tr> + <tr> + <td class="G10" align="right"><?php if ($auth_method != "none" && $is_loged_in == TRUE) { echo "<a href=\"{$HTTP_SERVER_VARS['PHP_SELF']}?action=logout\">{$logout_lang}</a>"; } ?> </td> + </tr> + <tr> + <td> + <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <tr> - <td align="left" width="20"> </td> - <td colspan="2"> - + <td width="2%"></td> + <td width="98%" valign="top" align="left"> <?php @@ -130,7 +154,9 @@ EOT; // Add or Update a calendar -if ($action == "addupdate") { +$addupdate_msg = ''; +$delete_msg = ''; +if ((isset($action)) && ($action == "addupdate")) { $addupdate_msg = ""; for($filenumber=1; $filenumber<6; $filenumber++) { diff --git a/functions/admin_functions.php b/functions/admin_functions.php index 4bdd712..7e7a8a6 100644 --- a/functions/admin_functions.php +++ b/functions/admin_functions.php @@ -50,10 +50,10 @@ function login_ftp ($username, $password) { global $ftp_server; // set up basic connection - $conn_id = ftp_connect($ftp_server); + $conn_id = @ftp_connect($ftp_server); // login with username and password - $login_result = ftp_login($conn_id, $username, $password); + $login_result = @ftp_login($conn_id, $username, $password); // check connection if ((!$conn_id) || (!$login_result)) { @@ -61,7 +61,7 @@ function login_ftp ($username, $password) { } // close the FTP stream - ftp_close($conn_id); + @ftp_close($conn_id); return TRUE; } @@ -96,24 +96,24 @@ function delete_cal ($filename) { $filename = get_ftp_calendar_path() . "/" . $filename; // set up basic connection - $conn_id = ftp_connect($ftp_server); + $conn_id = @ftp_connect($ftp_server); // login with username and password - $login_result = ftp_login($conn_id, $HTTP_SESSION_VARS['phpical_username'], $HTTP_SESSION_VARS['phpical_password']); + $login_result = @ftp_login($conn_id, $HTTP_SESSION_VARS['phpical_username'], $HTTP_SESSION_VARS['phpical_password']); // check connection if ((!$conn_id) || (!$login_result)) return FALSE; // delete the file - $delete = ftp_delete($conn_id, $filename); + $delete = @ftp_delete($conn_id, $filename); // check delete status if (!$delete) return FALSE; // close the FTP stream - ftp_close($conn_id); + @ftp_close($conn_id); return TRUE; } diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 05c9909..34dbebc 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -458,7 +458,7 @@ if ($parse_file) { if (!isset($bymonth)) $bymonth[] = date('m', $start_date_time); foreach($bymonth as $month) { $year = date('Y', $next_range_time); - if (is_array($byday)) { + if ((isset($byday)) && (is_array($byday))) { $checkdate_time = mktime(0,0,0,$month,1,$year); foreach($byday as $day) { ereg ('([-\+]{0,1})([0-9]{1})([A-Z]{2})', $day, $byday_arr); diff --git a/functions/init.inc.php b/functions/init.inc.php index 24df31d..1d8af84 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -6,7 +6,7 @@ //chmod(BASE.'calendars/School.ics',0666); // uncomment when developing, comment for shipping version -error_reporting (E_ALL); +//error_reporting (E_ALL); if (!defined('BASE')) define('BASE', './'); include(BASE.'config.inc.php'); diff --git a/preferences.php b/preferences.php index b8ffcf5..d42f8a7 100644 --- a/preferences.php +++ b/preferences.php @@ -96,10 +96,10 @@ if ((!isset($HTTP_COOKIE_VARS['phpicalendar'])) || ($cookie_unset)) { <td align="right" width="120" class="navback"> <table width="120" border="0" cellpadding="0" cellspacing="0"> <tr> - <td><?php echo '<a class="psf" href="'.BASE.'day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/day_on.gif" alt=" " border="0"></td>'; ?> - <td><?php echo '<a class="psf" href="'.BASE.'week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/week_on.gif" alt=" " border="0"></td>'; ?> - <td><?php echo '<a class="psf" href="'.BASE.'month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/month_on.gif" alt=" " border="0"></td>'; ?> - <td><?php echo '<a class="psf" href="'.BASE.'year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/year_on.gif" alt=" " border="0"></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'day.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/day_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'week.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/week_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'month.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/month_on.gif" alt=" " border="0"></a></td>'; ?> + <td><?php echo '<a class="psf" href="'.BASE.'year.php?cal='.$cal.'&getdate='.$getdate.'"><img src="'.BASE.'styles/'.$style_sheet.'/year_on.gif" alt=" " border="0"></a></td>'; ?> </tr> </table> </td> |