diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-09-29 18:16:03 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-09-29 18:16:03 -0700 |
commit | bfdb9bb8a87a29038ba1ae25355684ae19678fdd (patch) | |
tree | a074e2d6bfa19c17b284c3950b4555cf584eabe2 /mod/embed/start.php | |
parent | 7be23080f34a8f92ca1f8d49c3aa0e6ce3472f4c (diff) | |
parent | a458ae4e0f8e5b19884860fead6e5f901b95eca4 (diff) | |
download | elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.gz elgg-bfdb9bb8a87a29038ba1ae25355684ae19678fdd.tar.bz2 |
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'mod/embed/start.php')
-rw-r--r-- | mod/embed/start.php | 37 |
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 |