Can someone give a quick fix to remove the all tab from the activity page.I am using version 1.8.0.1
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
@steve Better than overriding core, you could override views/default/page/layouts/content/filter.php
And ad some kind of conditional to the tabs loop,
if ($name == 'all' && (elgg_get_context() == 'activity'))
continue;
Ibrahim Hasan code worked but it still shows the All tab. and other thing is that we should not chage the elgg core codes as Steve said. and the reason behind that is when we upgrade to newer version we need to rechange all the codes........ and Steve :) please do this soon I need this plugin :( and thanks for sharing everything with us :)
and make it that only admin can view the all tab not users :)
@mnrtrq @gillie, There are a few files to call that will override the tabs and I have it working except the override to engine/lib/river.php or to pages/river.php. I am trying a page handler in start.php with no luck.
It will have the all tab for the admin, just as it does in Private_River for 1.7
For see only the admin all tab, and user the friends tab:
<?php
/**
* Main activity stream list page
*/
if (elgg_is_admin_logged_in()) {
$options = array();
$page_type = preg_replace('[\W]', '', get_input('page_type', 'all'));
$type = preg_replace('[\W]', '', get_input('type', 'all'));
$active_section =
$subtype = preg_replace('[\W]', '', get_input('subtype', ''));
if ($subtype) {
$selector = "type=$type&subtype=$subtype";
} else {
$selector = "type=$type";
}
if ($type != 'all') {
$options['type'] = $type;
if ($subtype) {
$options['subtype'] = $subtype;
}
}
switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
$options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
$title = elgg_echo('river:all');
$page_filter = 'all';
break;
}
$activity = elgg_list_river($options);
$content = elgg_view('core/river/filter', array('selector' => $selector));
$sidebar = elgg_view('core/river/sidebar');
$params = array(
'content' => $content . $activity,
'sidebar' => $sidebar,
'filter_context' => $page_filter,
'class' => 'elgg-river-layout',
);
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body);
} else {
$options = array();
$page_type = preg_replace('[\W]', '', get_input('page_type', 'friends'));
$type = preg_replace('[\W]', '', get_input('type', 'friends'));
$active_section =
$subtype = preg_replace('[\W]', '', get_input('subtype', ''));
if ($subtype) {
$selector = "type=$type&subtype=$subtype";
} else {
$selector = "type=$type";
}
if ($type != 'friends') {
$options['type'] = $type;
if ($subtype) {
$options['subtype'] = $subtype;
}
}
switch ($page_type) {
case 'mine':
$title = elgg_echo('river:mine');
$page_filter = 'mine';
$options['subject_guid'] = elgg_get_logged_in_user_guid();
break;
case 'friends':
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
default:
$title = elgg_echo('river:friends');
$page_filter = 'friends';
$options['relationship_guid'] = elgg_get_logged_in_user_guid();
$options['relationship'] = 'friend';
break;
}
$activity = elgg_list_river($options);
$content = elgg_view('core/river/filter', array('selector' => $selector));
$sidebar = elgg_view('core/river/sidebar');
$params = array(
'content' => $content . $activity,
'sidebar' => $sidebar,
'filter_context' => $page_filter,
'class' => 'elgg-river-layout',
);
$body = elgg_view_layout('content', $params);
echo elgg_view_page($title, $body); }
@Oranyero, Thanks but like I said in the above posts, I am trying to workout the override of the page handlers, the rest of it works just fine.
Steve
Oranyero thanks but better make plugin :)
Just talked to Steve, and he seems to have accomplished the task ;)
done! :) Private_River_1.8
Awesome!
- Previous
- 1
- 2
- 3
- Next
You must log in to post replies.