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

This commit is contained in:
friendica 2015-03-09 16:25:55 -07:00
parent 97df5f1fd1
commit 26a414fe4b
4 changed files with 17 additions and 7 deletions

View File

@ -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'), '','');

View File

@ -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'),

View File

@ -13,6 +13,12 @@ function network_init(&$a) {
return;
}
if(count($_GET) < 2) {
$network_options = get_pconfig(local_channel(),'system','network_page_default');
if($network_options)
goaway('network' . '?f=&' . $network_options);
}
$channel = $a->get_channel();
$a->profile_uid = local_channel();
head_set_icon($channel['xchan_photo_s']);
@ -369,10 +375,13 @@ function network_content(&$a, $update = 0, $load = false) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id, received FROM item
left join abook on item.author_xchan = abook.abook_xchan
WHERE true $uids AND item_restrict = 0
and ((abook.abook_flags & %d) = 0 or abook.abook_flags is null)
$simple_update
$sql_extra $sql_nets
ORDER BY item.received DESC $pager_sql "
ORDER BY item.received DESC $pager_sql ",
intval(ABOOK_FLAG_BLOCKED)
);
require_once('include/items.php');

View File

@ -5,7 +5,7 @@
<ul id="saved-search-list" class="nav nav-pills nav-stacked">
{{foreach $saved as $search}}
<li id="search-term-{{$search.id}}">
<a class="pull-right group-edit-icon" title="{{$search.delete}}" onclick="return confirmDelete();" id="drop-saved-search-term-{{$search.id}}" href="{{$search.dellink}}"><i id="dropicon-saved-search-term-{{$search.id}}" class="icon-remove" ></i></a>
<a class="pull-right group-edit-tool" title="{{$search.delete}}" onclick="return confirmDelete();" id="drop-saved-search-term-{{$search.id}}" href="{{$search.dellink}}"><i id="dropicon-saved-search-term-{{$search.id}}" class="group-edit-icon icon-trash" ></i></a>
<a id="saved-search-term-{{$search.id}}"{{if $search.selected}} class="search-selected"{{/if}} href="{{$search.srchlink}}">{{$search.displayterm}}</a>
</li>
{{/foreach}}