public function tplComponent($params) { $uniqName = $params['uniqName']; $componentPlace = $this->componentList[$uniqName]; $viewInstance = new BASE_CMP_DragAndDropItem($uniqName); $viewInstance->setSettingList(empty($this->settingList[$uniqName]) ? array() : $this->settingList[$uniqName]); $viewInstance->setContentComponentClass($componentPlace['className']); return $viewInstance->renderView(); }
protected function getBoxSettingList(array $settingList, array $runTimeSettingList) { $box = parent::getBoxSettingList($settingList, $runTimeSettingList); $box["title"] = !$box["show_title"] ? "" : $box["title"]; $box["capEnabled"] = !empty($box["title"]) || !empty($box["capContent"]); return $box; }
public function tplComponent($params) { $uniqName = $params['uniqName']; $render = !empty($params['render']); $isClone = $this->componentList[$uniqName]['clone']; $componentPlace = $this->componentList[$uniqName]; $template = $this->customizeMode ? 'drag_and_drop_item_customize' : null; $viewInstance = new BASE_CMP_DragAndDropItem($uniqName, $isClone, $template, $this->sharedData); $viewInstance->setSettingList(empty($this->settingList[$uniqName]) ? array() : $this->settingList[$uniqName]); $viewInstance->componentParamObject->additionalParamList = $this->additionalSettingList; $viewInstance->componentParamObject->customizeMode = $this->customizeMode; if (!empty($this->standartSettings[$componentPlace['className']])) { $viewInstance->setStandartSettings($this->standartSettings[$componentPlace['className']]); } $viewInstance->setContentComponentClass($componentPlace['className']); if ($render) { return $viewInstance->renderView(); } return $viewInstance->renderScheme(); }
protected function getComponentMarkup(BASE_CMP_DragAndDropItem $viewInstance, $renderView = false) { /* @var $document OW_AjaxDocument */ $document = OW::getDocument(); $responce = array(); if ($renderView) { $responce['content'] = $viewInstance->renderView(); } else { $responce['content'] = $viewInstance->renderScheme(); } foreach ($document->getScripts() as $script) { $responce['scriptFiles'][] = $script; } $onloadScript = $document->getOnloadScript(); if (!empty($onloadScript)) { $responce['onloadScript'] = $onloadScript; } $styleDeclarations = $document->getStyleDeclarations(); if (!empty($styleDeclarations)) { $responce['styleDeclarations'] = $styleDeclarations; } $styleSheets = $document->getStyleSheets(); if (!empty($styleSheets)) { $responce['styleSheets'] = $styleSheets; } return $responce; }
protected function reloadComponent($data) { $componentUniqName = $data['componentId']; $renderView = !empty($data['render']); $entity = $data['entity']; $componentPlace = $this->componentService->findComponentPlace($componentUniqName, $entity); $component = $this->componentService->findComponent($componentPlace->componentId); $defaultSettingList = BOL_ComponentAdminService::getInstance()->findSettingList($componentUniqName); $entitySettingList = $this->componentService->findSettingList($componentUniqName, $entity); $viewInstance = new BASE_CMP_DragAndDropItem($componentUniqName, (bool) $componentPlace->clone, 'drag_and_drop_item_customize'); $viewInstance->setSettingList($defaultSettingList, $entitySettingList); $viewInstance->componentParamObject->additionalParamList = $data['additionalSettings']; $viewInstance->componentParamObject->customizeMode = true; $viewInstance->setContentComponentClass($component->className); return $this->getComponentMarkup($viewInstance, $renderView); }