Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\Announcements;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\ContentRouter;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\CreateMenu;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\EditorLocations;
|
||||
|
||||
/* 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;
|
||||
@@ -59,7 +59,7 @@ class _Venue
|
||||
*/
|
||||
public function attachmentPermissionCheck( $member, $id1, $id2, $id3, $attachment, $viewOnly=FALSE )
|
||||
{
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\FileStorage;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\FrontNavigation;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\LiveSearch;
|
||||
|
||||
/* 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;
|
||||
@@ -26,7 +26,7 @@ class _Calendars
|
||||
/**
|
||||
* Check we have access
|
||||
*
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAccess()
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class _Calendars
|
||||
/**
|
||||
* Get the search results
|
||||
*
|
||||
* @param string Search Term
|
||||
* @param string $searchTerm Search Term
|
||||
* @return array Array of results
|
||||
*/
|
||||
public function getResults( $searchTerm )
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\MemberSync;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
namespace IPS\calendar\extensions\core\Notifications;
|
||||
|
||||
/* 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;
|
||||
@@ -23,15 +23,23 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
class _Events
|
||||
{
|
||||
/**
|
||||
* Get configuration
|
||||
* Get fields for configuration
|
||||
*
|
||||
* @param \IPS\Member|null $member The member
|
||||
* @param \IPS\Member|null $member The member (to take out any notification types a given member will never see) or NULL if this is for the ACP
|
||||
* @return array
|
||||
*/
|
||||
public function getConfiguration( $member )
|
||||
public static function configurationOptions( \IPS\Member $member = NULL )
|
||||
{
|
||||
return array(
|
||||
'event_reminder' => array( 'default' => array( 'email' ), 'disabled' => array() ),
|
||||
'event_reminder' => array(
|
||||
'type' => 'standard',
|
||||
'notificationTypes' => array( 'event_reminder' ),
|
||||
'title' => 'notifications__calendar_Events',
|
||||
'showTitle' => FALSE,
|
||||
'description' => 'notifications__calendar_Events_desc',
|
||||
'default' => array( 'inline', 'push', 'email' ),
|
||||
'disabled' => array()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -39,6 +47,7 @@ class _Events
|
||||
* Parse notification: new_content
|
||||
*
|
||||
* @param \IPS\Notification\Inline $notification The notification
|
||||
* @param bool $htmlEscape TRUE to escape HTML in title
|
||||
* @return array
|
||||
* @code
|
||||
return array(
|
||||
@@ -51,7 +60,7 @@ class _Events
|
||||
);
|
||||
* @endcode
|
||||
*/
|
||||
public function parse_new_content( $notification )
|
||||
public function parse_new_content( $notification, $htmlEscape=TRUE )
|
||||
{
|
||||
$item = $notification->item;
|
||||
if ( !$item )
|
||||
@@ -60,7 +69,14 @@ class _Events
|
||||
}
|
||||
|
||||
return array(
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'notification__new_content', FALSE, array( 'sprintf' => array( $item->author()->name, mb_strtolower( $item->indefiniteArticle() ), $item->container()->_title, $item->mapped('title') ) ) ),
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'notification__new_content', FALSE, array(
|
||||
( $htmlEscape ? 'sprintf' : 'htmlsprintf' ) => array(
|
||||
$item->author()->name,
|
||||
mb_strtolower( $item->indefiniteArticle() ),
|
||||
$item->container()->getTitleForLanguage( \IPS\Member::loggedIn()->language(), $htmlEscape ? array( 'escape' => TRUE ) : array() ),
|
||||
$item->mapped('title')
|
||||
)
|
||||
) ),
|
||||
'url' => $notification->item->url(),
|
||||
'content' => $notification->item->content(),
|
||||
'author' => $notification->item->author(),
|
||||
@@ -72,6 +88,7 @@ class _Events
|
||||
* Parse notification: Event reminder
|
||||
*
|
||||
* @param \IPS\Notification\Inline $notification The notification
|
||||
* @param bool $htmlEscape TRUE to escape HTML in title
|
||||
* @return array
|
||||
* @code
|
||||
return array(
|
||||
@@ -84,7 +101,7 @@ class _Events
|
||||
);
|
||||
* @endcode
|
||||
*/
|
||||
public function parse_event_reminder( $notification )
|
||||
public function parse_event_reminder( $notification, $htmlEscape=TRUE )
|
||||
{
|
||||
$item = $notification->item;
|
||||
if ( !$item )
|
||||
@@ -93,11 +110,37 @@ class _Events
|
||||
}
|
||||
|
||||
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') ) ) ),
|
||||
'title' => \IPS\Member::loggedIn()->language()->addToStack( 'notification__event_reminder', FALSE, array(
|
||||
( $htmlEscape ? 'sprintf' : 'htmlsprintf' ) => 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() )
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse notification for mobile: event_reminder
|
||||
*
|
||||
* @param \IPS\Lang $language The language that the notification should be in
|
||||
* @param \IPS\Member $member The member that started following the recipient
|
||||
* @return array
|
||||
*/
|
||||
public static function parse_mobile_event_reminder( \IPS\Lang $language, \IPS\calendar\Event $event, $daysToGo )
|
||||
{
|
||||
return array(
|
||||
'body' => $language->addToStack( 'notification__event_reminder', FALSE, array( 'htmlsprintf' => array(
|
||||
$language->addToStack( "days_to_go", FALSE, array( 'pluralize' => array(
|
||||
$daysToGo
|
||||
) ) ),
|
||||
$event->mapped('title')
|
||||
) ) ),
|
||||
'data' => array(
|
||||
'url' => (string) $event->url(),
|
||||
'author' => $event->author()
|
||||
),
|
||||
'channelId' => 'events',
|
||||
);
|
||||
}
|
||||
}
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\Permissions;
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
namespace IPS\calendar\extensions\core\StreamItems;
|
||||
|
||||
/* 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;
|
||||
@@ -47,14 +47,21 @@ class _StreamItems
|
||||
}
|
||||
foreach ( \IPS\Db::i()->select( '*', 'calendar_event_rsvp', $where, 'rsvp_date DESC', 10 ) as $rsvp )
|
||||
{
|
||||
$event = \IPS\calendar\Event::load( $rsvp[ 'rsvp_event_id' ] );
|
||||
|
||||
if( $event->canView() )
|
||||
try
|
||||
{
|
||||
$member = \IPS\Member::load( $rsvp['rsvp_member_id'] );
|
||||
$title = htmlspecialchars( $event->title, ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
$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(), $title ) ) ) );
|
||||
$event = \IPS\calendar\Event::load( $rsvp[ 'rsvp_event_id' ] );
|
||||
if( $event->canView() )
|
||||
{
|
||||
$member = \IPS\Member::load( $rsvp['rsvp_member_id'] );
|
||||
$title = htmlspecialchars( $event->title, ENT_DISALLOWED, 'UTF-8', FALSE );
|
||||
$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(), $title ) ) ) );
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
/* Event doesn't exist */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Return */
|
||||
|
||||
Whitespace-only changes.
Reference in new issue
Block a user