当前位置: 首页>>代码示例>>PHP>>正文


PHP BOL_ComponentAdminService::findPlace方法代码示例

本文整理汇总了PHP中BOL_ComponentAdminService::findPlace方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_ComponentAdminService::findPlace方法的具体用法?PHP BOL_ComponentAdminService::findPlace怎么用?PHP BOL_ComponentAdminService::findPlace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BOL_ComponentAdminService的用法示例。


在下文中一共展示了BOL_ComponentAdminService::findPlace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action

 private function action($place, $userId, $customizeMode, $customizeRouts, $componentTemplate, $responderController = null)
 {
     $userCustomizeAllowed = (bool) $this->componentAdminService->findPlace($place)->editableByUser;
     if (!$userCustomizeAllowed && $customizeMode) {
         $this->redirect($customizeRouts['normal']);
     }
     $schemeList = $this->componentAdminService->findSchemeList();
     $state = $this->componentAdminService->findCache($place);
     if (empty($state)) {
         $state = array();
         $state['defaultComponents'] = $this->componentAdminService->findPlaceComponentList($place);
         $state['defaultPositions'] = $this->componentAdminService->findAllPositionList($place);
         $state['defaultSettings'] = $this->componentAdminService->findAllSettingList();
         $state['defaultScheme'] = (array) $this->componentAdminService->findSchemeByPlace($place);
         $this->componentAdminService->saveCache($place, $state);
     }
     $defaultComponents = $state['defaultComponents'];
     $defaultPositions = $state['defaultPositions'];
     $defaultSettings = $state['defaultSettings'];
     $defaultScheme = $state['defaultScheme'];
     if ($userCustomizeAllowed) {
         $userCache = $this->componentEntityService->findEntityCache($place, $userId);
         if (empty($userCache)) {
             $userCache = array();
             $userCache['userComponents'] = $this->componentEntityService->findPlaceComponentList($place, $userId);
             $userCache['userSettings'] = $this->componentEntityService->findAllSettingList($userId);
             $userCache['userPositions'] = $this->componentEntityService->findAllPositionList($place, $userId);
             $this->componentEntityService->saveEntityCache($place, $userId, $userCache);
         }
         $userComponents = $userCache['userComponents'];
         $userSettings = $userCache['userSettings'];
         $userPositions = $userCache['userPositions'];
     } else {
         $userComponents = array();
         $userSettings = array();
         $userPositions = array();
     }
     if (empty($defaultScheme) && !empty($schemeList)) {
         $defaultScheme = reset($schemeList);
     }
     $componentPanel = new BASE_CMP_DragAndDropEntityPanel($place, $userId, $defaultComponents, $customizeMode, $componentTemplate, $responderController);
     $componentPanel->setAdditionalSettingList(array('entityId' => $userId, 'entity' => 'user'));
     if (!empty($customizeRouts)) {
         $componentPanel->allowCustomize($userCustomizeAllowed);
         $componentPanel->customizeControlCunfigure($customizeRouts['customize'], $customizeRouts['normal']);
     }
     $componentPanel->setSchemeList($schemeList);
     $componentPanel->setPositionList($defaultPositions);
     $componentPanel->setSettingList($defaultSettings);
     $componentPanel->setScheme($defaultScheme);
     /*
              * This feature was disabled for users
              * if ( !empty($userScheme) )
               {
               $componentPanel->setEntityScheme($userScheme);
               } */
     if (!empty($userComponents)) {
         $componentPanel->setEntityComponentList($userComponents);
     }
     if (!empty($userPositions)) {
         $componentPanel->setEntityPositionList($userPositions);
     }
     if (!empty($userSettings)) {
         $componentPanel->setEntitySettingList($userSettings);
     }
     $this->assign('componentPanel', $componentPanel->render());
 }
开发者ID:hardikamutech,项目名称:loov,代码行数:67,代码来源:component_panel.php


注:本文中的BOL_ComponentAdminService::findPlace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。