mirror of
https://github.com/silverstripe/silverstripe-translatable
synced 2024-10-22 11:05:59 +02:00
SilverStripe coding convetions
This commit is contained in:
parent
03722d2a8e
commit
a66de759bb
@ -1466,21 +1466,18 @@ class Translatable extends DataExtension implements PermissionProvider {
|
||||
*/
|
||||
function MetaTags(&$tags) {
|
||||
$template = '<link rel="alternate" type="text/html" title="%s" hreflang="%s" href="%s" />' . "\n";
|
||||
$translations = $this->owner->getTranslations();
|
||||
$translations = $this->owner->getTranslations();
|
||||
if($translations) {
|
||||
$tags .= sprintf($template,
|
||||
Convert::raw2xml($this->owner->Title),
|
||||
i18n::convert_rfc1766($this->owner->Locale),
|
||||
$this->owner->AbsoluteLink()
|
||||
);
|
||||
|
||||
foreach($translations as $translation) {
|
||||
$translations = $translations->toArray();
|
||||
$translations[] = $this->owner;
|
||||
|
||||
foreach($translations as $translation) {
|
||||
$tags .= sprintf($template,
|
||||
Convert::raw2xml($translation->Title),
|
||||
i18n::convert_rfc1766($translation->Locale),
|
||||
$translation->AbsoluteLink()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user