/** * Returns the string which will be used in the template * @return string */ public function forTemplateEdit() { $dbField = $this->owner->dbObject('Filename'); FrontendEditing::setValue($dbField, $this->owner->Filename, $this->owner); $isEditable = FrontendEditing::editingEnabled() && FrontendEditing::isEditable($dbField); $value = $this->owner->forTemplate() . "99"; if ($isEditable) { $value = "<span class='editable'>" . $value . "</span>"; } return $value; }
/** * Set the value on the field. * Optionally takes the whole record as an argument, * to pick other values. * * @param mixed $value * @param array $record */ public function setValue($value, $record = null) { FrontendEditing::setValue($this, $value, $record); parent::setValue($value, $record); }