Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
_comment.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  */
11 ?>
12 
13 <li class="comment <?php echo !empty($isChild) ? 'child' : ''?>" id="comment-<?php echo $comment->id; ?>">
14 
15  <img src="<?php echo $this->getAvatar($comment)?>" alt="Profile" class="avatar" />
16 
17  <div class="comment-meta">
18  <h5 class="author">
19  <?php echo CHtml::link(CHtml::encode($comment->firstname . ' ' . $comment->lastname), '#');?>
20  <?php if ($this->canReply()) { ?>
21  - <?php echo CHtml::link(CommentsModule::t('Reply'), 'javascript:void(0)', array('id' => $comment->id, 'class' => 'comment-reply-link')); ?>
22  <?php }?>
23  </h5>
24 
25  <p class="date"><?php echo Yii::app()->dateFormatter->formatDateTime($comment->createtime);?></p>
26  </div>
27  <div class="comment-body">
28  <h6 class="comment-subject"><?php echo CHtml::encode($comment->subject);?></h6>
29 
30  <p class="comment-message"><?php echo nl2br(CHtml::encode($comment->description));?></p>
31  </div>
32 
33  <?php if (CommentsModule::canDelete($comment)): ?>
34  <span class="comment-delete">
35  <?php echo CHtml::link(CommentsModule::t('Delete'), !$this->isPreview ?
36  Yii::app()->createUrl('comments/comment/delete', array('id' => $comment->id, 'key' => $this->hash, 'return_url' => Yii::app()->request->getRequestUri())) : 'javascript:void(0)'
37  );?></span>
38  <?php endif ?>
39  <?php if (CommentsModule::canApprove($comment)) { ?>
40  <?php if ($comment->status == Comment::APPROVED) { ?>
41  <span class="comment-approve">
42  <?php echo CHtml::link(CommentsModule::t('Not approve'), !$this->isPreview ? Yii::app()->createUrl('comments/comment/approve',
43  array('status' => Comment::NOT_APPROVED, 'id' => $comment->id, 'key' => $this->hash, 'return_url' => Yii::app()->request->getRequestUri())) : 'javascript:void(0)'
44  );?></span>
45  <?php } else { ?>
46  <span class="comment-approve">
47  <?php echo CHtml::link(CommentsModule::t('Approve'),
48  !$this->isPreview ? Yii::app()->createUrl('comments/comment/approve', array('status' => Comment::APPROVED, 'id' => $comment->id, 'key' => $this->hash, 'return_url' => Yii::app()->request->getRequestUri())) : 'javascript:void(0)'
49  );?>
50  </span>
51  <?php } ?>
52  <?php }?>
53 
54 
55  <?php if ($this->oneLevelReply && empty($isChild) && count($comment->childs) > 0) { ?>
56  <ul class="children">
57  <?php foreach ($comment->childs as $child) { ?>
58  <?php echo $this->render('_comment', array('comment' => $child, 'isChild' => true)) ?>
59  <?php }?>
60  </ul>
61  <?php } ?>
62 </li>