Skip to content

Instantly share code, notes, and snippets.

@mlutfy
Created March 26, 2012 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlutfy/2205960 to your computer and use it in GitHub Desktop.
Save mlutfy/2205960 to your computer and use it in GitHub Desktop.
Static CiviCRM dashboard
/**
* Implements hook_civicrm_dashboard().
*
* Replaces the CiviCRM dashboard with only the Activity dashlet.
* Avoids having users setup their dashboard, and this is the only dashlet available in our installation.
*
* For more information:
* http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmdashboard
*/
function mymodule_civicrm_dashboard($contactID, &$contentPlacement) {
$contentPlacement = CRM_Utils_Hook::DASHBOARD_REPLACE;
require_once 'CRM/Dashlet/Page/Activity.php';
ob_start();
$dashlet = new CRM_Dashlet_Page_Activity();
$dashlet->run();
$output = ob_get_contents();
ob_end_clean();
return array(
ts('Activities') => $output,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment