aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/views/default/object/blog-comments.php
blob: 188214ff14fc835441db9f2c67593311b12049f3 (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
<?php

	/**
	 * Elgg blog aggregate comments view
	 * 
	 * @package ElggBlog
	 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
	 * @author Ben Werdmuller <ben@curverider.co.uk>
	 * @copyright Curverider Ltd 2008
	 * @link http://elgg.com/
	 * 
	 * @uses $vars['comments'] Array of comments
	 */

?>

		<div class="blog-comments">
		
<?php
		if (isset($vars['comments']) && is_array($vars['comments']) && sizeof($vars['comments']) > 0) {
			
			echo "<h3>". elgg_echo("comments") ."</h3><ol>";
			foreach($vars['comments'] as $comment) {
				
				echo elgg_view("object/blog-comment",array('entity' => $comment));
				
			}
			echo "</ol>";
			
		}

?>
			<form action="<?php echo $vars['url']; ?>action/blog/comments/add" method="post">
				<h3>
					<?php echo elgg_echo("blog:comment:add"); ?>
				</h3>
				<p>
					<label><?php echo elgg_echo("blog:comment:text"); ?>
						<?php

							echo elgg_view("input/longtext",array('internalname' => 'comment'));
						
						?>
					</label>
				</p>
				<p>
					<input type="hidden" name="blogpost_guid" value="<?php echo $vars['entity']->getGUID(); ?>" /> 
					<input type="submit" value="<?php echo elgg_echo("save"); ?>" />
				</p>
			</form>

		</div>