Файл: concrete5.7.5.6/concrete/blocks/html/controller.php
Строк: 71
<?php
namespace ConcreteBlockHtml;
use Loader;
use ConcreteCoreBlockBlockController;
class Controller extends BlockController
{
protected $btTable = 'btContentLocal';
protected $btInterfaceWidth = "600";
protected $btWrapperClass = 'ccm-ui';
protected $btInterfaceHeight = "500";
protected $btCacheBlockRecord = true;
protected $btCacheBlockOutput = true;
protected $btCacheBlockOutputOnPost = true;
protected $btCacheBlockOutputForRegisteredUsers = true;
protected $btIgnorePageThemeGridFrameworkContainer = true;
public $content = "";
public function getBlockTypeDescription()
{
return t("For adding HTML by hand.");
}
public function getBlockTypeName()
{
return t("HTML");
}
public function view()
{
$this->set('content', $this->content);
}
public function add()
{
$this->edit();
}
public function edit()
{
$this->requireAsset('ace');
}
public function getSearchableContent()
{
return $this->content;
}
public function save($data)
{
$args['content'] = isset($data['content']) ? $data['content'] : '';
parent::save($args);
}
public static function xml_highlight($s)
{
$s = htmlspecialchars($s);
$s = preg_replace(
"#<([/]*?)(.*)([s]*?)>#sU",
"<font color="#0000FF"><\1\2\3></font>",
$s
);
$s = preg_replace(
"#<([?])(.*)([?])>#sU",
"<font color="#800000"><\1\2\3></font>",
$s
);
$s = preg_replace(
"#<([^s?/=])(.*)([[s/]|>)#iU",
"<<font color="#808000">\1\2</font>\3",
$s
);
$s = preg_replace(
"#<([/])([^s]*?)([s]]*?)>#iU",
"<\1<font color="#808000">\2</font>\3>",
$s
);
$s = preg_replace(
"#([^s]*?)=("|')(.*)("|')#isU",
"<font color="#800080">\1</font>=<font color="#FF00FF">\2\3\4</font>",
$s
);
$s = preg_replace(
"#<(.*)([)(.*)(])>#isU",
"<\1<font color="#800080">\2\3\4</font>>",
$s
);
return nl2br($s);
}
}