/** * Returns chart title for a prime or sub vendor page based on 'category'/'featured dashboard'/'domain' * using values from current path. * * The page title above the visualization for Prime vendor Level and Sub vendor level pages: * * 1. Follow a three-line format when the M/WBE Category is equal to any of the following: * Asian American, Black American, Women or Hispanic * 2. Follow a two-line format when the M/WBE Category is equal to any of the following: * Individual & Others or Non M/WBE * * @param string $domain * @param string $defaultTitle * @return string */ static function getTitleByVendorType($domain, $defaultTitle = 'Total Spending') { $title = $minority_category = $minority_type_id = ''; if (_checkbook_check_is_mwbe_page()) { $minority_type_id = _getRequestParamValue('mwbe'); } else { $lastReqParam = _getLastRequestParamValue(); foreach ($lastReqParam as $key => $value) { switch ($key) { case 'vendor': $minority_type_id = self::getLatestMinorityTypeByVendorType($domain, $value, VendorType::$PRIME_VENDOR); break; case 'subvendor': if ($value != 'all') { $minority_type_id = self::getLatestMinorityTypeByVendorType($domain, $value, VendorType::$SUB_VENDOR); } break; default: } } } $minority_type_ids = explode('~', $minority_type_id); $minority_category = MappingUtil::getCurrenEhtnicityName($minority_type_ids); $MWBE_certified = MappingUtil::isMWBECertified($minority_type_ids); $title = $MWBE_certified ? '<p class="sub-chart-title">M/WBE Category: ' . $minority_category . '</p>' : $minority_category . ' '; $title .= RequestUtil::getSpendingCategoryName($defaultTitle); return html_entity_decode($title); }