]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Sorting tabs and upload sections correctly by name instead of id.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 8 Jul 2010 19:00:33 +0000 (19:00 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 8 Jul 2010 19:00:33 +0000 (19:00 +0000)
Passing internal_name to all views related to embedding to allow correct calls to elggEmbedInsertContent() in overrided layouts.

git-svn-id: http://code.elgg.org/elgg/trunk@6666 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/embed/README.txt
mod/embed/start.php
mod/embed/views/default/embed/css.php
mod/embed/views/default/embed/embed.php

index 1ed21262ca0db28361553ccbe5b2b49545e5475a..98948da3f52b278783451226bdbc786ebd8ec1ca 100644 (file)
@@ -94,6 +94,7 @@ CONTENTS:
                        limit - Limit for entity list.
                        section - The current active section.
                        upload_sections - Valid upload sections.
+                       internal_name - Internal name of the input field
                        
                The function should return $value as:
                        items - An array of ElggEntities
index 99d6207469c14226b0c7dfce591db1b3aa4d2528..eb4aef08df3ab66dd13134108986cf9e19dd80c6 100644 (file)
@@ -49,9 +49,10 @@ function embed_page_handler($page) {
                        // @todo trigger for all right now. If we categorize these later we can trigger
                        // for certain categories.
                        $sections = trigger_plugin_hook('embed_get_sections', 'all', NULL, array());
-                       $upload_sections = trigger_plugin_hook('embed_get_upload_sections', 'all', NULL, array());
-                       asort($sections, SORT_LOCALE_STRING);
-                       asort($upload_sections, SORT_LOCALE_STRING);
+                       $upload_sections = trigger_plugin_hook('embed_get_upload_sections', 'all', NULL, array()); 
+                       
+                       elgg_sort_3d_array_by_value($sections, 'name');
+                       elgg_sort_3d_array_by_value($upload_sections, 'name');
                        $active_section = get_input('active_section', NULL);
                        $internal_name = get_input('internal_name', NULL);
 
@@ -65,6 +66,7 @@ function embed_page_handler($page) {
                        break;
        }
 
+       // exit because this is in a modal display.
        exit;
 }
 
index 4bc57ea23bd4a3b250b73b9e12c4988e27e3ebcb..548781dac81ccd1ee2d31f7889da409786ec582e 100644 (file)
        background-color:#666666; 
        border:1px solid #666666; 
        color:white;
+}
+
+/* embed web services */
+.embed_disabled {
+       background-color: red;
+}
+
+.embed_warning {
+       background-color: yellow;
+}
+
+.embed_good {
+       background-color: green;
 }
\ No newline at end of file
index b57c3b289a47b52e1de9f04e00817ef098be084d..3eff5d4290111ed110dacb057421082ec9a50c9a 100644 (file)
@@ -65,7 +65,8 @@ if (!$sections) {
                        'offset' => $offset,
                        'limit' => $limit,
                        'section' => $active_section,
-                       'upload_sections' => $upload_sections
+                       'upload_sections' => $upload_sections,
+                       'internal_name' => $internal_name
                );
 
                // allow full override for this section