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

Version Path
bonethug-0.0.24 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.23 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.22 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.21 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.20 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.18 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.17 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.16 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.15 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.14 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.13 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.12 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.11 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.10 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.7 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.6 skel/project_types/silverstripe3/public/project/code/Pages/Page.php
bonethug-0.0.5 skel/project_types/silverstripe3/public/project/code/Pages/Page.php