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->render('_pagination', array('commentsTotal' => $commentsTotal)) ?>
37  <?php if ($this->oneLevelReply && !empty($this->contentId)) { ?>
38  <script type="text/javascript">
39  $(function () {
40  initCommentsReply({
41  comments: <?php echo CJSON::encode($this->getSafeCommentAttributes($comments))?>,
42  sel:{
43  form:"#comments-form-<?php echo $this->contentId?>",
44  commentsList:"#comments-list-<?php echo $this->contentId?>"
45  }
46  });
47  });
48  </script>
49  <?php } ?>
50  <?php } else { ?>
51  <p><?php echo CommentsModule::t('No comments')?> </p>
52  <?php } ?>
53 </section>