site-wide option to enable old-school settings

This commit is contained in:
Evan Prodromou 2011-09-24 09:46:13 -04:00
parent ae0b4d49c7
commit ea1a11a087
3 changed files with 31 additions and 16 deletions

View File

@ -859,3 +859,12 @@ performance
high: if you need high performance, or if you're seeing bad high: if you need high performance, or if you're seeing bad
performance, set this to true. It will turn off some high-intensity code from performance, set this to true. It will turn off some high-intensity code from
the site. the site.
oldschool
---------
enabled: enable certain old-style user settings options, like stream-only mode,
conversation trees, and nicknames in streams. Off by default, and
may not be well supported in future versions.

View File

@ -1148,31 +1148,36 @@ class User extends Managed_DataObject
function streamModeOnly() function streamModeOnly()
{ {
$osp = Old_school_prefs::staticGet('user_id', $this->id); if (common_config('oldschool', 'enabled')) {
if (!empty($osp)) { $osp = Old_school_prefs::staticGet('user_id', $this->id);
return $osp->stream_mode_only; if (!empty($osp)) {
} else { return $osp->stream_mode_only;
return false; }
} }
return false;
} }
function conversationTree() function conversationTree()
{ {
$osp = Old_school_prefs::staticGet('user_id', $this->id); if (common_config('oldschool', 'enabled')) {
if (!empty($osp)) { $osp = Old_school_prefs::staticGet('user_id', $this->id);
return $osp->conversation_tree; if (!empty($osp)) {
} else { return $osp->conversation_tree;
return false; }
} }
return false;
} }
function streamNicknames() function streamNicknames()
{ {
$osp = Old_school_prefs::staticGet('user_id', $this->id); if (common_config('oldschool', 'enabled')) {
if (!empty($osp)) { $osp = Old_school_prefs::staticGet('user_id', $this->id);
return $osp->stream_nicknames; if (!empty($osp)) {
} else { return $osp->stream_nicknames;
return false; }
} }
return false;
} }
} }

View File

@ -352,5 +352,6 @@ $default =
array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel array('cache' => true), // whether to cache the router object. Defaults to true, turn off for devel
'discovery' => 'discovery' =>
array('cors' => false), // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) array('cors' => false), // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
'performance' => array('high' => false) // disable some features for higher performance; default false 'performance' => array('high' => false), // disable some features for higher performance; default false
'oldschool' => array('enabled' => false) // enable users to use old-style UI
); );