__('Markup', __FILE__), 'summary' => __('Contains any other markup and optionally child Inputfields', __FILE__), 'version' => 102, 'permanent' => true, ); } protected $renderValueMode = false; public function init() { $this->set('markupText', ''); $this->set('markupFunction', null); // closure or name of function that returns markup, receives $this as arg0. $this->set('textformatters', array()); $this->skipLabel = Inputfield::skipLabelBlank; parent::init(); } public function renderReady(Inputfield $parent = null, $renderValueMode = false) { $label = $this->getSetting('label'); if(!strlen($label) && $this->skipLabel == Inputfield::skipLabelBlank) { $this->addClass('InputfieldHeaderHidden'); } return parent::renderReady($parent, $renderValueMode); } public function ___render() { $out = ''; $value = $this->attr('value'); if(strlen($value)) { $out .= "\n" . $value; } $markupFunction = $this->getSetting('markupFunction'); $markupText = $this->getSetting('markupText'); $textformatters = $this->getSetting('textformatters'); $description = $this->getSetting('description'); if($markupFunction !== null & is_callable($markupFunction)) { $out .= "\n" . call_user_func($markupFunction, $this); } if(strlen($markupText)) { $out .= "\n" . $markupText; } $out = trim($out); if(wireCount($textformatters)) { foreach($textformatters as $className) { $t = $this->wire('modules')->get($className); if(!$t) continue; $t->formatValue($this->wire('page'), $this->wire(new Field()), $out); } } if(strlen($description)) { $textFormat = $this->getSetting('textFormat'); if($this->getSetting('entityEncodeText') !== false && $textFormat != Inputfield::textFormatNone) { if($textFormat == Inputfield::textFormatBasic) { $description = $this->entityEncode($description, Inputfield::textFormatBasic); $out = "
{$description}
$out"; } else if($textFormat == Inputfield::textFormatMarkdown) { $out = "