Version 4.2.0
This commit is contained in:
1 parent
0dc2aee5ed
commit
96997ddd8e
2074 files changed
+125454
-55780
No files matched your search
@@ -1,12 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief streams
|
||||
* @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 02 Jul 2015
|
||||
* @version SVN_VERSION_NUMBER
|
||||
*/
|
||||
|
||||
namespace IPS\core\modules\front\discover;
|
||||
@@ -178,6 +177,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
|
||||
/* Start with a blank stream */
|
||||
$stream = \IPS\core\Stream::allActivityStream();
|
||||
$stream->default_view = "expanded";
|
||||
|
||||
/* Set the title to "All Activity" */
|
||||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('all_activity');
|
||||
@@ -187,7 +187,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
/* but only if we haven't submitted the form on this request */
|
||||
if( !\IPS\Request::i()->stream_submitted )
|
||||
{
|
||||
$streamFields = array( 'include_comments', 'classes', 'ownership', 'custom_members', 'read', 'follow', 'followed_types', 'date_type', 'date_start', 'date_end', 'date_relative_days', 'sort', 'tags', 'unread_links' );
|
||||
$streamFields = array( 'include_comments', 'classes', 'clubs', 'ownership', 'custom_members', 'read', 'follow', 'followed_types', 'date_type', 'date_start', 'date_end', 'date_relative_days', 'sort', 'tags', 'unread_links' );
|
||||
|
||||
/* Build and format field values */
|
||||
$_values = array();
|
||||
@@ -220,6 +220,11 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $_values['stream_club_filter'] ) and !isset( $_values['stream_club_select'] ) )
|
||||
{
|
||||
$_values['stream_club_select'] = 'select';
|
||||
}
|
||||
|
||||
$formattedValues = $stream->formatFormValues( $_values );
|
||||
|
||||
/* Overwrite stream config if present in the request */
|
||||
@@ -227,7 +232,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$requestKey = 'stream_' . $k;
|
||||
|
||||
if ( isset( \IPS\Request::i()->$requestKey ) )
|
||||
if ( isset( \IPS\Request::i()->$requestKey ) or ( $k === 'clubs' and ( isset( \IPS\Request::i()->stream_club_select ) or isset( \IPS\Request::i()->stream_club_filter ) ) ) )
|
||||
{
|
||||
if ( $stream->$k != $formattedValues[ $k ] )
|
||||
{
|
||||
@@ -341,7 +346,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
/* Is anything turned on? */
|
||||
$extra = array();
|
||||
foreach ( array( 'register', 'follow_member', 'follow_content', 'photo', 'like', 'rep_neg' ) as $k )
|
||||
foreach ( array( 'register', 'follow_member', 'follow_content', 'photo', 'like', 'react', 'clubs' ) as $k )
|
||||
{
|
||||
$key = "all_activity_{$k}";
|
||||
if ( \IPS\Settings::i()->$key )
|
||||
@@ -594,7 +599,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$url = $stream ? $stream->baseUrl->setQueryString( 'className', $class ) : \IPS\Request::i()->url()->setQueryString( 'className', $class );
|
||||
$containerClass = $class::$containerNodeClass;
|
||||
$field = new \IPS\Helpers\Form\Node( 'stream_containers_' . $class::$title, isset( $currentContainers[ $class ] ) ? $currentContainers[ $class ] : array(), NULL, array( 'url' => $url, 'class' => $class::$containerNodeClass, 'multiple' => TRUE, 'permissionCheck' => $containerClass::searchableNodesPermission() ), NULL, NULL, NULL, 'stream_containers_' . $class::$title );
|
||||
$field = new \IPS\Helpers\Form\Node( 'stream_containers_' . $class::$title, isset( $currentContainers[ $class ] ) ? $currentContainers[ $class ] : array(), NULL, array( 'url' => $url, 'class' => $class::$containerNodeClass, 'multiple' => TRUE, 'permissionCheck' => $containerClass::searchableNodesPermission(), 'clubs' => \IPS\IPS::classUsesTrait( $containerClass, 'IPS\Content\ClubContainer' ) ), NULL, NULL, NULL, 'stream_containers_' . $class::$title );
|
||||
$field->label = \IPS\Member::loggedIn()->language()->addToStack( 'stream_narrow_by_container_label', NULL, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->addToStack( $containerClass::$nodeTitle ) ) ) );
|
||||
|
||||
return \IPS\Output::i()->json( array( 'node' => \IPS\Theme::i()->getTemplate('streams')->filterFormContentTypeContent( $field, $class, \IPS\Request::i()->key ) ) );
|
||||
@@ -604,6 +609,47 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the club selector form element HTML
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getClubElement()
|
||||
{
|
||||
$clubOptions = array();
|
||||
foreach ( \IPS\Member\Club::clubs( \IPS\Member::loggedIn(), NULL, 'name', TRUE ) as $club )
|
||||
{
|
||||
$clubOptions[ "c{$club->id}" ] = $club->name;
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->stream_club_select ) )
|
||||
{
|
||||
switch ( \IPS\Request::i()->stream_club_select )
|
||||
{
|
||||
case 'all':
|
||||
$value = 0;
|
||||
break;
|
||||
|
||||
case 'none':
|
||||
$value = array();
|
||||
break;
|
||||
|
||||
default:
|
||||
$value = explode( ',', \IPS\Request::i()->stream_club_filter );
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$field = new \IPS\Helpers\Form\Select( 'stream_club_filter_dummy', $value, FALSE, array( 'options' => $clubOptions, 'parse' => 'normal', 'multiple' => TRUE, 'noDefault' => TRUE, 'unlimited' => 0, 'unlimitedLang' => 'stream_club_select_all' ), NULL, NULL, NULL, 'stream_club_filter' );
|
||||
$field->label = \IPS\Member::loggedIn()->language()->addToStack('stream_club_filter');
|
||||
|
||||
return \IPS\Output::i()->json( array( 'field' => \IPS\Theme::i()->getTemplate('streams')->filterFormClubs( $field ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Build form
|
||||
*
|
||||
@@ -650,7 +696,7 @@ class _streams extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$formattedValues = $stream->formatFormValues( $values );
|
||||
|
||||
foreach ( array( 'include_comments', 'classes', 'containers', 'ownership', 'custom_members', 'read', 'follow', 'followed_types', 'date_type', 'date_start', 'date_end', 'date_relative_days', 'sort', 'tags', 'unread_links' ) as $k )
|
||||
foreach ( array( 'include_comments', 'classes', 'containers', 'clubs', 'ownership', 'custom_members', 'read', 'follow', 'followed_types', 'date_type', 'date_start', 'date_end', 'date_relative_days', 'sort', 'tags', 'unread_links' ) as $k )
|
||||
{
|
||||
$requestKey = 'stream_' . $k;
|
||||
if ( isset( $formattedValues[ $k ] ) AND $stream->$k != $formattedValues[ $k ] )
|
||||
|
||||
Reference in new issue
Block a user