index f1431443cffc69c2abc8f0877408d40d5d165594..92c87511716d8da745d968cd700fa5d413b3c131 100644 (file)
--- a/include/class_config.inc
+++ b/include/class_config.inc
/* Configuration data */
var $data= array( 'TABS' => array(), 'LOCATIONS' => array(), 'SERVERS' => array(),
/* Configuration data */
var $data= array( 'TABS' => array(), 'LOCATIONS' => array(), 'SERVERS' => array(),
- 'MAIN' => array( 'FAXFORMATS' => array() ),
+ 'MAIN' => array(),
'MENU' => array(), 'SERVICE' => array());
var $basedir= "";
'MENU' => array(), 'SERVICE' => array());
var $basedir= "";
var $idepartments= array();
var $adepartments= array();
var $tdepartments= array();
var $idepartments= array();
var $adepartments= array();
var $tdepartments= array();
+ var $filename = "";
+ var $last_modified = 0;
function config($filename, $basedir= "")
{
function config($filename, $basedir= "")
{
}
}
}
}
+
+ function check_and_reload()
+ {
+ if($this->filename != "" && filemtime($this->filename) != $this->last_modified){
+
+ $this->config_found= FALSE;
+ $this->tags= array();
+ $this->level= 0;
+ $this->gpc= 0;
+ $this->section= "";
+ $this->currentLocation= "";
+
+ $this->parser = xml_parser_create();
+ xml_set_object($this->parser, $this);
+ xml_set_element_handler($this->parser, "tag_open", "tag_close");
+ $this->parse($this->filename);
+ if(isset($_SESSION['plist'])){
+ unset($_SESSION['plist']);
+ }
+ if(isset($_SESSION['plug'])){
+ unset($_SESSION['plug']);
+ }
+ if(isset($_GET['plug'])){
+ unset($_GET['plug']);
+ }
+ }
+ }
+
+
function parse($filename)
{
function parse($filename)
{
+ $this->last_modified = filemtime($filename);
+ $this->filename = $filename;
$fh= fopen($filename, "r");
$xmldata= fread($fh, 100000);
fclose($fh);
$fh= fopen($filename, "r");
$xmldata= fread($fh, 100000);
fclose($fh);
}
break;
}
break;
- /* Handle faxformat */
- case 'FAXFORMAT':
- if ($this->tags[$this->level-2] == 'MAIN'){
- /* Add fax formats */
- $this->data['MAIN']['FAXFORMATS'][]= $attrs['TYPE'];
- }
- break;
-
/* Load main parameters */
case 'MAIN':
$this->data['MAIN']= array_merge ($this->data['MAIN'], $attrs);
/* Load main parameters */
case 'MAIN':
$this->data['MAIN']= array_merge ($this->data['MAIN'], $attrs);