Wednesday, 14 September 2011

Remove Riverdashboard "All" tab in elgg

Follow below 2 steps to remove "All" tab in elgg riverdashboard

Setp 1:

Open the nav.php file in riverdashboard plugin
>> elgg-root\mod\riverdashboard\views\default\riverdashboard\nav.php
$allselect = '';
$friendsselect = '';
$mineselect = '';
switch($vars['orient']) {
    case '':
        $allselect = 'class="selected"';
        break;
    case 'friends':
        $friendsselect = 'class="selected"';
        break;
    case 'mine':
        $mineselect = 'class="selected"';
        break;
}

?>

<?php
if (isloggedin()) {
?>
    <div id="elgg_horizontal_tabbed_nav">
        <ul>
            <li <?php echo $allselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display="><?php echo elgg_echo('all'); ?></a></li>
            <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
            <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
        </ul>
    </div>
<?php
}
?>



Remove above lines and paste following lines in nav.php file

$friendsselect = '';
$mineselect = '';
switch($vars['orient']) {
    case '':
         $friendsselect = 'class="selected"';
        break;
    case 'friends':
        $friendsselect = 'class="selected"';
        break;
    case 'mine':
        $mineselect = 'class="selected"';
        break;
}

?>

<?php
if (isloggedin()) {
?>
    <div id="elgg_horizontal_tabbed_nav">
        <ul>
           <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
            <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
        </ul>
    </div>
<?php
}
?>
Step 2:

 Open the index.php file in riverdashboard plugin
switch($orient) {
    case 'mine':
        $subject_guid = get_loggedin_userid();
        $relationship_type = '';
        break;
    case 'friends':
        $subject_guid = get_loggedin_userid();
        $relationship_type = 'friend';
        break;
    default:
        $subject_guid = 0;
        $relationship_type = '';
        break;
}


Remove above lines and paste following lines in riverdashboard index.php file


 switch($orient) {
    case 'mine':
        $subject_guid = get_loggedin_userid();
        $relationship_type = '';
        break;
    case 'friends':
        $subject_guid = get_loggedin_userid();
        $relationship_type = 'friend';
        break;
    default:
        $subject_guid = get_loggedin_userid();;
        $relationship_type = 'friend';
        break;
}

0 comments:

Post a Comment