aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/views/default/bookmarks/form.php
blob: ef8a18dc3f6829cfb74ee45da8efe9045b41d265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?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>