import mtweb.0.4.1
[mtweb] / web / app / data / modules / share / mw_data_out_config.php
1 <?php
2
3   class mw_data_out_config extends mw_data
4   {
5
6     function out_config()
7     { $env = $this->env();
8       $config = array();
9       if($env->out_file_exists("config.xml"))
10       { if($this->buffer = file_get_contents($env->out_file("config.xml")))
11         { if(!isset($this->sxml)) $this->sxml = new sxml();
12           $this->sxml->parse($this->buffer);
13           $this->buffer = $this->sxml->data["config"][0];
14           if($this->buffer["subs"]) foreach($this->buffer["subs"] as $key => $value)
15           { $config[$key] = array
16             ( "type" => $value[0]["attrs"]["type"],
17               "default" => $value[0]["attrs"]["default"],
18               "text" => $value[0]["data"]
19             );
20           }
21         }
22         else $config = false;
23       }
24       return $config;
25     }
26
27   }
28
29 ?>