Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
PreviewController.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  * This controller used for widgets preview.
11  * It returns widgets with some content.
12  */
14 {
15 
16  /**
17  * CommentsWidget
18  *
19  * @param string $contentId content id
20  * @param bool|string $allowAnonymous allow anonymous comments
21  *
22  * @return void
23  */
24  public function actionCommentsWidget($contentId = null, $allowAnonymous = 'true')
25  {
26  if (isset($_GET['lang'])) {
27  Yii::app()->language = $_GET['lang'];
28  }
29 
30  $this->renderPartial('CommentsWidget', array('contentId' => $contentId, 'allowAnonymous' => strtolower($allowAnonymous) === 'true'));
31  }
32 
33  /**
34  * CommentsFormWidget
35  *
36  * @param string $contentId content id
37  * @param bool $allowAnonymous allow anonymous comments
38  *
39  * @return void
40  */
41  public function actionCommentsFormWidget($contentId = null, $allowAnonymous = true)
42  {
43  $this->renderPartial('CommentsFormWidget', array('contentId' => $contentId, 'allowAnonymous' => strtolower($allowAnonymous) === 'true'));
44  }
45 
46  /**
47  * CommentsListWidget
48  *
49  * @param string $contentId content id
50  *
51  * @return void
52  */
53  public function actionCommentsListWidget($contentId = null)
54  {
55  $this->renderPartial('CommentsListWidget', array('contentId' => $contentId));
56  }
57 
58 }