00001 <?php
00007 include_once("core/modules/moduleinformation/IModuleInfoConfig.class.php");
00008 include_once("core/modules/moduleinformation/backends/ModuleInfoXmlConfigOption.class.php");
00009
00014 class ModuleInfoXmlConfig extends IModuleInfoConfig
00015 {
00016
00017 var $name;
00018 var $type;
00019 var $level;
00020 var $screennames;
00021 var $descriptions;
00022 var $defaultValue;
00023 var $options;
00024
00025
00026 var $tree;
00027
00028
00029 function ModuleInfoXmlConfig($tree)
00030 {
00031 $this->tree = $tree;
00032 $this->_ProcessTree();
00033 }
00034
00035 function _ProcessTree()
00036 {
00037 $this->name = $this->tree["attributes"]["name"];
00038 $this->type = $this->tree["attributes"]["type"];
00039 $this->level = $this->tree["attributes"]["level"];
00040
00041 foreach ($this->tree["children"] as $childtree)
00042 {
00043 $lang = $childtree["attributes"]["lang"];
00044 if (!$childtree["attributes"]["lang"])
00045 $lang = "default";
00046
00047 switch($childtree["tag"])
00048 {
00049 case "screenname":
00050 $this->screennames[$lang] = $childtree["value"];
00051 break;
00052
00053 case "description":
00054 $this->descriptions[$lang] = $childtree["value"];
00055 break;
00056
00057 case "defaultvalue":
00058 $this->defaultValue = $childtree["value"];
00059 break;
00060
00061 case "options":
00062 $this->_ProcessTreeOptions($childtree);
00063 break;
00064 }
00065 }
00066 }
00067
00068 function _ProcessTreeOptions($options)
00069 {
00070 if (count($options["children"]) > 0)
00071 {
00072 foreach($options["children"] as $option)
00073 $this->options[] = new ModuleInfoXmlConfigOption($option);
00074 }
00075 }
00076
00077 function GetName()
00078 {
00079 return $this->name;
00080 }
00081
00082 function GetType()
00083 {
00084 return $this->type;
00085 }
00086
00087 function GetLevel()
00088 {
00089 return $this->level;
00090 }
00091
00092 function GetScreenNames()
00093 {
00094 return $this->screennames;
00095 }
00096
00097 function GetDescriptions()
00098 {
00099 return $this->descriptions;
00100 }
00101
00102 function HasDefaultValue()
00103 {
00104 return isset($this->defaultValue);
00105 }
00106 function GetDefaultValue()
00107 {
00108 return $this->defaultvalue;
00109 }
00110
00111 function GetOptions()
00112 {
00113 return $this->options;
00114 }
00115 }
00116 ?>