add 'safe mode' over-ride to connection image pixelation

This commit is contained in:
zotlabs 2019-07-30 22:37:55 -07:00
parent 717587762b
commit e163ece9e0
4 changed files with 29 additions and 1 deletions

22
Zotlabs/Module/Safe.php Normal file
View file

@ -0,0 +1,22 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Web\Controller;
class Safe extends Controller {
function init() {
if (array_key_exists('unsafe',$_SESSION) && intval($_SESSION['unsafe'])) {
$_SESSION['unsafe'] = 0;
}
else {
$_SESSION['unsafe'] = 1;
}
goaway(z_root());
}
}

View file

@ -91,6 +91,8 @@ function nav($template = 'default') {
$nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn');
$nav['safe'] = array('safe', t('Safe Mode'), ((intval($_SESSION['unsafe'])) ? t('(is off)') : t('(is on)')) , t('Connection image filtering'),'safe_nav_btn');
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select'))
$nav['channels'] = $chans;

View file

@ -1490,7 +1490,7 @@ function prepare_body(&$item,$attach = false,$opts = false) {
$pixelation = floatval(get_pconfig($item['uid'],'system','content_pixelation',0.05));
$censored = (($item['author']['abook_censor'] || $item['owner']['abook_censor'])
$censored = ((($item['author']['abook_censor'] || $item['owner']['abook_censor']) && (! intval($_SESSION['unsafe'])))
? 'data-pixelate data-value="' . $pixelation . '" data-reveal="true" '
: ''
);

View file

@ -50,6 +50,10 @@
<div class="dropdown-divider"></div>
<a class="dropdown-item{{if $sel.name == Admin}} active{{/if}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a>
{{/if}}
{{if $nav.safe}}
<div class="dropdown-divider"></div>
<a class="dropdown-item{{if $sel.name == Safe}} active{{/if}}" href="{{$nav.safe.0}}" title="{{$nav.safe.3}}" role="menuitem" id="{{$nav.safe.4}}">{{$nav.safe.1}} {{$nav.safe.2}}</a>
{{/if}}
{{if $nav.logout}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}" role="menuitem" id="{{$nav.logout.4}}">{{$nav.logout.1}}</a>