Exemplo n.º 1
0
 public static function get($key)
 {
     if (self::$_options === null) {
         self::$_options = XenForo_Application::get('options');
     }
     switch ($key) {
         case 'applicationVersionId':
             return XenForo_Application::$versionId;
         case 'cacheCutoffDays':
             return 7;
         case 'indexTabId':
             return 'WidgetFramework_home';
         case 'layoutEditorEnabled':
             if (self::$_layoutEditorEnabled === null) {
                 if (!XenForo_Application::isRegistered('session')) {
                     // no session yet...
                     return false;
                 }
                 $session = XenForo_Application::getSession();
                 self::$_layoutEditorEnabled = $session->get('_WidgetFramework_layoutEditor') === true;
                 if (!self::$_layoutEditorEnabled and !empty($_REQUEST['_layoutEditor'])) {
                     $visitor = XenForo_Visitor::getInstance();
                     if ($visitor->hasAdminPermission('style')) {
                         self::$_layoutEditorEnabled = true;
                     }
                 }
             }
             // use the cached value
             return self::$_layoutEditorEnabled;
     }
     return self::$_options->get('wf_' . $key);
 }