/** * bp_album_picture_title_truncate() * * @version 0.1.8.12 * @since 0.1.8.0 */ function bp_album_picture_title_truncate($length = 11) { echo bp_album_get_picture_title_truncate($length); }
/** * bp_album_setup_nav() * * Sets up the user profile navigation items for the component. This adds the top level nav * item and all the sub level nav items to the navigation array. This is then * rendered in the template. * * @version 0.1.8.12 * @since 0.1.8.0 */ function bp_album_setup_nav() { global $bp, $pictures_template; $nav_item_name = apply_filters('bp_album_nav_item_name', __('Album', 'bp-album')); bp_core_new_nav_item(array('name' => $nav_item_name, 'slug' => $bp->album->slug, 'position' => 80, 'screen_function' => 'bp_album_screen_pictures', 'default_subnav_slug' => $bp->album->pictures_slug, 'show_for_displayed_user' => true)); $album_link = ($bp->displayed_user->id ? $bp->displayed_user->domain : $bp->loggedin_user->domain) . $bp->album->slug . '/'; $album_link_title = $bp->displayed_user->id ? bp_word_or_name(__("My pictures", 'bp-album'), __("%s's pictures", 'bp-album'), false, false) : __("My pictures", 'bp-album'); bp_core_new_subnav_item(array('name' => $album_link_title, 'slug' => $bp->album->pictures_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_pictures', 'position' => 10)); if ($bp->current_component == $bp->album->slug && $bp->current_action == $bp->album->single_slug) { add_filter('bp_get_displayed_user_nav_' . $bp->album->single_slug, 'bp_album_single_subnav_filter', 10, 2); bp_core_new_subnav_item(array('name' => isset($pictures_template->pictures[0]->id) ? bp_album_get_picture_title_truncate(20) : __('Picture', 'bp-album'), 'slug' => $bp->album->single_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_single', 'position' => 20)); } bp_core_new_subnav_item(array('name' => __('Upload picture', 'bp-album'), 'slug' => $bp->album->upload_slug, 'parent_slug' => $bp->album->slug, 'parent_url' => $album_link, 'screen_function' => 'bp_album_screen_upload', 'position' => 30, 'user_has_access' => bp_is_my_profile())); }