public function getCreator($locale)
{
/* -- Cache it in our class; no need to fetch it more than once */
if (isset($this->cachedCreator[$locale])) {
return $this->cachedCreator[$locale];
}
$settings = $this->getSettings($locale);
$creator = array();
$creator['locale'] = $settings['locale'];
$creator['siteCreatorType'] = ucfirst($settings['siteCreatorType']);
$creator['siteCreatorSubType'] = "";
$creator['siteCreatorSpecificType'] = "";
/* -- Handle migrating the old way of storing siteCreatorType
$creator['siteCreatorSubType'] = $settings['siteCreatorSubType'];
$creator['siteCreatorSpecificType'] = $settings['siteCreatorSpecificType'];
if (($creator['siteCreatorType'] != "Organization") && ($creator['siteCreatorType'] != "Person"))
{
$creator['siteCreatorSubType'] = $creator['siteCreatorType'];
$creator['siteCreatorType'] = "Organization";
}
if ($creator['siteCreatorSubType'] == "Restaurant")
{
$creator['siteCreatorSpecificType'] = $creator['siteCreatorSubType'];
$creator['siteCreatorSubType'] = "LocalBusiness";
}
*/
$creator['genericCreatorName'] = $settings['genericCreatorName'];
$creator['genericCreatorAlternateName'] = $settings['genericCreatorAlternateName'];
$creator['genericCreatorDescription'] = $settings['genericCreatorDescription'];
$creator['genericCreatorUrl'] = $settings['genericCreatorUrl'];
$creator['genericCreatorImageId'] = $settings['genericCreatorImageId'];
$image = craft()->assets->getFileById($settings['genericCreatorImageId']);
if ($image) {
$creator['genericCreatorImage'] = $this->getFullyQualifiedUrl($image->url);
$creator['genericCreatorImageHeight'] = $image->getHeight();
$creator['genericCreatorImageWidth'] = $image->getWidth();
} else {
$creator['genericCreatorImage'] = '';
}
$creator['genericCreatorTelephone'] = $settings['genericCreatorTelephone'];
$creator['genericCreatorEmail'] = $settings['genericCreatorEmail'];
$creator['genericCreatorStreetAddress'] = $settings['genericCreatorStreetAddress'];
$creator['genericCreatorAddressLocality'] = $settings['genericCreatorAddressLocality'];
$creator['genericCreatorAddressRegion'] = $settings['genericCreatorAddressRegion'];
$creator['genericCreatorPostalCode'] = $settings['genericCreatorPostalCode'];
$creator['genericCreatorAddressCountry'] = $settings['genericCreatorAddressCountry'];
$creator['genericCreatorGeoLatitude'] = $settings['genericCreatorGeoLatitude'];
$creator['genericCreatorGeoLongitude'] = $settings['genericCreatorGeoLongitude'];
$creator['organizationCreatorDuns'] = $settings['organizationCreatorDuns'];
$creator['organizationCreatorFounder'] = $settings['organizationCreatorFounder'];
$creator['organizationCreatorFoundingDate'] = $settings['organizationCreatorFoundingDate'];
$creator['organizationCreatorFoundingLocation'] = $settings['organizationCreatorFoundingLocation'];
$creator['organizationCreatorContactPoints'] = $settings['organizationCreatorContactPoints'];
/* -- Handle the organization contact points */
$contactPoints = array();
if (isset($creator['organizationCreatorContactPoints']) && is_array($creator['organizationCreatorContactPoints'])) {
foreach ($creator['organizationCreatorContactPoints'] as $contacts) {
$spec = array("type" => "ContactPoint", "telephone" => $contacts['telephone'], "contactType" => $contacts['contactType']);
$contactPoints[] = $spec;
}
}
$contactPoints = array_filter($contactPoints);
$creator['contactPoint'] = $contactPoints;
if (count($creator['contactPoint']) < 1) {
unset($creator['contactPoint']);
}
$creator['personCreatorGender'] = $settings['personCreatorGender'];
$creator['personCreatorBirthPlace'] = $settings['personCreatorBirthPlace'];
$creator['corporationCreatorTickerSymbol'] = $settings['corporationCreatorTickerSymbol'];
$identity['restaurantCreatorServesCuisine'] = $settings['restaurantCreatorServesCuisine'];
$identity['restaurantCreatorMenuUrl'] = $this->getFullyQualifiedUrl($settings['restaurantCreatorMenuUrl']);
$identity['restaurantCreatorReservationsUrl'] = $this->getFullyQualifiedUrl($settings['restaurantCreatorReservationsUrl']);
$creator['genericCreatorHumansTxt'] = $settings['genericCreatorHumansTxt'];
$result = $creator;
$this->cachedCreator[$locale] = $result;
return $result;
}