]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added back tab switching
authorcash <cash.costello@gmail.com>
Sun, 19 Jun 2011 02:06:40 +0000 (22:06 -0400)
committercash <cash.costello@gmail.com>
Sun, 19 Jun 2011 02:06:40 +0000 (22:06 -0400)
mod/embed/start.php
mod/embed/views/default/embed/tabs.php
mod/embed/views/default/js/embed/embed.php

index 3b6e58ce12b2cfedaf8067d7b99c70ae76c9fc60..e6fc5551b32e40890487132a5a0f888ccb7e5c45 100644 (file)
@@ -32,16 +32,10 @@ function embed_init() {
  * @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 = '';
-       }
        
        $items[] = ElggMenuItem::factory(array(
                'name' => 'embed',
-               'href' => "embed?{$active_section}internal_id={$vars['id']}",
+               'href' => "embed",
                'text' => elgg_echo('media:insert'),
                'rel' => 'lightbox',
                'link_class' => "elgg-longtext-control elgg-lightbox embed-control embed-control-{$vars['id']}",
index a148ece9f62542f35188a8130baf7a42622fb0e5..3f377fee550d04b361a058705e405be8f4ff1d25 100644 (file)
@@ -16,7 +16,7 @@ foreach ($sections as $section_id => $section_info) {
        $tab = array(
                'title' => $section_info['name'],
                'url' => '#',
-               'url_class' => 'embed_section',
+               'url_class' => 'embed-section',
                'url_id' => $section_id,
        );
 
@@ -31,7 +31,7 @@ if ($upload_sections) {
        $tabs[] = array(
                'title' => elgg_echo('embed:upload'),
                'url' => '#',
-               'url_class' => 'embed_section',
+               'url_class' => 'embed-section',
                'url_id' => 'upload',
                'selected' => ($active_section == 'upload')
        );
index b709af05ecf5951f93587c70f67271e353a7dd39..3b398af3ae3d4e7085214de6ba32e7714f00e1f2 100644 (file)
@@ -15,6 +15,8 @@ elgg.embed.init = function() {
 
        // special pagination helper for lightbox
        $('.embed-wrapper .elgg-pagination a').live('click', elgg.embed.pagination);
+
+       $('.embed-section').live('click', elgg.embed.loadTab);
 }
 
 /**
@@ -50,4 +52,17 @@ elgg.embed.pagination = function(event) {
        event.preventDefault();
 }
 
+/**
+ * Loads an embed tab
+ *
+ * @param {Object} event
+ * @return void
+ */
+elgg.embed.loadTab = function(event) {
+       var section = $(this).attr('id');
+       var url = elgg.config.wwwroot + 'embed/embed?active_section=' + section;
+       $('.embed-wrapper').parent().load(url);
+       event.preventDefault();
+}
+
 elgg.register_hook_handler('init', 'system', elgg.embed.init);