Returns a "field holder" for this field - used by templates.
@param {array} $properties key value pairs of template variables
@return {string} HTML to be used
325532
public function FieldHolder($properties=array()) {
        $obj=($properties ? $this->customise($properties):$this);
        
        
        Requirements::css(CB_DIR.'/css/PackageViewField.css');
        Requirements::javascript(CB_DIR.'/javascript/PackageViewField.js');
        
        return $obj->renderWith($this->getFieldHolderTemplates());
    }
238574
public function Field($properties = [])
    {
        Requirements::customCSS('.field.simpleguard { display: none !important; }');
        
        return DBField::create_field('HTMLFragment', $this->honeypot->Field() . $this->timestamp->Field());
    }
898910
public function FieldHolder($properties=array()) {
        Requirements::css(CB_DIR.'/css/PackageSelectionField.css');
        Requirements::javascript(CB_DIR.'/javascript/PackageSelectionField.js');
        
        return parent::FieldHolder($properties);
    }
407665
final public static function format_properties($properties) {
        foreach ($properties as $property => $definition) {
            // Ensures that null is set to its default.
            if (!isset($definition['null'])) {
                $properties[$property]['null'] = NULL_NOT_ALLOWED;
            }
            if (!isset($definition['description'])) {
                $properties[$property]['description'] = $property;
            }

            // If an array is provided, it may be a nested array that is unformatted so rinse and repeat.
            if (is_array($definition['type'])) {
                $properties[$property]['type'] = static::format_properties($definition['type']);
            }
        }
        return $properties;
    }
1002038
protected function preUpdate(array $properties = null)
    {
        if (!$this->locked()) {
            $this->setSlug($this->generateSlug());
        }

        return parent::preUpdate($properties);
    }
303775
public function Field($properties = array())
    {
        $options = array();

        foreach ($this->getOptions()->filter('Selected', true) as $option) {
            $options[] = $option->Title;
        }

        $field = ReadonlyField::create($this->name . '_Readonly', $this->title);

        $field->setForm($this->form);
        $field->setValue(implode(', ', $options));
        return $field->Field();
    }
759147
protected function eachProperties(
        array $properties,
        $prefix = null,
        $ogPrefix = true
    ) {
        $html = [];

        foreach ($properties as $property => $value) {
            // multiple properties
            if (is_array($value)) {
                $subListPrefix = (is_string($property)) ? $property : $prefix;
                $subList = $this->eachProperties($value, $subListPrefix);

                $html[] = $subList;
            } else {
                if (is_string($prefix)) {
                    $key = (is_string($property)) ?
                        $prefix.':'.$property :
                        $prefix;
                } else {
                    $key = $property;
                }

                // if empty jump to next
                if (empty($value)) {
                    continue;
                }

                $html[] = $this->makeTag($key, $value, $ogPrefix);
            }
        }

        return implode($html);
    }
451491
public function Field($properties = [])
    {
        $label = $this->valueToLabel();
        if (!is_null($label)) {
            $attrValue = Convert::raw2xml($label);
            $inputValue = $this->value;
        } else {
            $attrValue = '<i>(' . _t('SilverStripe\\Forms\\FormField.NONE', 'none') . ')</i>';
            $inputValue = '';
        }

        $properties = array_merge($properties, array(
            'AttrValue' => DBField::create_field('HTMLFragment', $attrValue),
            'InputValue' => $inputValue
        ));

        return parent::Field($properties);
    }
967246
public function Field($properties = array())
    {
        $value = '';
        $titleArray = array();
        $idArray = array();
        $items = $this->getItems();
        $emptyTitle = _t('SilverStripe\\Forms\\DropdownField.CHOOSE', '(Choose)', 'start value of a dropdown');

        if ($items && count($items)) {
            foreach ($items as $item) {
                $idArray[] = $item->ID;
                $titleArray[] = ($item instanceof ViewableData)
                    ? $item->obj($this->getLabelField())->forTemplate()
                    : Convert::raw2xml($item->{$this->getLabelField()});
            }

            $title = implode(", ", $titleArray);
            sort($idArray);
            $value = implode(",", $idArray);
        } else {
            $title = $emptyTitle;
        }

        $dataUrlTree = '';
        if ($this->form) {
            $dataUrlTree = $this->Link('tree');
            if (!empty($idArray)) {
                $dataUrlTree = Controller::join_links($dataUrlTree, '?forceValue=' . implode(',', $idArray));
            }
        }
        $properties = array_merge(
            $properties,
            array(
                'Title' => $title,
                'EmptyTitle' => $emptyTitle,
                'Link' => $dataUrlTree,
                'Value' => $value
            )
        );
        return FormField::Field($properties);
    }
