DirectorObjectForm: fix strange notifications

...like "The operty has been modified"
This commit is contained in:
Thomas Gelf 2016-03-17 08:47:59 +01:00
parent 7546a9db66
commit 2c8b16893c
1 changed files with 6 additions and 1 deletions

View File

@ -655,7 +655,12 @@ abstract class DirectorObjectForm extends QuickForm
protected function getObjectname() protected function getObjectname()
{ {
if ($this->objectName === null) { if ($this->objectName === null) {
return substr(join('', array_slice(explode('\\', get_class($this)), -1)), 6, -4); $className = substr(strrchr(get_class($this), '\\'), 1);
if (substr($className, 0, 6) === 'Icinga') {
return substr($className, 6, -4);
} else {
return substr($className, 0, -4);
}
} }
return $this->objectName; return $this->objectName;