当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_PCP_BAO_PCP::getPcpDashboardInfo方法代码示例

本文整理汇总了PHP中CRM_PCP_BAO_PCP::getPcpDashboardInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_PCP_BAO_PCP::getPcpDashboardInfo方法的具体用法?PHP CRM_PCP_BAO_PCP::getPcpDashboardInfo怎么用?PHP CRM_PCP_BAO_PCP::getPcpDashboardInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_PCP_BAO_PCP的用法示例。


在下文中一共展示了CRM_PCP_BAO_PCP::getPcpDashboardInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildUserDashBoard

 /**
  * Function to build user dashboard
  *
  * @return void
  * @access public
  */
 function buildUserDashBoard()
 {
     //build component selectors
     $dashboardElements = array();
     $config = CRM_Core_Config::singleton();
     $this->_userOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'user_dashboard_options');
     $components = CRM_Core_Component::getEnabledComponents();
     $this->assign('contactId', $this->_contactId);
     foreach ($components as $name => $component) {
         $elem = $component->getUserDashboardElement();
         if (!$elem) {
             continue;
         }
         if (!empty($this->_userOptions[$name]) && (CRM_Core_Permission::access($component->name) || CRM_Core_Permission::check($elem['perm'][0]))) {
             $userDashboard = $component->getUserDashboardObject();
             $dashboardElements[] = array('class' => 'crm-dashboard-' . strtolower($component->name), 'sectionTitle' => $elem['title'], 'templatePath' => $userDashboard->getTemplateFileName(), 'weight' => $elem['weight']);
             $userDashboard->run();
         }
     }
     if (!empty($this->_userOptions['Permissioned Orgs'])) {
         $dashboardElements[] = array('class' => 'crm-dashboard-permissionedOrgs', 'templatePath' => 'CRM/Contact/Page/View/RelationshipSelector.tpl', 'sectionTitle' => ts('Your Contacts / Organizations'), 'weight' => 40);
     }
     if (!empty($this->_userOptions['PCP'])) {
         $dashboardElements[] = array('class' => 'crm-dashboard-pcp', 'templatePath' => 'CRM/Contribute/Page/PcpUserDashboard.tpl', 'sectionTitle' => ts('Personal Campaign Pages'), 'weight' => 40);
         list($pcpBlock, $pcpInfo) = CRM_PCP_BAO_PCP::getPcpDashboardInfo($this->_contactId);
         $this->assign('pcpBlock', $pcpBlock);
         $this->assign('pcpInfo', $pcpInfo);
     }
     if (!empty($this->_userOptions['Assigned Activities'])) {
         // Assigned Activities section
         $dashboardElements[] = array('class' => 'crm-dashboard-assignedActivities', 'templatePath' => 'CRM/Activity/Page/UserDashboard.tpl', 'sectionTitle' => ts('Your Assigned Activities'), 'weight' => 5);
         $userDashboard = new CRM_Activity_Page_UserDashboard();
         $userDashboard->run();
     }
     usort($dashboardElements, array('CRM_Utils_Sort', 'cmpFunc'));
     $this->assign('dashboardElements', $dashboardElements);
     if (!empty($this->_userOptions['Groups'])) {
         $this->assign('showGroup', TRUE);
         //build group selector
         $gContact = new CRM_Contact_Page_View_UserDashBoard_GroupContact();
         $gContact->run();
     } else {
         $this->assign('showGroup', FALSE);
     }
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:51,代码来源:UserDashBoard.php


注:本文中的CRM_PCP_BAO_PCP::getPcpDashboardInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。