aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default/widgets
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 23:15:07 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-03 23:15:07 +0000
commit0320936f29dd83534b5af386a981131be7981a9a (patch)
tree1d524f4a43c5974bf10b1177a8935754ee176ec5 /mod/bookmarks/views/default/widgets
parente2ba75ce7dad46f87c43b7ef256e79053af5566e (diff)
downloadelgg-0320936f29dd83534b5af386a981131be7981a9a.tar.gz
elgg-0320936f29dd83534b5af386a981131be7981a9a.tar.bz2
Updated bookmarks with new interface.
git-svn-id: http://code.elgg.org/elgg/trunk@5266 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks/views/default/widgets')
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/edit.php39
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/view.php99
2 files changed, 69 insertions, 69 deletions
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
index c399fd6d1..2ae8af6e4 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
@@ -1,18 +1,27 @@
<?php
+/**
+ * Elgg bookmark widget edit view
+ *
+ * @package ElggBookmarks
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
?>
- <p>
- <?php echo elgg_echo('bookmarks:numbertodisplay'); ?>:
- <select name="params[num_display]">
- <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
- <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
- <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
- <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
- <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
- <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
- <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
- <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
- <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
- <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
- </select>
- </p> \ No newline at end of file
+<p>
+ <?php echo elgg_echo('bookmarks:numbertodisplay'); ?>:
+ <select name="params[num_display]">
+ <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option>
+ <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option>
+ <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option>
+ <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option>
+ <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option>
+ <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option>
+ <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option>
+ <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option>
+ <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option>
+ <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option>
+ </select>
+</p> \ 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
index b7c35d2b8..482a4e3d9 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/view.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/view.php
@@ -1,65 +1,56 @@
-
-<script type="text/javascript">
-$(document).ready(function () {
- $('a.share_more_info').click(function () {
- $(this.parentNode).children("[class=share_desc]").slideToggle("fast");
- return false;
- });
-}); /* end document ready function */
-</script>
-
- <?php
-
- //get the num of shares the user want to display
- $num = $vars['entity']->num_display;
+<?php
+/**
+ * Elgg bookmark widget view
+ *
+ * @package ElggBookmarks
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+//get the num of shares the user want to display
+$num = $vars['entity']->num_display;
- //if no number has been set, default to 4
- if(!$num)
- $num = 4;
+//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));
+//grab the users bookmarked items
+$bookmarks = get_entities('object', 'bookmarks',$vars['entity']->owner_guid, "", $num, 0, false);
- if($shares){
+if($bookmarks){
- foreach($shares as $s){
+ foreach($bookmarks as $b){
- //get the owner
- $owner = $s->getOwnerEntity();
+ //get the owner
+ $owner = $b->getOwnerEntity();
- //get the time
- $friendlytime = friendly_time($s->time_created);
+ //get the time
+ $friendlytime = friendly_time($b->time_created);
- //get the user icon
- $icon = elgg_view(
- "profile/icon", array(
- 'entity' => $owner,
- 'size' => 'tiny',
- )
- );
-
- //get the bookmark title
- $info = "<p class=\"shares_title\"><a href=\"{$s->getURL()}\">{$s->title}</a></p>";
+ //get the bookmark title
+ $info = "<div class='river_object_bookmarks_create'><p class=\"shares_title\"><a href=\"{$b->address}\">{$b->title}</a></p></div>";
- //get the user details
- $info .= "<p class=\"shares_timestamp\"><small><a href=\"{$owner->getURL()}\">{$owner->name}</a> {$friendlytime}</small></p>";
-
- //get the bookmark description
- if($s->description)
- $info .= "<a href=\"javascript:void(0);\" class=\"share_more_info\">".elgg_echo('bookmarks:more')."</a><br /><div class=\"share_desc\"><p>{$s->description}</p></div>";
-
- //display
- echo "<div class=\"shares_widget_wrapper\">";
- echo "<div class=\"shares_widget_icon\">" . $icon . "</div>";
- echo "<div class=\"shares_widget_content\">" . $info . "</div>";
- echo "</div>";
+ //get the user details
+ $info .= "<p class=\"shares_timestamp\"><small>{$friendlytime} ";
+
+ //get the bookmark description
+ if($s->description)
+ $info .= "<a href=\"javascript:void(0);\" class=\"share_more_info\">".elgg_echo('bookmarks:more')."</a></small></p><div class=\"share_desc\"><p>{$s->description}</p></div>";
+ else
+ $info .= "</small></p>";
+
+ //display
+ echo "<div class='ContentWrapper bookmarks'>";
+ echo "<div class='shares_widget_content'>" . $info . "</div></div>";
- }
+ }
- $user_inbox = $vars['url'] . "pg/bookmarks/" . page_owner_entity()->username . "/inbox";
- echo "<div class=\"shares_widget_wrapper\"><a href=\"{$user_inbox}\">".elgg_echo('bookmarks:inbox')."</a></div>";
+ $user_inbox = $vars['url'] . "pg/bookmarks/" . page_owner_entity()->username;
+ if (get_entities('object', 'bookmarks', $vars['entity']->container_guid, '', '', '', true) > $num)
+ echo "<div class='ContentWrapper bookmarks more'><a href=\"{$user_inbox}\">".elgg_echo('bookmarks:read')."</a></div>";
- }
-
-
- ?> \ No newline at end of file
+} else {
+ echo "<div class='ContentWrapper'>" . elgg_echo("bookmarks:widget:description") . "</div>";
+} \ No newline at end of file