示例#1
0
 /**
  * Reuse drupal blocks into a left sidebar. Assign the generated template
  * to the smarty instance
  *
  * @return void
  * @access public
  * @static
  */
 function sidebarLeft()
 {
     $blockIds = array(1, 2, 4, 8);
     $blocks = array();
     foreach ($blockIds as $id) {
         require_once 'CRM/Core/Block.php';
         $blocks[] = CRM_Core_Block::getContent($id);
     }
     require_once 'CRM/Core/Smarty.php';
     $template =& CRM_Core_Smarty::singleton();
     $template->assign_by_ref('blocks', $blocks);
     $sidebarLeft = $template->fetch('CRM/Block/blocks.tpl');
     $template->assign_by_ref('sidebarLeft', $sidebarLeft);
 }
示例#2
0
 /**
  * Reuse drupal blocks into a left sidebar. Assign the generated template
  * to the smarty instance
  *
  * @return void
  * @access public
  * @static
  */
 static function sidebarLeft()
 {
     $config =& CRM_Core_Config::singleton();
     require_once 'CRM/Core/Block.php';
     $blockIds = array(CRM_Core_Block::CREATE_NEW, CRM_Core_Block::RECENTLY_VIEWED, CRM_Core_Block::DASHBOARD, CRM_Core_Block::ADD, CRM_Core_Block::LANGSWITCH);
     $blocks = array();
     foreach ($blockIds as $id) {
         $blocks[] = CRM_Core_Block::getContent($id);
     }
     require_once 'CRM/Core/Smarty.php';
     $template =& CRM_Core_Smarty::singleton();
     $template->assign_by_ref('blocks', $blocks);
     $sidebarLeft = $template->fetch('CRM/Block/blocks.tpl');
     $template->assign_by_ref('sidebarLeft', $sidebarLeft);
 }
示例#3
0
 /**
  * Reuse drupal blocks into a left sidebar.
  *
  * Assign the generated template to the smarty instance.
  */
 public static function sidebarLeft()
 {
     $config = CRM_Core_Config::singleton();
     if ($config->userFrameworkFrontend) {
         return;
     }
     $blockIds = array(CRM_Core_Block::CREATE_NEW, CRM_Core_Block::RECENTLY_VIEWED, CRM_Core_Block::DASHBOARD, CRM_Core_Block::ADD, CRM_Core_Block::LANGSWITCH);
     $blocks = array();
     foreach ($blockIds as $id) {
         $blocks[] = CRM_Core_Block::getContent($id);
     }
     $template = CRM_Core_Smarty::singleton();
     $template->assign_by_ref('blocks', $blocks);
     $sidebarLeft = $template->fetch('CRM/Block/blocks.tpl');
     $template->assign_by_ref('sidebarLeft', $sidebarLeft);
 }