本文整理汇总了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());
}