$callable, 'group' => $groupName ); } private function init() { if(self::$_initialized === false) { $alle = glob(dirname(__FILE__).'/../../extends/emailtemplates/*.inc.php'); foreach($alle as $datei) { include_once(realpath($datei)); } } } public function getAllTemplates($moduleName) { $this->init(); $return = array(); foreach(self::$Register as $hash => $callable) { $result = call_user_func_array(array($callable['class'], 'getAllTemplates'), array($moduleName)); if(!empty($result)) { $final = array(); foreach($result as $id => $name) { $final['s#V2#'.$hash.'-'.$id] = $name; } $return[$callable['group']] = $final; } } return $return; } public function getTemplate($key, VTEntity $context) { $key = str_replace('s#V2#', '', $key); $parts = explode('-', $key); $this->init(); $callable = self::$Register[$parts[0]]['class']; $result = call_user_func_array(array($callable, 'getTemplate'), array($parts[1], $context)); return $result; } }