Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -229,6 +229,24 @@ class Blog extends Model implements Embeddable
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the action column map if the action is enabled in this node
|
||||
*
|
||||
* @param string $action
|
||||
* @return bool
|
||||
*/
|
||||
public function checkAction( string $action ) : bool
|
||||
{
|
||||
/* We don't want any kind of specific comment moderation here, just leave it up to the
|
||||
general rules */
|
||||
if( $action == 'moderate_comments' )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::checkAction( $action );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check permissions on any node
|
||||
@@ -784,31 +802,6 @@ class Blog extends Model implements Embeddable
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* [Node] Get the title to store in the log
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function titleForLog(): ?string
|
||||
{
|
||||
if ( !$this->member_id )
|
||||
{
|
||||
try
|
||||
{
|
||||
return Lang::load( Lang::defaultLanguage() )->get( static::$titleLangPrefix . $this->_id );
|
||||
}
|
||||
catch( UnderflowException )
|
||||
{
|
||||
/* If we're changing from a member blog to a group blog, the language string won't exist yet */
|
||||
return $this->_title;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->_title;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Mass update search index after changes
|
||||
*/
|
||||
@@ -856,7 +849,7 @@ class Blog extends Model implements Embeddable
|
||||
}
|
||||
|
||||
/* The seo_name isn't set, so let's fix that real quick and return it */
|
||||
$title = $this->member_id ? $this->name : Lang::load( Lang::defaultLanguage() )->get( 'blogs_blog_' . $this->id );
|
||||
$title = Lang::load( Lang::defaultLanguage() )->get( 'blogs_blog_' . $this->id );
|
||||
|
||||
$seoTitle = Url::seoTitle( $title );
|
||||
$this->seo_name = $seoTitle;
|
||||
@@ -1024,9 +1017,9 @@ class Blog extends Model implements Embeddable
|
||||
/**
|
||||
* [Node] Get number of unapproved content comments
|
||||
*
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
protected function get__unapprovedComments(): int
|
||||
protected function get__unapprovedComments(): ?int
|
||||
{
|
||||
return $this->count_comments_hidden;
|
||||
}
|
||||
@@ -1351,7 +1344,7 @@ class Blog extends Model implements Embeddable
|
||||
* @param Club $club
|
||||
* @return void
|
||||
*/
|
||||
public function clubForm( Form $form, Club $club ) : void
|
||||
public function _clubForm( Form $form, Club $club ) : void
|
||||
{
|
||||
Output::i()->jsFiles = array_merge( Output::i()->jsFiles, Output::i()->js( 'front_view.js', 'blog', 'front' ) );
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@ class Entry extends Item implements
|
||||
* @param array $where Where clause
|
||||
* @param string|null $order MySQL ORDER BY clause (NULL to order by date)
|
||||
* @param int|array|null $limit Limit clause
|
||||
* @param string $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
|
||||
* @param string|null $permissionKey A key which has a value in the permission map (either of the container or of this class) matching a column ID in core_permission_index or NULL to ignore permissions
|
||||
* @param int|bool|null $includeHiddenItems Include hidden items? NULL to detect if currently logged in member has permission, -1 to return public content only, TRUE to return unapproved content and FALSE to only return unapproved content the viewing member submitted
|
||||
* @param int $queryFlags Select bitwise flags
|
||||
* @param Member|null $member The member (NULL to use currently logged in member)
|
||||
@@ -394,7 +394,7 @@ class Entry extends Item implements
|
||||
* @param array|null $location Array of item lat and long
|
||||
* @return ActiveRecordIterator|int
|
||||
*/
|
||||
public static function getItemsWithPermission( array $where=array(), string $order=null, int|array|null $limit=10, string $permissionKey='read', int|bool|null $includeHiddenItems= Filter::FILTER_AUTOMATIC, int $queryFlags=0, Member $member=null, bool $joinContainer=FALSE, bool $joinComments=FALSE, bool $joinReviews=FALSE, bool $countOnly=FALSE, array|null $joins=null, bool|Model $skipPermission=FALSE, bool $joinTags=TRUE, bool $joinAuthor=TRUE, bool $joinLastCommenter=TRUE, bool $showMovedLinks=FALSE, array|null $location=null ): ActiveRecordIterator|int
|
||||
public static function getItemsWithPermission( array $where=array(), string $order=null, int|array|null $limit=10, ?string $permissionKey='read', int|bool|null $includeHiddenItems= Filter::FILTER_AUTOMATIC, int $queryFlags=0, Member $member=null, bool $joinContainer=FALSE, bool $joinComments=FALSE, bool $joinReviews=FALSE, bool $countOnly=FALSE, array|null $joins=null, bool|Model $skipPermission=FALSE, bool $joinTags=TRUE, bool $joinAuthor=TRUE, bool $joinLastCommenter=TRUE, bool $showMovedLinks=FALSE, array|null $location=null ): ActiveRecordIterator|int
|
||||
{
|
||||
if ( in_array( $permissionKey, array( 'view', 'read' ) ) )
|
||||
{
|
||||
@@ -804,11 +804,16 @@ class Entry extends Item implements
|
||||
$response = parent::canComment( $member, $considerPostBeforeRegistering );
|
||||
if( $response )
|
||||
{
|
||||
if ( !$member->member_id and $considerPostBeforeRegistering and Settings::i()->post_before_registering
|
||||
and Login::registrationType() != 'disabled'and Settings::i()->bot_antispam_type !== 'none' )
|
||||
if ( !$member->member_id and ( !$considerPostBeforeRegistering or !Settings::i()->post_before_registering )
|
||||
and Login::registrationType() != 'disabled' )
|
||||
{
|
||||
/* We can override post before register for guests */
|
||||
return (bool) Group::load( Settings::i()->member_group )->g_blog_allowcomment;
|
||||
}
|
||||
elseif( $member->member_id )
|
||||
{
|
||||
return (bool) $member->group['g_blog_allowcomment'];
|
||||
}
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
Reference in new issue
Block a user