public function getElement($name)
{
// check if a persona is requested for this page, if yes deliver a different version of the element (prefixed)
if ($this->getUsePersona()) {
$personaName = $this->getPersonaElementName($name);
if ($this->hasElement($personaName)) {
$name = $personaName;
} else {
// if there's no dedicated content for this persona, inherit from the "original" content (unprefixed)
// and mark it as inherited so it is clear in the ui that the content is not specific to the selected persona
// replace all occurrences of the persona prefix, this is needed because of block-prefixes
$inheritedName = str_replace($this->getPersonaElementPrefix(), "", $name);
$inheritedElement = parent::getElement($inheritedName);
if ($inheritedElement) {
$inheritedElement = clone $inheritedElement;
$inheritedElement->setDao(null);
$inheritedElement->setName($personaName);
$inheritedElement->setInherited(true);
$this->setElement($personaName, $inheritedElement);
return $inheritedElement;
}
}
}
// delegate to default
return parent::getElement($name);
}