public function getNamespacePrefix($section = 'auto')
{
// Get the namespaces for the front-end and back-end parts of the component
$frontEndNamespace = '\\' . $this->componentNamespace . '\\Site\\';
$backEndNamespace = '\\' . $this->componentNamespace . '\\Admin\\';
// Special case: if the frontend and backend paths are identical, we don't use the Site and Admin namespace
// suffixes after $this->componentNamespace (so you may use FOF with JApplicationWeb apps)
if ($this->frontEndPath == $this->backEndPath) {
$frontEndNamespace = '\\' . $this->componentNamespace . '\\';
$backEndNamespace = '\\' . $this->componentNamespace . '\\';
}
switch ($section) {
default:
case 'auto':
if ($this->platform->isBackend()) {
return $backEndNamespace;
} else {
return $frontEndNamespace;
}
break;
case 'inverse':
if ($this->platform->isBackend()) {
return $frontEndNamespace;
} else {
return $backEndNamespace;
}
break;
case 'site':
return $frontEndNamespace;
break;
case 'admin':
return $backEndNamespace;
break;
}
}