aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default/bookmarks/form.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/views/default/bookmarks/form.php')
-rw-r--r--mod/bookmarks/views/default/bookmarks/form.php204
1 files changed, 114 insertions, 90 deletions
diff --git a/mod/bookmarks/views/default/bookmarks/form.php b/mod/bookmarks/views/default/bookmarks/form.php
index 12cd76ba7..2131f7cd8 100644
--- a/mod/bookmarks/views/default/bookmarks/form.php
+++ b/mod/bookmarks/views/default/bookmarks/form.php
@@ -1,109 +1,133 @@
<?php
/**
- * Elgg bookmarks plugin form
- *
- * @package ElggBookmarks
- */
+* 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;
- $access_id = $vars['entity']->access_id;
$tags = $vars['entity']->tags;
- $notes = $vars['entity']->description;
- $owner = get_entity($vars['entity']->container_guid);
- $url = "action/bookmarks/edit";
-}else{
- //set some variables
- $guid = '';
+ $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',"");
- $notes = '';
+ $highlight = 'all';
+
if ($address == "previous")
$address = $_SERVER['HTTP_REFERER'];
$tags = array();
- if(elgg_get_page_owner_entity() instanceof ElggGroup){
- //if in a group, set the access level to default to the group
- $access_id = elgg_get_page_owner_entity()->group_acl;
- }else{
- $access_id = get_default_access(get_loggedin_user());
+
+ if (defined('ACCESS_DEFAULT')) {
+ $access_id = ACCESS_DEFAULT;
+ } else {
+ $access_id = 0;
}
- $owner = get_loggedin_user();
- $url = "action/bookmarks/add";
+ $shares = array();
+ $owner = page_owner_entity();
}
+
?>
-<form id="bookmark_edit_form" class="margin-top" action="<?php echo elgg_get_site_url() . $url; ?>" method="post">
- <?php echo elgg_view('input/securitytoken'); ?>
- <p>
- <label>
- <?php echo elgg_echo('title'); ?>
- <?php
- echo elgg_view('input/text',array(
- 'internalname' => 'title',
- 'value' => $title,
- ));
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('bookmarks:address'); ?>
- <?php
- echo elgg_view('input/url',array(
- 'internalname' => 'address',
- 'value' => $address,
- ));
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('bookmarks:addnote'); ?>
- <br />
- <?php
-
- echo elgg_view('input/text',array(
- 'internalname' => 'notes',
- 'value' => $notes,
- ));
-
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('tags'); ?>
- <?php
- echo elgg_view('input/tags',array(
- 'internalname' => 'tags',
- 'value' => $tags,
- ));
- ?>
- </label>
- </p>
- <p>
- <label>
- <?php echo elgg_echo('access'); ?>
- <?php
- //if it is a group, pull out the group access view
- if(elgg_get_page_owner_entity() instanceof ElggGroup){
- $access_options = group_access_options($owner);
- echo elgg_view('input/access', array('internalname' => 'access',
- 'value' => $access_id,
- 'options' => $access_options));
- }else{
- echo elgg_view('input/access', array('internalname' => 'access',
- 'value' => $access_id));
- }
- ?>
- </label>
- </p>
- <p>
- <?php echo $vars['container_guid'] ? elgg_view('input/hidden', array('internalname' => 'container_guid', 'value' => $vars['container_guid'])) : ""; ?>
- <input type="hidden" value="<?php echo $guid; ?>" name="guid" />
- <input type="submit" onfocus="blur()" value="<?php echo elgg_echo('save'); ?>" />
- </p>
+<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(
+ 'internalname' => 'title',
+ 'value' => $title,
+ ));
+
+ ?>
+ </label>
+</p>
+<p>
+ <label>
+ <?php echo elgg_echo('bookmarks:address'); ?>
+ <?php
+
+ echo elgg_view('input/url',array(
+ 'internalname' => 'address',
+ 'value' => $address,
+ ));
+
+ ?>
+ </label>
+</p>
+<p class="longtext_editarea">
+ <label>
+ <?php echo elgg_echo('description'); ?>
+ <br />
+ <?php
+
+ echo elgg_view('input/longtext',array(
+ 'internalname' => 'description',
+ 'value' => $description,
+ ));
+
+ ?>
+ </label>
+</p>
+<p>
+ <label>
+ <?php echo elgg_echo('tags'); ?>
+ <?php
+
+ echo elgg_view('input/tags',array(
+ 'internalname' => '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, 'internalname' => 'shares', 'highlight' => $highlight));
+?>
+</p>
+<?php
+ }
+
+ ?>
+<p>
+ <label>
+ <?php echo elgg_echo('access'); ?>
+ <?php
+
+ echo elgg_view('input/access',array(
+ 'internalname' => 'access',
+ 'value' => $access_id,
+ ));
+
+ ?>
+ </label>
+</p>
+<p>
+ <?php echo $vars['container_guid'] ? elgg_view('input/hidden', array('internalname' => '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