function getDefaultConfig () { $config = parent::getDefaultConfig(); $config["mapping"] = "|Strasse|Plz|telefon|fax|email|url"; $config["aliases"] = "|"._("Straße:")."|"._("Ort:")."|"._("Telefon:") ."|"._("Fax:")."|"._("Email:")."|"._("Homepage:"); return $config; }
function getDefaultConfig () { global $INST_TYPE; $config = parent::getDefaultConfig(); foreach ($INST_TYPE as $type) $names .= "|{$type['name']}:"; $config["aliases"] = $names; return $config; }
/** * The constructor of a child class has to call this parent constructor! */ function ExternModule ($range_id, $module_name, $config_id = NULL, $set_config = NULL, $global_id = NULL) { foreach ($GLOBALS["EXTERN_MODULE_TYPES"] as $type => $module) { if ($module["module"] == $module_name) { $this->type = $type; break; } } // the module is called via extern.php (not via the admin area) and there is // no config_id so it's necessary to check the range_id if (!$config_id && !$this->checkRangeId($range_id)) { $this->printError(); } if (is_null($this->type)) { $this->printError(); } $this->name = $module_name; if ($config_id) { $this->config = ExternConfig::GetInstance($range_id, $module_name, $config_id); } else { $this->config = ExternConfig::GetInstance($range_id, $module_name); } // the "Main"-element is included in every module and needs information // about the data this module handles with $this->elements["Main"] = ExternElementMain::GetInstance($module_name, $this->data_fields, $this->field_names, $this->config); // instantiate the registered elements foreach ($this->registered_elements as $name => $registered_element) { if (is_int($name) || !$name) { $this->elements[$registered_element] = ExternElement::GetInstance($this->config, $registered_element); } else { $this->elements[$name] = ExternElement::GetInstance($this->config, $registered_element); $this->elements[$name]->name = $name; } } if ($set_config && !$config_id) { $config = $this->getDefaultConfig(); $this->config->setDefaultConfiguration($config); } // overwrite modules configuration with global configuration if (!is_null($global_id)) { $this->config->setGlobalConfig(ExternConfig::GetInstance($range_id, $module_name, $global_id), $this->registered_elements); } $this->setup(); }