Source of file Admin.php
Size: 1,609 Bytes - Last Modified: 2021-12-24T06:51:25+00:00
/var/www/docs.ssmods.com/process/src/src/SilverStripe/Admin.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | <?php namespace Heyday\Vend\SilverStripe; use Heyday\Vend\Exceptions\SetupException; /** * Class AvailabilityAdmin */ class Admin extends \LeftAndMain { /** * @var string */ private static $url_base = "admin"; /** * @var string */ private static $url_segment = 'vend'; /** * @var string */ private static $url_rule = '/$Action/$ID/$OtherID'; /** * @var string */ private static $menu_title = 'Vend Admin'; /** * @var string */ private static $menu_icon = 'silverstripe-vend/img/vend.png'; /** * @var int */ private static $menu_priority = 0; /** * @var int */ private static $url_priority = 50; /** * @var array */ private static $allowed_actions = array( 'VendSetupForm' ); /** * init method */ public function init() { \Requirements::css('silverstripe-vend/css/vend-admin.css'); parent::init(); } /** * @param Int $id * @param \FieldList $fields * @return SetupForm * @throws SetupException */ public function getEditForm($id = null, $fields = null) { $client_id = \Config::inst()->get('VendAPI', 'clientID'); $client_secret = \Config::inst()->get('VendAPI', 'clientSecret'); $redirect_uri = \Config::inst()->get('VendAPI', 'redirectURI'); if (is_null($client_id) || is_null($client_secret) || is_null($redirect_uri)) { throw new SetupException; } return new SetupForm($this, 'EditForm'); } } |