From e45c0d4a62e6bc0f5aa2cd0522987123a9b457c7 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 16 Feb 2011 22:00:32 +0000 Subject: Refs #2680. Bookmarks revamp, part 2. git-svn-id: http://code.elgg.org/elgg/trunk@8264 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/forms/bookmarks/save.php | 59 ++++++++++++++++++++ mod/bookmarks/views/default/object/bookmarks.php | 10 ++-- .../views/default/widgets/bookmarks/content.php | 31 +++++++++++ .../views/default/widgets/bookmarks/edit.php | 32 +++++------ .../views/default/widgets/bookmarks/view.php | 65 ---------------------- 5 files changed, 110 insertions(+), 87 deletions(-) create mode 100644 mod/bookmarks/views/default/forms/bookmarks/save.php create mode 100644 mod/bookmarks/views/default/widgets/bookmarks/content.php delete mode 100644 mod/bookmarks/views/default/widgets/bookmarks/view.php (limited to 'mod/bookmarks/views') diff --git a/mod/bookmarks/views/default/forms/bookmarks/save.php b/mod/bookmarks/views/default/forms/bookmarks/save.php new file mode 100644 index 000000000..9b15b542f --- /dev/null +++ b/mod/bookmarks/views/default/forms/bookmarks/save.php @@ -0,0 +1,59 @@ + +
+
+ 'title', 'value' => $title)); ?> +
+
+
+ 'address', 'value' => $address)); ?> +
+
+ + 'description', 'value' => $desc)); ?> +
+
+ + 'tags', 'value' => $tags)); ?> +
+ +
+
+ 'access_id', 'value' => $access_id)); ?> +
+
+ 'container_guid', 'value' => $container_guid)); + +if ($guid) { + echo elgg_view('input/hidden', array('name' => 'bookmark_guid', 'value' => $guid)); +} + +echo elgg_view('input/submit', array('value' => elgg_echo("save"))); + +?> +
\ No newline at end of file diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index aa7694fb6..abb14ab1f 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -74,10 +74,12 @@ $bookmark_info HTML; } elseif (elgg_in_context('gallery')) { - echo ''; + echo << +

$bookmark->title

+

$owner_link $date

+ +HTML; } else { // brief view $url = $bookmark->address; diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php new file mode 100644 index 000000000..5f9f469d1 --- /dev/null +++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php @@ -0,0 +1,31 @@ +num_display; + +$options = array( + 'type' => 'object', + 'subtype' => 'bookmarks', + 'container_guid' => $vars['entity']->owner_guid, + 'limit' => $max, + 'full_view' => FALSE, + 'pagination' => FALSE, +); +$content = elgg_list_entities($options); + +echo $content; + +if ($content) { + $url = "pg/bookmarks/owner/" . elgg_get_page_owner_entity()->username; + $more_link = elgg_view('output/url', array( + 'href' => $url, + 'text' => elgg_echo('bookmarks:more'), + )); + echo "$more_link"; +} else { + echo elgg_echo('bookmarks:none'); +} diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php index edb6afdf2..f31b7660f 100644 --- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php +++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php @@ -1,28 +1,24 @@ num_display)) { - $vars['entity']->num_display = 4; +if (!isset($vars['entity']->max_display)) { + $vars['entity']->max_display = 4; } -?> -

- : - -

\ No newline at end of file +
+ : + +
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/view.php b/mod/bookmarks/views/default/widgets/bookmarks/view.php deleted file mode 100644 index 6a5c7476a..000000000 --- a/mod/bookmarks/views/default/widgets/bookmarks/view.php +++ /dev/null @@ -1,65 +0,0 @@ - - - -num_display; - -//if no number has been set, default to 4 -if(!$num) - $num = 4; - -//grab the users bookmarked items -$shares = elgg_get_entities(array('types' => 'object', 'subtypes' => 'bookmarks', 'container_guid' => $vars['entity']->owner_guid, 'limit' => $num, 'offset' => 0)); - -if($shares){ - - foreach($shares as $s){ - - //get the owner - $owner = $s->getOwnerEntity(); - - //get the time - $friendlytime = elgg_view_friendly_time($s->time_created); - - //get the user icon - $icon = elgg_view( - "profile/icon", array( - 'entity' => $owner, - 'size' => 'tiny', - ) - ); - - //get the bookmark title - $info = "

getURL()}\">{$s->title}

"; - - //get the user details - $info .= "

getURL()}\">{$owner->name} {$friendlytime}

"; - - //get the bookmark description - if($s->description) - $info .= "".elgg_echo('bookmarks:more')."

{$s->description}

"; - - //display - echo "
"; - echo "
" . $icon . "
"; - echo "
" . $info . "
"; - echo "
"; - - } - - $user_inbox = $vars['url'] . "pg/bookmarks/owner/" . page_owner_entity()->username; - echo "
".elgg_echo('bookmarks:morebookmarks')."
"; - -} - - -?> \ No newline at end of file -- cgit v1.2.3