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  $this->renderPartial('CommentsWidget', array('contentId' => $contentId, 'allowAnonymous' => strtolower($allowAnonymous) === 'true'));
27  }
28 
29  /**
30  * CommentsFormWidget
31  *
32  * @param string $contentId content id
33  * @param bool $allowAnonymous allow anonymous comments
34  *
35  * @return void
36  */
37  public function actionCommentsFormWidget($contentId = null, $allowAnonymous = true)
38  {
39  $this->renderPartial('CommentsFormWidget', array('contentId' => $contentId, 'allowAnonymous' => strtolower($allowAnonymous) === 'true'));
40  }
41 
42  /**
43  * CommentsListWidget
44  *
45  * @param string $contentId content id
46  *
47  * @return void
48  */
49  public function actionCommentsListWidget($contentId = null)
50  {
51  $this->renderPartial('CommentsListWidget', array('contentId' => $contentId));
52  }
53 
54 }