1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 23:07:59 +00:00

Working on Frontend

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@24 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
losinshi
2006-08-16 10:59:36 +00:00
parent 162879454a
commit 4249404692
4 changed files with 59 additions and 17 deletions
+8 -2
View File
@@ -14,7 +14,9 @@ class Parser{
function appendContent($newContent){
if(is_array($newContent)){
for($i = 0; $i < count($newContent); $i++){
echo "adding: ".$newContent[$i]."\n";
array_push($this->contentArray, $newContent[$i]);
echo "added: ".$this->contentArray[count($this->contentArray)-1]."\n";
}
} else {
array_push($this->contentArray, $newContent);
@@ -23,6 +25,8 @@ class Parser{
/* Zeigt den Geparsten Inhalt an */
function printContent(){
echo "\n ---- Printing ----\n";
echo "";
$array = &$this->getContentArray();
for ($i = 0; $i < count($array); $i++){
echo $array[$i];
@@ -31,20 +35,22 @@ class Parser{
function parseContent($fileName, $callingObject, $filePart=null){
echo "\n\nparse: ".$fileName."\n\n";
$fileArray = file($fileName); /* File als Array einlesen */
if($filePart != null){
$fileArray = $this->_fetchFilePart(&$fileArray, $filePart); /* Wenn File aus mehreren Template-Teilen besteht, dann wird hir der relevante Zeil geholt */
}
for($i = 0; $i < count($fileArray); $i++){ /* Das Array durchlaufen ... */
echo "Zeile: ".$i." = ".$fileArray[$i]."\n";
if(0 != preg_match_all("/\{content:([a-z]+):([a-z0-9_]+)\}/i", $fileArray[$i], $results)){
print_r($results);
//print_r($results);
for($j = 0; $j < count($results[1]); $j++){
$callingObject->$results[1][$j]($results[2][$j]);
//$fileArray[$i] = preg_replace("/\{content:fill:".$results[1][$j]."\}/i", $fileContents[$results[1][$j]], $fileArray[$i]);
}
}
}
//$this->appendContent($fileArray);
$this->appendContent($fileArray);
}