diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 08:02:12 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 08:02:12 +0000 |
commit | 49c91aa389416ee8cb66dbb4d3d7a2512c411790 (patch) | |
tree | eefcffe1f34e98493044bd9295abfd84bb56d748 /mod/embed/start.php | |
parent | 35be18083c4262c94d58f85609aabfff5a0f9412 (diff) | |
download | elgg-49c91aa389416ee8cb66dbb4d3d7a2512c411790.tar.gz elgg-49c91aa389416ee8cb66dbb4d3d7a2512c411790.tar.bz2 |
Fixes #2895: Embed uses longtext menu -- I believe that covers *all* the menus we had brought up!
git-svn-id: http://code.elgg.org/elgg/trunk@8534 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/embed/start.php')
-rw-r--r-- | mod/embed/start.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php index cda9f4db4..f071657a9 100644 --- a/mod/embed/start.php +++ b/mod/embed/start.php @@ -15,12 +15,33 @@ function embed_init() { elgg_extend_view('css/elgg', 'embed/css'); elgg_extend_view('js/elgg', 'embed/js'); elgg_extend_view('footer/analytics', 'embed/lightbox_init'); - elgg_extend_view('input/longtext', 'embed/link', 1); + + 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'); } +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 = ''; + } + + $items[] = array( + 'name' => 'embed', + 'href' => "pg/embed/?{$active_section}internal_name={$vars['name']}", + 'text' => elgg_echo('media:insert'), + 'rel' => 'facebox', + 'class' => 'elgg-longtext-control', + 'weight' => 1, + ); + + return $items; +} + /** * Serves pages for upload and embed. * |