3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
21 class CRM_Contact_Page_DashBoard
extends CRM_Core_Page
{
26 public function run() {
27 // Add dashboard js and css
28 $resources = CRM_Core_Resources
::singleton();
29 $resources->addScriptFile('civicrm', 'js/jquery/jquery.dashboard.js', 0, 'html-header', FALSE);
30 $resources->addStyleFile('civicrm', 'css/dashboard.css');
31 $this->assign('contactDashlets', CRM_Core_BAO_Dashboard
::getContactDashletsForJS());
33 CRM_Utils_System
::setTitle(ts('CiviCRM Home'));
34 $contactID = CRM_Core_Session
::getLoggedInContactID();
36 // call hook to get html from other modules
37 // ignored but needed to prevent warnings
38 $contentPlacement = CRM_Utils_Hook
::DASHBOARD_BELOW
;
39 $html = CRM_Utils_Hook
::dashboard($contactID, $contentPlacement);
40 if (is_array($html)) {
41 $this->assign_by_ref('hookContent', $html);
42 $this->assign('hookContentPlacement', $contentPlacement);
45 $communityMessages = CRM_Core_CommunityMessages
::create();
46 if ($communityMessages->isEnabled()) {
47 $message = $communityMessages->pick();
49 $this->assign('communityMessages', $communityMessages->evalMarkup($message['markup']));