diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-16 22:00:32 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-16 22:00:32 +0000 |
commit | e45c0d4a62e6bc0f5aa2cd0522987123a9b457c7 (patch) | |
tree | 06644a4bd5a764c8dda28cec6125ac5ead486e11 /mod/bookmarks/pages/add.php | |
parent | 851b6f87d426ff60d21eeafd6d63ff241bb18b82 (diff) | |
download | elgg-e45c0d4a62e6bc0f5aa2cd0522987123a9b457c7.tar.gz elgg-e45c0d4a62e6bc0f5aa2cd0522987123a9b457c7.tar.bz2 |
Refs #2680. Bookmarks revamp, part 2.
git-svn-id: http://code.elgg.org/elgg/trunk@8264 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks/pages/add.php')
-rw-r--r-- | mod/bookmarks/pages/add.php | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/mod/bookmarks/pages/add.php b/mod/bookmarks/pages/add.php index 17e1e6fa4..5a61c2e96 100644 --- a/mod/bookmarks/pages/add.php +++ b/mod/bookmarks/pages/add.php @@ -1,36 +1,35 @@ <?php - /** - * Elgg bookmarks plugin add bookmark page + * Add bookmark page * * @package ElggBookmarks */ gatekeeper(); +$bookmark_guid = get_input('guid'); +$bookmark = get_entity($bookmark_guid); +$container_guid = (int) get_input('container_guid'); +$container = get_entity($container_guid); -// Get the current page's owner -$page_owner = page_owner_entity(); -if ($page_owner === false || is_null($page_owner)) { - $page_owner = $_SESSION['user']; - set_page_owner($page_owner->getGUID()); +// for groups. +$page_owner = $container; +if (elgg_instanceof($container, 'object')) { + $page_owner = $container->getContainerEntity(); } -if ($page_owner instanceof ElggGroup) - $container = $page_owner->guid; -$area2 .= elgg_view_title(elgg_echo('bookmarks:this'), false); +elgg_set_page_owner_guid($page_owner->getGUID()); -// If we've been given a bookmark to edit, grab it -if ($this_guid = get_input('bookmark',0)) { - $entity = get_entity($this_guid); - if ($entity->canEdit()) { - $area2 .= elgg_view('bookmarks/form',array('entity' => $entity, 'container_guid' => $container)); - } -} else { - $area2 .= elgg_view('bookmarks/form', array('container_guid' => $container)); -} +$title = elgg_echo('bookmarks:add'); +elgg_push_breadcrumb($title); + +$vars = bookmarks_prepare_form_vars(); +$content = elgg_view_form('bookmarks/save', array(), $vars); -// Format page -$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2); +$body = elgg_view_layout('content', array( + 'filter' => '', + 'buttons' => '', + 'content' => $content, + 'title' => $title, +)); -// Draw it -page_draw(elgg_echo('bookmarks:add'),$body); +echo elgg_view_page($title, $body);
\ No newline at end of file |