コード例 #1
0
ファイル: AdminController.php プロジェクト: Umz/ImpressPages
 public function index()
 {
     ipAddJsVariable('ipTranslationAreYouSure', __('Are you sure?', 'Ip-admin', false));
     ipAddJs('Ip/Internal/Core/assets/js/angular.js');
     ipAddJs('Ip/Internal/Pages/assets/js/pages.js');
     ipAddJs('Ip/Internal/Pages/assets/js/pagesLayout.js');
     ipAddJs('Ip/Internal/Pages/assets/js/menuList.js');
     ipAddJs('Ip/Internal/Pages/assets/jstree/jstree.min.js');
     ipAddJs('Ip/Internal/Pages/assets/js/jquery.pageTree.js');
     ipAddJs('Ip/Internal/Pages/assets/js/jquery.pageProperties.js');
     ipAddJs('Ip/Internal/Grid/assets/grid.js');
     ipAddJs('Ip/Internal/Grid/assets/gridInit.js');
     ipAddJs('Ip/Internal/Grid/assets/subgridField.js');
     ipAddJsVariable('languageList', Helper::languageList());
     ipAddJsVariable('ipPagesLanguagesPermission', ipAdminPermission('Languages'));
     $menus = Model::getMenuList();
     foreach ($menus as $key => &$menu) {
         $default = 'top';
         if ($key == 0) {
             $default = 'bottom';
         }
         $menu['defaultPosition'] = Model::getDefaultMenuPagePosition($menu['alias'], false, $default);
         $default = 'below';
         $menu['defaultPositionWhenSelected'] = Model::getDefaultMenuPagePosition($menu['alias'], true, $default);
     }
     $menus = ipFilter('ipPagesMenuList', $menus);
     ipAddJsVariable('menuList', $menus);
     $variables = array('addPageForm' => Helper::addPageForm(), 'addMenuForm' => Helper::addMenuForm(), 'languagesUrl' => ipConfig()->baseUrl() . '?aa=Languages.index');
     $layout = ipView('view/layout.php', $variables);
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     ipAddJsVariable('listStylePageSize', ipGetOption('Pages.pageListSize', 30));
     return $layout->render();
 }
コード例 #2
0
ファイル: AdminController.php プロジェクト: Umz/ImpressPages
 public function index()
 {
     ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
     ipAddCss('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.css');
     ipAddJs('Ip/Internal/Core/assets/js/easyXDM/easyXDM.min.js');
     ipAddJs('Ip/Internal/Design/assets/options.js');
     ipAddJs('Ip/Internal/Design/assets/market.js');
     ipAddJs('Ip/Internal/Design/assets/design.js');
     ipAddJs('Ip/Internal/Design/assets/pluginInstall.js');
     ipAddJs('Ip/Internal/System/assets/market.js');
     $model = Model::instance();
     $themes = $model->getAvailableThemes();
     $model = Model::instance();
     $theme = $model->getTheme(ipConfig()->theme());
     $options = $theme->getOptionsAsArray();
     $themePlugins = $model->getThemePlugins();
     $installedPlugins = \Ip\Internal\Plugins\Service::getActivePluginNames();
     $notInstalledPlugins = array();
     //filter plugins that are already installed
     foreach ($themePlugins as $plugin) {
         if (!empty($plugin['name']) && (!in_array($plugin['name'], $installedPlugins) || !is_dir(ipFile('Plugin/' . $plugin['name'])))) {
             $notInstalledPlugins[] = $plugin;
         }
     }
     if (isset($_SESSION['module']['design']['pluginNote'])) {
         $pluginNote = $_SESSION['module']['design']['pluginNote'];
         unset($_SESSION['module']['design']['pluginNote']);
     } else {
         $pluginNote = '';
     }
     $data = array('pluginNote' => $pluginNote, 'theme' => $model->getTheme(ipConfig()->theme()), 'plugins' => $notInstalledPlugins, 'availableThemes' => $themes, 'marketUrl' => $model->getMarketUrl(), 'showConfiguration' => !empty($options), 'contentManagementUrl' => ipConfig()->baseUrl() . '?aa=Content.index', 'contentManagementText' => __('Manage content', 'Ip-admin', false));
     $contentView = ipView('view/layout.php', $data);
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     return $contentView->render();
 }
