diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-06-26 06:24:46 -0700 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-06-26 06:24:46 -0700 |
commit | 33f5c59d5318bc1e9a607215a31e48c6f7ab5b29 (patch) | |
tree | f519afd28b7d9c5d03d078c3afd1a3a77c5b45a4 /mod/embed/views/default/embed/tabs.php | |
parent | f3240e1da73d4a89e379c0c34f8ce86f460e18dc (diff) | |
parent | 9ab2a7f6ea6650fcbbb20f9d0dd207de2d58b286 (diff) | |
download | elgg-33f5c59d5318bc1e9a607215a31e48c6f7ab5b29.tar.gz elgg-33f5c59d5318bc1e9a607215a31e48c6f7ab5b29.tar.bz2 |
Merge pull request #41 from cash/embed-lightbox
Fixes #3564 Embed rewrite using new lightbox
Diffstat (limited to 'mod/embed/views/default/embed/tabs.php')
-rw-r--r-- | mod/embed/views/default/embed/tabs.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mod/embed/views/default/embed/tabs.php b/mod/embed/views/default/embed/tabs.php new file mode 100644 index 000000000..3f377fee5 --- /dev/null +++ b/mod/embed/views/default/embed/tabs.php @@ -0,0 +1,40 @@ +<?php +/** + * Embed tabs + * + * @uses $vars['sections'] + * @uses $vars['upload_sections'] + * @uses $vars['actibe_section'] + */ + +$sections = elgg_extract('sections', $vars, array()); +$active_section = elgg_extract('active_section', $vars, array_shift(array_keys($sections))); +$upload_sections = elgg_extract('upload_sections', $vars, array()); + +$tabs = array(); +foreach ($sections as $section_id => $section_info) { + $tab = array( + 'title' => $section_info['name'], + 'url' => '#', + 'url_class' => 'embed-section', + 'url_id' => $section_id, + ); + + if ($section_id == $active_section) { + $tab['selected'] = TRUE; + } + $tabs[] = $tab; +} + +// make sure upload is always the last tab +if ($upload_sections) { + $tabs[] = array( + 'title' => elgg_echo('embed:upload'), + 'url' => '#', + 'url_class' => 'embed-section', + 'url_id' => 'upload', + 'selected' => ($active_section == 'upload') + ); +} + +echo elgg_view('navigation/tabs', array('tabs' => $tabs)); |