Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+35
View File
@@ -14,6 +14,8 @@ namespace IPS\gallery\widgets;
/* To prevent PHP errors (extending class does not exist) revealing path */
use IPS\Content\Widget;
use IPS\Helpers\Form;
use IPS\Helpers\Form\YesNo;
use IPS\Output;
use IPS\Theme;
use function defined;
@@ -62,4 +64,37 @@ class albums extends Widget
Output::i()->cssFiles = array_merge( Output::i()->cssFiles, Theme::i()->css( 'gallery.css', 'gallery', 'front' ) );
parent::init();
}
/**
* Specify widget configuration
*
* @param Form|null $form Form object
* @return Form
*/
public function configuration( Form &$form=null ): Form
{
$form = parent::configuration( $form );
$form->add( new YesNo( 'widget_feed_album_empty', $this->configuration['widget_feed_album_empty'] ?? true, false ), 'widget_feed_author' );
return $form;
}
/**
* Get where clause
*
* @return array
*/
protected function buildWhere(): array
{
$where = parent::buildWhere();
/* We default to true to maintain previous behavior */
if( isset( $this->configuration['widget_feed_album_empty'] ) and !$this->configuration['widget_feed_album_empty'] )
{
$where[] = [ 'album_count_imgs>?', 0 ];
}
return $where;
}
}