merge groups and filed posts into activity filters
This commit is contained in:
parent
6bfc5aa96c
commit
cbaaa1c57f
@ -18,7 +18,7 @@ class Channel extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|
||||||
if(strpos($_GET['search'], '@') === 0 || strpos($_GET['search'], '!') === 0 || strpos($_GET['search'], '?') === 0)
|
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
|
||||||
goaway('search' . '?f=&search=' . $_GET['search']);
|
goaway('search' . '?f=&search=' . $_GET['search']);
|
||||||
|
|
||||||
$which = null;
|
$which = null;
|
||||||
|
@ -16,7 +16,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strpos($_GET['search'], '@') === 0 || strpos($_GET['search'], '!') === 0 || strpos($_GET['search'], '?') === 0)
|
if(in_array(substr($_GET['search'],0,1),[ '@', '!', '?']))
|
||||||
goaway('search' . '?f=&search=' . $_GET['search']);
|
goaway('search' . '?f=&search=' . $_GET['search']);
|
||||||
|
|
||||||
if(count($_GET) < 2) {
|
if(count($_GET) < 2) {
|
||||||
@ -389,7 +389,7 @@ class Network extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if($conv) {
|
if($conv) {
|
||||||
$item_thread_top = '';
|
$item_thread_top = '';
|
||||||
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan like '%s' or item_mentionsme = 1 )) ",
|
$sql_extra .= sprintf(" AND parent IN (SELECT distinct(parent) from item where ( author_xchan = '%s' or item_mentionsme = 1 )) ",
|
||||||
dbesc(protect_sprintf($channel['channel_hash']))
|
dbesc(protect_sprintf($channel['channel_hash']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,42 +9,82 @@ class Activity_filter {
|
|||||||
if(! local_channel())
|
if(! local_channel())
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
$starred_active = '';
|
|
||||||
$conv_active = '';
|
|
||||||
|
|
||||||
if(x($_GET,'star')) {
|
|
||||||
$starred_active = 'active';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(x($_GET,'conv')) {
|
|
||||||
$conv_active = 'active';
|
|
||||||
}
|
|
||||||
|
|
||||||
$cmd = \App::$cmd;
|
$cmd = \App::$cmd;
|
||||||
|
|
||||||
// tabs
|
|
||||||
$tabs = [];
|
$tabs = [];
|
||||||
|
|
||||||
if(feature_enabled(local_channel(),'personal_tab')) {
|
if(feature_enabled(local_channel(),'personal_tab')) {
|
||||||
$tabs[] = array(
|
if(x($_GET,'conv')) {
|
||||||
|
$conv_active = (($_GET['conv'] == 1) ? 'active' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabs[] = [
|
||||||
'label' => t('Personal Posts'),
|
'label' => t('Personal Posts'),
|
||||||
'icon' => 'user-circle',
|
'icon' => 'user-circle',
|
||||||
'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&conv=1',
|
'url' => z_root() . '/' . $cmd . '/?f=&conv=1',
|
||||||
'sel' => $conv_active,
|
'sel' => $conv_active,
|
||||||
'title' => t('Posts that mention or involve you'),
|
'title' => t('Show posts that mention or involve me'),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(feature_enabled(local_channel(),'star_posts')) {
|
if(feature_enabled(local_channel(),'star_posts')) {
|
||||||
$tabs[] = array(
|
if(x($_GET,'star')) {
|
||||||
|
$starred_active = (($_GET['star'] == 1) ? 'active' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabs[] = [
|
||||||
'label' => t('Starred Posts'),
|
'label' => t('Starred Posts'),
|
||||||
'icon' => 'star',
|
'icon' => 'star',
|
||||||
'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&star=1',
|
'url'=>z_root() . '/' . $cmd . '/?f=&star=1',
|
||||||
'sel'=>$starred_active,
|
'sel'=>$starred_active,
|
||||||
'title' => t('Favourite Posts'),
|
'title' => t('Show posts that i have starred'),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(feature_enabled(local_channel(),'groups')) {
|
||||||
|
$groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
|
||||||
|
intval(local_channel())
|
||||||
|
);
|
||||||
|
|
||||||
|
if($groups) {
|
||||||
|
foreach($groups as $g) {
|
||||||
|
if(x($_GET,'gid')) {
|
||||||
|
$group_active = (($_GET['gid'] == $g['id']) ? 'active' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabs[] = [
|
||||||
|
'label' => $g['gname'],
|
||||||
|
'icon' => 'users',
|
||||||
|
'url' => z_root() . '/' . $cmd . '/?f=&gid=' . $g['id'],
|
||||||
|
'sel' => $group_active,
|
||||||
|
'title' => sprintf(t('Show posts related to the %s privacy group'), $g['gname']),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(feature_enabled(local_channel(),'filing')) {
|
||||||
|
$terms = q("select distinct term from term where uid = %d and ttype = %d order by term asc",
|
||||||
|
intval(local_channel()),
|
||||||
|
intval(TERM_FILE)
|
||||||
|
);
|
||||||
|
|
||||||
|
if($terms) {
|
||||||
|
foreach($terms as $t) {
|
||||||
|
if(x($_GET,'file')) {
|
||||||
|
$file_active = (($_GET['file'] == $t['term']) ? 'active' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tabs[] = [
|
||||||
|
'label' => $t['term'],
|
||||||
|
'icon' => 'folder',
|
||||||
|
'url' => z_root() . '/' . $cmd . '/?f=&file=' . $t['term'],
|
||||||
|
'sel' => $file_active,
|
||||||
|
'title' => sprintf(t('Show posts that i have filed to %s'), $t['term']),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$arr = ['tabs' => $tabs];
|
$arr = ['tabs' => $tabs];
|
||||||
|
|
||||||
@ -54,7 +94,7 @@ class Activity_filter {
|
|||||||
|
|
||||||
if($arr['tabs']) {
|
if($arr['tabs']) {
|
||||||
return replace_macros($tpl, [
|
return replace_macros($tpl, [
|
||||||
'$title' => t('Additional Filters'),
|
'$title' => t('Activity Filters'),
|
||||||
'$tabs' => $arr['tabs'],
|
'$tabs' => $arr['tabs'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ class Activity_order {
|
|||||||
// override order for search results and filer results
|
// override order for search results and filer results
|
||||||
if(x($_GET,'search') || x($_GET,'file')) {
|
if(x($_GET,'search') || x($_GET,'file')) {
|
||||||
$unthreaded_active = 'active';
|
$unthreaded_active = 'active';
|
||||||
$commentord_active = $postord_active = '';
|
$commentord_active = $postord_active = 'disabled';
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = \App::$cmd;
|
$cmd = \App::$cmd;
|
||||||
@ -75,6 +75,9 @@ class Activity_order {
|
|||||||
if(x($_GET,'conv'))
|
if(x($_GET,'conv'))
|
||||||
$filter .= '&conv=' . $_GET['conv'];
|
$filter .= '&conv=' . $_GET['conv'];
|
||||||
|
|
||||||
|
if(x($_GET,'file'))
|
||||||
|
$filter .= '&file=' . $_GET['file'];
|
||||||
|
|
||||||
|
|
||||||
// tabs
|
// tabs
|
||||||
$tabs = [];
|
$tabs = [];
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
[region=aside]
|
[region=aside]
|
||||||
[widget=activity_order][/widget]
|
[widget=activity_order][/widget]
|
||||||
[widget=collections][/widget]
|
|
||||||
[widget=activity_filter][/widget]
|
[widget=activity_filter][/widget]
|
||||||
[widget=forums][/widget]
|
[widget=forums][/widget]
|
||||||
[widget=suggestions][/widget]
|
[widget=suggestions][/widget]
|
||||||
[widget=savedsearch][/widget]
|
[widget=savedsearch][/widget]
|
||||||
[widget=filer][/widget]
|
|
||||||
[widget=notes][/widget]
|
[widget=notes][/widget]
|
||||||
[/region]
|
[/region]
|
||||||
|
|
||||||
|
@ -89,6 +89,11 @@ $(document).ready(function() {
|
|||||||
tagClass: 'badge badge-pill badge-warning text-dark'
|
tagClass: 'badge badge-pill badge-warning text-dark'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a.disabled').click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
var doctitle = document.title;
|
var doctitle = document.title;
|
||||||
function checkNotify() {
|
function checkNotify() {
|
||||||
var notifyUpdateElem = document.getElementById('notify-update');
|
var notifyUpdateElem = document.getElementById('notify-update');
|
||||||
|
Reference in New Issue
Block a user