示例#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();
 }
 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;
 }
示例#3
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();
 }