Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

@@ -1,13 +1,12 @@
<?php
/**
* @brief Announcements Extension: Calendar
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 29 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\Announcements;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Content Router extension: Calendar
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 7 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\ContentRouter;
@@ -32,10 +31,10 @@ class _Calendar
/**
* Constructor
*
* @param \IPS\Member|NULL $member If checking access, the member to check for, or NULL to not check access
* @param \IPS\Member|IPS\Member\Group|NULL $member If checking access, the member/group to check for, or NULL to not check access
* @return void
*/
public function __construct( \IPS\Member $member = NULL )
public function __construct( $member = NULL )
{
if ( $member === NULL or $member->canAccessModule( \IPS\Application\Module::get( 'calendar', 'calendar', 'front' ) ) )
{
@@ -1,13 +1,12 @@
<?php
/**
* @brief Create Menu Extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 23 Dec 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\CreateMenu;
@@ -1,13 +1,12 @@
<?php
/**
* @brief Editor Extension: Event text
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 7 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\EditorLocations;
@@ -0,0 +1,77 @@
<?php
/**
* @brief Editor Extension: Venue
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Venues
* @since 10 Feb 2017
*/
namespace IPS\calendar\extensions\core\EditorLocations;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* Editor Extension: Venue
*/
class _Venue
{
/**
* Can we use HTML in this editor?
*
* @param \IPS\Member $member The member
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
public function canUseHtml( $member )
{
return NULL;
}
/**
* Can we use attachments in this editor?
*
* @param \IPS\Member $member The member
* @param \IPS\Helpers\Form\Editor $field The editor field
* @return bool|null NULL will cause the default value (based on the member's permissions) to be used, and is recommended in most cases. A boolean value will override that.
*/
public function canAttach( $member, $field )
{
return FALSE;
}
/**
* Permission check for attachments
*
* @param \IPS\Member $member The member
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @param array $attachment The attachment data
* @return bool
*/
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment )
{
return TRUE;
}
/**
* Attachment lookup
*
* @param int|null $id1 Primary ID
* @param int|null $id2 Secondary ID
* @param string|null $id3 Arbitrary data
* @return \IPS\Http\Url|\IPS\Content|\IPS\Node\Model
* @throws \LogicException
*/
public function attachmentLookup( $id1, $id2, $id3 )
{
// return \IPS\Http\Url::internal( ... );
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief File Storage Extension: Events
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 13 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\FileStorage;
@@ -81,7 +80,7 @@ class _Events
/**
* Check if a file is valid
*
* @param \IPS\Http\Url $file The file to check
* @param string $file The file path to check
* @return bool
*/
public function isValidFile( $file )
@@ -1,13 +1,12 @@
<?php
/**
* @brief Front Navigation Extension: Calendar
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 23 Dec 2013
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\FrontNavigation;
@@ -71,6 +70,6 @@ class _Calendar extends \IPS\core\FrontNavigation\FrontNavigationAbstract
*/
public function active()
{
return \IPS\Dispatcher::i()->application->directory === 'calendar';
return !\IPS\core\FrontNavigation::$clubTabActive and \IPS\Dispatcher::i()->application->directory === 'calendar';
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief ACP Live Search Extension
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 08 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\LiveSearch;
@@ -54,7 +53,7 @@ class _Calendars
$calendars = \IPS\Db::i()->select(
"*",
'calendar_calendars',
array( "word_custom LIKE CONCAT( '%', ?, '%' ) AND lang_id=?", $searchTerm, \IPS\Member::loggedIn()->language()->id ),
array( "cal_club_id IS NULL AND word_custom LIKE CONCAT( '%', ?, '%' ) AND lang_id=?", $searchTerm, \IPS\Member::loggedIn()->language()->id ),
NULL,
NULL
)->join(
@@ -1,13 +1,12 @@
<?php
/**
* @brief Member Sync
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 7 Jan 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\MemberSync;
@@ -36,6 +35,7 @@ class _Calendar
\IPS\Db::i()->update( 'calendar_event_rsvp', array( 'rsvp_member_id' => $member->member_id ), array( 'rsvp_member_id=?', $member2->member_id ), array(), NULL, \IPS\Db::IGNORE );
\IPS\Db::i()->update( 'calendar_import_feeds', array( 'feed_member_id' => $member->member_id ), array( 'feed_member_id=?', $member2->member_id ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_approved_by' => $member->member_id ), array( 'event_approved_by=?', $member2->member_id ) );
\IPS\Db::i()->update( 'calendar_event_reminders', array( 'reminder_member_id' => $member->member_id ), array( 'reminder_member_id=?', $member2->member_id ) );
}
/**
@@ -49,5 +49,6 @@ class _Calendar
\IPS\Db::i()->delete( 'calendar_event_rsvp', array( 'rsvp_member_id=?', $member->member_id ) );
\IPS\Db::i()->update( 'calendar_import_feeds', array( 'feed_member_id' => 0 ), array( 'feed_member_id=?', $member->member_id ) );
\IPS\Db::i()->update( 'calendar_events', array( 'event_approved_by' => 0 ), array( 'event_approved_by=?', $member->member_id ) );
\IPS\Db::i()->delete( 'calendar_event_reminders', array( 'reminder_member_id=?', $member->member_id ) );
}
}
@@ -1,12 +1,11 @@
<?php
/**
* @brief Notification Options
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 20 May 2016
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\Notifications;
@@ -31,7 +30,9 @@ class _Events
*/
public function getConfiguration( $member )
{
return array();
return array(
'event_reminder' => array( 'default' => array( 'email' ), 'disabled' => array() ),
);
}
/**
@@ -66,4 +67,37 @@ class _Events
'unread' => (bool) ( $item->unread() )
);
}
/**
* Parse notification: Event reminder
*
* @param \IPS\Notification\Inline $notification The notification
* @return array
* @code
return array(
'title' => "Mark has replied to A Topic", // The notification title
'url' => new \IPS\Http\Url( ... ), // The URL the notification should link to
'content' => "Lorem ipsum dolar sit", // [Optional] Any appropriate content. Do not format this like an email where the text
// explains what the notification is about - just include any appropriate content.
// For example, if the notification is about a post, set this as the body of the post.
'author' => \IPS\Member::load( 1 ), // [Optional] The user whose photo should be displayed for this notification
);
* @endcode
*/
public function parse_event_reminder( $notification )
{
$item = $notification->item;
if ( !$item )
{
throw new \OutOfRangeException;
}
return array(
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'notification__event_reminder', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( "days_to_go", FALSE, array( 'pluralize' => array( $notification->extra['daysToGo'] ) ) ), $item->mapped('title') ) ) ),
'url' => $notification->item->url(),
'content' => $notification->item->content(),
'author' => $notification->item->author(),
'unread' => (bool) ( $item->unread() )
);
}
}
@@ -1,13 +1,12 @@
<?php
/**
* @brief Permissions
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 16 Apr 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\calendar\extensions\core\Permissions;
@@ -0,0 +1,64 @@
<?php
/**
* @brief Activity stream items extension: StreamItems
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @subpackage Calendar
* @since 21 Feb 2017
*/
namespace IPS\calendar\extensions\core\StreamItems;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* @brief Activity stream items extension: StreamItems
*/
class _StreamItems
{
/**
* Is there content to display?
*
* @param \IPS\Member|NULL $author The author to limit extra items to
* @param Timestamp|NULL $lastTime If provided, only items since this date are included. If NULL, it works out which to include based on what results are being shown
* @param Timestamp|NULL $firstTime If provided, only items before this date are included. If NULL, it works out which to include based on what results are being shown
* @return array Array of \IPS\Content\Search\Result\Custom objects
*/
public function extraItems( $author=NULL, $lastTime=NULL, $firstTime=NULL )
{
$rsvps = array();
/* RSVP */
$where = array( array( 'rsvp_date>? and calendar_event_rsvp.rsvp_response=?', $lastTime, 1 ) );
if ( $firstTime )
{
$where[] = array( 'rsvp_date<?', $firstTime );
}
if ( $author )
{
$where[] = array( 'calendar_event_rsvp.rsvp_member_id=?', $author->member_id );
}
foreach ( \IPS\Db::i()->select( '*', 'calendar_event_rsvp', $where, 'rsvp_date DESC', 10 ) as $rsvp )
{
$member = \IPS\Member::load( $rsvp['rsvp_member_id'] );
$event = \IPS\calendar\Event::load( $rsvp[ 'rsvp_event_id' ] );
$rsvps[] = new \IPS\Content\Search\Result\Custom( \IPS\DateTime::ts( $rsvp[ 'rsvp_date' ] ), \IPS\Member::loggedIn()->language()->addToStack( 'calendar_activity_stream_rsvp', FALSE, array( 'htmlsprintf' => array( \IPS\Theme::i()->getTemplate( 'global', 'core', 'front' )->userLink( $member ), $event->url(), $event->title ) ) ) );
}
/* Return */
if ( !empty( $rsvps ) )
{
return $rsvps;
}
return array();
}
}