public function FieldHolder($properties = array()) { Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); Requirements::javascript(THIRDPARTY_DIR . '/jquery-entwine/dist/jquery.entwine-dist.js'); Requirements::javascript('swipestripe-currency/javascript/ExchangeRateField.js'); return parent::FieldHolder(); }
function FieldHolder() { $regions = Region::shipping_regions(); $jsonRegions = json_encode($regions); Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js'); Requirements::javascriptTemplate('swipestripe/javascript/RegionField.js', array("regions" => $jsonRegions, 'defaultValue' => $this->Value())); return parent::FieldHolder(); }
/** * Builds the form field, sets default attributes, and includes JS * * @param array $attributes The attributes to include on the formfield * @return SSViewer */ public function FieldHolder($attributes = array()) { Requirements::javascript(FRAMEWORK_DIR . "/admin/thirdparty/chosen/chosen/chosen.jquery.js"); Requirements::css(FRAMEWORK_DIR . "/admin/thirdparty/chosen/chosen/chosen.css"); $this->addExtraClass('chosen'); if (!$this->getAttribute('data-search-threshold')) { $this->setSearchThreshold(self::$default_search_threshold); } return parent::FieldHolder($attributes); }
function FieldHolder() { ShowHideField::include_files(); return parent::FieldHolder(); }
public function FilterDropdown() { $map = $this->filter_empty_string ? array($this->RelativeLink(array('filter' => '')) => $this->filter_empty_string) : array(); foreach($this->filter_map as $k => $v) { $map[$this->RelativeLink(array('filter' => $this->filtered_field.'_'.$k))] = $v; } $value = !empty($this->filter) ? $this->RelativeLink(array('filter' => $this->filter)) : null; $dropdown = new DropdownField('Filter',$this->filter_label . " (<a href='#' class='refresh'>"._t('DataObjectManager.REFRESH','refresh')."</a>)", $map, $value); return $dropdown->FieldHolder(); }
function GroupFilter() { $groups = DataObject::get('Group'); $groupArray = array('' => _t('MemberList.ANYGROUP', 'Any group')); foreach ($groups as $group) { $groupArray[$group->ID] = $group->Title; } $field = new DropdownField('MemberListGroup', _t('MemberList.FILTERBYG', 'Filter by group'), $groupArray); return $field->FieldHolder(); }