From 389e05d4d162116e350ec47cdab287fc78f6cfaf Mon Sep 17 00:00:00 2001 From: brettp Date: Thu, 17 Feb 2011 04:11:38 +0000 Subject: Fixes #2680. Added group profile bookmark widget. Fixed a problem editing bookmarks. git-svn-id: http://code.elgg.org/elgg/trunk@8272 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/bookmarks/actions/bookmarks/edit.php | 33 ---------------- mod/bookmarks/start.php | 2 +- .../views/default/bookmarks/group_module.php | 44 ++++++++++++++++++++++ .../default/bookmarks/groupprofile_bookmarks.php | 34 ----------------- .../views/default/forms/bookmarks/save.php | 2 +- 5 files changed, 46 insertions(+), 69 deletions(-) delete mode 100644 mod/bookmarks/actions/bookmarks/edit.php create mode 100644 mod/bookmarks/views/default/bookmarks/group_module.php delete mode 100644 mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php diff --git a/mod/bookmarks/actions/bookmarks/edit.php b/mod/bookmarks/actions/bookmarks/edit.php deleted file mode 100644 index 87de1c5e2..000000000 --- a/mod/bookmarks/actions/bookmarks/edit.php +++ /dev/null @@ -1,33 +0,0 @@ -getSubtype() == "bookmarks" && $bookmark->canEdit()) { - $bookmark->title = $title; - $bookmark->description = $notes; - $bookmark->address = $address; - $bookmark->access_id = $access; - $bookmark->tags = $tagarray; - if ($bookmark->save()) { - system_message(elgg_echo('bookmarks:edit:success')); - } else { - system_message(elgg_echo('bookmarks:edit:fail')); - } -}else{ - system_message(elgg_echo('bookmarks:edit:fail')); -} -$account = get_entity($bookmark->container_guid); -forward("pg/bookmarks/" . $account->username); \ No newline at end of file diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 00a640644..1fd9768a1 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -52,7 +52,7 @@ function bookmarks_init() { // Groups add_group_tool_option('bookmarks', elgg_echo('bookmarks:enablebookmarks'), true); - elgg_extend_view('groups/tool_latest', 'bookmarks/group_bookmarks'); + elgg_extend_view('groups/tool_latest', 'bookmarks/group_module'); } /** diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php new file mode 100644 index 000000000..94204d7e8 --- /dev/null +++ b/mod/bookmarks/views/default/bookmarks/group_module.php @@ -0,0 +1,44 @@ +bookmarks_enable == "no") { + return true; +} + +$all_link = elgg_view('output/url', array( + 'href' => "pg/bookmarks/group/$group->guid/owner", + 'text' => elgg_echo('link:view:all'), +)); + +$header = "$all_link"; +$header .= '

' . elgg_echo('bookmarks:group') . '

'; + +elgg_push_context('widgets'); +$options = array( + 'type' => 'object', + 'subtype' => 'bookmarks', + 'container_guid' => elgg_get_page_owner_guid(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); +$content = elgg_list_entities($options); +elgg_pop_context(); + +if (!$content) { + $content = '

' . elgg_echo('bookmarks:none') . '

'; +} + +$new_link = elgg_view('output/url', array( + 'href' => "pg/bookmarks/add/$group->guid", + 'text' => elgg_echo('bookmarks:add'), +)); +$content .= "$new_link"; + +echo elgg_view_module('info', '', $content, array('header' => $header)); diff --git a/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php b/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php deleted file mode 100644 index ad8095d11..000000000 --- a/mod/bookmarks/views/default/bookmarks/groupprofile_bookmarks.php +++ /dev/null @@ -1,34 +0,0 @@ -bookmarks_enable != 'no') { -?> - -
-

- 'object', - 'subtypes' => 'bookmarks', - 'container_guid' => $vars['entity']->guid, - 'limit' => 5, - 'full_view' => FALSE, - 'pagination' => FALSE)); - set_context($context); - - if ($content) { - echo $content; - - $more_url = "{$vars['url']}pg/bookmarks/owner/group:{$vars['entity']->guid}/"; - echo ""; - } else { - echo "
" . elgg_echo("bookmarks:nogroup") . "
"; - } -?> -
- 'container_guid', 'value' => $container_guid)); if ($guid) { - echo elgg_view('input/hidden', array('name' => 'bookmark_guid', 'value' => $guid)); + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $guid)); } echo elgg_view('input/submit', array('value' => elgg_echo("save"))); -- cgit v1.2.3