public function __construct($name, $title = "", $value = "", $width = 1140, $height = 600, $baseImages = null) { $this->width = $width; $this->height = $height; $this->baseImages = $baseImages; parent::__construct($name, $title, $value); }
/** * * @param GridField $name * @param string $data - json encoded string */ public function __construct($grid, $value = null) { $this->grid = $grid; if ($value) { $this->setValue($value); } parent::__construct($grid->getName() . '[GridState]'); }
public function __construct($name, $title = null, $value = "", $form = null) { // naming with underscores to prevent values from actually being saved somewhere $this->fieldLatitude = new HiddenField("{$name}[Latitude]", null); $this->fieldLongditude = new HiddenField("{$name}[Longditude]", null); $this->fieldPositionSet = new HiddenField("{$name}[PositionSet]", null); $this->fieldPositionSet->setValue(0); parent::__construct($name, $title, null, $form); $this->setValue($value); }
public function __construct($name, $title = null, $value = null, $mapping = [], $identifier = null) { if ($value && $value instanceof \DataObjectInterface) { $this->recordClass = get_class($value); } elseif (\ClassInfo::exists($name) && singleton($name) instanceof \DataObjectInterface) { $this->recordClass = $name; } $this->mapping = $mapping; $this->identifier = $identifier; $this->doNotMapTo(); parent::__construct($name, $title); }
/** * Returns an input field, class="text" and type="text" with an optional maxlength */ function __construct($name, $title = null, $flickrPhoto = '', $maxLength = null, $form = null) { $this->maxLength = $maxLength; parent::setTemplate('FLickrPhotoSelectionField'); $value = ''; if ($flickrPhoto) { $value = $flickrPhoto->ID; $this->flickrTitle = $flickrPhoto->Title; $this->flickrID = $flickrPhoto->FlickrID; $this->mediumURL = $flickrPhoto->MediumURL; } $this->addExtraClass('flickrPhotoSelectionField'); parent::__construct($name, $title, $value, $form); }
function __construct($name, $title = null, $value = '') { parent::__construct($name, $title, $value); }
public function __construct($name, $title, $className = "SiteTree", $label = "Title", $val = null, $form = null) { parent::__construct($name, $title, $val, $form); $this->labelField = $label; $this->sourceClass = $className; }
/** * Creates a new optionset field for order modifers with the naming convention * Modifiers[ClassName] where ClassName is name of modifier class. * * @param name The field name, needs to be the class name of the class that is going to be the modifier * @param title The field title * @param source An map of the dropdown items * @param value The current value * @param form The parent form */ function __construct($modifier, $title = null, $value = "", $maxLength = null, $form = null) { $name = "Modifiers[{$modifier->ClassName}]"; $this->modifier = $modifier; parent::__construct($name, $title, $value, $maxLength, $form); }
/** * Creates a new optionset field for order modifers with the naming convention * Modifiers[ClassName] where ClassName is name of modifier class. * * @param name The field name, needs to be the class name of the class that is going to be the modifier * @param title The field title * @param source An map of the dropdown items * @param value The current value * @param form The parent form */ function __construct($modifier, $title = null, $value = "", $maxLength = null, $form = null) { $name = "Modifiers[" . get_class($modifier) . "]"; $this->modifier = $modifier; parent::__construct($name, $title, $value, $maxLength, $form); }