getHomeInstanceId() публичный Метод

getHomeInstanceId
public getHomeInstanceId ( null | string $siteKey = null ) : string
$siteKey null | string site key
Результат string
 public function editSetting(SiteHandler $siteHandler, MenuHandler $menuHandler)
 {
     $config = app('xe.site')->getSiteConfig();
     $siteKey = $siteHandler->getCurrentSiteKey();
     $indexInstance = $siteHandler->getHomeInstanceId();
     $menus = $menuHandler->getAll($siteKey, 'items');
     return \XePresenter::make('settings.setting', compact('config', 'menus', 'indexInstance'));
 }
 public function editSetting(MenuRetrieveHandler $menuHandler, SiteHandler $siteHandler, ThemeHandler $themeHandler)
 {
     $config = app('xe.site')->getSiteConfig();
     $siteKey = $siteHandler->getCurrentSiteKey();
     $indexInstance = $siteHandler->getHomeInstanceId();
     $menus = $menuHandler->getAllMenu($siteKey);
     $selectedTheme = $themeHandler->getSiteThemeId();
     return \Presenter::make('settings.setting', compact('config', 'selectedTheme', 'menus', 'indexInstance'));
 }
Пример #3
0
 /**
  * getHomeInstanceRoute
  *
  * @return InstanceRoute
  */
 private function getHomeInstanceRoute()
 {
     if (static::$homeInstanceRoute === null) {
         $homeInstanceId = $this->siteHandler->getHomeInstanceId();
         $instanceRoute = $this->routeRepo->findByInstanceId($homeInstanceId);
         static::$homeInstanceRoute = $instanceRoute;
         return $instanceRoute;
     } else {
         return static::$homeInstanceRoute;
     }
 }
 /**
  * getHomeInstanceRoute
  *
  * @return InstanceRoute
  */
 private function getHomeInstanceRoute()
 {
     /**
      * @var $instanceRouter InstanceRouteHandler
      **/
     if (static::$homeInstanceRoute === null) {
         $instanceRouter = $this->routeHandler;
         $homeInstanceId = $this->siteHandler->getHomeInstanceId();
         $instanceRoute = $instanceRouter->getByInstanceId($homeInstanceId);
         static::$homeInstanceRoute = $instanceRoute;
         return $instanceRoute;
     } else {
         return static::$homeInstanceRoute;
     }
 }
Пример #5
0
 /**
  * editItem
  * 선택된 메뉴의 아이템을 view & edit 페이지 구성
  *
  * @param MenuHandler   $handler menu handler
  * @param ModuleHandler $modules module handler
  * @param SiteHandler   $sites   site handler
  * @param string        $menuId  menu id
  * @param string        $itemId  item id
  *
  * @return RendererInterface
  */
 public function editItem(MenuHandler $handler, ModuleHandler $modules, SiteHandler $sites, $menuId, $itemId)
 {
     $item = $handler->getItem($itemId, ['basicImage', 'hoverImage', 'selectedImage', 'mBasicImage', 'mHoverImage', 'mSelectedImage']);
     $menu = $item->menu;
     if ($menu->getKey() !== $menuId) {
         throw new InvalidArgumentHttpException(400);
     }
     try {
         $menuType = $modules->getModuleObject($item->type);
     } catch (NotFoundModuleException $e) {
         $menuType = null;
     }
     $homeId = $sites->getHomeInstanceId();
     $itemConfig = $handler->getMenuItemTheme($item);
     $desktopTheme = $itemConfig->getPure('desktopTheme');
     $mobileTheme = $itemConfig->getPure('mobileTheme');
     $parentThemeMode = false;
     if ($desktopTheme === null && $mobileTheme === null) {
         $parentThemeMode = true;
     }
     $parentConfig = $itemConfig->getParent();
     return XePresenter::make('menu.editItem', ['menu' => $menu, 'item' => $item, 'homeId' => $homeId, 'menuType' => $menuType, 'parentThemeMode' => $parentThemeMode, 'itemConfig' => $itemConfig, 'parentConfig' => $parentConfig]);
 }
Пример #6
0
 /**
  * editItem
  * 선택된 메뉴의 아이템을 view & edit 페이지 구성
  *
  * @param MenuRetrieveHandler $menuHandler   menu handler
  * @param ModuleHandler       $moduleHandler module handler
  * @param MenuConfigHandler   $configHandler menu config handler
  * @param SiteHandler         $siteHandler   site handler
  * @param string              $menuId        menu id
  * @param string              $itemId        item id
  *
  * @return RendererInterface
  */
 public function editItem(MenuRetrieveHandler $menuHandler, ModuleHandler $moduleHandler, MenuConfigHandler $configHandler, SiteHandler $siteHandler, $menuId, $itemId)
 {
     $menu = $menuHandler->getMenu($menuId);
     $item = $menu->getItem($itemId);
     try {
         $menuType = $moduleHandler->getModuleObject($item->type);
     } catch (NotFoundModuleException $e) {
         $menuType = null;
     }
     $homeId = $siteHandler->getHomeInstanceId();
     $itemConfig = $configHandler->getMenuItemTheme($item);
     $desktopTheme = $itemConfig->getPure('desktopTheme');
     $mobileTheme = $itemConfig->getPure('mobileTheme');
     $parentThemeMode = false;
     if ($desktopTheme === null && $mobileTheme === null) {
         $parentThemeMode = true;
     }
     $parentConfig = $itemConfig->getParent();
     return Presenter::make('menu.editItem', ['menu' => $menu, 'item' => $item, 'homeId' => $homeId, 'menuType' => $menuType, 'parentThemeMode' => $parentThemeMode, 'itemConfig' => $itemConfig, 'parentConfig' => $parentConfig]);
 }