aboutsummaryrefslogtreecommitdiff
path: root/views/default/forms/tasks/comments/add.php
blob: ddbca14f5d64b49e624a2d2acbd5e73cddb082d7 (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
<?php
/**
 * Tasks comments add form
 *
 * @package ElggTasks
 *
 * @uses ElggEntity $vars['entity'] The entity to comment on
 * @uses bool       $vars['inline'] Show a single line version of the form?
 */

elgg_load_library('elgg:tasks');

if (isset($vars['entity']) && elgg_is_logged_in()) {
	
	$inline = elgg_extract('inline', $vars, false);
	
	if ($inline) {
		echo elgg_view('input/text', array('name' => 'generic_comment'));
		echo elgg_view('input/submit', array('value' => elgg_echo('comment')));
	} else {
?>
	<div>
		<label><?php echo elgg_echo("generic_comments:add"); ?></label>
		<?php echo elgg_view('input/longtext', array('name' => 'generic_comment')); ?>
		<br /><label><?php echo elgg_echo('tasks:state:actions'); ?></label>
		<?php
		echo elgg_view('input/radio', array(
			'name' => 'state_action',
			'options' => tasks_prepare_radio_options($vars['entity']),
		));
		?>
	</div>
	<div class="elgg-foot">
<?php
		echo elgg_view('input/submit', array('value' => elgg_echo("tasks:comments:post")));
?>
	</div>
<?php
	}
	
	echo elgg_view('input/hidden', array(
		'name' => 'entity_guid',
		'value' => $vars['entity']->getGUID()
	));
}