38 require_once realpath(dirname(__FILE__)).
"/../field_renderers.inc";
42 static $urlExpression =
"/^(ht|f)tp(s?)\\:\\/\\/[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\.\\?\\,\\'\\/\\\\\\+&%\$#_=]*)?$/";
55 $label = isset($this->label) ? $this->label : $this->parent->prettifyFieldName($field);
57 if ($this->checkSyntax)
72 $value = $this->parent->data->get($field);
73 $escaped = htmlspecialchars($value, ENT_QUOTES,
'UTF-8');
74 $safe = htmlSafe($value);
76 if ($this->displayLength > 0)
78 $safe =
ellipsis($safe, $this->displayLength);
81 if (!$this->parent->readOnlyForm)
83 echo
"<input id='{$this->parent->id}_{$field}' type='hidden' name='$field' value='".$escaped.
"'/>";
89 echo
"<a target='{$this->target}' href='$value'>$safe</a>";
93 echo htmlSafe($value);
_startField($field, $styles="")
Internal method to generate the starting HTML for the field (including the label)
_endField($field)
Internal method to generate the closing HTML for the field.
Field renderer for string data fields.
StringFieldRenderer(&$parent)
addValidatorsToForm($field, $required=false)
This method is called by the AutoForm to add any default input validators that are required by the Fi...
URLFieldRenderer(&$parent)
$checkSyntax
Set to true to force users to only enter valid URLs.
ellipsis($txt, $max, $wholeWord=false)
Truncate the supplied text at the given maximum length.