[Projeler-commits] r171 - in docume: lib test
projeler-uludag at uludag.org.tr
projeler-uludag at uludag.org.tr
28 Eyl 2006 Per 00:16:44 EEST
Author: gokmen.goksel
Date: Thu Sep 28 00:16:43 2006
New Revision: 171
Modified:
docume/lib/xhtml.php
docume/lib/xml.php
docume/test/index.php
docume/test/style.css
Log:
xmli set edebilelim,istediğimiz tabloyla iş yapabilelim..
Modified: docume/lib/xhtml.php
=================================================================
--- docume/lib/xhtml.php (original)
+++ docume/lib/xhtml.php Thu Sep 28 00:16:43 2006
@@ -3,6 +3,7 @@
class MakeForms {
public $vezir;
+ public $xml;
function MakeForms($xml,$Vezir=false){
$this->xml = $xml;
Modified: docume/lib/xml.php
=================================================================
--- docume/lib/xml.php (original)
+++ docume/lib/xml.php Thu Sep 28 00:16:43 2006
@@ -10,24 +10,19 @@
return 0;
}
- function get_node($xml,$node,$field){
- $i=0;
- foreach ($xml->page as $pages){
- if ($i==$node){
- switch($field) {
- case "content":
- return $pages->content;
- break;
- case "list":
- return $pages->content->list;
- break;
- case "header":
- return $pages->header;
- break;
+ function set_($xml,$table,$field,$value){
+ $k=$j=0;
+ foreach ($xml->table as $tables){
+ if ($table==$tables['name']){
+ foreach ($tables->field as $fields){
+ if ($fields['name']==$field)
+ $xml->table[$k]->field[$j]=$value;
+ else
+ $j++;
}
- }
- else $i++;
+ } else $k++;
}
+ return $xml;
}
?>
Modified: docume/test/index.php
=================================================================
--- docume/test/index.php (original)
+++ docume/test/index.php Thu Sep 28 00:16:43 2006
@@ -25,6 +25,17 @@
$xml=get_xml($file_);
$xhtml = new MakeForms($xml);
+
+ # get the table name form address bar..
+ if (isset($_GET["table"])) $table=$_GET["table"];else $table="all";
+
+ $xhtml->ParseForms($table);
+
+ # set_ (xml_handle,table,field,value)...
+ set_($xml,"news","Title","Gökmen");
+ set_($xml,"news","Lang","EN");
+
+ $xhtml->xml = $xml;
$xhtml->ParseForms("news");
return;
@@ -32,12 +43,13 @@
}
# file list..
- if ($handle = opendir("../_db/"))
+ if ($handle = opendir("../_db/")){
while (false !== ($file=readdir($handle)))
if ($file<>"." and $file<>"..")
echo "<a href='{$PHP_SELF}?file=$file'>$file</a><br/> ";
else
echo "$file<br/>";
+ }
?>
</body>
Modified: docume/test/style.css
=================================================================
--- docume/test/style.css (original)
+++ docume/test/style.css Thu Sep 28 00:16:43 2006
@@ -4,7 +4,7 @@
margin: 0;
padding: 5px 0 8px 0;
padding-left: 155px;
-border-top: 1px dashed gray;
+border-top: 1px dotted gray;
height: 1%;
}
Projeler-commits mesaj listesiyle ilgili
daha fazla bilgi