set/get viewdesigns flag and use it
This commit is contained in:
parent
d4db9d83d8
commit
e6c54a59e1
@ -83,14 +83,12 @@ class OthersettingsAction extends AccountSettingsAction
|
|||||||
{
|
{
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
|
|
||||||
$this->elementStart('form', array('method' => 'post',
|
$this->elementStart('form', array('method' => 'post',
|
||||||
'id' => 'form_settings_other',
|
'id' => 'form_settings_other',
|
||||||
'class' => 'form_settings',
|
'class' => 'form_settings',
|
||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('othersettings')));
|
common_local_url('othersettings')));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
$this->element('legend', null, _('URL Auto-shortening'));
|
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
// I18N
|
// I18N
|
||||||
@ -109,10 +107,14 @@ class OthersettingsAction extends AccountSettingsAction
|
|||||||
|
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
$this->dropdown('urlshorteningservice', _('Service'),
|
$this->dropdown('urlshorteningservice', _('Shorten URLs with'),
|
||||||
$services, _('Automatic shortening service to use.'),
|
$services, _('Automatic shortening service to use.'),
|
||||||
false, $user->urlshorteningservice);
|
false, $user->urlshorteningservice);
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
|
$this->elementStart('li');
|
||||||
|
$this->checkbox('viewdesigns', _('View profile designs'),
|
||||||
|
$user->viewdesigns, _('Show or hide profile designs.'));
|
||||||
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
$this->submit('save', _('Save'));
|
$this->submit('save', _('Save'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
@ -145,6 +147,8 @@ class OthersettingsAction extends AccountSettingsAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$viewdesigns = $this->boolean('viewdesigns');
|
||||||
|
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
|
|
||||||
assert(!is_null($user)); // should already be checked
|
assert(!is_null($user)); // should already be checked
|
||||||
@ -154,6 +158,7 @@ class OthersettingsAction extends AccountSettingsAction
|
|||||||
$original = clone($user);
|
$original = clone($user);
|
||||||
|
|
||||||
$user->urlshorteningservice = $urlshorteningservice;
|
$user->urlshorteningservice = $urlshorteningservice;
|
||||||
|
$user->viewdesigns = $viewdesigns;
|
||||||
|
|
||||||
$result = $user->update($original);
|
$result = $user->update($original);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ if (!defined('LACONICA')) {
|
|||||||
/**
|
/**
|
||||||
* Base class for actions that use a group's design
|
* Base class for actions that use a group's design
|
||||||
*
|
*
|
||||||
* Pages related to groups can be themed with a design.
|
* Pages related to groups can be themed with a design.
|
||||||
* This superclass returns that design.
|
* This superclass returns that design.
|
||||||
*
|
*
|
||||||
* @category Action
|
* @category Action
|
||||||
@ -48,7 +48,7 @@ class GroupDesignAction extends Action {
|
|||||||
|
|
||||||
/** The group in question */
|
/** The group in question */
|
||||||
var $group = null;
|
var $group = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the groups's design stylesheet
|
* Show the groups's design stylesheet
|
||||||
*
|
*
|
||||||
@ -58,10 +58,14 @@ class GroupDesignAction extends Action {
|
|||||||
{
|
{
|
||||||
parent::showStylesheets();
|
parent::showStylesheets();
|
||||||
|
|
||||||
$design = $this->getDesign();
|
$user = common_current_user();
|
||||||
|
|
||||||
if (!empty($design)) {
|
if (empty($user) || $user->viewdesigns) {
|
||||||
$design->showCSS($this);
|
$design = $this->getDesign();
|
||||||
|
|
||||||
|
if (!empty($design)) {
|
||||||
|
$design->showCSS($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,12 +80,10 @@ class GroupDesignAction extends Action {
|
|||||||
|
|
||||||
function getDesign()
|
function getDesign()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (empty($this->group)) {
|
if (empty($this->group)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->group->getDesign();
|
return $this->group->getDesign();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -61,11 +61,15 @@ class OwnerDesignAction extends Action {
|
|||||||
{
|
{
|
||||||
parent::showStylesheets();
|
parent::showStylesheets();
|
||||||
|
|
||||||
$design = $this->getDesign();
|
$user = common_current_user();
|
||||||
|
|
||||||
if (!empty($design)) {
|
if (empty($user) || $user->viewdesigns) {
|
||||||
$design->showCSS($this);
|
$design = $this->getDesign();
|
||||||
}
|
|
||||||
|
if (!empty($design)) {
|
||||||
|
$design->showCSS($this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user