aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/views/default')
-rw-r--r--mod/bookmarks/views/default/bookmarks/bookmarklet.php35
-rw-r--r--mod/bookmarks/views/default/bookmarks/form.php133
-rw-r--r--mod/bookmarks/views/default/bookmarks/owner_block.php10
-rw-r--r--mod/bookmarks/views/default/bookmarks/sharing.php80
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/annotate.php10
-rw-r--r--mod/bookmarks/views/default/river/object/bookmarks/create.php40
-rw-r--r--mod/bookmarks/views/default/widgets/bookmarks/edit.php2
7 files changed, 51 insertions, 259 deletions
diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
index 531619409..119b9d107 100644
--- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php
+++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php
@@ -1,33 +1,32 @@
<?php
/**
- * Elgg get bookmarks bookmarklet view
- *
- * @package ElggBookmarks
+ * Bookmarklet
+ *
+ * @package Bookmarks
*/
$page_owner = elgg_get_page_owner_entity();
-$bookmarktext = elgg_echo("bookmarks:this");
if ($page_owner instanceof ElggGroup) {
- $bookmarktext = elgg_echo("bookmarks:this:group", array($page_owner->name));
- $name = "group:$page_owner->guid";
+ $title = elgg_echo("bookmarks:this:group", array($page_owner->name));
} else {
- $name = $page_owner->username;
+ $title = elgg_echo("bookmarks:this");
}
+$guid = $page_owner->getGUID();
+
if (!$name && ($user = elgg_get_logged_in_user_entity())) {
$name = $user->username;
}
+$url = elgg_get_site_url();
+
+$bookmarklet = "<a href=\"javascript:location.href='{$url}pg/bookmarks/add/$guid?address='"
+ . "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">"
+ . "<img src=\"{$url}_graphics/elgg_bookmarklet.gif\" border=\"0\" title=\"$title\" /> </a>";
+
?>
-<h3><?php echo elgg_echo('bookmarks:browser_bookmarklet')?></h3>
-<a href="javascript:location.href='<?php echo elgg_get_site_url(); ?>pg/bookmarks/<?php echo $name; ?>/add?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"> <img src="<?php echo elgg_get_site_url(); ?>_graphics/elgg_bookmarklet.gif" border="0" title="<?php echo elgg_echo('bookmarks:this');?>" /> </a>
-<br />
-<div class="elgg-discover">
- <a class="link">Instructions</a>
- <div class="elgg-discoverable">
- <p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p>
- <p><?php echo elgg_echo("bookmarks:bookmarklet:descriptionie"); ?></p>
- <p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p>
- </div>
-</div> \ No newline at end of file
+<p><?php echo elgg_echo("bookmarks:bookmarklet:description"); ?></p>
+<p><?php echo $bookmarklet; ?></p>
+<p><?php echo elgg_echo("bookmarks:bookmarklet:descriptionie"); ?></p>
+<p><?php echo elgg_echo("bookmarks:bookmarklet:description:conclusion"); ?></p> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/bookmarks/form.php b/mod/bookmarks/views/default/bookmarks/form.php
deleted file mode 100644
index ef8a18dc3..000000000
--- a/mod/bookmarks/views/default/bookmarks/form.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-
-/**
-* Elgg bookmarks plugin form
-*
-* @package ElggBookmarks
-*/
-
-if(isset($vars['entity'])){
- $guid = $vars['entity']->guid;
- $title = $vars['entity']->title;
- $description = $vars['entity']->description;
- $address = $vars['entity']->address;
- $tags = $vars['entity']->tags;
- $access_id = $vars['entity']->access_id;
- $shares = $vars['entity']->shares;
- $owner = $vars['entity']->getOwnerEntity();
- $highlight = 'default';
-
-} else {
- $guid = 0;
- $title = get_input('title',"");
- $title = stripslashes($title); // strip slashes from URL encoded apostrophes
- $description = "";
- $address = get_input('address',"");
- $highlight = 'all';
-
- if ($address == "previous")
- $address = $_SERVER['HTTP_REFERER'];
- $tags = array();
-
- if (defined('ACCESS_DEFAULT')) {
- $access_id = ACCESS_DEFAULT;
- } else {
- $access_id = 0;
- }
- $shares = array();
- $owner = page_owner_entity();
-}
-
-?>
-<div class="contentWrapper">
-<form action="<?php echo $vars['url']; ?>action/bookmarks/add" method="post">
-<?php echo elgg_view('input/securitytoken'); ?>
-<p>
- <label>
- <?php echo elgg_echo('title'); ?>
- <?php
-
- echo elgg_view('input/text',array(
- 'name' => 'title',
- 'value' => $title,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <label>
- <?php echo elgg_echo('bookmarks:address'); ?>
- <?php
-
- echo elgg_view('input/url',array(
- 'name' => 'address',
- 'value' => $address,
- ));
-
- ?>
- </label>
-</p>
-<p class="longtext_editarea">
- <label>
- <?php echo elgg_echo('description'); ?>
- <br />
- <?php
-
- echo elgg_view('input/longtext',array(
- 'name' => 'description',
- 'value' => $description,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <label>
- <?php echo elgg_echo('tags'); ?>
- <?php
-
- echo elgg_view('input/tags',array(
- 'name' => 'tags',
- 'value' => $tags,
- ));
-
- ?>
- </label>
-</p>
- <?php
-
- //echo elgg_view('bookmarks/sharing',array('shares' => $shares, 'owner' => $owner));
- if ($friends = elgg_get_entities_from_relationship(array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) {
-?>
-<p>
- <label><?php echo elgg_echo("bookmarks:with"); ?></label><br />
-<?php
- echo elgg_view('friends/picker',array('entities' => $friends, 'name' => 'shares', 'highlight' => $highlight));
-?>
-</p>
-<?php
- }
-
- ?>
-<p>
- <label>
- <?php echo elgg_echo('access'); ?>
- <?php
-
- echo elgg_view('input/access',array(
- 'name' => 'access',
- 'value' => $access_id,
- ));
-
- ?>
- </label>
-</p>
-<p>
- <?php echo $vars['container_guid'] ? elgg_view('input/hidden', array('name' => 'container_guid', 'value' => $vars['container_guid'])) : ""; ?>
- <input type="hidden" name="bookmark_guid" value="<?php echo $guid; ?>" />
- <input type="submit" value="<?php echo elgg_echo('save'); ?>" />
-</p>
-
-</form>
-</div> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/bookmarks/owner_block.php b/mod/bookmarks/views/default/bookmarks/owner_block.php
deleted file mode 100644
index d9b31d8d4..000000000
--- a/mod/bookmarks/views/default/bookmarks/owner_block.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-
-$label = elgg_echo('bookmarks:this');
-$user = elgg_get_logged_in_user_entity();
-$url = "'" . $vars['url'] . "pg/bookmarks/add/{$user->username}?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)";
-
-?>
-<div id="owner_block_bookmark_this">
-<a href="javascript:location.href=<?php echo $url; ?>"><?php echo $label ?></a>
-</div>
diff --git a/mod/bookmarks/views/default/bookmarks/sharing.php b/mod/bookmarks/views/default/bookmarks/sharing.php
deleted file mode 100644
index 779af4de2..000000000
--- a/mod/bookmarks/views/default/bookmarks/sharing.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
- $owner = $vars['owner'];
- if ($friends = elgg_get_entities_from_relationship(array('relationship' => 'friend', 'relationship_guid' => $owner->getGUID(), 'inverse_relationship' => FALSE, 'type' => 'user', 'limit' => 9999))) {
-
-?>
-
-<table border="0" cellspacing="0" cellpadding="0">
-
-<?php
-
- $col = 0;
- foreach($friends as $friend) {
-
- if ($col == 0) echo "<tr>";
-
- $label = elgg_view("profile/icon",array('entity' => $friend, 'size' => 'tiny'));
- $options[$label] = $friend->getGUID();
-
-?>
-
- <td>
-
- <input type="checkbox" name="shares[]" value="<?php echo $options[$label]; ?>" />
-
- </td>
-
- <td >
-
- <div style="width: 25px; margin-bottom: 15px;">
- <?php
-
- echo $label;
-
- ?>
- </div>
- </td>
- <td style="width: 300px; padding: 5px;">
- <?php
-
- echo $friend->name;
-
- ?>
- </td>
-<?php
-
-
- $col++;
-
- if ($col == 3) {
-
- $col = 0;
- echo "</tr>";
-
- }
-
-
- }
- if ($col != 3) {
- echo "</tr>";
- }
-
-
-?>
-
-</table>
-
-<?php
-
- /*echo elgg_view('input/checkboxes',array(
-
- 'name' => 'shares',
- 'options' => $options,
- 'value' => $vars['shares'],
-
- )); */
-
- }
-
-?> \ No newline at end of file
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/annotate.php b/mod/bookmarks/views/default/river/object/bookmarks/annotate.php
deleted file mode 100644
index 8db8a6581..000000000
--- a/mod/bookmarks/views/default/river/object/bookmarks/annotate.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<?php
-$statement = $vars['statement'];
-$performed_by = $statement->getSubject();
-$object = $statement->getObject();
-
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("bookmarks:river:annotate"),$url) . " ";
-$string .= "<a href=\"" . $object->getURL() . "\">" . elgg_echo("bookmarks:river:item") . "</a>";
-
-echo $string; \ No newline at end of file
diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php
index 82ea75af7..743efdb22 100644
--- a/mod/bookmarks/views/default/river/object/bookmarks/create.php
+++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php
@@ -1,10 +1,36 @@
<?php
-$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
-$object = get_entity($vars['item']->object_guid);
-$url = $object->getURL();
+/**
+ * New bookmarks river entry
+ *
+ * @package Bookmarks
+ */
-$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
-$string = sprintf(elgg_echo("bookmarks:river:created"),$url) . " ";
-$string .= "<a href=\"" . $object->getURL() . "\">" . $object->title . "</a>"; //elgg_echo("bookmarks:river:item") . "</a>";
+$object = $vars['item']->getObjectEntity();
+$excerpt = elgg_get_excerpt($object->description);
-echo $string;
+$params = array(
+ 'href' => $object->getURL(),
+ 'text' => $object->title,
+);
+$link = elgg_view('output/url', $params);
+
+$group_string = '';
+$container = $object->getContainerEntity();
+if ($container instanceof ElggGroup) {
+ $params = array(
+ 'href' => $container->getURL(),
+ 'text' => $container->name,
+ );
+ $group_link = elgg_view('output/url', $params);
+ $group_string = elgg_echo('river:ingroup', array($group_link));
+}
+
+$link = elgg_echo('bookmarks:river:created', array($link));
+
+echo " $link $group_string";
+
+if ($excerpt) {
+ echo '<div class="elgg-river-content">';
+ echo $excerpt;
+ echo '</div>';
+}
diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
index f31b7660f..99d65ac8f 100644
--- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php
+++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php
@@ -19,6 +19,6 @@ $dropdown = elgg_view('input/dropdown', $params);
?>
<div>
- <?php echo elgg_echo('bookmarks:max_display'); ?>:
+ <?php echo elgg_echo('bookmarks:numbertodisplay'); ?>:
<?php echo $dropdown; ?>
</div>