diff options
author | friendica <info@friendica.com> | 2015-03-05 23:31:01 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-05 23:31:01 -0800 |
commit | f6da235a7d0eae48f7b691a139825708b99dcd75 (patch) | |
tree | e9b7202f0c0591b2f932f50733134c8d5ec313a1 /include/dir_fns.php | |
parent | bd4d2f3b44face9d265c28c84e9ca9eb85d1ee7d (diff) | |
download | volse-hubzilla-f6da235a7d0eae48f7b691a139825708b99dcd75.tar.gz volse-hubzilla-f6da235a7d0eae48f7b691a139825708b99dcd75.tar.bz2 volse-hubzilla-f6da235a7d0eae48f7b691a139825708b99dcd75.zip |
major cleanup of directory options
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r-- | include/dir_fns.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php index 468e28ae5..cd6d452d6 100644 --- a/include/dir_fns.php +++ b/include/dir_fns.php @@ -80,6 +80,8 @@ function dir_sort_links() { if ($observer) $safe_mode = get_xconfig($observer,'directory','safe_mode'); + else + $safe_mode = ((array_key_exists('safemode',$_SESSION)) ? intval($_SESSION['safemode']) : false); if($safe_mode === false) $safe_mode = 1; @@ -96,7 +98,7 @@ function dir_sort_links() { // Build urls without order and pubforums so it's easy to tack on the changed value // Probably there's an easier way to do this - $current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'normal'); + $current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : 'date'); $url = 'directory?f='; $tmp = array_merge($_GET,$_POST); @@ -107,6 +109,8 @@ function dir_sort_links() { $tmp = array_merge($_GET,$_POST); unset($tmp['pubforums']); + unset($tmp['global']); + unset($tmp['safe']); unset($tmp['q']); unset($tmp['f']); $forumsurl = $url . http_build_query($tmp); @@ -125,7 +129,10 @@ function dir_sort_links() { '$forumsurl' => $forumsurl, '$safemode' => t('Safe Mode'), '$toggle' => $toggle, - '$globaldir' => $globaldir, + '$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'','',' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''), + + '$pubforums' => array('pubforums', t('Public Forums Only'),(x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : ''),'','',' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''), + '$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'','',' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''), '$localdir' => t('This Website Only'), )); return $o; |