3 if (!defined('GNUSOCIAL')) { exit(1); }
5 class SensitiveContentSettingsAction extends SettingsAction
9 return _m('Sensitive content settings');
12 function getInstructions()
14 return _m('Set preferences for display of "sensitive" content');
17 function showContent()
20 $user = $this->scoped->getUser();
22 $this->elementStart('form', array('method' => 'post',
23 'id' => 'sensitivecontent',
24 'class' => 'form_settings',
25 'action' => common_local_url('sensitivecontentsettings')));
27 $this->elementStart('fieldset');
28 $this->hidden('token', common_session_token());
29 $this->elementStart('ul', 'form_data');
31 $this->elementStart('li');
32 $this->checkbox('hidesensitive', _('Hide attachments in posts hashtagged #NSFW'),
33 ($this->arg('hidesensitive')) ?
34 $this->boolean('hidesensitive') : $this->scoped->getPref('MoonMan','hide_sensitive',0));
35 $this->elementEnd('li');
38 $this->elementEnd('ul');
39 $this->submit('save', _m('BUTTON','Save'));
41 $this->elementEnd('fieldset');
42 $this->elementEnd('form');
47 $hidesensitive = $this->booleanintstring('hidesensitive');
48 $this->scoped->setPref('MoonMan','hide_sensitive', $hidesensitive);
49 return _('Settings saved.');