diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-16 21:01:42 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-16 21:01:42 -0300 |
commit | 5f6dc365a8445a48156b45912827eac39fd64fc5 (patch) | |
tree | 0dc3326151072bb5d97592513e1af4b40be32e07 /pages | |
download | elgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.gz elgg-5f6dc365a8445a48156b45912827eac39fd64fc5.tar.bz2 |
Squashed 'mod/subgroups/' content from commit 835015b
git-subtree-dir: mod/subgroups
git-subtree-split: 835015b66b9de6dc6de91ab39f95e1f09b2dbf84
Diffstat (limited to 'pages')
-rw-r--r-- | pages/subgroups/edit.php | 46 | ||||
-rw-r--r-- | pages/subgroups/owner.php | 38 |
2 files changed, 84 insertions, 0 deletions
diff --git a/pages/subgroups/edit.php b/pages/subgroups/edit.php new file mode 100644 index 000000000..f8b0921ef --- /dev/null +++ b/pages/subgroups/edit.php @@ -0,0 +1,46 @@ +<?php +/** + * Manage subgroups page + * + * @package ElggSubroups + */ + +elgg_load_library('elgg:subgroups'); + +$page_owner = elgg_get_page_owner_entity(); +elgg_set_context('groups'); + +if(!($page_owner instanceof ElggGroup) || !$page_owner->canEdit()){ + forward($page_owner->getURL()); +} + +elgg_push_breadcrumb(elgg_echo('group'),'groups/all'); +elgg_push_breadcrumb($page_owner->name, $page_owner->getURL()); + +$title = elgg_echo('subgroups:add'); +elgg_push_breadcrumb($title); + +elgg_register_title_button('subgroups', 'new'); + +elgg_register_menu_item('title', array( + 'name' => 'add_existing', + 'href' => "#subgroups-add", + 'text' => elgg_echo("subgroups:add_existing"), + 'rel' => 'toggle', + 'link_class' => 'elgg-button elgg-button-action', + 'priority' => 200, +)); + +$form_vars = array('class' => 'hidden', 'id' => 'subgroups-add'); +$body_vars = array('group' => $page_owner); + +$content = elgg_view_form('subgroups/add', $form_vars, $body_vars); +$content .= list_subgroups($page_owner); + +$body = elgg_view_layout('content', array( + 'content' => $content, + 'title' => $title, + 'filter' => '' +)); + +echo elgg_view_page($title, $body); diff --git a/pages/subgroups/owner.php b/pages/subgroups/owner.php new file mode 100644 index 000000000..ae06d968d --- /dev/null +++ b/pages/subgroups/owner.php @@ -0,0 +1,38 @@ +<?php +/** + * List of group's subgroups + * + * @package ElggSubgroups + */ + +elgg_load_library('elgg:subgroups'); + +// access check for closed groups +group_gatekeeper(); + +$owner = elgg_get_page_owner_entity(); +if (!$owner) { + forward('groups/all'); +} + +elgg_register_title_button(); + +$title = elgg_echo("subgroups:owner", array($owner->name)); + +elgg_push_breadcrumb(elgg_echo('groups'), "groups/all"); +elgg_push_breadcrumb($owner->name, $owner->getURL()); +elgg_push_breadcrumb(elgg_echo('relatedgroups')); + +// List +$content = list_subgroups($owner); +if (!$content) { + $content = elgg_echo("subgroups:none"); +} + +$body = elgg_view_layout('content', array( + 'title' => $title, + 'content' => $content, + 'filter' => '', +)); + +echo elgg_view_page($title, $body); |