protected function ContributeManager::getOrganizationBadge in Contribute 8
Get an organization's membership badge from Drupal.org.
Return value
string An organization's membership badge from Drupal.org.
1 call to ContributeManager::getOrganizationBadge()
- ContributeManager::getMembership in src/
ContributeManager.php - Get membership status.
File
- src/
ContributeManager.php, line 578
Class
- ContributeManager
- Class ContributeManager.
Namespace
Drupal\contributeCode
protected function getOrganizationBadge() {
$organization = $this
->getOrganization();
if (!$organization) {
return '';
}
$body = $this
->get($organization['url']);
if (preg_match('#"(https://www.drupal.org/sites/all/modules/drupalorg/drupalorg/images/association_[^"]+\\.svg)"#', $body, $match)) {
return $match[1];
}
else {
return '';
}
}