Source of file PlaceholderImagePerPageExtension.php
Size: 0,981 Bytes - Last Modified: 2021-12-23T10:38:24+00:00
/var/www/docs.ssmods.com/process/src/code/PlaceholderImagePerPageExtension.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php /** * Description of PlaceholderImagePerPageExtension. * * @author Tom Densham <tom.densham@studiobonito.co.uk> * @copyright (c) 2012, Studio Bonito Ltd. * @version 1.0 */ class PlaceholderImagePerPageExtension extends DataExtension { /** * List of one-to-one relationships. {@link DataObject::$has_one} * * @access public * @static * @var array */ public static $has_one = array( 'PlaceholderImage' => 'Image' ); /** * Returns a FieldList with which to create the editing form. {@link SiteTree::getCMSFields()} * * @return FieldList */ public function updateCMSFields(FieldList $fields) { $placeholderImageUploadField = new UploadField('PlaceholderImage', 'Placeholder Image'); $placeholderImageUploadField->allowedExtensions = array('jpg', 'gif', 'png'); $fields->addFieldToTab('Root.Images', $placeholderImageUploadField); return $fields; } } |