username; if (!$page_owner) { $page_owner = $logged_in_user; } // so we know if the user is looking at their own, everyone's or all friends $filter_context = $vars['context']; // get the object type $type = $vars['type']; // create an empty string to start with $new_button = ''; // generate a list of default tabs $default_tabs = array( 'all' => array( 'title' => elgg_echo('all'), 'url' => (isset($vars['all_link'])) ? $vars['all_link'] : "mod/$type/all.php", 'selected' => ($filter_context == 'everyone'), ), 'mine' => array( 'title' => elgg_echo('mine'), 'url' => (isset($vars['mine_link'])) ? $vars['mine_link'] : "pg/$type/$username", 'selected' => ($filter_context == 'mine'), ), 'friend' => array( 'title' => elgg_echo('friends'), 'url' => (isset($vars['friend_link'])) ? $vars['friend_link'] : "pg/$type/$username/friends", 'selected' => ($filter_context == 'friends'), ), ); // determine if using default or overwritten tabs $tabs = (isset($vars['tabs'])) ? $vars['tabs'] : $default_tabs; $tab_list = elgg_view('navigation/tabs', array('tabs' => $tabs)); $title = elgg_echo($type); $title = '
' . elgg_view_title($title) . '
'; // must be logged in to see any action buttons if (isloggedin()) { // only show the new button when not on the add form. // hide the tabs when on the add form. if ($filter_context == 'action') { $tab_list = ''; } else { // @todo remove the hard coded reference to the videolist plugin if (elgg_get_context() == "videolist"){ $video_link = elgg_get_site_url() . "pg/videolist/browse/$username/"; $new_button = "" . elgg_echo('videolist:browsemenu') . ''; } else { $new_link = elgg_normalize_url((isset($vars['new_link'])) ? $vars['new_link'] : "pg/$type/$username/new"); $new_button = "" . elgg_echo($type . ':new') . ''; } $new_button = "
$new_button
"; } // also hide the tabs if in a group context (ie, listing groups) or // when viewing tools belonging to a group if (elgg_get_context() == 'groups' || $page_owner instanceof ElggGroup) { $tab_list = ''; } } echo << $title $new_button HTML; echo $tab_list;