Merge pull request #24022 from colemanw/afformFrontend
[civicrm-core.git] / CRM / Core / Joomla.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 * Joomla class.
20 *
21 * (clearly copied & pasted from a drupal class).
22 *
23 * Still used?
24 */
25 class CRM_Core_Joomla {
26
27 /**
28 * Reuse drupal blocks into a left sidebar.
29 *
30 * Assign the generated template to the smarty instance.
31 */
32 public static function sidebarLeft() {
33 $config = CRM_Core_Config::singleton();
34
35 if ($config->userFrameworkFrontend) {
36 return;
37 }
38
39 $blockIds = [
40 CRM_Core_Block::CREATE_NEW,
41 CRM_Core_Block::RECENTLY_VIEWED,
42 CRM_Core_Block::DASHBOARD,
43 CRM_Core_Block::ADD,
44 CRM_Core_Block::LANGSWITCH,
45 //CRM_Core_Block::EVENT,
46 //CRM_Core_Block::FULLTEXT_SEARCH
47 ];
48
49 $blocks = [];
50 foreach ($blockIds as $id) {
51 $blocks[] = CRM_Core_Block::getContent($id);
52 }
53
54 $template = CRM_Core_Smarty::singleton();
55 $template->assign_by_ref('blocks', $blocks);
56 $sidebarLeft = $template->fetch('CRM/Block/blocks.tpl');
57 $template->assign_by_ref('sidebarLeft', $sidebarLeft);
58 }
59
60 }