コード例 #3
0
 public function index()
 {
     ipAddCss('assets/repositoryLayout.css');
     ipAddJs('assets/layout.js');
     $routeVariables = array('aa' => 'RepositoryManager.repository', 'disableAdminNavbar' => 1);
     //        ipResponse()->setLayoutVariable('repositoryUrl', ipActionUrl($routeVariables));
     //        ipResponse()->setLayout('Plugin/RepositoryManager/view/index.php');
     ////        ipSetLayout('view/index.php');
     //        return 'a';
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     return ipView('view/index.php', array('repositoryUrl' => ipActionUrl($routeVariables)));
 }
コード例 #4
0
ファイル: Event.php プロジェクト: Umz/ImpressPages
 public static function ipBeforeController()
 {
     //show admin submenu if needed
     if (ipRoute()->isAdmin()) {
         ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
         ipAddCss('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.css');
         $submenu = Submenu::getSubmenuItems();
         $submenu = ipFilter('ipAdminSubmenu', $submenu);
         if ($submenu) {
             ipResponse()->setLayoutVariable('submenu', $submenu);
         }
     }
     // Show admin toolbar if admin is logged in:
     if (ipAdminId() && !ipRequest()->getRequest('pa') || ipRequest()->getRequest('aa') && ipAdminId()) {
         if (!ipRequest()->getQuery('ipDesignPreview') && !ipRequest()->getQuery('disableAdminNavbar')) {
             ipAddJs('Ip/Internal/Admin/assets/admin.js');
             ipAddJsVariable('ipAdminNavbar', static::getAdminNavbarHtml());
         }
     }
     // Show popup with autogenerated user information if needed
     $adminIsAutogenerated = ipStorage()->get('Ip', 'adminIsAutogenerated');
     if ($adminIsAutogenerated) {
         $adminId = \Ip\Internal\Admin\Backend::userId();
         $admin = \Ip\Internal\Administrators\Model::getById($adminId);
         ipAddJs('Ip/Internal/Admin/assets/adminIsAutogenerated.js');
         $data = array('adminUsername' => $admin['username'], 'adminPassword' => ipStorage()->get('Ip', 'adminIsAutogenerated'), 'adminEmail' => $admin['email']);
         ipAddJsVariable('ipAdminIsAutogenerated', ipView('view/adminIsAutoGenerated.php', $data)->render());
     }
     if (ipContent()->getCurrentPage()) {
         // initialize management
         if (ipIsManagementState()) {
             if (!ipRequest()->getQuery('ipDesignPreview') && !ipRequest()->getQuery('disableManagement')) {
                 \Ip\Internal\Content\Helper::initManagement();
             }
         }
         //show page content
         $response = ipResponse();
         $response->setDescription(\Ip\ServiceLocator::content()->getDescription());
         $response->setKeywords(ipContent()->getKeywords());
         $response->setTitle(ipContent()->getTitle());
     }
 }
コード例 #5
0
ファイル: Event.php プロジェクト: Umz/ImpressPages
 /**
  * Used when management is needed in controller routed using routes.
  * @param $info
  * @return null
  */
 public static function ipBeforeController_70($info)
 {
     if (empty($info['page']) || empty($info['management']) || !ipIsManagementState()) {
         return null;
     }
     //find current page
     $page = $info['page'];
     // change layout if safe mode
     if (\Ip\Internal\Admin\Service::isSafeMode()) {
         ipSetLayout(ipFile('Ip/Internal/Admin/view/safeModeLayout.php'));
     } else {
         ipSetLayout($page->getLayout());
     }
     // initialize management
     if (!ipRequest()->getQuery('ipDesignPreview') && !ipRequest()->getQuery('disableManagement')) {
         Helper::initManagement();
     }
     //show page content
     $response = ipResponse();
     $response->setDescription(\Ip\ServiceLocator::content()->getDescription());
     $response->setKeywords(ipContent()->getKeywords());
     $response->setTitle(ipContent()->getTitle());
 }
