aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/embed/upload.php
blob: d995b4b2b476ab5be6b6cab41a328b16244fc421 (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
<h2 class="media_modal_title">Embed / Upload Media</h2>
<?php

echo elgg_view('embed/tabs',array('tab' => 'upload', 'internalname'=>get_input('internalname')));

if (!elgg_view_exists('file/upload')) {
	echo "<p>" . elgg_echo('embed:file:required') . "</p>";
} else {
	$action = 'file/upload';
	
?>
<form id="media_upload" action="<?php echo $vars['url']; ?>action/file/upload" method="post" enctype="multipart/form-data">
	<p>
		<label for="upload"><?php echo elgg_echo("file:file"); ?><br />
	<?php
		echo elgg_view('input/securitytoken');
		echo elgg_view("input/file",array('internalname' => 'upload', 'js' => 'id="upload"'));
		
	?>
	</label></p>
	<p>
		<label><?php echo elgg_echo("title"); ?><br />
		<?php

			echo elgg_view("input/text", array(
								"internalname" => "title",
								"value" => $title,
												));
		
		?>
		</label>
	</p>
	<p>
	<label for="filedescription"><?php echo elgg_echo("description"); ?><br />
	<textarea class="input_textarea" name="description" id="filedescription"></textarea>
	</label></p>
	
	<p>
		<label><?php echo elgg_echo("tags"); ?><br />
		<?php
			echo elgg_view("input/tags", array(
								"internalname" => "tags",
								"value" => $tags,
												));

		?>
		</label>
	</p>
	<p>
		<label>
			<?php echo elgg_echo('access'); ?><br />
			<?php echo elgg_view('input/access', array('internalname' => 'access_id','value' => ACCESS_DEFAULT)); ?>
		</label>
	</p>

	<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()}\" />";
		
		?>
		<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
	</p>
</form>
<script type="text/javascript"> 
        // bind 'myForm' and provide a simple callback function 
        $('#media_upload').submit(function() { 
            var options = {  
			    success:    function() { 
			        $('.popup .content').load('<?php echo $vars['url'] . 'pg/embed/media'; ?>?internalname=<?php echo $vars['internalname']; ?>'); 
			    } 
			}; 
        	$(this).ajaxSubmit(options);
            return false; 
        }); 
</script> 

<?php
	
}

?>