Return valid form data
@param $content
@return \stdClass
353125
protected function _defaultData($content)
    {
        $content = @unserialize($content);
        if (empty($content) || !is_a($content, \stdClass::class)) {
            $content = new \stdClass;
        }
        $content->captcha = !empty($content->captcha) ? $content->captcha : false;
        $content->email_from = !empty($content->email_from) ? $content->email_from : '';
        $content->email_to = !empty($content->email_to) ? $content->email_to : '';
        $content->template = !empty($content->template) ? $content->template : '';
        $content->page_to = !empty($content->page_to) ? $content->page_to : '';
        return $content;
    }
580604
public function getControl($content = NULL)
	{
		$btn = Html::el('button', [
			'type' => 'button',
			'name' => $this->getHtmlName(),
		]);
		$btn->setHtml($content === NULL ? $this->caption : $content);
		$this->addBtnClass($btn);

		return $btn;
	}
875955
protected function renderElement($content = null)
    {
        // Get element parts
        $element    = $this->getElement();
        $attributes = $this->getAttributesAsString();

        // Create html
        $html = '<' . $element;
        if ($attributes) {
            $html .= $attributes;
        }

        // Create closing tag
        if (is_string($content)) {
            $html .= '>' . $content . '</' . $element;
        }
        $html .= $this->getClosingBracket();

        return $html;
    }
873580
public function prepareContent($content)
    {
        if (is_array($content)) {
            $ctt = '';
            foreach ($content as $key=>$ctt_entry) {
                $ctt .= $ctt_entry;
            }
            $content = $ctt;
        }
        return (string) $content;
    }
720332
protected function getEOL($content)
    {
        static $eols = [
            "\r\n",
            "\n",
            "\r",
        ];
        foreach($eols as $eol)
        {
            if(strpos($content, $eol))
            {
                return $eol;
            }
        }
        return PHP_EOL;
    }
449925
public function &setContent($content)
    {
        // Set element type by analyzing the element
        switch (true) {

            case ($content instanceof FormGroup):
                $this->type = 'group';
                break;

            case ($content instanceof ControlsCollectionInterface):
                $this->type = 'collection';
                break;

            case ($content instanceof AbstractForm):
                $this->type = 'control';
                break;

            case ($content instanceof AbstractHtml):
                $this->type = 'factory';
                break;

            default:
                $this->type = 'html';
        }

        $this->content = $content;

        return $content;
    }
931948
public function contentParser($content)
    {
        return str_replace(['{{dataApiUrl}}', '{{title}}', '{{template}}'], [$this->getDataApiUrl(), $this->getTitle(), $this->_template], $content);
    }
551431
public function parseContent($content)
    {
        $cto = $this->getContentTypeObject();
        if (!empty($cto)) {
            return $cto->parseContent($content);
        } else {
            return $content;
        }
    }
41603
protected function getHtml( $content )
	{
		$site = Route::input( 'site', Input::get( 'site', 'default' ) );
		return View::make( 'shop::jqadm.index', array( 'content' => $content, 'site' => $site ) );
	}
21079
public function data($content, $options = [])
    {
        if (isset($options['returnAll']) && $options['returnAll']) {
            return BlockSelectOption::getOptionsArray($this->_block->id);
        }
        return parent::data($content);
    }
1260616
public function parse($content)
    {
        $set = null;
        if (strpos($content, '@ORM') === false) {
            return $set;
        }

        if (preg_match(self::PATTERN, $content, $matches)) {
            $set[] = [$matches[1], $matches[2]];
        }



        return $set;
    }
1278334
public function display($content, $options = [])
    {
        $formData = $this->_defaultData($content);
        $view = !empty($options['view']) ? $options['view'] : $formData->template;
        return FormWrap::view($this->_block, $options, $this->displayView($view), ['form_data' => $formData]);
    }
796316
public function fix($content)
    {
        $trimmed = trim($content);
        if (empty($trimmed)) {
            return $content;
        }

        // Get a clean new StateBag
        $this->stateBag = new StateBag();

        $dom = $this->loadDOMDocument($trimmed);

        $this->processDOM($dom, $dom);

        $content = $this->exportDOMDocument($dom);

        return $content;
    }
1153918
private function guessContentType($content)
    {
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);

        if (is_resource($content)) {
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
        }

        return $fileInfo->buffer($content);
    }
25935
public function convert($content)
    {
        $result = strtr($content, $this->rules);
        return $this->correct($result);
    }
1025702
protected function getFullTextValues(Content $content)
    {
        $fullTextValues = [];
        foreach ($content->fields as $field) {
            $fieldDefinition = $this->contentTypeHandler->getFieldDefinition(
                $field->fieldDefinitionId, Content\Type::STATUS_DEFINED
            );
            if (!$fieldDefinition->isSearchable) {
                continue;
            }

            $value = $this->getFullTextFieldValue($field, $fieldDefinition);
            if (empty($value)) {
                continue;
            }

            $fullTextValues[] = new FullTextValue(
                [
                    'id' => $field->id,
                    'fieldDefinitionId' => $field->fieldDefinitionId,
                    'fieldDefinitionIdentifier' => $fieldDefinition->identifier,
                    'languageCode' => $field->languageCode,
                    'value' => !is_array($value) ? $value : implode(' ', $value),
                ]
            );
        }

        return $fullTextValues;
    }
1254407
protected function formatContent($content)
    {
        $searches = array(
            '{{filename}}',
            '{{namespace}}',
            '{{className}}',
        );

        $replaces = array(
            $this->data['filename'],
            $this->data['namespace'],
            $this->data['className'],
        );

        return str_replace($searches, $replaces, $content);
    }