aboutsummaryrefslogtreecommitdiff
path: root/mod/embed
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-07-08 19:00:33 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-07-08 19:00:33 +0000
commit54f6c1732cc2482bb3329629b23a7efc901a92f3 (patch)
tree064cde7c0dbba5f96edf1252333a8e2e5c0c7e8a /mod/embed
parent11303f9b08227999ac0f362eaea145989555fa95 (diff)
downloadelgg-54f6c1732cc2482bb3329629b23a7efc901a92f3.tar.gz
elgg-54f6c1732cc2482bb3329629b23a7efc901a92f3.tar.bz2
Sorting tabs and upload sections correctly by name instead of id.
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
Diffstat (limited to 'mod/embed')
-rw-r--r--mod/embed/README.txt1
-rw-r--r--mod/embed/start.php8
-rw-r--r--mod/embed/views/default/embed/css.php13
-rw-r--r--mod/embed/views/default/embed/embed.php3
4 files changed, 21 insertions, 4 deletions
diff --git a/mod/embed/README.txt b/mod/embed/README.txt
index 1ed21262c..98948da3f 100644
--- a/mod/embed/README.txt
+++ b/mod/embed/README.txt
@@ -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
diff --git a/mod/embed/start.php b/mod/embed/start.php
index 99d620746..eb4aef08d 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -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;
}
diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php
index 4bc57ea23..548781dac 100644
--- a/mod/embed/views/default/embed/css.php
+++ b/mod/embed/views/default/embed/css.php
@@ -147,4 +147,17 @@
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
diff --git a/mod/embed/views/default/embed/embed.php b/mod/embed/views/default/embed/embed.php
index b57c3b289..3eff5d429 100644
--- a/mod/embed/views/default/embed/embed.php
+++ b/mod/embed/views/default/embed/embed.php
@@ -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