Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -299,7 +299,7 @@ Filter
|
||||
* @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)
|
||||
@@ -316,7 +316,7 @@ Filter
|
||||
* @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( $permissionKey == 'add' )
|
||||
{
|
||||
|
||||
@@ -259,9 +259,9 @@ class Category extends Model implements Permissions
|
||||
/**
|
||||
* [Node] Get number of unapproved content items
|
||||
*
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
protected function get__unnapprovedItems(): int
|
||||
protected function get__unnapprovedItems(): ?int
|
||||
{
|
||||
return $this->count_imgs_hidden;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ class Category extends Model implements Permissions
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function get__unapprovedComments(): int
|
||||
protected function get__unapprovedComments(): ?int
|
||||
{
|
||||
return $this->count_comments_hidden;
|
||||
}
|
||||
@@ -1067,14 +1067,14 @@ class Category extends Model implements Permissions
|
||||
* @param Club $club
|
||||
* @return void
|
||||
*/
|
||||
public function clubForm( Form $form, Club $club ) : void
|
||||
public function _clubForm( Form $form, Club $club ) : void
|
||||
{
|
||||
/* @var Item $itemClass */
|
||||
$itemClass = static::$contentItemClass;
|
||||
$form->add( new Text( 'club_node_name', $this->_id ? $this->_title : Member::loggedIn()->language()->addToStack( $itemClass::$title . '_pl' ), TRUE, array( 'maxLength' => 255 ) ) );
|
||||
$form->add( new Editor( 'club_node_description', $this->_id ? Member::loggedIn()->language()->get( static::$titleLangPrefix . $this->_id . '_desc' ) : NULL, FALSE, array( 'app' => 'gallery', 'key' => 'Categories', 'autoSaveKey' => ( $this->id ? "gallery-cat-{$this->id}" : "gallery-new-cat" ), 'attachIds' => $this->id ? array( $this->id, NULL, 'description' ) : NULL, 'minimize' => 'cdesc_placeholder' ) ) );
|
||||
|
||||
$form->add( new YesNo( 'category_allow_albums_club', $this->id ? $this->allow_albums : TRUE ) );
|
||||
$form->add( new YesNo( 'category_allow_albums_club', $this->id ? $this->allow_albums : TRUE, false, [ 'togglesOn' => [ 'category_sort_options' ] ] ) );
|
||||
$form->add( new YesNo( 'category_allow_comments', $this->id ? $this->allow_comments : TRUE ) );
|
||||
$form->add( new YesNo( 'category_allow_reviews', $this->id ? $this->allow_reviews : FALSE ) );
|
||||
|
||||
@@ -1109,7 +1109,7 @@ class Category extends Model implements Permissions
|
||||
$this->allow_albums = $values['category_allow_albums_club'];
|
||||
$this->allow_comments = $values['category_allow_comments'];
|
||||
$this->allow_reviews = $values['category_allow_reviews'];
|
||||
$this->sort_options = $values['category_sort_options'];
|
||||
$this->sort_options = $values['category_sort_options'] ?? 'updated';
|
||||
$this->sort_options_img = $values['category_sort_options_img'];
|
||||
$this->can_tag = TRUE;
|
||||
$this->tag_prefixes = TRUE;
|
||||
|
||||
@@ -289,7 +289,13 @@ Filter
|
||||
*/
|
||||
public function get__dimensions(): array
|
||||
{
|
||||
return is_array( $this->_data['data'] ) ? $this->_data['data'] : ( $this->_data['data'] ? json_decode( $this->_data['data'], TRUE ) : array() );
|
||||
if( isset( $this->_data['data'] ) )
|
||||
{
|
||||
$data = is_array( $this->_data['data'] ) ? $this->_data['data'] : json_decode( $this->_data['data'], true );
|
||||
return is_array( $data ) ? $data : [];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1967,9 +1973,15 @@ Filter
|
||||
*/
|
||||
public function canSetAsAlbumCover( ?Member $member=NULL ) : bool
|
||||
{
|
||||
/* If this image is not part of an album, this is always false */
|
||||
if( !$this->album_id or !( $this->directContainer() instanceof Album ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$member = $member ?: Member::loggedIn();
|
||||
/* Allow album owners to always change the album cover */
|
||||
if( ( $this->album_id AND $album = Album::load( $this->album_id ) AND $member->member_id AND $album->owner_id == $member->member_id ) OR static::modPermission( 'edit', $member, $this->container() ) )
|
||||
if( ( $album = Album::load( $this->album_id ) AND $member->member_id AND $album->owner_id == $member->member_id ) OR static::modPermission( 'edit', $member, $this->container() ) )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2058,7 +2070,7 @@ Filter
|
||||
* @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)
|
||||
@@ -2075,7 +2087,7 @@ Filter
|
||||
* @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=null, 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=null, 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 ( $order === NULL )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user