diff options
author | redmatrix <git@macgirvin.com> | 2016-04-13 16:31:06 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-04-13 16:31:06 -0700 |
commit | 9a0b61e4afed94727679eee966afb76e1add2beb (patch) | |
tree | 76f5b8d6e29fe8ffe543c75064a5e8e2e384f10c /mod/display.php | |
parent | a8a0ca82913a923ce2a08e1cb41305b66cf35e24 (diff) | |
download | volse-hubzilla-9a0b61e4afed94727679eee966afb76e1add2beb.tar.gz volse-hubzilla-9a0b61e4afed94727679eee966afb76e1add2beb.tar.bz2 volse-hubzilla-9a0b61e4afed94727679eee966afb76e1add2beb.zip |
refactor the js detection into a checkjs class which is only enabled on demand (currently only the channel and display pages). Will probably require a bit more work to hide/disable the cover photo when js is disabled. Have not actually tested without js to discover any other potential page issues. Have only confirmed that the detection class works and redirects to set a jsdisabled cookie and reload the page with that cookie+variable set if called from the channel page.
Diffstat (limited to 'mod/display.php')
-rw-r--r-- | mod/display.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/display.php b/mod/display.php index 9c50eb9c0..2844a1205 100644 --- a/mod/display.php +++ b/mod/display.php @@ -5,6 +5,10 @@ function display_content(&$a, $update = 0, $load = false) { // logger("mod-display: update = $update load = $load"); + + $checkjs = new Zotlabs\Web\CheckJS(); + + if($load) $_SESSION['loadtime'] = datetime_convert(); @@ -168,13 +172,13 @@ function display_content(&$a, $update = 0, $load = false) { $sql_extra = public_permissions_sql($observer_hash); - if(($update && $load) || ($_COOKIE['jsdisabled'] == 1)) { + if(($update && $load) || ($checkjs->disabled())) { $updateable = false; $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']),intval(App::$pager['start'])); - if($load || ($_COOKIE['jsdisabled'] == 1)) { + if($load || ($checkjs->disabled())) { $r = null; require_once('include/identity.php'); @@ -290,7 +294,7 @@ function display_content(&$a, $update = 0, $load = false) { } - if ($_COOKIE['jsdisabled'] == 1) { + if ($checkjs->disabled()) { $o .= conversation($a, $items, 'display', $update, 'traditional'); if ($items[0]['title']) App::$page['title'] = $items[0]['title'] . " - " . App::$page['title']; |