Render properties

@param  array $value
@param  array $addAttr
@return string
543684
protected function renderProperties( array $values  = array(),
                                         array $addAttr = array() )
    {
        $markup = '';

        foreach ( $values as $key => $data )
        {
            if ( is_string( $key ) && isset( $data['value'] ) )
            {
                $markup .= $this->renderProperty(
                    $key,
                    $data['value'],
                    ! empty( $data['priority'] ),
                    $addAttr
                );
            }
        }

        return $markup;
    }
782997
private function drawPropertyValue($html, $value)
    {
        if (is_scalar($value)) {
            return $html->h($value);
        } elseif ($value instanceof HtmlOutput) {
            return $value->toHtml($html);
        } elseif ($value instanceof \Sabre\Xml\XmlSerializable) {
            // There's no default html output for this property, we're going
            // to output the actual xml serialization instead.
            $xml = $this->server->xml->write('{DAV:}root', $value, $this->server->getBaseUri());
            // removing first and last line, as they contain our root
            // element.
            $xml = explode("\n", $xml);
            $xml = array_slice($xml, 2, -2);

            return '<pre>'.$html->h(implode("\n", $xml)).'</pre>';
        } else {
            return '<em>unknown</em>';
        }
    }
1230406
public function render($value, $class = 'btn-default', $style = null)
    {
        $class = trim($class);

        $extra = '';
        if ($this->isDisabled) {
            $extra .= ' disabled="disabled"';
        }
        if ($this->id !== null) {
            $extra .= ' id="'.$this->id.'"';
        }
        if ($this->name !== null) {
            $extra .= ' name="'.$this->name.'"';
        }
        if ($style !== null) {
            $extra .= ' style="'.$style.'"';
        }

        if ($this->isActive) {
            $class .= ' active';
        }
        if ($this->isBlock) {
            $class .= ' btn-block';
        }
        if ($this->size !== null) {
            $class .= ' '.$this->size;
        }

        if ($this->type == self::TYPE_ANCHOR) {
            if ($this->anchorTarget !== null) {
                $extra .= ' target="'.$this->anchorTarget.'"';
            }

            return sprintf($this->formatAnchor, $this->anchor, $class, $extra, $value);
        } elseif ($this->type == self::TYPE_INPUT) {
            return sprintf($this->formatInput, $this->inputType, $value, $class, $extra);
        } else {
            return sprintf($this->formatButton, $class, $extra, $value);
        }
    }
1186205
protected function AddRichTextField($name, $value = '')
   {
        $renderer = new CKEditorRenderer(PathUtil::BackendRTEPath(), PathUtil::BackendRTEUrl(),
            PathUtil::UploadPath(), PathUtil::UploadUrl(), self::Guard());
        $field = new Custom($renderer);
        $field->SetName($name);
        $field->SetValue($value);
        $this->AddField($field);
        return $field;
   }
722559
protected function option($display, $value, array $attributes = [])
    {
        $options = ['value' => $value] + $attributes;

        return $this->toHtmlString('<option'.$this->attributes($options).'>'.e($display).'</option>');
    }
743075
public static function hidden($name, $value, array $attributes = array())
    {
        $node = new Node\Hidden();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
320437
public function url($name, $value = null, array $attributes = array(), array $extra = array())
    {
        return $this->build('url', $name, $value, $attributes, $extra);
    }
429889
public static function text($name, $value, array $attributes = array())
    {
        $node = new Node\Text();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
403631
protected function doBuild($type, $name, $value = null, array $attributes = array(), array $extra = array(), $options = null)
    {
        $attributes = $this->replaceAttributes($attributes);

        if (!$this->checkAccess($attributes)) {
            return '';
        }

        $required = $this->getRequired($attributes);
        $label = $this->getLabel($name, $attributes);
        $htmlName = $this->getHtmlName($name);
        $id = $this->getHtmlId($name, $attributes);
        $errors = $this->getControlErrors($name);
        $hasErrors = !empty($errors);
        $customTemplate = $this->getCustomTemplate($attributes);

        $attributes = $this->getHtmlAttributes($type, $attributes, $errors, $id);

        $input = $this->buildControl($type, $name, $value, $attributes, $options, $htmlName, $hasErrors);

        return $this->theme->render(
            $customTemplate,
            array_merge($extra, compact('htmlName', 'id',  'label', 'input', 'errors', 'hasErrors', 'required')),
            'fields.'.$this->getDefaultTemplate($type)
        );
    }
1061210
private function _addAttributeToArray(array &$attributeArray, $name, $value)
    {
        // If multiple attributes exist, add as an array value
        if (isset($attributeArray[$name])) {
            // Initialize the array with the existing value
            if (!is_array($attributeArray[$name])) {
                $existingValue = $attributeArray[$name];
                $attributeArray[$name] = array($existingValue);
            }

            $attributeArray[$name][] = trim($value);
        } else {
            $attributeArray[$name] = trim($value);
        }
    }
943775
public static function input( array $attributes = array(), $value = null, $wrapper = null )
    {
        $_html = static::tag( 'input', $attributes, $value, true, true );

        if ( null !== $wrapper )
        {
            $_html = static::div( array('class' => $wrapper), $_html );
        }

        return $_html;
    }
1084532
private function renderParentProperty(EnvironmentInterface $environment, $property, $value)
    {
        $evaluation = $property->getExtra();

        if (\is_array($value)) {
            return \implode(', ', $value);
        }

        $isRendered = false;

        $value = $this->renderForCheckbox($property, $value, $isRendered);
        $value = $this->renderForDateTime($environment, $property, $value, $isRendered);
        $value = $this->renderReference($value, $evaluation['reference'], $isRendered);

        $options = $property->getOptions();
        if ($evaluation['isAssociative'] || \array_is_assoc($options)) {
            $value = $options[$value];
        }

        return $value;
    }
453743
public static function date($name, $value, array $attributes = array())
    {
        $node = new Node\Date();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
1043884
protected function serialization(array &$value)
    {
        $data = [
            self::DATA_KEY => \array_merge(
                PropertyHelper::setResponseDataTypeAndId($this->mappings, $value),
                DataAttributesHelper::setResponseDataAttributes($this->mappings, $value),
                DataLinksHelper::setResponseDataLinks($this->mappings, $value),
                DataLinksHelper::setResponseDataRelationship($this->mappings, $value, $value)
            ),
        ];

        DataIncludedHelper::setResponseDataIncluded($this->mappings, $value, $data);

        $this->setResponseLinks($value, $data);
        $this->setResponseMeta($data);
        $this->setResponseVersion($data);

        return $data;
    }
702480
static function text($name, $value, $attr = array())
    {
        $attr = array_merge(
            array(
                "type" => "text"
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
583462
public function input($type, $name, $value = null, array $attributes = array(), array $extra = array())
    {
        return $this->build($type, $name, $value, $attributes, $extra);
    }
1208181
private function renderField(string $value): string
    {
        if (isset($this->field)) {
            $field = '';
            if (isset($this->namespace)) {
                $field = $this->namespace.'$';
            }
            $field .= $this->field;

            if (isset($this->matchType)) {
                $field .= '.'.$this->matchType;
            }
            $value .= $field.':';
        }

        return $value;
    }