Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -174,11 +174,21 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
*/
protected function get__comments()
{
$comments = $this->count_comments;
return (int) $this->count_comments;
}
/**
* [Node] Get number of content comments (including children)
*
* @return int
*/
protected function get__commentsForDisplay()
{
$comments = $this->_comments;
foreach( $this->children() as $child )
{
$comments += $child->count_comments;
$comments += $child->_comments;
}
return $comments;
@@ -796,6 +806,17 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
return parent::deleteOrMoveFormSubmit( $values );
}
/**
* Set Default Values
*
* @return void
*/
public function setDefaultValues()
{
$this->sort_options = 'album_last_img_date';
$this->sort_options_img = 'updated';
}
/**
* Get template for node tables
*
@@ -900,6 +921,19 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
$form->add( new \IPS\Helpers\Form\YesNo( 'category_allow_albums', $this->id ? $this->allow_albums : TRUE ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'category_allow_comments', $this->id ? $this->allow_comments : TRUE ) );
$form->add( new \IPS\Helpers\Form\YesNo( 'category_allow_reviews', $this->id ? $this->allow_reviews : FALSE ) );
$sortoptions = array(
'album_last_img_date' => 'sort_updated',
'album_last_comment' => 'sort_last_comment',
'album_rating_aggregate' => 'sort_rating',
'album_comments' => 'sort_num_comments',
'album_reviews' => 'sort_num_reviews',
'album_name' => 'sort_album_name',
'album_count_comments' => 'sort_album_count_comments',
'album_count_imgs' => 'sort_album_count_imgs'
);
$form->add( new \IPS\Helpers\Form\Select( 'category_sort_options', $this->sort_options ?: 'updated', FALSE, array( 'options' => $sortoptions ), NULL, NULL, NULL, 'category_sort_options' ) );
$form->add( new \IPS\Helpers\Form\Select( 'category_sort_options_img', $this->sort_options_img ?: 'updated', FALSE, array( 'options' => array( 'updated' => 'sort_updated', 'last_comment' => 'sort_last_comment', 'title' => 'album_sort_caption', 'rating' => 'sort_rating', 'date' => 'sort_date', 'num_comments' => 'sort_num_comments', 'num_reviews' => 'sort_num_reviews', 'views' => 'sort_views' ) ), NULL, NULL, NULL, 'category_sort_options_img' ) );
}
/**
@@ -914,6 +948,8 @@ class _Category extends \IPS\Node\Model implements \IPS\Node\Permissions
$this->allow_albums = $values['category_allow_albums'];
$this->allow_comments = $values['category_allow_comments'];
$this->allow_reviews = $values['category_allow_reviews'];
$this->sort_options = $values['category_sort_options'];
$this->sort_options_img = $values['category_sort_options_img'];
$this->can_tag = TRUE;
$this->tag_prefixes = TRUE;