X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_plugin.inc;h=953f18ddaab3023caf0e722c82c3ce6e4a25aa6e;hb=b6ceb3ba053010e9a0559d2569e29c229bafeeaa;hp=bb7d7354c19c2d5d4cb24ff415cccf6e5060ae12;hpb=8835813a83be7453c24f74652f64a4ab96f734c8;p=gosa.git diff --git a/include/class_plugin.inc b/include/class_plugin.inc index bb7d7354c..953f18dda 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -141,10 +141,10 @@ class plugin /* Get LDAP descriptor */ $ldap= $this->config->get_ldap_link(); - if ($dn != NULL){ + if ($dn !== NULL){ /* Load data to 'attrs' and save 'dn' */ - if ($parent != NULL){ + if ($parent !== NULL){ $this->attrs= $parent->attrs; } else { $ldap->cat ($dn); @@ -400,15 +400,12 @@ class plugin $message= array(); /* Skip if we've no config object */ - if (!isset($this->config)){ + if (!isset($this->config) || !is_object($this->config)){ return $message; } /* Find hooks entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "CHECK"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "CHECK"); - } + $command= $this->config->search(get_class($this), "CHECK", array('menu', 'tabs')); if ($command != ""){ @@ -569,10 +566,7 @@ class plugin function postcreate($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTCREATE"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTCREATE"); - } + $command= $this->config->search(get_class($this), "POSTCREATE",array('menu', 'tabs')); if ($command != ""){ @@ -604,10 +598,7 @@ class plugin function postmodify($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTMODIFY"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTMODIFY"); - } + $command= $this->config->search(get_class($this), "POSTMODIFY",array('menu','tabs')); if ($command != ""){ @@ -639,11 +630,7 @@ class plugin function postremove($add_attrs= array()) { /* Find postremove entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTREMOVE"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTREMOVE"); - } - + $command= $this->config->search(get_class($this), "POSTREMOVE",array('menu','tabs')); if ($command != ""){ /* Additional attributes */ @@ -1422,7 +1409,7 @@ class plugin $this->snapDialog = NULL; } - if($this->snapDialog){ + if(is_object($this->snapDialog )){ $this->snapDialog->save_object(); return($this->snapDialog->execute()); }