Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,30 +11,36 @@
|
||||
|
||||
namespace IPS\{app}\extensions\core\Announcements;
|
||||
|
||||
use IPS\core\Announcements\Announcement as AnnouncementClass;
|
||||
use IPS\Extensions\AnnouncementsAbstract;
|
||||
use IPS\Helpers\Form\FormAbstract;
|
||||
use IPS\Helpers\Form\Node;
|
||||
use function defined;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Announcements Extension
|
||||
*/
|
||||
class _{class}
|
||||
class {class} extends AnnouncementsAbstract
|
||||
{
|
||||
public static $idField = "id";
|
||||
public static string $idField = "id";
|
||||
|
||||
public static $controllers = array();
|
||||
public static array $controllers = array();
|
||||
|
||||
/**
|
||||
* Get Setting Field
|
||||
*
|
||||
* @param \IPS\core\Announcements\Announcement $announcement
|
||||
* @return \IPS\Helpers\Form\FormAbstract Form element
|
||||
* @param AnnouncementClass|null $announcement
|
||||
* @return FormAbstract Form element
|
||||
*/
|
||||
public function getSettingField( ?\IPS\core\Announcements\Announcement $announcement ): \IPS\Helpers\Form\FormAbstract
|
||||
public function getSettingField( ?AnnouncementClass $announcement ): FormAbstract
|
||||
{
|
||||
return new \IPS\Helpers\Form\Node( 'announce_download_categories', ( $announcement ) ? explode( ",", $announcement->ids ) : NULL, FALSE, array( 'class' => 'IPS\downloads\Category', 'zeroVal' => 'any', 'multiple' => TRUE ), NULL, NULL, NULL, 'announce_download_categories' );
|
||||
return new Node( 'announce_download_categories', ( $announcement ) ? explode( ",", $announcement->ids ) : NULL, FALSE, array( 'class' => 'IPS\downloads\Category', 'zeroVal' => 'any', 'multiple' => TRUE ), NULL, NULL, NULL, 'announce_download_categories' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user