diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-06-26 06:24:46 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-06-26 06:24:46 -0700 |
commit | 33f5c59d5318bc1e9a607215a31e48c6f7ab5b29 (patch) | |
tree | f519afd28b7d9c5d03d078c3afd1a3a77c5b45a4 /mod/embed/start.php | |
parent | f3240e1da73d4a89e379c0c34f8ce86f460e18dc (diff) | |
parent | 9ab2a7f6ea6650fcbbb20f9d0dd207de2d58b286 (diff) | |
download | elgg-33f5c59d5318bc1e9a607215a31e48c6f7ab5b29.tar.gz elgg-33f5c59d5318bc1e9a607215a31e48c6f7ab5b29.tar.bz2 |
Merge pull request #41 from cash/embed-lightbox
Fixes #3564 Embed rewrite using new lightbox
Diffstat (limited to 'mod/embed/start.php')
-rw-r--r-- | mod/embed/start.php | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php index f6f49a53f..f6f1acc57 100644 --- a/mod/embed/start.php +++ b/mod/embed/start.php @@ -13,33 +13,42 @@ elgg_register_event_handler('init', 'system', 'embed_init'); */ function embed_init() { elgg_extend_view('css/elgg', 'embed/css'); - elgg_extend_view('js/elgg', 'embed/js'); - elgg_extend_view('js/elgg', 'embed/lightbox_init'); elgg_register_plugin_hook_handler('register', 'menu:longtext', 'embed_longtext_menu'); // Page handler for the modal media embed elgg_register_page_handler('embed', 'embed_page_handler'); - elgg_register_js('elgg.embed', 'mod/embed/js/embed.js', 'footer'); + elgg_register_js('elgg.embed', 'js/embed/embed.js', 'footer'); } +/** + * Add the embed menu item to the long text menu + * + * @param string $hook + * @param string $type + * @param array $items + * @param array $vars + * @return array + */ function embed_longtext_menu($hook, $type, $items, $vars) { - // yeah this is naughty. embed and ecml might want to merge. - if (elgg_is_active_plugin('ecml')) { - $active_section = 'active_section=web_services&'; - } else { - $active_section = ''; + + if (elgg_get_context() == 'embed') { + return $items; } $items[] = ElggMenuItem::factory(array( 'name' => 'embed', - 'href' => "embed?{$active_section}internal_id={$vars['id']}", + 'href' => "embed", 'text' => elgg_echo('media:insert'), - 'rel' => 'facebox', - 'link_class' => 'elgg-longtext-control', - 'priority' => 1, + 'rel' => 'lightbox', + 'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}", + 'priority' => 10, )); + + elgg_load_js('lightbox'); + elgg_load_css('lightbox'); + elgg_load_js('elgg.embed'); return $items; } |