Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
CommentsListWidget.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 <section class="comments-list-widget co mments" id="comments-list-<?php echo $this->contentId?>">
13  <?php echo CHtml::link('', '#', array('name' => 'list_' . $this->contentId, 'class' => 'anchor')) ?>
14  <h6 class="section-title"><?php echo CommentsModule::t('Comments')?> (<?php echo $commentsCountWithChildren?>)</h6>
15  <?php if ($message = Yii::app()->user->getFlash('commentDeleteError' . $this->contentId)) { ?>
16  <div class="flash-error">
17  <?php echo $message?>
18  </div>
19  <?php } ?>
20  <?php if ($message = Yii::app()->user->getFlash('commentDeleteSuccess' . $this->contentId)) { ?>
21  <div class="flash-success">
22  <?php echo $message?>
23  </div>
24  <?php } ?>
25  <?php if ($message = Yii::app()->user->getFlash('commentApproveSuccess' . $this->contentId)) { ?>
26  <div class="flash-success">
27  <?php echo $message?>
28  </div>
29  <?php } ?>
30  <?php if (count($comments) > 0) { ?>
31  <ol class="comments-list">
32  <?php foreach ($comments as $comment) { ?>
33  <?php echo $this->render('_comment', array('comment' => $comment)) ?>
34  <?php };?>
35  </ol>
36  <?php $this->widget('comments.widgets.CommentLinkPager',
37  array(
38  'pages' => $pages,
39  'contentId' => $this->contentId,
40  'htmlOptions' => array('class'=>'pagination'),
41  'firstPageLabel'=> CommentsModule::t('First'),
42  'nextPageLabel' => CommentsModule::t('Next'),
43  'prevPageLabel' => CommentsModule::t('Previous'),
44  'lastPageLabel' => CommentsModule::t('Last'),
45  )) ?>
46  <?php if ($this->oneLevelReply && !empty($this->contentId)) { ?>
47  <script type="text/javascript">
48  $(function () {
49  initCommentsReply({
50  comments: <?php echo CJSON::encode($this->getSafeCommentAttributes($comments))?>,
51  sel:{
52  form:"#comments-form-<?php echo $this->contentId?>",
53  commentsList:"#comments-list-<?php echo $this->contentId?>"
54  }
55  });
56  });
57  </script>
58  <?php } ?>
59  <?php } else { ?>
60  <p><?php echo CommentsModule::t('No comments')?> </p>
61  <?php } ?>
62 </section>