Changeset 3468771
- Timestamp:
- 02/24/2026 04:27:40 PM (5 weeks ago)
- Location:
- cs-integration
- Files:
-
- 84 added
- 9 edited
-
tags/1.0.7 (added)
-
tags/1.0.7/LICENSE.txt (added)
-
tags/1.0.7/README.md (added)
-
tags/1.0.7/README.txt (added)
-
tags/1.0.7/admin (added)
-
tags/1.0.7/admin/class-cs-integration-admin.php (added)
-
tags/1.0.7/admin/css (added)
-
tags/1.0.7/admin/css/cs-integration-admin.css (added)
-
tags/1.0.7/admin/index.php (added)
-
tags/1.0.7/admin/js (added)
-
tags/1.0.7/admin/js/cs-integration-admin.js (added)
-
tags/1.0.7/admin/partials (added)
-
tags/1.0.7/admin/partials/cs-integration-admin-display.php (added)
-
tags/1.0.7/assets (added)
-
tags/1.0.7/assets/arrow-back.svg (added)
-
tags/1.0.7/assets/arrow-forward.svg (added)
-
tags/1.0.7/assets/calendar.svg (added)
-
tags/1.0.7/assets/caret-down-filled.svg (added)
-
tags/1.0.7/assets/clock.svg (added)
-
tags/1.0.7/assets/close.svg (added)
-
tags/1.0.7/assets/icon-256x256.png (added)
-
tags/1.0.7/assets/location.svg (added)
-
tags/1.0.7/cs-integration.php (added)
-
tags/1.0.7/fonts (added)
-
tags/1.0.7/fonts/glyphs (added)
-
tags/1.0.7/fonts/glyphs/LICENSE.txt (added)
-
tags/1.0.7/fonts/glyphs/README.txt (added)
-
tags/1.0.7/fonts/glyphs/config.json (added)
-
tags/1.0.7/fonts/glyphs/css (added)
-
tags/1.0.7/fonts/glyphs/css/animation.css (added)
-
tags/1.0.7/fonts/glyphs/css/glyphs-codes.css (added)
-
tags/1.0.7/fonts/glyphs/css/glyphs-embedded.css (added)
-
tags/1.0.7/fonts/glyphs/css/glyphs-ie7-codes.css (added)
-
tags/1.0.7/fonts/glyphs/css/glyphs-ie7.css (added)
-
tags/1.0.7/fonts/glyphs/css/glyphs.css (added)
-
tags/1.0.7/fonts/glyphs/demo.html (added)
-
tags/1.0.7/fonts/glyphs/font (added)
-
tags/1.0.7/fonts/glyphs/font/glyphs.eot (added)
-
tags/1.0.7/fonts/glyphs/font/glyphs.svg (added)
-
tags/1.0.7/fonts/glyphs/font/glyphs.ttf (added)
-
tags/1.0.7/fonts/glyphs/font/glyphs.woff (added)
-
tags/1.0.7/fonts/glyphs/font/glyphs.woff2 (added)
-
tags/1.0.7/includes (added)
-
tags/1.0.7/includes/class-cs-integration-activator.php (added)
-
tags/1.0.7/includes/class-cs-integration-deactivator.php (added)
-
tags/1.0.7/includes/class-cs-integration-i18n.php (added)
-
tags/1.0.7/includes/class-cs-integration-loader.php (added)
-
tags/1.0.7/includes/class-cs-integration.php (added)
-
tags/1.0.7/includes/index.php (added)
-
tags/1.0.7/index.php (added)
-
tags/1.0.7/languages (added)
-
tags/1.0.7/languages/cs-integration.pot (added)
-
tags/1.0.7/languages/en_GB.mo (added)
-
tags/1.0.7/languages/en_GB.po (added)
-
tags/1.0.7/languages/fr.mo (added)
-
tags/1.0.7/languages/fr.po (added)
-
tags/1.0.7/public (added)
-
tags/1.0.7/public/class-cs-integration-public.php (added)
-
tags/1.0.7/public/css (added)
-
tags/1.0.7/public/css/cs-integration-public.css (added)
-
tags/1.0.7/public/index.php (added)
-
tags/1.0.7/public/js (added)
-
tags/1.0.7/public/js/cs-integration-public-orig.js (added)
-
tags/1.0.7/public/js/cs-integration-public.js (added)
-
tags/1.0.7/public/partials (added)
-
tags/1.0.7/public/partials/cs-integration-public-display.php (added)
-
tags/1.0.7/public/shortcodes (added)
-
tags/1.0.7/public/shortcodes/class-churchsuite.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-calendar-event-view.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-calendar-shortcode.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-compact-event-view.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-event-card-view.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-event-cards-shortcode.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-event-list-shortcode.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-event.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-group-view.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-group.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-item.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-json-api.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-shortcode.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-smallgroups-shortcode.php (added)
-
tags/1.0.7/public/shortcodes/class-cs-view.php (added)
-
tags/1.0.7/public/shortcodes/index.php (added)
-
tags/1.0.7/uninstall.php (added)
-
trunk/README.md (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/cs-integration.php (modified) (2 diffs)
-
trunk/public/shortcodes/class-cs-calendar-event-view.php (modified) (2 diffs)
-
trunk/public/shortcodes/class-cs-calendar-shortcode.php (modified) (10 diffs)
-
trunk/public/shortcodes/class-cs-compact-event-view.php (modified) (3 diffs)
-
trunk/public/shortcodes/class-cs-event-card-view.php (modified) (4 diffs)
-
trunk/public/shortcodes/class-cs-event-list-shortcode.php (modified) (2 diffs)
-
trunk/public/shortcodes/class-cs-group.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cs-integration/trunk/README.md
r3357920 r3468771 3 3 * Tags: Events, ChurchSuite, Featured 4 4 * Requires at least: 6.4 5 * Tested up to: 6. 86 * Stable tag: 1.0. 65 * Tested up to: 6.9 6 * Stable tag: 1.0.7 7 7 * License: GPLv2 or later 8 8 … … 209 209 ## Changelog 210 210 211 ### 1.0.7 212 213 **2026-02-24** 214 * Added output of dates which takes account of the current Locale of the server 215 * Bumped version number 216 * Bumped Wordpress Compatibility testing to 6.9 217 211 218 ### 1.0.6 212 219 -
cs-integration/trunk/README.txt
r3357920 r3468771 3 3 * Tags: Events, ChurchSuite, Featured 4 4 * Requires at least: 6.4 5 * Tested up to: 6. 86 * Stable tag: 1.0. 65 * Tested up to: 6.9 6 * Stable tag: 1.0.7 7 7 * License: GPLv2 or later 8 8 … … 209 209 == Changelog == 210 210 211 = 1.0.7 = 212 213 **2026-02-24** 214 * Added output of dates which takes account of the current Locale of the server 215 * Bumped version number 216 * Bumped Wordpress Compatibility testing to 6.9 217 211 218 = 1.0.6 = 212 219 -
cs-integration/trunk/cs-integration.php
r3357920 r3468771 20 20 * Plugin URI: https://github.com/AlwynBarry/cs-integration 21 21 * Description: CS Integration provides shortcodes to request and display JSON data from the public JSON ChurchSuite feeds. 22 * Version: 1.0. 622 * Version: 1.0.7 23 23 * Author: Alwyn Barry 24 24 * Author URI: https://github.com/AlwynBarry/ … … 39 39 * This will be updated it as we release new versions. 40 40 */ 41 const CS_INTEGRATION_VERSION = '1.0. 3';41 const CS_INTEGRATION_VERSION = '1.0.7'; 42 42 43 43 /** -
cs-integration/trunk/public/shortcodes/class-cs-calendar-event-view.php
r3354836 r3468771 59 59 */ 60 60 public function display() : string { 61 // A value to prevent repeated creation of a new instance 62 $timeFormat = datefmt_create( 63 \Locale::getDefault(), 64 \IntlDateFormatter::NONE, 65 \IntlDateFormatter::SHORT, 66 null, 67 \IntlDateFormatter::GREGORIAN 68 ); 61 69 // Display the event wrapper, and include the event unique ID, the event 62 70 // status and the event category as classes to be styled, if these are set … … 78 86 $event_time = ''; 79 87 if ( $this->cs_event->is_start_date() ) { 80 $event_time .= ' <div class="cs-time"><span class="cs-start-time">' . date _format( $this->cs_event->get_start_date(), 'g:ia') . '</span>';81 $event_time .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="cs-end-time">' . date _format( $this->cs_event->get_end_date(), 'g:ia') . '</span>' : '';88 $event_time .= ' <div class="cs-time"><span class="cs-start-time">' . datefmt_format( $timeFormat, $this->cs_event->get_start_date() ) . '</span>'; 89 $event_time .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="cs-end-time">' . datefmt_format( $timeFormat, $this->cs_event->get_end_date() ) . '</span>' : ''; 82 90 $event_time .= '</div>' . "\n"; 83 91 } -
cs-integration/trunk/public/shortcodes/class-cs-calendar-shortcode.php
r3350221 r3468771 47 47 * Constant values created to prevent unnecessary re-creation of values used in expressions 48 48 */ 49 protected \IntlDateFormatter $shortDayFormat; 50 protected \IntlDateFormatter $shortMonthFormat; 51 protected \IntlDateFormatter $longMonthFormat; 49 52 protected readonly \DateInterval $one_day; 50 53 protected readonly \DateInterval $one_week; … … 58 61 protected \DateTime $date_from; 59 62 protected \DateTime $date_to; 63 protected \DateTime $date_beyond; // A constant just to help mark when we're outside the calendar 60 64 61 65 /* … … 69 73 */ 70 74 public function __construct( $atts ) { 71 // Set the values always required by this shortcode 75 // Set the date formatters used to remove repeated instance creation 76 $this->set_date_formatters(); 77 78 // Set the date constants used to remove repeated instance creation 72 79 $this->page_url = get_permalink(); 73 80 $this->one_day = \DateInterval::createFromDateString( '1 day' ); … … 98 105 $this->date_from = self::get_sunday_before_month( $this->month_start ); 99 106 $this->date_to = self::get_saturday_after_month( $this->month_start ); 107 $this->date_beyond = clone $this->date_to; 108 $this->date_beyond->add( $this->one_day ); 100 109 101 110 // Override or set the atts we need so we get the events for this month … … 107 116 // Now we can call the parent constructor to set all other attributes 108 117 parent::__construct( $atts, ChurchSuite::EVENTS ); 118 } 119 120 /* 121 * Set the 'constant' values used to remove repeated instance creation of the required date formatters. 122 * 123 * @since 1.0.2 124 */ 125 private function set_date_formatters() { 126 $this->shortDayFormat = datefmt_create( 127 \Locale::getDefault(), 128 \IntlDateFormatter::FULL, 129 \IntlDateFormatter::NONE, 130 null, 131 \IntlDateFormatter::GREGORIAN, 132 'EEE' 133 ); 134 $this->shortMonthFormat = datefmt_create( 135 \Locale::getDefault(), 136 \IntlDateFormatter::FULL, 137 \IntlDateFormatter::NONE, 138 null, 139 \IntlDateFormatter::GREGORIAN, 140 'MMM' 141 ); 142 $this->longMonthFormat = datefmt_create( 143 \Locale::getDefault(), 144 \IntlDateFormatter::FULL, 145 \IntlDateFormatter::NONE, 146 null, 147 \IntlDateFormatter::GREGORIAN, 148 'MMMM' 149 ); 109 150 } 110 151 … … 221 262 . ' <div class="cs-calendar-month-header">' . "\n" 222 263 . ' <div class="cs-calendar-month-title">' . "\n" 223 . ' ' . $date->format( 'F' ) . ' ' .$date->format( 'Y' ) . "\n"264 . ' ' . datefmt_format($this->longMonthFormat, $date) . ' ' . $date->format( 'Y' ) . "\n" 224 265 . ' </div>' . "\n" 225 . ' <div class="cs-calendar-month-nav">' . "\n"266 . ' <div class="cs-calendar-month-nav">' . "\n" 226 267 . ' <button type="button" class="cs-calendar-previous-link" onclick="window.location.href=' . $this->get_previous_month_link() . '">' . "\n" 227 . ' <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">' . "\n"228 . ' <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>' . "\n"229 . ' </svg>' . "\n"230 . ' </button>' . "\n"268 . ' <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">' . "\n" 269 . ' <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>' . "\n" 270 . ' </svg>' . "\n" 271 . ' </button>' . "\n" 231 272 . ' <button type="button" class="cs-calendar-next-link" onclick="window.location.href=' . $this->get_next_month_link() . '">' . "\n" 232 . ' <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">' . "\n"233 . ' <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>' . "\n"234 . ' </svg>' . "\n"235 . ' </button>' . "\n"236 . ' </div>' . "\n"273 . ' <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">' . "\n" 274 . ' <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>' . "\n" 275 . ' </svg>' . "\n" 276 . ' </button>' . "\n" 277 . ' </div>' . "\n" 237 278 . ' </div>' . "\n" 238 . ' <div class="cs-calendar-days-grid">' . "\n"279 . ' <div class="cs-calendar-days-grid">' . "\n" 239 280 . ' <div class="cs-calendar-day-name-header">' . "\n"; 240 281 … … 246 287 $period = new \DatePeriod( $sunday_date, $this->one_day, $saturday_date ); 247 288 foreach ( $period as $day ) { 248 $output .= ' <div class="cs-calendar-day-name-cell">' . $day->format( 'D') . '</div>' . "\n";289 $output .= ' <div class="cs-calendar-day-name-cell">' . datefmt_format($this->shortDayFormat, $day) . '</div>' . "\n"; 249 290 } 250 291 … … 253 294 254 295 . ' </div>' . "\n" 255 . ' <div class="cs-calendar-days">' . "\n";256 return $output;296 . ' <div class="cs-calendar-days">' . "\n"; 297 return $output; 257 298 } 258 299 … … 288 329 $output .= ' <span class="cs-day">' . $date->format( 'D' ) . '</span>' . "\n"; 289 330 $output .= ' <span class="cs-date-number">' . $day . '</span>' . "\n"; 290 $output .= ' <span class="cs-month">' . $date->format( 'F') . '</span>' . "\n";331 $output .= ' <span class="cs-month">' . datefmt_format($this->shortMonthFormat, $date) . '</span>' . "\n"; 291 332 $output .= ' <span class="cs-year">' . $date->format( 'Y' ) . '</span>' . "\n"; 292 333 $output .= ' </div>'; … … 326 367 $date = clone $this->date_from; 327 368 // Output the start of the first row of the table, for the first week 328 // $output .= '<div class="cs-calendar-row">' . "\n";329 369 $output .= self::get_day_top( $date, $this->is_date_in_month( $date ), $this->is_date_today( $date ) ); 330 370 // Iterate over all events in the month; If none, the later loop will print out the blank month -
cs-integration/trunk/public/shortcodes/class-cs-compact-event-view.php
r3257115 r3468771 32 32 33 33 /* 34 * Constant values created to prevent unnecessary re-creation of values used in expressions 35 * @since 1.0.0 36 */ 37 protected \IntlDateFormatter $timeFormat; 38 39 /* 34 40 * The event to be displayed, set via the constructor 35 41 * @since 1.0.0 … … 51 57 parent::__construct( $cs ); 52 58 $this->cs_event = $cs_event; 59 $this->set_date_formatters(); 60 } 61 62 /* 63 * Set the 'constant' values used to remove repeated instance creation of the required date formatters. 64 */ 65 private function set_date_formatters() { 66 // Set the date formatters used to remove repeated instance creation 67 $this->timeFormat = datefmt_create( 68 \Locale::getDefault(), 69 \IntlDateFormatter::NONE, 70 \IntlDateFormatter::SHORT, 71 null, 72 \IntlDateFormatter::GREGORIAN 73 ); 53 74 } 54 75 … … 68 89 // Display the event time and the end time if provided 69 90 if ( $this->cs_event->is_start_date() ) { 70 $output .= ' <div class="cs-time"><span class="cs-start-time">' . date _format( $this->cs_event->get_start_date(), 'g:ia') . '</span>';71 $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="cs-end-time">' . date _format( $this->cs_event->get_end_date(), 'g:ia') . '</span>' : '';91 $output .= ' <div class="cs-time"><span class="cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>'; 92 $output .= ( $this->cs_event->is_end_date() ) ? '-' . '<span class="cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' : ''; 72 93 $output .= '</div>' . "\n"; 73 94 } -
cs-integration/trunk/public/shortcodes/class-cs-event-card-view.php
r3257115 r3468771 32 32 33 33 /* 34 * Constant values created to prevent unnecessary re-creation of values used in expressions 35 * @since 1.0.2 36 * @access protected 37 * @var \IntlDateFormatter $monthAndDateFormat - a date formatter for month name and date 38 * @var \IntlDateFormatter $timeFormat - a date formatter for a hour:min time 39 */ 40 protected \IntlDateFormatter $monthAndDateFormat; 41 protected \IntlDateFormatter $timeFormat; 42 43 /* 34 44 * The event to be displayed, set via the constructor 35 45 * @since 1.0.0 … … 51 61 parent::__construct( $cs ); 52 62 $this->cs_event = $cs_event; 63 $this->set_date_formatters(); 64 } 65 66 /* 67 * Set the 'constant' values used to remove repeated instance creation of the required date formatters. 68 * 69 * @since 1.0.7 70 */ 71 private function set_date_formatters() { 72 // Set the date formatters used to remove repeated instance creation 73 $this->monthAndDateFormat = datefmt_create( 74 \Locale::getDefault(), 75 \IntlDateFormatter::MEDIUM, 76 \IntlDateFormatter::NONE, 77 null, 78 \IntlDateFormatter::GREGORIAN 79 ); 80 $this->timeFormat = datefmt_create( 81 \Locale::getDefault(), 82 \IntlDateFormatter::NONE, 83 \IntlDateFormatter::SHORT, 84 null, 85 \IntlDateFormatter::GREGORIAN 86 ); 53 87 } 54 88 … … 61 95 */ 62 96 public function display() : string { 97 63 98 // Display the card, and include the event unique ID 64 99 $output = '<div ' … … 82 117 // Display the start and end times where they are provided 83 118 if ( $this->cs_event->is_start_date() ) { 84 $output .= ' <div class="cs-date"><span class="cs-date-gliph">' . date _format( $this->cs_event->get_start_date(),'M jS, Y') . '</span></div>' . "\n";119 $output .= ' <div class="cs-date"><span class="cs-date-gliph">' . datefmt_format( $this->monthAndDateFormat, $this->cs_event->get_start_date() ) . '</span></div>' . "\n"; 85 120 $output .= ' <div class="cs-time">'; 86 $output .= ' <span class="cs-time-gliph cs-start-time">' . date _format( $this->cs_event->get_start_date(), 'g:ia') . '</span>';87 $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="cs-end-time">' . date _format( $this->cs_event->get_end_date(), 'g:ia') . '</span>' . "\n" : "\n";121 $output .= ' <span class="cs-time-gliph cs-start-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_start_date() ) . '</span>'; 122 $output .= ( $this->cs_event->is_end_date() ) ? ' - <span class="cs-end-time">' . datefmt_format( $this->timeFormat, $this->cs_event->get_end_date() ) . '</span>' . "\n" : "\n"; 88 123 $output .= ' </div>' . "\n"; 89 124 } -
cs-integration/trunk/public/shortcodes/class-cs-event-list-shortcode.php
r3357920 r3468771 51 51 protected readonly \DateInterval $one_day; 52 52 53 /* 54 * Process the supplied attributes to leave only valid parameters, create the URLs 55 * required for the JSON feed from ChurchSuite and create the means to communicate via 56 * that JSON feed. Also, create the unique cache key appropriate for this query. 57 * 58 * @since 1.0.0 59 * @param array() $atts An array of strings representing the attributes of the JSON call 60 * Mandatory params: church_name - the ChurchSuite recognised name of the church 61 */ 53 62 public function __construct( $atts ) { 54 63 parent::__construct( $atts, ChurchSuite::EVENTS ); 64 // Set the convenience constant, used to reduce re-calculation in the loop over events 55 65 $this->one_day = \DateInterval::createFromDateString( '1 day' ); 56 66 } … … 65 75 protected function display_event_date( \DateTime $event_date ) : string { 66 76 $result = '<div class="cs-date">'; 67 $result .= '<span class="cs-day">' . $event_date->format( 'D') . '</span>';68 $result .= '<span class="cs-date-number">' . $event_date->format( 'd') . '</span>';69 $result .= '<span class="cs-month">' . $event_date->format( 'M') . '</span>';70 $result .= '<span class="cs-year">' . $event_date->format( 'Y') . '</span>';77 $result .= '<span class="cs-day">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'EE' ), $event_date ) . '</span>'; 78 $result .= '<span class="cs-date-number">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'dd' ), $event_date ) . '</span>'; 79 $result .= '<span class="cs-month">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'MMM' ), $event_date ) . '</span>'; 80 $result .= '<span class="cs-year">' . datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::NONE, null, \IntlDateFormatter::GREGORIAN, 'yyyy' ), $event_date ) . '</span>'; 71 81 $result .= '</div>'; 72 82 return $result; -
cs-integration/trunk/public/shortcodes/class-cs-group.php
r3257115 r3468771 147 147 protected function fetch_time_of_meeting( \stdclass $group_obj ) : string { 148 148 return ( isset( $group_obj->time ) && ( $group_obj->time !== '' ) ) 149 ? date _format( date_create( $group_obj->time ), 'g:ia')149 ? datefmt_format( datefmt_create( \Locale::getDefault(), \IntlDateFormatter::NONE, \IntlDateFormatter::SHORT, null, \IntlDateFormatter::GREGORIAN ), date_create( $group_obj->time ) ) 150 150 : '' ; 151 151 }
Note: See TracChangeset
for help on using the changeset viewer.