diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:49:08 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:49:08 +0100 |
| commit | 57fc0448e118d27d792b676f3929931c79b4fa06 (patch) | |
| tree | 06e3f582ec4f0c5db065423cffd696fa27e832ff | |
| parent | f3cbb2283a777e0ec4675bdd0d83ba2dc812723f (diff) | |
| download | calendar-57fc0448e118d27d792b676f3929931c79b4fa06.tar.gz calendar-57fc0448e118d27d792b676f3929931c79b4fa06.tar.bz2 calendar-57fc0448e118d27d792b676f3929931c79b4fa06.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | admin/admin_calendar_inc.php | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | icons/day.gif | bin | 282 -> 282 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/month.gif | bin | 271 -> 271 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/pkg_calendar.gif | bin | 1021 -> 1021 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/pkg_calendar.png | bin | 2786 -> 2786 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/week.gif | bin | 287 -> 287 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/weeklist.gif | bin | 287 -> 287 bytes | |||
| -rwxr-xr-x[-rw-r--r--] | icons/year.gif | bin | 286 -> 286 bytes | |||
| -rw-r--r-- | includes/bit_setup_inc.php | 4 | ||||
| -rw-r--r-- | includes/classes/Calendar.php | 3 | ||||
| -rw-r--r-- | liberty_plugins/data.calendar.php | 26 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/help_mod_calendar.tpl | 0 | ||||
| -rw-r--r-- | modules/index.php | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_calendar.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | modules/mod_minical.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | styles/minical.css | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | styles/plain.css | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/calendar_nav_inc.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/calendar_options_inc.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/calendar_preferences_inc.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/html_head_inc.tpl | 0 | ||||
| -rw-r--r-- | templates/index.php | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/menu_calendar.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/menu_calendar_admin.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/minical.tpl | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | templates/user_preferences_inc.tpl | 0 |
26 files changed, 20 insertions, 19 deletions
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 Binary files differindex 0783700..0783700 100644..100755 --- a/icons/day.gif +++ b/icons/day.gif diff --git a/icons/month.gif b/icons/month.gif Binary files differindex 7ef3128..7ef3128 100644..100755 --- a/icons/month.gif +++ b/icons/month.gif diff --git a/icons/pkg_calendar.gif b/icons/pkg_calendar.gif Binary files differindex 9c7dba2..9c7dba2 100644..100755 --- a/icons/pkg_calendar.gif +++ b/icons/pkg_calendar.gif diff --git a/icons/pkg_calendar.png b/icons/pkg_calendar.png Binary files differindex af736c7..af736c7 100644..100755 --- a/icons/pkg_calendar.png +++ b/icons/pkg_calendar.png diff --git a/icons/week.gif b/icons/week.gif Binary files differindex 9db43fc..9db43fc 100644..100755 --- a/icons/week.gif +++ b/icons/week.gif diff --git a/icons/weeklist.gif b/icons/weeklist.gif Binary files differindex 98c0e0f..98c0e0f 100644..100755 --- a/icons/weeklist.gif +++ b/icons/weeklist.gif diff --git a/icons/year.gif b/icons/year.gif Binary files differindex 064a07d..064a07d 100644..100755 --- a/icons/year.gif +++ b/icons/year.gif 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 '<div class="error">Calendar Package Not Active</div>'; }
\ No newline at end of file diff --git a/modules/help_mod_calendar.tpl b/modules/help_mod_calendar.tpl index 9e6db5d..9e6db5d 100644..100755 --- a/modules/help_mod_calendar.tpl +++ b/modules/help_mod_calendar.tpl 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 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); diff --git a/modules/mod_calendar.tpl b/modules/mod_calendar.tpl index 185d291..185d291 100644..100755 --- a/modules/mod_calendar.tpl +++ b/modules/mod_calendar.tpl diff --git a/modules/mod_minical.tpl b/modules/mod_minical.tpl index bf2d050..bf2d050 100644..100755 --- a/modules/mod_minical.tpl +++ b/modules/mod_minical.tpl diff --git a/styles/minical.css b/styles/minical.css index 80ecec5..80ecec5 100644..100755 --- a/styles/minical.css +++ b/styles/minical.css diff --git a/styles/plain.css b/styles/plain.css index cc04949..cc04949 100644..100755 --- a/styles/plain.css +++ b/styles/plain.css diff --git a/templates/calendar_nav_inc.tpl b/templates/calendar_nav_inc.tpl index d6604e9..d6604e9 100644..100755 --- a/templates/calendar_nav_inc.tpl +++ b/templates/calendar_nav_inc.tpl diff --git a/templates/calendar_options_inc.tpl b/templates/calendar_options_inc.tpl index e2a2120..e2a2120 100644..100755 --- a/templates/calendar_options_inc.tpl +++ b/templates/calendar_options_inc.tpl diff --git a/templates/calendar_preferences_inc.tpl b/templates/calendar_preferences_inc.tpl index a98d94a..a98d94a 100644..100755 --- a/templates/calendar_preferences_inc.tpl +++ b/templates/calendar_preferences_inc.tpl diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index cdb0ce7..cdb0ce7 100644..100755 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl diff --git a/templates/index.php b/templates/index.php index 3e305fe..c0437d0 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,4 +1,4 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); diff --git a/templates/menu_calendar.tpl b/templates/menu_calendar.tpl index cedf915..cedf915 100644..100755 --- a/templates/menu_calendar.tpl +++ b/templates/menu_calendar.tpl diff --git a/templates/menu_calendar_admin.tpl b/templates/menu_calendar_admin.tpl index 36e22f6..36e22f6 100644..100755 --- a/templates/menu_calendar_admin.tpl +++ b/templates/menu_calendar_admin.tpl diff --git a/templates/minical.tpl b/templates/minical.tpl index e5f6bcb..e5f6bcb 100644..100755 --- a/templates/minical.tpl +++ b/templates/minical.tpl diff --git a/templates/user_preferences_inc.tpl b/templates/user_preferences_inc.tpl index ebbc430..ebbc430 100644..100755 --- a/templates/user_preferences_inc.tpl +++ b/templates/user_preferences_inc.tpl |
