aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/start.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-22 08:12:07 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-22 08:12:07 -0500
commite49df853b2cc3a6a9bc2dd527a64951050142eb9 (patch)
tree6f485b560f89331c65fad3993e055a1834b07177 /mod/embed/start.php
parent5e5b3705a5ca7b66dfe386490c5570af88b49009 (diff)
parentfea599f1653d7206e34ac33c0c0a668cb587bc20 (diff)
downloadelgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.gz
elgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.bz2
Merge branch '1.8' after 1.8.2 release
Conflicts: version.php
Diffstat (limited to 'mod/embed/start.php')
-rw-r--r--mod/embed/start.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 015c0c0e4..a3ccab66b 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -37,10 +37,15 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
if (elgg_get_context() == 'embed') {
return $items;
}
+
+ $url = 'embed';
+ if (elgg_get_page_owner_guid()) {
+ $url = 'embed?container_guid=' . elgg_get_page_owner_guid();
+ }
$items[] = ElggMenuItem::factory(array(
'name' => 'embed',
- 'href' => "embed",
+ 'href' => $url,
'text' => elgg_echo('embed:media'),
'rel' => 'lightbox',
'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}",
@@ -49,6 +54,7 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
elgg_load_js('lightbox');
elgg_load_css('lightbox');
+ elgg_load_js('jquery.form');
elgg_load_js('elgg.embed');
return $items;
@@ -64,7 +70,9 @@ function embed_longtext_menu($hook, $type, $items, $vars) {
*/
function embed_select_tab($hook, $type, $items, $vars) {
- $tab_name = array_pop(explode('/', full_url()));
+ // can this ba called from page handler instead?
+ $page = get_input('page');
+ $tab_name = array_pop(explode('/', $page));
foreach ($items as $item) {
if ($item->getName() == $tab_name) {
$item->setSelected();
@@ -85,6 +93,11 @@ function embed_select_tab($hook, $type, $items, $vars) {
*/
function embed_page_handler($page) {
+ $container_guid = (int)get_input('container_guid');
+ if ($container_guid) {
+ elgg_set_page_owner_guid($container_guid);
+ }
+
echo elgg_view('embed/layout');
// exit because this is in a modal display.
@@ -120,15 +133,17 @@ function embed_list_items($entities, $vars = array()) {
*/
function embed_get_list_options($options = array()) {
+ $container_guids = array(elgg_get_logged_in_user_guid());
if (elgg_get_page_owner_guid()) {
- $container_guid = elgg_get_page_owner_guid();
- } else {
- $container_guid = elgg_get_logged_in_user_guid();
+ $page_owner_guid = elgg_get_page_owner_guid();
+ if ($page_owner_guid != elgg_get_logged_in_user_guid()) {
+ $container_guids[] = $page_owner_guid;
+ }
}
$defaults = array(
'limit' => 6,
- 'container_guid' => $container_guid,
+ 'container_guids' => $container_guids,
'item_class' => 'embed-item',
);