_groupTitle = (string)$groupTitle;
return $this;
}
public function getGroupTitle()
{
return $this->_groupTitle;
}
public function getData()
{
/** @var $itemObj App_Cms_Item_HtmlBlock_Obj */
$itemObj = App_Cms_Obj::getInstance()->getItemObject($this->getOption('type'));
if ($this->_doc->isPagePreviewMode()) {
$itemObj->setDraftPrefix('Draft');
}
$itemObj->setLanguage(Qs_Constant::get('CURRENT_LANGUAGE'));
$itemObj->setPrimaryKey($this->getOption('number'));
$itemObj->initData();
$data = $itemObj->getData();
if (!isset($data['content'])) {
$itemObj->setLanguage(Qs_Constant::get('DEFAULT_LANGUAGE'))
->setPrimaryKey($this->getOption('number'))
->clearData()
->initData();
$data = $itemObj->getData();
}
return $data;
}
public function exec()
{
$data = $this->getData();
if (!isset($data['content'])) {
return false;
}
if (null !== ($placeholdersSource = $this->getConfig('placeholders'))) {
$separator = (false !== strpos($placeholdersSource, '\\')) ? '\\' : '_';
$placeholderSourceObj = 'App' . $separator . $placeholdersSource . 'Obj';
if (class_exists($placeholderSourceObj)) {
/** @var Qs_Db_Obj $placeholderObj */
$placeholderObj = new $placeholderSourceObj();
if ($this->_doc->isPagePreviewMode()) {
if (method_exists($placeholderObj, 'getPlaceholdersPreviewData')) {
$placeholdersData = $placeholderObj->getPlaceholdersPreviewData();
} else {
$placeholdersData = [];
}
} else {
$placeholdersData = $placeholderObj->getPlaceholdersData();
}
if ($placeholdersData) {
$data['content'] = str_replace(
array_keys($placeholdersData),
array_values($placeholdersData),
$data['content']
);
}
}
}
$data['tpl'] = $this->getTemplate('view.tpl');
$this->_addItem($data);
return $this;
}
}