本文整理汇总了PHP中BOL_ComponentAdminService::findCache方法的典型用法代码示例。如果您正苦于以下问题:PHP BOL_ComponentAdminService::findCache方法的具体用法?PHP BOL_ComponentAdminService::findCache怎么用?PHP BOL_ComponentAdminService::findCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOL_ComponentAdminService
的用法示例。
在下文中一共展示了BOL_ComponentAdminService::findCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index($paramList)
{
$place = BOL_ComponentService::PLACE_INDEX;
$customize = !empty($paramList['mode']) && $paramList['mode'] == 'customize';
$allowCustomize = OW::getUser()->isAdmin();
$template = 'drag_and_drop_index';
if ($customize) {
if (!OW::getUser()->isAuthenticated()) {
throw new AuthenticateException();
}
if (!$allowCustomize) {
$this->redirect(OW::getRouter()->uriForRoute('base_index'));
}
}
if ($allowCustomize) {
$template = $customize ? 'drag_and_drop_index_customize' : 'drag_and_drop_index';
if ($customize) {
OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'main_menu_index');
}
}
if ($customize) {
$masterPageFileDir = OW::getThemeManager()->getMasterPageTemplate('dndindex');
OW::getDocument()->getMasterPage()->setTemplate($masterPageFileDir);
$this->setDocumentKey('base_index_page_customize');
} else {
$this->setDocumentKey('base_index_page');
}
$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 (empty($defaultScheme) && !empty($schemeList)) {
$defaultScheme = reset($schemeList);
}
$componentPanel = new BASE_CMP_DragAndDropIndex($place, $defaultComponents, $customize, $template);
$componentPanel->allowCustomize($allowCustomize);
$customizeUrls = array('customize' => OW::getRouter()->urlForRoute('base_index_customize', array('mode' => 'customize')), 'normal' => OW::getRouter()->urlForRoute('base_index'));
$componentPanel->customizeControlCunfigure($customizeUrls['customize'], $customizeUrls['normal']);
$componentPanel->setSchemeList($schemeList);
$componentPanel->setPositionList($defaultPositions);
$componentPanel->setSettingList($defaultSettings);
$componentPanel->setScheme($defaultScheme);
/* $themeName = OW_Config::getInstance()->getValue('base', 'selectedTheme');
$sidebarPosition = BOL_ThemeService::getInstance()->findThemeByName($themeName)->getSidebarPosition(); */
$sidebarPosition = OW::getThemeManager()->getCurrentTheme()->getDto()->getSidebarPosition();
$componentPanel->setSidebarPosition($sidebarPosition);
$componentPanel->assign('adminPluginsUrl', OW::getRouter()->urlForRoute('admin_plugins_installed'));
$this->addComponent('componentPanel', $componentPanel);
$this->setDocumentKey('base_index_page');
}
示例2: fetchFromCache
private function fetchFromCache()
{
$place = BOL_ComponentAdminService::PLACE_INDEX;
$state = $this->service->findCache($place);
if (empty($state)) {
$this->componentList = $this->service->findSectionComponentList($place, 'sidebar');
$this->positionList = $this->service->findSectionPositionList($place, 'sidebar');
$this->settingList = $this->service->findSettingListByComponentPlaceList($this->componentList);
return;
}
foreach ($state['defaultPositions'] as $key => $item) {
if ($item['section'] == 'sidebar') {
$this->positionList[$key] = $item;
$this->componentList[$key] = $state['defaultComponents'][$key];
if (!empty($state['defaultSettings'][$key])) {
$this->settingList[$key] = $state['defaultSettings'][$key];
}
}
}
}