Sha256: 2dd3dab68372b0a17553397ca469dd99107203f0d0c2e33a0b5e58dac654dc52
Contents?: true
Size: 1.16 KB
Versions: 5
Compression:
Stored size: 1.16 KB
Contents
<?php class Page extends SiteTree { private static $can_be_root = true; private static $db = array( ); private static $has_one = array( 'PrimaryImage' => 'Image' ); public function getCMSFields() { $fields = parent::getCMSFields(); $imageField = new UploadField('PrimaryImage', 'Image'); $imageField->getValidator()->setAllowedExtensions(array('jpg','jpeg','gif','png')); $fields->addFieldToTab('Root.Main', $imageField, 'Content'); return $fields; } } class Page_Controller extends ContentController { /** * An array of actions that can be accessed via a request. Each array element should be an action name, and the * permissions or conditions required to allow the user to access it. * * <code> * array ( * 'action', // anyone can access this action * 'action' => true, // same as above * 'action' => 'ADMIN', // you must have ADMIN permissions to access this action * 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true * ); * </code> * * @var array */ private static $allowed_actions = array ( ); public function init() { parent::init(); } }
Version data entries
5 entries across 5 versions & 1 rubygems