aboutsummaryrefslogtreecommitdiff
path: root/views/default/friends/forms/edit.php
blob: 6ed58d5bfb194220ad98c9bc1b198a6b8c0fd201 (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
<?php

	/**
	 * Elgg friend collections add/edit 
	 * 
	 * @package ElggFriends
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Dave Tosh <dave@elgg.com>
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.com/
	 * 
	 * @uses $vars['object'] Optionally, the collection edit
	 */
	 
	// var_export($vars['collection'][0]->id);
 
	// Set title, form destination
		if (isset($vars['collection'])) {
			$action = "friends/editcollection";
			$title = $vars['collection'][0]->name;
		} else  {
			$action = "friends/addcollection";
			$title = "";
	    }

?>

	<form action="<?php echo $vars['url']; ?>action/<?php echo $action; ?>" method="post">
		<p>
			<label><?php echo elgg_echo("friends:collectionname"); ?><br />
			<?php

				echo elgg_view("input/text", array(
									"internalname" => "collection_name",
									"value" => $title,
													));
			
			?>
			</label>
		</p>
		<p>
		<?php
		    if($vars['collection_members']){
    		    echo elgg_echo("friends:collectionfriends") . "<br />";
        	    foreach($vars['collection_members'] as $mem){
            	    
            	   echo elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny'));
            	   echo $mem->name;
  
        	    }
    	    }
    	?>
    	</p>
		<p>
			<label><?php echo elgg_echo("friends:addfriends"); ?><br />
			<?php

				//echo elgg_view('friends/friendslist');
				echo elgg_view('friends/picker',array('entities' => $vars['friends'], 'internalname' => 'friends_collection'));
			
			?>
			</label>
		</p>
		<p>
			<?php

				if (isset($vars['collection'])) {
					?><input type="hidden" name="collection_id" value="<?php echo $vars['collection'][0]->id; ?>" /><?php
				}
			
			?>
			<input type="submit" name="submit" value="<?php echo elgg_echo('save'); ?>" />
		</p>
	
	</form>