aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php6
-rw-r--r--start.php32
-rw-r--r--views/default/videolist/group_video_header.php21
3 files changed, 31 insertions, 28 deletions
diff --git a/index.php b/index.php
index 1b94775d6..3fe409b8a 100644
--- a/index.php
+++ b/index.php
@@ -13,7 +13,7 @@ global $CONFIG;
require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
-$owner = page_owner_entity();
+$page_owner = page_owner_entity();
if ($page_owner === false || is_null($page_owner)) {
$page_owner = $_SESSION['user'];
set_page_owner($page_owner->getGUID());
@@ -37,11 +37,15 @@ $title = sprintf(elgg_echo("videolist:home"), "$owner->name");
//set videolist header
if(page_owner() == get_loggedin_userid()) {
$area1 .= elgg_view('page_elements/content_header', array('context' => "mine", 'type' => 'videolist'));
+}elseif(page_owner_entity() instanceof ElggGroup){
+ $area1 .= elgg_view('navigation/breadcrumbs');
+ $area1 .= elgg_view('videolist/group_video_header');
} else {
$area1 .= elgg_view('navigation/breadcrumbs');
$area1 .= elgg_view('page_elements/content_header_member', array('type' => 'videolist'));
}
+
// include a view for plugins to extend
$area3 = elgg_view("videolist/sidebar", array("object_type" => 'videolist'));
diff --git a/start.php b/start.php
index 63e3ac382..0ca2a2f87 100644
--- a/start.php
+++ b/start.php
@@ -40,9 +40,6 @@ function videolist_init() {
// Register entity type
register_entity_type('object','videolist');
-
- // Register profile menu hook
- register_plugin_hook('profile_menu', 'profile', 'videolist_profile_menu');
}
/**
@@ -97,7 +94,7 @@ function videolist_pagesetup() {
$page_owner = page_owner_entity();
if ($page_owner instanceof ElggGroup && get_context() == "groups") {
- //add_submenu_item(sprintf(elgg_echo("videolist:group"), page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
+ add_submenu_item(sprintf(elgg_echo("videolist:group"), page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
} else if (get_context() == "videolist") {
/**********************************************************************************************
****if user is OR is not registered user then show him following page menus to choose from
@@ -109,19 +106,11 @@ function videolist_pagesetup() {
add_submenu_item(elgg_echo('videolist:find'),$CONFIG->wwwroot."pg/videolist/search/");
*/
- if ((page_owner() == $_SESSION['guid'] || !page_owner()) && isloggedin()) {
- //add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
- //add_submenu_item(sprintf(elgg_echo('videolist:new'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/new/". page_owner_entity()->username);
- //add_submenu_item(sprintf(elgg_echo('videolist:browsemenu'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/browse/". page_owner_entity()->username);
- //add_submenu_item(sprintf(elgg_echo('videolist:find'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/search/");
- } else if (page_owner() && $page_owner instanceof ElggUser) {
- add_submenu_item(sprintf(elgg_echo("videolist:home"),$page_owner->name), $CONFIG->wwwroot . "pg/videolist/owned/". $page_owner->username);
- }
- } else if (get_context() == "groupsvideos") {
- add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
+ } else if (get_context() == "groups") {
+ //add_submenu_item(sprintf(elgg_echo("videolist:home"),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/owned/" . page_owner_entity()->username);
if ($page_owner->canEdit()) {
- add_submenu_item(sprintf(elgg_echo('videolist:browsemenu'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/browse/". page_owner_entity()->username);
- add_submenu_item(sprintf(elgg_echo('videolist:new'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/new/". page_owner_entity()->username);
+ //add_submenu_item(sprintf(elgg_echo('videolist:browsemenu'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/browse/". page_owner_entity()->username);
+ //add_submenu_item(sprintf(elgg_echo('videolist:new'),page_owner_entity()->name), $CONFIG->wwwroot . "pg/videolist/new/". page_owner_entity()->username);
}
}
}
@@ -185,17 +174,6 @@ function videolist_object_notifications_intercept($hook, $entity_type, $returnva
return null;
}
-function videolist_profile_menu($hook, $entity_type, $return_value, $params) {
- global $CONFIG;
-
- $return_value[] = array(
- 'text' => elgg_echo('videolist'),
- 'href' => "{$CONFIG->url}pg/videolist/owned/{$params['owner']->username}",
- );
-
- return $return_value;
-}
-
// Register a handler for adding videos
register_elgg_event_handler('create', 'videolist', 'videolist_create_event_listener');
diff --git a/views/default/videolist/group_video_header.php b/views/default/videolist/group_video_header.php
new file mode 100644
index 000000000..d3f59b773
--- /dev/null
+++ b/views/default/videolist/group_video_header.php
@@ -0,0 +1,21 @@
+<?php
+/**
+* Page header view, when visiting a group's videos
+**/
+
+$user = page_owner_entity();
+$user_name = elgg_view_title($user->name . "'s " . elgg_echo('videos'));
+$url = $CONFIG->wwwroot . "pg/videolist/browse/". $user->username . "/";
+if(isloggedin())
+ $upload_link = "<a href=\"{$url}\" class='action_button'>" . elgg_echo('videolist:browsemenu') . '</a>';
+else
+ $upload_link = '';
+?>
+<div id="content_header" class="clearfloat">
+ <div class="content_header_title">
+ <?php echo $user_name; ?>
+ </div>
+ <div class="content_header_options">
+ <?php echo $upload_link; ?>
+ </div>
+</div> \ No newline at end of file