예제 #1
0
 public function __construct()
 {
     parent::__construct();
     SanityCheck::basicCheck();
     $this->sModuleName = Manager::usePath();
     $this->oResourceIncluder = ResourceIncluder::defaultIncluder();
     if (isset($_REQUEST[self::CONTENT_LANGUAGE_SESSION_KEY])) {
         self::setContentLanguage($_REQUEST[self::CONTENT_LANGUAGE_SESSION_KEY]);
     }
     if (Session::getSession()->isAuthenticated() && Session::getSession()->getUser()->getIsBackendLoginEnabled()) {
         $oUser = Session::getSession()->getUser();
         Session::getSession()->setLanguage(Session::getSession()->getUser()->getLanguageId());
         if (isset($_REQUEST['preview']) || !$oUser->getIsAdminLoginEnabled()) {
             LinkUtil::redirect(LinkUtil::link(@$_REQUEST['preview'], 'PreviewManager'));
         }
     }
 }
예제 #2
0
 public function __construct($bShouldLogin = true)
 {
     parent::__construct();
     SanityCheck::basicCheck();
     if ($bShouldLogin && (!Session::getSession()->isAuthenticated() || !Session::getSession()->getUser()->getIsBackendLoginEnabled())) {
         LinkUtil::redirect(LinkUtil::link(array(), 'AdminManager', array('preview' => self::getRequestedPath())));
     }
     $oResourceIncluder = ResourceIncluder::defaultIncluder();
     $oResourceIncluder->addCustomJs('window.FILE_PREFIX = "' . MAIN_DIR_FE_PHP . Manager::getPrefixForManager('FileManager') . '";');
     //Fix JSON requests when using Prototype in the frontend
     $oResourceIncluder->addReverseDependency('lib_prototype', false, 'preview/prototype_json_fix.js');
     //Add jQuery and jQuery UI
     $oResourceIncluder->addJavaScriptLibrary('jquery', AdminManager::JQUERY_VERSION, null, true, null, ResourceIncluder::PRIORITY_FIRST);
     $oResourceIncluder->addJavaScriptLibrary('jqueryui', AdminManager::JQUERY_UI_VERSION);
     //Add client widget handling code
     $oResourceIncluder->addResource('widget/widget.js');
     $oResourceIncluder->addResource('widget/widget_skeleton.js');
     //Provides some basic overrides for tooltip, notifyuser and stuff
     //Override some site styles in specific regions
     $oResourceIncluder->addResource('preview/preview-reset.css');
     $oResourceIncluder->addResource('preview/preview-default.css');
     $oResourceIncluder->addResource('admin/theme/jquery-ui-1.10.2.custom.min.css');
     //Add the css that handles styles for all widgets but namespace it so it applies only to specific areas of the page (editable areas, dialogs, the admin menu, etc.)
     $this->addNamespacedCss(array('widget', 'widget.css'));
     $oResourceIncluder->addResource('backend/additions.js', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('preview/additions.js', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('backend/additions.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     $oResourceIncluder->addResource('preview/additions.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     //preview-interface.css contains things like the edit buttons
     ResourceIncluder::defaultIncluder()->addResource('preview-interface.css', null, null, null, ResourceIncluder::PRIORITY_NORMAL, null, true);
     //Include the resources of widgets we know we’re gonna use.
     if ($bShouldLogin) {
         $oLoginWindowWidget = WidgetModule::getWidget('login_window');
         LoginWindowWidgetModule::includeResources();
     }
     $this->oAdminMenuWidget = WidgetModule::getWidget('admin_menu');
     AdminMenuWidgetModule::includeResources();
     $this->oPageTypeWidget = WidgetModule::getWidget('page_type');
     PageTypeWidgetModule::includeResources();
 }