1254383
function Get($key, $property) {
		$key = strtolower($key);
		$property = strtolower($property);

		list($tag, $subtag) = explode(':', $key);
		list($tag, $class) = explode('.', $tag);
		list($tag, $id) = explode('#', $tag);
		$result = '';
		foreach($this->css as $_tag => $value) {
			list($_tag, $_subtag) = explode(':', $_tag);
			list($_tag, $_class) = explode('.', $_tag);
			list($_tag, $_id) = explode('#', $_tag);

			$tagmatch = (strcmp($tag, $_tag) == 0) | (strlen($_tag) == 0);
			$subtagmatch = (strcmp($subtag, $_subtag) == 0) | (strlen($_subtag) == 0);
			$classmatch = (strcmp($class, $_class) == 0) | (strlen($_class) == 0);
			$idmatch = (strcmp($id, $_id) == 0);

			if($tagmatch & $subtagmatch & $classmatch & $idmatch) {
		    	$temp = $_tag;
				if((strlen($temp) > 0) & (strlen($_class) > 0)) {
					$temp .= '.' . $_class;
				} elseif(strlen($temp) == 0) {
					$temp = '.' . $_class;
				}
				if((strlen($temp) > 0) & (strlen($_subtag) > 0)) {
					$temp .= ':' . $_subtag;
				} elseif(strlen($temp) == 0) {
					$temp = ':' . $_subtag;
				}
				if(isset($this->css[$temp][$property])) {
					$result = $this->css[$temp][$property];
				}
			}
		}
		return $result;
	}
783031
public function getProperties($properties){
        $values= array();
        foreach ($properties as $key) {
            $values[$key]= $this->getProperty($key);
        }
        return $values;
    }
1356830
function(property, value, fields) {
            fields = fields || [];
            var getters = this.__getGetters(property, true);

            for (var i = 0, ii = getters.length; i < ii; ++i) {
                var result = getters[i].call(this, value, fields);

                if (!_.isUndefined(result)) {
                    value = result;
                }
            }

            return value;
        }
739681
public static function isValidHtmlType(array $properties)
    {
        return Helpers::isKeyExists($properties, 'html-type') &&
            (
            in_array($properties['html-type'], self::$validHtmlTypes)
            || self::isValidSelectRangeType($properties)
        );
    }
651851
function make_styles_string($styles) {
        if (empty($styles)) {
            return null;
        }

        $string = '';
        foreach($styles as $property => $value) {
            $string .= $property . ':' . $value . ';';
        }
        return $string;
    }
418929
protected function generateStyle(array $properties)
	{
		ksort($properties);

		$style = '';
		foreach ($properties as $name => $value)
		{
			$style .= $name . ':' . $value . ';';
		}

		return trim($style, ';');
	}
701959
public function Field($properties = array())
    {
        if ($this->isReadonly()) {
            $nullableCheckbox = new CheckboxField_Readonly($this->getIsNullId());
        } else {
            $nullableCheckbox = new CheckboxField($this->getIsNullId());
        }

        $nullableCheckbox->setValue(is_null($this->dataValue()));

        return sprintf(
            '%s %s&nbsp;<span>%s</span>',
            $this->valueField->Field(),
            $nullableCheckbox->Field(),
            $this->getIsNullLabel()
        );
    }
1281873
protected function _getInputHelp(array $properties) : string
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $properties['controller']))->parseToArray();
        $typeaheadFields = !empty($config['table']['typeahead_fields']) ? $config['table']['typeahead_fields'] : [];
        // if no typeahead fields, use display field
        if (empty($typeaheadFields)) {
            $typeaheadFields = [$properties['displayField']];
        }

        $virtualFields = !empty($config['virtualFields']) ? $config['virtualFields'] : [];

        // extract virtual fields, if any
        $result = [];
        foreach ($typeaheadFields as $typeaheadField) {
            $fields = isset($virtualFields[$typeaheadField]) ?
                (array)$virtualFields[$typeaheadField] :
                [$typeaheadField];

            $result = array_merge($result, $fields);
        }

        return implode(', or ', array_map(function ($value) {
            return Inflector::humanize($value);
        }, $result));
    }