aboutsummaryrefslogtreecommitdiffstats
path: root/include/dir_fns.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
committerfriendica <info@friendica.com>2015-03-05 18:24:49 -0800
commit22391a24378cae317cdf62dc4be4b31b68e8191f (patch)
treeeca9be09c179ab036625dd64fbaea91d181f87fc /include/dir_fns.php
parente73d0ee418564eb32517f86930c78384ca3bd52d (diff)
downloadvolse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.gz
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.tar.bz2
volse-hubzilla-22391a24378cae317cdf62dc4be4b31b68e8191f.zip
straighten out some directory stuff, which required some Comanche structural changes
Diffstat (limited to 'include/dir_fns.php')
-rw-r--r--include/dir_fns.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 37a7c04e7..468e28ae5 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -74,7 +74,26 @@ function check_upstream_directory() {
function dir_sort_links() {
- // Build urls without order and pubforums so it's easy to tack on the changed value
+ $safe_mode = 1;
+
+ $observer = get_observer_hash();
+
+ if ($observer)
+ $safe_mode = get_xconfig($observer,'directory','safe_mode');
+ if($safe_mode === false)
+ $safe_mode = 1;
+
+ if(! $safe_mode)
+ $toggle = t('Enable Safe Search');
+ else
+ $toggle = t('Disable Safe Search');
+
+ if($observer)
+ $globaldir = get_xconfig($observer,'directory','globaldir');
+ else
+ $globaldir = ((array_key_exists('globaldir',$_SESSION)) ? intval($_SESSION['globaldir']) : false);
+
+ // 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');
@@ -104,7 +123,10 @@ function dir_sort_links() {
'$selected_sort' => $current_order,
'$sorturl' => $sorturl,
'$forumsurl' => $forumsurl,
-
+ '$safemode' => t('Safe Mode'),
+ '$toggle' => $toggle,
+ '$globaldir' => $globaldir,
+ '$localdir' => t('This Website Only'),
));
return $o;
}