Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -2048,7 +2048,7 @@ abstract class Comment extends Content
|
||||
{
|
||||
$ipAddressColumn = static::$databaseColumnMap['ip_address'];
|
||||
$menu->addSeparator();
|
||||
$menu->add( new ContentMenuLink( url: Url::internal( 'app=core&module=modcp&controller=modcp&tab=ip_tools&ip=' . $this->$ipAddressColumn ), languageString: Member::loggedIn()->language()->addToStack( 'ip_address' ) . ' ' . $this->$ipAddressColumn ) );
|
||||
$menu->add( new ContentMenuLink( url: Url::internal( 'app=core&module=modcp&controller=modcp&tab=ip_tools&ip=' . $this->$ipAddressColumn, 'front', 'modcp_ip_tools' ), languageString: Member::loggedIn()->language()->addToStack( 'ip_address' ) . ' ' . $this->$ipAddressColumn ) );
|
||||
}
|
||||
|
||||
foreach( $this->ui( 'menuItems', array(), TRUE ) as $key => $link )
|
||||
|
||||
@@ -204,6 +204,7 @@ class Controller extends CoverPhotoController
|
||||
/* We also want to update the views if we have a page parameter */
|
||||
if( IPS::classUsesTrait( $item, 'IPS\Content\ViewUpdates' ) and isset( $class::$databaseColumnMap['views'] ) AND isset( Request::i()->page ) AND Request::i()->page )
|
||||
{
|
||||
/* @var $item ViewUpdates */
|
||||
$item->updateViews();
|
||||
}
|
||||
|
||||
@@ -297,6 +298,7 @@ class Controller extends CoverPhotoController
|
||||
$idColumn = $class::$databaseColumnId;
|
||||
if ( IPS::classUsesTrait( $class, 'IPS\Content\ViewUpdates' ) AND isset( $class::$databaseColumnMap['views'] ) )
|
||||
{
|
||||
/* @var $item ViewUpdates */
|
||||
$item->updateViews();
|
||||
}
|
||||
else
|
||||
@@ -4775,7 +4777,7 @@ class Controller extends CoverPhotoController
|
||||
'promotype' => 'promote'
|
||||
] );
|
||||
|
||||
Webhook::fire( 'content_promoted', $item );
|
||||
Webhook::fire( 'content_promoted', $promote );
|
||||
|
||||
Output::i()->redirect( $objectToPromote->url(), Member::loggedIn()->language()->addToStack( 'promote_complete' ) );
|
||||
}
|
||||
@@ -5024,7 +5026,7 @@ class Controller extends CoverPhotoController
|
||||
$promote->setText( $values['promote_internal_text'] );
|
||||
$promote->save();
|
||||
|
||||
Webhook::fire( 'content_promoted', $item );
|
||||
Webhook::fire( 'content_promoted', $promote );
|
||||
|
||||
/* Redirect back to the list */
|
||||
Output::i()->redirect( Url::internal( 'app=core&module=modcp&controller=modcp&tab=featured', 'front', 'modcp_featured' ), 'saved' );
|
||||
|
||||
@@ -139,11 +139,14 @@ class ModeratorPermissions
|
||||
public function getPermissions( array $toggles ): array
|
||||
{
|
||||
$class = static::$class;
|
||||
$containerNodeClass = $class::$containerNodeClass;
|
||||
|
||||
$return = array();
|
||||
|
||||
$return[ $containerNodeClass::$modPerm ] = array( 'Node', array( 'class' => $containerNodeClass, 'zeroVal' => 'all', 'multiple' => TRUE ) );
|
||||
|
||||
if( isset( $class::$containerNodeClass ) )
|
||||
{
|
||||
$containerNodeClass = $class::$containerNodeClass;
|
||||
$return[ $containerNodeClass::$modPerm ] = array( 'Node', array( 'class' => $containerNodeClass, 'zeroVal' => 'all', 'multiple' => TRUE ) );
|
||||
}
|
||||
|
||||
foreach ( $this->actions as $k )
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ use IPS\Dispatcher;
|
||||
use IPS\Extensions\PermissionsAbstract;
|
||||
use IPS\IPS;
|
||||
use IPS\Member;
|
||||
use IPS\Member\Group;
|
||||
use IPS\Node\Model;
|
||||
use IPS\Settings;
|
||||
|
||||
@@ -121,11 +122,17 @@ class Permissions
|
||||
*
|
||||
* @param string $permission
|
||||
* @param object $object
|
||||
* @param Member|null $member
|
||||
* @param Member|Group|null $member
|
||||
* @return int
|
||||
*/
|
||||
public static function can( string $permission, object $object, ?Member $member=null ) : int
|
||||
public static function can( string $permission, object $object, Member|Group|null $member=null ) : int
|
||||
{
|
||||
/* Rather than do a breaking change, skip this check if we pass in a group */
|
||||
if( $member instanceof Group )
|
||||
{
|
||||
return static::PERM_DEFAULT;
|
||||
}
|
||||
|
||||
/* Only allow these extensions to run on the front-end or from the API */
|
||||
if( !Dispatcher::hasInstance() or ( Dispatcher::i()->controllerLocation != 'front' and Dispatcher::i()->controllerLocation != 'api' ) )
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace IPS\Content\Search;
|
||||
|
||||
use IPS\Application;
|
||||
use IPS\Content;
|
||||
use IPS\Member;
|
||||
use function get_class;
|
||||
use function is_string;
|
||||
use function in_array;
|
||||
@@ -36,19 +37,27 @@ class SearchContent
|
||||
/**
|
||||
* Returns all searchable classes
|
||||
*
|
||||
* @param Member|bool $member Member to check against or false to skip
|
||||
* @return array
|
||||
*/
|
||||
public static function searchableClasses() : array
|
||||
public static function searchableClasses( Member|bool $member=false ) : array
|
||||
{
|
||||
if( static::$_searchableClasses === null )
|
||||
{
|
||||
$classes = array();
|
||||
foreach( Application::allExtensions( 'core', 'SearchContent', false, null, null, false ) as $extension )
|
||||
{
|
||||
/** @var $extension SearchContentAbstract */
|
||||
$classes = array_merge( $classes, $extension::supportedClasses() );
|
||||
}
|
||||
static::$_searchableClasses = $classes;
|
||||
}
|
||||
|
||||
if( $member !== false )
|
||||
{
|
||||
return array_intersect( Content::routedClasses( $member ), static::$_searchableClasses );
|
||||
}
|
||||
|
||||
return static::$_searchableClasses;
|
||||
}
|
||||
|
||||
|
||||
@@ -353,8 +353,9 @@ class Tag extends Model
|
||||
$this->text = $values['tag_text'];
|
||||
$this->save();
|
||||
}
|
||||
|
||||
/* Do we need to update the tag name? */
|
||||
elseif( $this->text != $values['tag_text'] )
|
||||
if( $this->text != $values['tag_text'] )
|
||||
{
|
||||
Task::queue( 'core', 'UpdateTaggedItems', [ 'tag' => $this->text, 'new' => $values['tag_text'] ], 5, [ 'tag' ] );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user