File: commentdraw.inc

package info (click to toggle)
gallery 1.5.4-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 26,712 kB
  • ctags: 6,567
  • sloc: php: 33,824; sh: 446; xml: 96; makefile: 88; perl: 61
file content (55 lines) | stat: -rw-r--r-- 1,666 bytes parent folder | download
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
<?php /* $Id: commentdraw.inc 10595 2005-06-19 13:44:36Z jenst $ */ ?>
<?php 

global $commentdraw, $i, $index, $id;

$commentTable = new galleryTable();
$commentTable->setAttrs(array(
	'width' => '75%',
	'align' => 'center',
        'border' => 0,
        'cellspacing' => 0,
        'cellpadding' => 0,
        'class' => 'commentbox'));

$commentTable->setColumnCount(3);

$commenterName = '<b>'. wordwrap($commentdraw["name"], 50, " ", 1) .'</b>';
if ($gallery->user->isAdmin()) {
	$commenterName .= '@ &nbsp;'. $commentdraw["IPNumber"];
}

$commentTable->addElement(array(
        'content' => _("From:"),
        'cellArgs' => array('class' => 'commentboxhead', 'width' => 50)));

$commentTable->addElement(array(
        'content' => $commenterName,
        'cellArgs' => array('class' => 'commentboxhead', 'width' => '55%')));


$commentTable->addElement(array(
        'content' => '('. $commentdraw["datePosted"] .')',
        'cellArgs' => array('class' => 'commentboxhead')));


$commentTable->addElement(array(
        'content' => wordwrap($commentdraw["comment"], 100, " ", 1),
        'cellArgs' => array('colspan' => '3')));

if ($gallery->user->canWriteToAlbum($gallery->album)) {
    $url = doCommand('delete-comment',
	array('index'=> $commentdraw['index'],
		'comment_index' => $i,
		'albumName' => $commentdraw['albumName'])
	);

   $commentTable->addElement(array(
        'content' => '<a href="#" onclick="javascript:' . popup($url,1) . '">['. _("delete comment") . ']</a>',
        'cellArgs' => array('colspan' => '3', 'class' => 'commentboxfooter', 'align' => 'center')));
}

global $commentBox;
$commentBox = $commentTable->render();

?>