From 26a414fe4b3ab4b1d995233f0402532ad41eaeb7 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 9 Mar 2015 16:25:55 -0700 Subject: make network page default options work more or less universally instead of just from the navbar, and fix some saved-search weirdness related to the delete-term icon --- include/nav.php | 3 +-- include/widgets.php | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/nav.php b/include/nav.php index 5e8317cfa..f8a112592 100644 --- a/include/nav.php +++ b/include/nav.php @@ -176,9 +176,8 @@ EOT; if(local_channel()) { - $network_options = get_pconfig(local_channel(),'system','network_page_default'); - $nav['network'] = array('network' . (($network_options) ? '?f=&' . $network_options : ''), + $nav['network'] = array('network', t('Matrix'), "", t('Your matrix'),'network_nav_btn'); $nav['network']['mark'] = array('', t('Mark all matrix notifications seen'), '',''); diff --git a/include/widgets.php b/include/widgets.php index 17c740967..243c4a25e 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -233,7 +233,6 @@ function widget_savedsearch($arr) { $srchurl = rtrim(preg_replace('/searchsave\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $hasq = ((strpos($srchurl,'?') !== false) ? true : false); $srchurl = rtrim(preg_replace('/searchremove\=[^\&].*?(\&|$)/is','',$srchurl),'&'); - $hasq = ((strpos($srchurl,'?') !== false) ? true : false); $srchurl = rtrim(preg_replace('/search\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = rtrim(preg_replace('/submit\=[^\&].*?(\&|$)/is','',$srchurl),'&'); @@ -241,7 +240,10 @@ function widget_savedsearch($arr) { $hasq = ((strpos($srchurl,'?') !== false) ? true : false); + $hasamp = ((strpos($srchurl,'&') !== false) ? true : false); + if(($hasamp) && (! $hasq)) + $srchurl = substr($srchurl,0,strpos($srchurl,'&')) . '?f=&' . substr($srchurl,strpos($srchurl,'&')+1); $o = ''; @@ -257,8 +259,8 @@ function widget_savedsearch($arr) { $saved[] = array( 'id' => $rr['tid'], 'term' => $rr['term'], - 'dellink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&searchremove=1&search=' . urlencode($rr['term']), - 'srchlink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&search=' . urlencode($rr['term']), + 'dellink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&searchremove=1&search=' . urlencode($rr['term']), + 'srchlink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&search=' . urlencode($rr['term']), 'displayterm' => htmlspecialchars($rr['term'], ENT_COMPAT,'UTF-8'), 'encodedterm' => urlencode($rr['term']), 'delete' => t('Remove term'), -- cgit v1.2.3