示例#1
0
文件: sidebar.php 项目: vazahat/dudex
 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();
 }
示例#2
0
 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 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);
 }