aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/start.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-08-27 18:54:13 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-08-27 18:54:13 -0700
commit146c55ddd745be06f6206e70884cb9e430ba6231 (patch)
tree8277881f60c3d09f1054997caba0bda5983f798d /mod/embed/start.php
parent0179e8c68b0827d77c61a31c8c0d6bf4a277c785 (diff)
downloadelgg-146c55ddd745be06f6206e70884cb9e430ba6231.tar.gz
elgg-146c55ddd745be06f6206e70884cb9e430ba6231.tar.bz2
Fixes #2911. Embed plugins works again. Added menu for embed sections. This plugin is painfully messy.
Diffstat (limited to 'mod/embed/start.php')
-rw-r--r--mod/embed/start.php37
1 files changed, 29 insertions, 8 deletions
diff --git a/mod/embed/start.php b/mod/embed/start.php
index bdd832b4e..6c26163e9 100644
--- a/mod/embed/start.php
+++ b/mod/embed/start.php
@@ -74,13 +74,34 @@ function embed_page_handler($page) {
// listing
// item
// default to embed/listing | item if not found.
- // @todo trigger for all right now. If we categorize these later we can trigger
- // for certain categories.
- $sections = elgg_trigger_plugin_hook('embed_get_sections', 'all', NULL, array());
- $upload_sections = elgg_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');
+
+ // @todo the menu system is good for registering and sorting, but not great for
+ // displaying tabs.
+ // Pulling in the menu manually and passing it through the embed/tabs view.
+ // We should work on making it easier to use tabs through the menu system, then fix
+ // this mess.
+ $menus = get_config('menus');
+ $menu = $menus['embed:sections'];
+
+ $sections = array();
+ $upload_sections = array();
+
+ foreach ($menu as $item) {
+ switch ($item->section) {
+ case 'upload':
+ $upload_sections[$item->getName()] = array(
+ 'name' => $item->getText(),
+ );
+ break;
+
+ default:
+ $sections[$item->getName()] = array(
+ 'name' => $item->getText(),
+ );
+ break;
+ }
+ }
+
$active_section = get_input('active_section', '');
$active_section = preg_replace('[\W]', '', $active_section);
$internal_id = get_input('internal_id', '');
@@ -97,4 +118,4 @@ function embed_page_handler($page) {
// exit because this is in a modal display.
exit;
-}
+} \ No newline at end of file