コード例 #6
0
ファイル: PageAssets.php プロジェクト: Umz/ImpressPages
 public function generateHead()
 {
     $cacheVersion = $this->getCacheVersion();
     $cssFiles = $this->getCss();
     $inDesignPreview = false;
     $data = ipRequest()->getRequest();
     if (!empty($data['ipDesign']['pCfg']) || !empty($data['restoreDefault'])) {
         $inDesignPreview = \Ip\Internal\Design\ConfigModel::instance()->isInPreviewState();
     }
     if ($inDesignPreview) {
         $themeAssetsUrl = ipThemeUrl(\Ip\Application::ASSETS_DIR . '/');
         $designService = \Ip\Internal\Design\Service::instance();
         $theme = ipConfig()->theme();
         foreach ($cssFiles as &$file) {
             if (strpos($file['value'], $themeAssetsUrl) === 0) {
                 $pathinfo = pathinfo($file['value']);
                 if ($pathinfo['extension'] == 'css' && $themeAssetsUrl . $pathinfo['basename'] == $file['value']) {
                     $themeFile = \Ip\Application::ASSETS_DIR . '/' . $pathinfo['filename'] . '.less';
                     if (file_exists(ipThemeFile($themeFile))) {
                         $file['value'] = $designService->getRealTimeUrl($theme, $themeFile);
                         $file['cacheFix'] = false;
                     }
                 }
             }
             if ($file['cacheFix']) {
                 $file['value'] .= (strpos($file['value'], '?') !== false ? '&' : '?') . $cacheVersion;
             }
         }
     } else {
         foreach ($cssFiles as &$file) {
             if ($file['cacheFix']) {
                 $file['value'] .= (strpos($file['value'], '?') !== false ? '&' : '?') . $cacheVersion;
             }
         }
     }
     $cssFiles = ipFilter('ipCss', $cssFiles);
     $response = ipResponse();
     $data = array('title' => $response->getTitle(), 'keywords' => $response->getKeywords(), 'description' => $response->getDescription(), 'favicon' => $response->getFavicon(), 'charset' => $response->getCharset(), 'css' => $cssFiles);
     $head = ipView('Ip/Internal/Config/view/head.php', $data)->render();
     $head = ipFilter('ipHead', $head);
     return $head;
 }
コード例 #7
0
ファイル: SiteController.php プロジェクト: Umz/ImpressPages
 public function passwordReset()
 {
     if (\Ip\Internal\Admin\Backend::userId()) {
         //user has already been logged in
         \Ip\Internal\Content\Service::setManagementMode(1);
         return new \Ip\Response\Redirect(ipHomeUrl());
     }
     $content = ipView('view/passwordReset2.php', array('passwordResetForm' => FormHelper::getPasswordResetForm2()));
     ipAddJs('Ip/Internal/Admin/assets/passwordReset2.js');
     $response = ipResponse();
     $response->setLayout('Ip/Internal/Admin/view/loginLayout.php');
     $response->setLayoutVariable('content', $content);
     ipAddJs('assets/languageSelect.js');
     $response->setLayoutVariable('languageSelectForm', FormHelper::getLanguageSelectForm());
     return $response;
 }
コード例 #8
0
ファイル: AdminController.php プロジェクト: Umz/ImpressPages
 public function market()
 {
     ipAddJs('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.js');
     ipAddCss('Ip/Internal/Core/assets/js/jquery-ui/jquery-ui.css');
     ipAddJs('Ip/Internal/Core/assets/js/easyXDM/easyXDM.min.js');
     ipAddJs('Ip/Internal/Plugins/assets/market.js');
     $data = array('marketUrl' => Model::marketUrl());
     $contentView = ipView('view/market.php', $data);
     ipResponse()->setLayoutVariable('removeAdminContentWrapper', true);
     return $contentView->render();
 }