Merge pull request #18118 from artfulrobot/artfulrobot-msgtpl-disable-smarty
[civicrm-core.git] / CRM / UF / Form / Inline / PreviewById.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * This class generates form components
20 * for previewing Civicrm Profile Group
21 *
22 */
23 class CRM_UF_Form_Inline_PreviewById extends CRM_UF_Form_AbstractPreview {
24
25 /**
26 * Pre processing work done here.
27 *
28 * gets session variables for group or field id
29 *
30 * @param
31 *
32 * @return void
33 * @throws \CRM_Core_Exception
34 */
35 public function preProcess() {
36 // Inline forms don't get menu-level permission checks
37 if (!CRM_Core_Permission::check('access CiviCRM')) {
38 CRM_Core_Error::statusBounce(ts('Permission Denied'));
39 }
40 $gid = CRM_Utils_Request::retrieve('id', 'Positive');
41 $fields = CRM_Core_BAO_UFGroup::getFields($gid, FALSE, NULL, NULL, NULL, FALSE, NULL, FALSE, NULL, CRM_Core_Permission::CREATE, 'field_name', NULL, TRUE);
42 $this->setProfile($fields);
43 }
44
45 }