$this->contact = CRM_Contact_BAO_Contact::retrieve($params, $defaults);
}
+ function buildDashboard() {
+ $components = CRM_Core_Component::getEnabledComponents();
+
+ // Use the CiviMember component dashboard.
+ $memberComponent = $components['CiviMember'];
+ $elem = $memberComponent->getUserDashboardElement();
+ $userDashboard = $memberComponent->getUserDashboardObject();
+ $userDashboard->run();
+ $dashboardElement = array(
+ 'class' => 'crm-dashboard-' . strtolower($memberComponent->name),
+ 'sectionTitle' => $elem['title'],
+ 'templatePath' => $userDashboard->getTemplateFileName(),
+ 'weight' => $elem['weight'],
+ );
+ $this->assign('element', $dashboardElement);
+ }
+
function run() {
CRM_Utils_System::setTitle(ts('Welcome, ') . $this->contact->first_name . '!');
$this->assign('contact', $this->contact);
+ $this->buildDashboard();
+
parent::run();
}
}
<p>Your display name is {$contact->display_name}</p>
<p>Your contact ID is #{$contact->id}</p>
+
+<tr{if isset($element.class)} class="{$element.class}"{/if}>
+ <td>
+ <div class="header-dark">{$element.sectionTitle}</div>
+ {include file=$element.templatePath}
+ </td>
+</tr>