Sha256: fcc21f0ff601864685342d0d60ab1e5c6358e1b46115c456b0d0e6e6ffe252ff
Contents?: true
Size: 1.49 KB
Versions: 17
Compression:
Stored size: 1.49 KB
Contents
<?php class Page extends SiteTree { private static $can_be_root = false; 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(); // Note: you should use SS template require tags inside your templates // instead of putting Requirements calls here. However these are // included so that our older themes still work Requirements::themedCSS('reset'); Requirements::themedCSS('layout'); Requirements::themedCSS('typography'); Requirements::themedCSS('form'); } }
Version data entries
17 entries across 17 versions & 1 rubygems