From f6da235a7d0eae48f7b691a139825708b99dcd75 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Mar 2015 23:31:01 -0800 Subject: major cleanup of directory options --- include/dir_fns.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'include/dir_fns.php') 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; -- cgit v1.2.3