Working on Frontend

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@23 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
losinshi 2006-08-16 08:58:06 +00:00
parent 89c7264674
commit 162879454a
2 changed files with 16 additions and 5 deletions

View File

@ -1,11 +1,22 @@
<?
include_once("php_inc/parser.inc.php");
class Module{
var $parserInstance = NULL; /* Parser - Instanz */
var $connectionInstance = NULL; /* Connection - Instanz */
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])
}
}

View File

@ -10,24 +10,24 @@ class ModuleSet{
/* Konstruktor */
function ModuleSet($setName){
$parser = $this->getParserInstance(); /* Parserinstanz holen */
$parser->parseContent($this->getSetFilename($setName), $this, NULL); /* Set Parsen */
$parser = $this->_getParserInstance(); /* Parserinstanz holen */
$parser->parseContent($this->_getSetFilename($setName), $this, NULL); /* Set Parsen */
}
/* Dateinamen eines Setz aus dessen Namen zusammenbauen */
function getSetFilename($setName){
function _getSetFilename($setName){
return "content/module_sets/set_".$setName.".html";
}
/* Parser Instanzieren (wenn noch nicht ist) und zurückgeben */
function getParserInstance(){
function _getParserInstance(){
if($this->parserInstance==NULL)
$parserInstance = new Parser();
return $parserInstance;
}
/* Ein Modul hinzufügen */
function addModule($modName){
function _addModule($modName){
$params = explode("_",$modName); /* Modulname und Sensorid trennen */
include("content/modules/mod_".$params[0].".html");
}