Working on Frontend
git-svn-id: file:///home/jan/tmp/wetterstation/trunk@23 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
parent
89c7264674
commit
162879454a
|
|
@ -1,11 +1,22 @@
|
||||||
<?
|
<?
|
||||||
|
include_once("php_inc/parser.inc.php");
|
||||||
|
|
||||||
class Module{
|
class Module{
|
||||||
|
|
||||||
var $parserInstance = NULL; /* Parser - Instanz */
|
var $parserInstance = NULL; /* Parser - Instanz */
|
||||||
var $connectionInstance = NULL; /* Connection - Instanz */
|
var $connectionInstance = NULL; /* Connection - Instanz */
|
||||||
|
|
||||||
function Module($modName, $sensId, $parser, $connection){
|
function Module($modName, $sensId, $parser, $connection){
|
||||||
|
$parser->parseContent($this->_getModuleFilename($modName));
|
||||||
|
}
|
||||||
|
|
||||||
|
function _getModuleFilename($modName){
|
||||||
|
return "/content/modules/mod_".$modName.".html";
|
||||||
|
}
|
||||||
|
|
||||||
|
function fill($contentId){
|
||||||
|
$content_split = explode("_", $contentId);
|
||||||
|
return $this->"get".$content_split[0]($content_split[1])
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,24 +10,24 @@ class ModuleSet{
|
||||||
|
|
||||||
/* Konstruktor */
|
/* Konstruktor */
|
||||||
function ModuleSet($setName){
|
function ModuleSet($setName){
|
||||||
$parser = $this->getParserInstance(); /* Parserinstanz holen */
|
$parser = $this->_getParserInstance(); /* Parserinstanz holen */
|
||||||
$parser->parseContent($this->getSetFilename($setName), $this, NULL); /* Set Parsen */
|
$parser->parseContent($this->_getSetFilename($setName), $this, NULL); /* Set Parsen */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dateinamen eines Setz aus dessen Namen zusammenbauen */
|
/* Dateinamen eines Setz aus dessen Namen zusammenbauen */
|
||||||
function getSetFilename($setName){
|
function _getSetFilename($setName){
|
||||||
return "content/module_sets/set_".$setName.".html";
|
return "content/module_sets/set_".$setName.".html";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parser Instanzieren (wenn noch nicht ist) und zurückgeben */
|
/* Parser Instanzieren (wenn noch nicht ist) und zurückgeben */
|
||||||
function getParserInstance(){
|
function _getParserInstance(){
|
||||||
if($this->parserInstance==NULL)
|
if($this->parserInstance==NULL)
|
||||||
$parserInstance = new Parser();
|
$parserInstance = new Parser();
|
||||||
return $parserInstance;
|
return $parserInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ein Modul hinzufügen */
|
/* Ein Modul hinzufügen */
|
||||||
function addModule($modName){
|
function _addModule($modName){
|
||||||
$params = explode("_",$modName); /* Modulname und Sensorid trennen */
|
$params = explode("_",$modName); /* Modulname und Sensorid trennen */
|
||||||
include("content/modules/mod_".$params[0].".html");
|
include("content/modules/mod_".$params[0].".html");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue