Version 4.1.19
This commit is contained in:
1 parent
28bd025b35
commit
2bd5025018
2674 files changed
+233518
-77766
No files matched your search
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* @brief Notification Settings Controller
|
||||
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
|
||||
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
|
||||
* @license http://www.invisionpower.com/legal/standards/
|
||||
* @package IPS Social Suite
|
||||
* @package IPS Community Suite
|
||||
* @since 27 Aug 2013
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
@@ -57,28 +57,6 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
\IPS\Output::i()->json( array( 'data' => \IPS\Theme::i()->getTemplate( 'system' )->notificationsAjax( $notifications ) ) );
|
||||
}
|
||||
elseif ( isset( \IPS\Request::i()->format ) and \IPS\Request::i()->format === 'rss' )
|
||||
{
|
||||
$document = \IPS\Xml\Rss::newDocument( $urlObject, \IPS\Member::loggedIn()->language()->get('notifications'), sprintf( \IPS\Member::loggedIn()->language()->get( 'notifications_rss_desc' ), \IPS\Member::loggedIn()->name, \IPS\Settings::i()->board_name ) );
|
||||
|
||||
if ( count( $table->getRows() ) )
|
||||
{
|
||||
foreach ( $table->getRows() as $notification )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->parseOutputForDisplay( $notification['data']['title'] );
|
||||
|
||||
if( isset( $notification['data']['content'] ) )
|
||||
{
|
||||
\IPS\Member::loggedIn()->language()->parseOutputForDisplay( $notification['data']['content'] );
|
||||
}
|
||||
|
||||
$document->addItem( $notification['data']['title'], $notification['data']['url'], isset( $notification['data']['content'] ) ? $notification['data']['content'] : NULL, $notification['notification']->updated_time, $notification['notification']->id );
|
||||
}
|
||||
}
|
||||
|
||||
/* @note application/rss+xml is not a registered IANA mime-type so we need to stick with text/xml for RSS */
|
||||
\IPS\Output::i()->sendOutput( $document->asXML(), 200, 'text/xml' );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('notifications');
|
||||
@@ -113,7 +91,8 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
$form->add( new \IPS\Helpers\Form\Radio( 'auto_track_type', \IPS\Member::loggedIn()->auto_follow['method'] ?: 'immediate', FALSE, array( 'options' => array(
|
||||
'immediate' => \IPS\Member::loggedIn()->language()->addToStack('follow_type_immediate'),
|
||||
'daily' => \IPS\Member::loggedIn()->language()->addToStack('follow_type_daily'),
|
||||
'weekly' => \IPS\Member::loggedIn()->language()->addToStack('follow_type_weekly')
|
||||
'weekly' => \IPS\Member::loggedIn()->language()->addToStack('follow_type_weekly'),
|
||||
'none' => \IPS\Member::loggedIn()->language()->addToStack('follow_type_none')
|
||||
) ), NULL, NULL, NULL, 'auto_track_type' ) );
|
||||
/* Changed in 4.1: since email_notifications_once is new, combined show_pm_popup in and made a checkbox set for better organization */
|
||||
$notificationPrefValues = array();
|
||||
@@ -457,9 +436,12 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
$output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'system', 'core' ) ), 'followForm' ) );
|
||||
|
||||
/* @see http://community.invisionpower.com/4bugtrack/follow-button-adds-meta-title-and-link-tags-r3209/ */
|
||||
if( \IPS\Request::i()->isAjax() ){
|
||||
if( \IPS\Request::i()->isAjax() )
|
||||
{
|
||||
\IPS\Output::i()->sendOutput( $output, 200, 'text/html', \IPS\Output::i()->httpHeaders );
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = $output;
|
||||
}
|
||||
}
|
||||
@@ -591,21 +573,21 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
$thing = $class::loadAndCheckPerms( \IPS\Request::i()->follow_id );
|
||||
$followers = $thing->followers( $class::FOLLOW_PUBLIC, array( 'none', 'immediate', 'daily', 'weekly' ), NULL, array( ( $thisPage - 1 ) * $perPage, $perPage ), 'name' );
|
||||
$anonymous = $thing->followers( $class::FOLLOW_ANONYMOUS )->count( TRUE );
|
||||
$title = $thing->name;
|
||||
$title = $thing->mapped('title');
|
||||
}
|
||||
else
|
||||
{
|
||||
$thing = $class::load( \IPS\Request::i()->follow_id );
|
||||
$followers = $thing->followers( $class::FOLLOW_PUBLIC, array( 'none', 'immediate', 'daily', 'weekly' ), NULL, array( ( $thisPage - 1 ) * $perPage, $perPage ), 'name' );
|
||||
$anonymous = $thing->followers( $class::FOLLOW_ANONYMOUS )->count( TRUE );
|
||||
$title = $thing->mapped('title');
|
||||
$title = $thing->name;
|
||||
}
|
||||
}
|
||||
catch ( \OutOfRangeException $e )
|
||||
{
|
||||
\IPS\Output::i()->error( 'node_error', '2C154/6', 404, '' );
|
||||
}
|
||||
|
||||
|
||||
/* Display */
|
||||
if ( \IPS\Request::i()->isAjax() and isset( \IPS\Request::i()->_infScroll ) )
|
||||
{
|
||||
@@ -614,12 +596,14 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
else
|
||||
{
|
||||
$url = \IPS\Http\Url::internal( "app=core&module=system§ion=notifications&do=followers&follow_app=". \IPS\Request::i()->follow_app ."&follow_area=". \IPS\Request::i()->follow_area ."&follow_id=" . \IPS\Request::i()->follow_id . "&_infScroll=1" );
|
||||
$removeAllUrl = \IPS\Http\Url::internal( "app=core&module=system§ion=notifications&do=removeFollowers&follow_app=". \IPS\Request::i()->follow_app ."&follow_area=". \IPS\Request::i()->follow_area ."&follow_id=" . \IPS\Request::i()->follow_id )->csrf();
|
||||
|
||||
$pagination = \IPS\Theme::i()->getTemplate( 'global', 'core', 'global' )->pagination( $url, ceil( $followers->count( TRUE ) / $perPage ), $thisPage, $perPage, FALSE, 'followerPage' );
|
||||
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('item_followers', FALSE, array( 'sprintf' => array( $title ) ) );
|
||||
\IPS\Output::i()->breadcrumb[] = array( $thing->url(), $title );
|
||||
\IPS\Output::i()->breadcrumb[] = array( NULL, \IPS\Member::loggedIn()->language()->addToStack('who_follows_this') );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->followers( $url, $pagination, $followers, $anonymous );
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->followers( $url, $pagination, $followers, $anonymous, $removeAllUrl );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -675,23 +659,42 @@ class _notifications extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if ( isset( \IPS\Request::i()->button_type ) && \IPS\Request::i()->button_type === 'search' )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'profile' )->memberSearchFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'profile' )->memberSearchFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'profile' )->memberFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'profile' )->memberFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( \IPS\Request::i()->button_type == 'manage' )
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'system' )->manageFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'system' )->manageFollowButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
\IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'global' )->followButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count );
|
||||
\IPS\Output::i()->sendOutput( \IPS\Theme::i()->getTemplate( 'global' )->followButton( \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id, $count ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all followers
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function removeFollowers()
|
||||
{
|
||||
\IPS\Session::i()->csrfCheck();
|
||||
|
||||
if ( !\IPS\Member::loggedIn()->modPermission('can_remove_followers') )
|
||||
{
|
||||
\IPS\Output::i()->error( 'cant_remove_followers', '2C154/A', 403, 'cant_remove_followers_admin' );
|
||||
}
|
||||
|
||||
\IPS\Db::i()->delete( 'core_follow', array( 'follow_app=? AND follow_area=? AND follow_rel_id=?', \IPS\Request::i()->follow_app, \IPS\Request::i()->follow_area, \IPS\Request::i()->follow_id ) );
|
||||
|
||||
\IPS\Output::i()->redirect( ( !empty( $_SERVER['HTTP_REFERER'] ) ) ? \IPS\Http\Url::createFromString( $_SERVER['HTTP_REFERER'] ) : \IPS\Http\Url::internal( '' ), 'followers_removed' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user