provide a noscript_content switch for mod channel and display
This commit is contained in:
parent
54fa28441c
commit
d29415a6e2
@ -71,6 +71,8 @@ class Channel extends Controller {
|
|||||||
|
|
||||||
function get($update = 0, $load = false) {
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
|
$noscript_content = get_config('system', 'noscript_content', '1');
|
||||||
|
|
||||||
if($load)
|
if($load)
|
||||||
$_SESSION['loadtime'] = datetime_convert();
|
$_SESSION['loadtime'] = datetime_convert();
|
||||||
|
|
||||||
@ -272,7 +274,7 @@ class Channel extends Controller {
|
|||||||
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
|
App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20));
|
||||||
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
|
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start']));
|
||||||
|
|
||||||
if((! $update) || ($load)) {
|
if($noscript_content || $load) {
|
||||||
if($mid) {
|
if($mid) {
|
||||||
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
$r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal
|
||||||
AND item_wall = 1 $sql_extra limit 1",
|
AND item_wall = 1 $sql_extra limit 1",
|
||||||
@ -411,10 +413,17 @@ class Channel extends Controller {
|
|||||||
$o .= conversation($items,$mode,$update,$page_mode);
|
$o .= conversation($items,$mode,$update,$page_mode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
$o .= '<noscript>';
|
$o .= '<noscript>';
|
||||||
$o .= conversation($items,$mode,$update,'traditional');
|
if($noscript_content) {
|
||||||
$o .= alt_pager(count($items));
|
$o .= conversation($items,$mode,$update,'traditional');
|
||||||
|
$o .= alt_pager(count($items));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to view this content.') . '</div>';
|
||||||
|
}
|
||||||
$o .= '</noscript>';
|
$o .= '</noscript>';
|
||||||
|
|
||||||
$o .= conversation($items,$mode,$update,$page_mode);
|
$o .= conversation($items,$mode,$update,$page_mode);
|
||||||
|
|
||||||
if ($mid && $items[0]['title'])
|
if ($mid && $items[0]['title'])
|
||||||
|
@ -12,8 +12,9 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
function get($update = 0, $load = false) {
|
function get($update = 0, $load = false) {
|
||||||
|
|
||||||
$module_format = 'html';
|
$noscript_content = get_config('system', 'noscript_content', '1');
|
||||||
|
|
||||||
|
$module_format = 'html';
|
||||||
|
|
||||||
if(argc() > 1) {
|
if(argc() > 1) {
|
||||||
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
|
$module_format = substr(argv(1),strrpos(argv(1),'.') + 1);
|
||||||
@ -251,7 +252,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$sql_extra = public_permissions_sql($observer_hash);
|
$sql_extra = public_permissions_sql($observer_hash);
|
||||||
|
|
||||||
if((! $update) || ($load)) {
|
if($noscript_content || $load) {
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
@ -367,7 +368,12 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$o .= '<noscript>';
|
$o .= '<noscript>';
|
||||||
$o .= conversation($items, 'display', $update, 'traditional');
|
if($noscript_content) {
|
||||||
|
$o .= conversation($items, 'display', $update, 'traditional');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
|
||||||
|
}
|
||||||
$o .= '</noscript>';
|
$o .= '</noscript>';
|
||||||
|
|
||||||
if ($items[0]['title'])
|
if ($items[0]['title'])
|
||||||
@ -429,7 +435,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$o .= '<div id="content-complete"></div>';
|
$o .= '<div id="content-complete"></div>';
|
||||||
|
|
||||||
if(((! $update) || ($load)) && (! $items)) {
|
if((($update && $load) || $noscript_content) && (! $items)) {
|
||||||
|
|
||||||
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
|
$r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1",
|
||||||
dbesc($item_hash)
|
dbesc($item_hash)
|
||||||
|
Reference in New Issue
Block a user