aboutsummaryrefslogtreecommitdiff
path: root/views/default/upload/upload_form_content.php
blob: c2476e7d848e5e4e7bd9fa42833b28cf0bff303d (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
<input type="hidden" name="number_of_files" value="1">
<?php

if (isset($vars['entity'])) {
	$title = $vars['entity']->title;
	$description = $vars['entity']->description;
	$tags = $vars['entity']->tags;
	$access_id = $vars['entity']->access_id;
} else  {
	$title = "";
	$description = "";
	$tags = "";
	$access_id = get_default_access();
}

$plugin = $vars['plugin'];

if (!$vars['entity']) {

?>
	<div id="option_container">
		<p>
			<label><?php echo elgg_echo("title"); ?><br />
			<?php

				echo elgg_view("input/text", array(
									"internalname" => "title_0"
													));
			
			?>
			</label>
		</p>
		<p>
			<label><?php echo elgg_echo("$plugin:file"); ?><br />
			<?php

				echo elgg_view("input/file",array('internalname' => 'upload_0'));
			
			?>
			</label>
		</p>
		</div>
		<p><input type="button" onclick="javascript:file_addtoform()" value="<?php echo elgg_echo("$plugin:add_to_form"); ?>"></p>
<?php
	} else {

?>
		<p>
			<label><?php echo elgg_echo("title"); ?><br />
			<?php

				echo elgg_view("input/text", array(
									"internalname" => "title",
									"value" => $title,
													));
			
			?>
			</label>
		</p>
<?php
	}
?>
		<p class="longtext_editarea">
			<label><?php echo elgg_echo("description"); ?><br />
			<?php

				echo elgg_view("input/longtext",array(
									"internalname" => "description",
									"value" => $description,
													));
			?>
			</label>
		</p>
		<br />
		<p>
			<label><?php echo elgg_echo("tags"); ?><br />
			<?php

				echo elgg_view("input/tags", array(
									"internalname" => "tags",
									"value" => $tags,
													));
			
			?>
		</label></p>
<?php

		$categories = elgg_view('categories',$vars);
		if (!empty($categories)) {
?>

		<p>
			<?php echo $categories; ?>
		</p>

<?php
		}
		echo elgg_view("$plugin/folders/select",$vars);
?>
		<p>
			<label>
				<?php echo elgg_echo('access'); ?><br />
				<?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => $access_id)); ?>
			</label>
		</p>
	
<?php

	if (isset($vars['container_guid']))
		echo "<input type=\"hidden\" name=\"container_guid\" value=\"{$vars['container_guid']}\" />";
	if (isset($vars['entity']))
		echo "<input type=\"hidden\" name=\"file_guid\" value=\"{$vars['entity']->getGUID()}\" />";

?>