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
@@ -12,35 +12,42 @@
|
||||
namespace IPS\calendar\extensions\core\Announcements;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\core\Announcements\Announcement;
|
||||
use IPS\Extensions\AnnouncementsAbstract;
|
||||
use IPS\Helpers\Form\FormAbstract;
|
||||
use IPS\Helpers\Form\Node;
|
||||
use function defined;
|
||||
|
||||
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 _Calendars
|
||||
class Calendars extends AnnouncementsAbstract
|
||||
{
|
||||
/**
|
||||
* @brief ID Field
|
||||
*/
|
||||
public static $idField = "id";
|
||||
public static string $idField = "id";
|
||||
|
||||
/**
|
||||
* @brief Controller classes
|
||||
*/
|
||||
public static $controllers = array( "IPS\\calendar\\modules\\front\\calendar\\view" );
|
||||
public static array $controllers = array( "IPS\\calendar\\modules\\front\\calendar\\view" );
|
||||
|
||||
/**
|
||||
* Get Setting Field
|
||||
*
|
||||
* @param \IPS\core\Announcements\Announcement $announcement
|
||||
* @return Form element
|
||||
* @param Announcement|null $announcement
|
||||
* @return FormAbstract Form element
|
||||
*/
|
||||
public function getSettingField( $announcement )
|
||||
public function getSettingField( ?Announcement $announcement ): FormAbstract
|
||||
{
|
||||
return new \IPS\Helpers\Form\Node( 'announce_calendars', ( $announcement AND $announcement->ids ) ? explode( ",", $announcement->ids ) : 0, FALSE, array( 'class' => 'IPS\calendar\Calendar', 'zeroVal' => 'any', 'multiple' => TRUE ), NULL, NULL, NULL, 'announce_calendars' );
|
||||
return new Node( 'announce_calendars', ( $announcement AND $announcement->ids ) ? explode( ",", $announcement->ids ) : 0, FALSE, array( 'class' => 'IPS\calendar\Calendar', 'zeroVal' => 'any', 'multiple' => TRUE ), NULL, NULL, NULL, 'announce_calendars' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user