From 57fc0448e118d27d792b676f3929931c79b4fa06 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 14 May 2026 09:49:08 +0100 Subject: php-cs-fixer tidies to php8.5 standards Co-Authored-By: Claude Sonnet 4.6 --- admin/admin_calendar_inc.php | 2 +- icons/day.gif | Bin icons/month.gif | Bin icons/pkg_calendar.gif | Bin icons/pkg_calendar.png | Bin icons/week.gif | Bin icons/weeklist.gif | Bin icons/year.gif | Bin includes/bit_setup_inc.php | 4 ++-- includes/classes/Calendar.php | 3 ++- liberty_plugins/data.calendar.php | 26 +++++++++++++------------- modules/help_mod_calendar.tpl | 0 modules/index.php | 2 +- modules/mod_calendar.tpl | 0 modules/mod_minical.tpl | 0 styles/minical.css | 0 styles/plain.css | 0 templates/calendar_nav_inc.tpl | 0 templates/calendar_options_inc.tpl | 0 templates/calendar_preferences_inc.tpl | 0 templates/html_head_inc.tpl | 0 templates/index.php | 2 +- templates/menu_calendar.tpl | 0 templates/menu_calendar_admin.tpl | 0 templates/minical.tpl | 0 templates/user_preferences_inc.tpl | 0 26 files changed, 20 insertions(+), 19 deletions(-) mode change 100644 => 100755 icons/day.gif mode change 100644 => 100755 icons/month.gif mode change 100644 => 100755 icons/pkg_calendar.gif mode change 100644 => 100755 icons/pkg_calendar.png mode change 100644 => 100755 icons/week.gif mode change 100644 => 100755 icons/weeklist.gif mode change 100644 => 100755 icons/year.gif mode change 100644 => 100755 modules/help_mod_calendar.tpl mode change 100644 => 100755 modules/mod_calendar.tpl mode change 100644 => 100755 modules/mod_minical.tpl mode change 100644 => 100755 styles/minical.css mode change 100644 => 100755 styles/plain.css mode change 100644 => 100755 templates/calendar_nav_inc.tpl mode change 100644 => 100755 templates/calendar_options_inc.tpl mode change 100644 => 100755 templates/calendar_preferences_inc.tpl mode change 100644 => 100755 templates/html_head_inc.tpl mode change 100644 => 100755 templates/menu_calendar.tpl mode change 100644 => 100755 templates/menu_calendar_admin.tpl mode change 100644 => 100755 templates/minical.tpl mode change 100644 => 100755 templates/user_preferences_inc.tpl diff --git a/admin/admin_calendar_inc.php b/admin/admin_calendar_inc.php index 1144f9a..ae1bee3 100644 --- a/admin/admin_calendar_inc.php +++ b/admin/admin_calendar_inc.php @@ -51,7 +51,7 @@ if( function_exists( 'simple_set_value' ) && $gBitUser->isAdmin() && !empty( $_R } foreach( $calendarTypeDefaults as $key => $val ) { simple_set_toggle_array( 'defaultTypes', $key, CALENDAR_PKG_NAME); - } + } } // Build the list of what is selected. Has to come AFTER the set. diff --git a/icons/day.gif b/icons/day.gif old mode 100644 new mode 100755 diff --git a/icons/month.gif b/icons/month.gif old mode 100644 new mode 100755 diff --git a/icons/pkg_calendar.gif b/icons/pkg_calendar.gif old mode 100644 new mode 100755 diff --git a/icons/pkg_calendar.png b/icons/pkg_calendar.png old mode 100644 new mode 100755 diff --git a/icons/week.gif b/icons/week.gif old mode 100644 new mode 100755 diff --git a/icons/weeklist.gif b/icons/weeklist.gif old mode 100644 new mode 100755 diff --git a/icons/year.gif b/icons/year.gif old mode 100644 new mode 100755 diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index 85f47b7..3158e86 100644 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -11,9 +11,9 @@ $pRegisterHash = [ define( 'CALENDAR_PKG_NAME', $pRegisterHash['package_name'] ); define( 'CALENDAR_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' ); define( 'CALENDAR_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' ); -define( 'CALENDAR_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); +define( 'CALENDAR_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); define( 'CALENDAR_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/'); -define( 'CALENDAR_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); +define( 'CALENDAR_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); $gBitSystem->registerPackage( $pRegisterHash ); if( $gBitSystem->isPackageActive( 'calendar' ) && $gBitUser->hasPermission( 'p_calendar_view' )) { diff --git a/includes/classes/Calendar.php b/includes/classes/Calendar.php index b3a5fc0..19714b4 100644 --- a/includes/classes/Calendar.php +++ b/includes/classes/Calendar.php @@ -12,6 +12,7 @@ * Required setup */ namespace Bitweaver\Calendar; + use Bitweaver\BitDate; use Bitweaver\KernelTools; use Bitweaver\Liberty\LibertyContent; @@ -83,7 +84,7 @@ class Calendar extends LibertyContent { $item['created'] += $this->display_offset; $item['last_modified'] += $this->display_offset; $item['event_time'] += $this->display_offset; - $item['parsed'] = self::parseDataHash( $item ); + $item['parsed'] = self::parseDataHash( $item ); $dstart = $this->mDate->gmmktime( 0, 0, 0, $this->mDate->date( "m", $item['timestamp'], true ), $this->mDate->date( "d", $item['timestamp'], true ), $this->mDate->date( "Y", $item['timestamp'], true ) ); $ret[$dstart][] = $item; } diff --git a/liberty_plugins/data.calendar.php b/liberty_plugins/data.calendar.php index cc7861a..bb38a8e 100644 --- a/liberty_plugins/data.calendar.php +++ b/liberty_plugins/data.calendar.php @@ -47,39 +47,39 @@ function data_calendar( $data, $params ) { if ($gBitSystem->isPackageActive('calendar')) { $offset = $gBitSystem->get_display_offset(); - $bitDate = new BitDate($offset); - + $bitDate = new BitDate($offset); + $time = $bitDate->getUTCTime(); $date = $bitDate->getDate($time, true); - + $month = $date['mon']; $year = $date['year']; $month_day = $date['mday']; $month_name = $date['month']; - + // reset time so we can make today look different in template with compare $time = $bitDate->mktime(0, 0, 0, $month, $month_day, $year); - + $last_time = $bitDate->mktime(0, 0, 0, $month, 0, $year); $next_time = $bitDate->mktime(0, 0, 0, $month + 1, 1, $year); $last = $bitDate->getDate($last_time); $next = $bitDate->getDate($next_time); - + $days = []; for ($i = 2; $i < 9; $i++) { // Start from known sunday. $timestamp = $bitDate->mktime(0, 0, 0, 1, $i, 2000); $days[] = $bitDate->strftime('%a', $timestamp); } - + // Build a two-dimensional array of UNIX timestamps. $calendar = []; - + // Start with last days of previous month. $week = []; $month_begin = $bitDate->mktime(0, 0, 0, $month, 1, $year); $month_begin_dow = strftime('%w', $month_begin); - + $days_last_month = $bitDate->daysInMonth($last['month'], $last['year']); for ($dow = 0; $dow < $month_begin_dow; @@ -89,13 +89,13 @@ function data_calendar( $data, $params ) { $d['dim'] = true; $week[] = $d; } - + // Do this month $days_in_month = $bitDate->daysInMonth($month, $year); for ($i = 1; $i <= $days_in_month; $i++) { if ($dow == 7) { $calendar[] = $week; - + // Done with row $dow = 0; unset($week); @@ -111,7 +111,7 @@ function data_calendar( $data, $params ) { unset($d['today']); $dow++; } - + // Do the last month. for ($i = 1; $dow < 7; $i++, $dow++) { $d['time'] = $bitDate->mktime(0, 0, 0, $month + 1, $i, $year); @@ -136,6 +136,6 @@ function data_calendar( $data, $params ) { return $gBitSmarty->fetch('bitpackage:calendar/minical.tpl'); } - + return '
Calendar Package Not Active
'; } \ No newline at end of file diff --git a/modules/help_mod_calendar.tpl b/modules/help_mod_calendar.tpl old mode 100644 new mode 100755 diff --git a/modules/index.php b/modules/index.php index 1e6de35..30a5490 100644 --- a/modules/index.php +++ b/modules/index.php @@ -1,4 +1,4 @@ -