Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -12,7 +12,7 @@
namespace IPS\calendar\widgets;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
@@ -38,21 +38,13 @@ class _upcomingEvents extends \IPS\Widget\PermissionCache
*/
public $plugin = '';
/**
* @brief Cache Expiration
* @note We allow this cache to be valid for 12 hours
*/
public $cacheExpiration = 43200;
/**
* Constructor
*
* @param String $uniqueKey Unique key for this specific instance
* @param string $uniqueKey Unique key for this specific instance
* @param array $configuration Widget custom configuration
* @param null|string|array $access Array/JSON string of executable apps (core=sidebar only, content=IP.Content only, etc)
* @param null|string $orientation Orientation (top, bottom, right, left)
* @param boolean $allowReuse If true, when the block is used, it will remain in the sidebar so it can be used again.
* @param string $menuStyle Menu is a drop down menu, modal is a bigger modal panel.
* @return void
*/
public function __construct( $uniqueKey, array $configuration, $access=null, $orientation=null )
@@ -83,10 +75,7 @@ class _upcomingEvents extends \IPS\Widget\PermissionCache
*/
public function configuration( &$form=null )
{
if ( $form === null )
{
$form = new \IPS\Helpers\Form;
}
$form = parent::configuration( $form );
/* Container */
$form->add( new \IPS\Helpers\Form\Node( 'widget_calendar', isset( $this->configuration['widget_calendar'] ) ? $this->configuration['widget_calendar'] : 0, FALSE, array(
@@ -110,7 +99,7 @@ class _upcomingEvents extends \IPS\Widget\PermissionCache
*/
public function preConfig( $values )
{
if ( is_array( $values['widget_calendar'] ) )
if ( \is_array( $values['widget_calendar'] ) )
{
$values['widget_calendar'] = array_keys( $values['widget_calendar'] );
}
@@ -161,10 +150,10 @@ class _upcomingEvents extends \IPS\Widget\PermissionCache
}
}
$events = \IPS\calendar\Event::retrieveEvents( $_today, $endDate, ( $calendars === NULL ? NULL : !is_array( $calendars ) ? array( $calendars ) : $calendars ), $count, FALSE );
$events = \IPS\calendar\Event::retrieveEvents( $_today, $endDate, ( $calendars === NULL ? NULL : !\is_array( $calendars ) ? array( $calendars ) : $calendars ), $count, FALSE );
/* Auto hiding? */
if( !count($events) AND isset( $this->configuration['auto_hide'] ) AND $this->configuration['auto_hide'] )
if( !\count($events) AND isset( $this->configuration['auto_hide'] ) AND $this->configuration['auto_hide'] )
{
return '';
}