[Projeler-commits] r170 - in docume: _db lib test

projeler-uludag at uludag.org.tr projeler-uludag at uludag.org.tr
27 Eyl 2006 Çar 23:01:33 EEST


Author: gokmen.goksel
Date: Wed Sep 27 23:01:31 2006
New Revision: 170

Modified:
   docume/_db/sample.xml
   docume/lib/xhtml.php
   docume/test/index.php
   docume/test/style.css
Log:
build capabilities for given table name.

Modified: docume/_db/sample.xml
=================================================================
--- docume/_db/sample.xml	(original)
+++ docume/_db/sample.xml	Wed Sep 27 23:01:31 2006
@@ -7,11 +7,17 @@
 <sign>Tubitak/Uekae - Pardus Projesi</sign>
 
     <table name="pages">
-        <field name="Title" type="char" size="200">asdasdasd</field>
-        <field name="NiceTitle" type="char" size="200">assvxv</field>
-        <field name="Lang" type="set" values="TR,EN">EN</field>
+        <field name="Title" type="char" size="200"></field>
+        <field name="NiceTitle" type="char" size="200"></field>
+        <field name="Lang" type="set" values="TR,EN">TR</field>
         <field name="Modules" type="char" size="200"></field>
         <field name="Content" type="text"></field>
     </table>
+    
+    <table name="news">
+        <field name="Title" type="char" size="200"></field>
+        <field name="NiceTitle" type="char" size="200"></field>
+        <field name="Lang" type="set" values="TR,EN">TR</field>
+    </table>
 
 </docume>

Modified: docume/lib/xhtml.php
=================================================================
--- docume/lib/xhtml.php	(original)
+++ docume/lib/xhtml.php	Wed Sep 27 23:01:31 2006
@@ -10,9 +10,11 @@
                 $this->vezir=$Vezir;
         }
 
-        function Build($xml,$method="GET") {
+        function Build($xml,$show,$method="GET") {
             foreach ($xml->table as $tables){
-                $ret = "<h3>".$xml->name."</h3>\n";
+                $show=="all"?$que="all":$que=$tables['name'];
+                if ($show==$que){
+                $ret.= "<h3>".$xml->name." :: ".$tables['name']." table </h3>\n";
                 $ret.= "<form action='?' method='$method' id='".$tables['name']."' class='cssform'>\n";
                 foreach ($tables->field as $fields){
                     $ret.="<p><label for='{$fields['name']}'>{$fields['name']}</label>\n";
@@ -38,12 +40,13 @@
                         <input type='submit' value='Submit' />\n
                         <input type='reset' value='Reset' />\n
                        </p></form>";
+                }
             }
             return $ret;
         }
 
-        function ParseForms(){
-            echo $this->Build($this->xml);
+        function ParseForms($show="all"){
+            echo $this->Build($this->xml,$show);
         }
     }
 

Modified: docume/test/index.php
=================================================================
--- docume/test/index.php	(original)
+++ docume/test/index.php	Wed Sep 27 23:01:31 2006
@@ -25,7 +25,7 @@
             $xml=get_xml($file_);
 
             $xhtml = new MakeForms($xml);
-            $xhtml->ParseForms();
+            $xhtml->ParseForms("news");
 
             return;
         }

Modified: docume/test/style.css
=================================================================
--- docume/test/style.css	(original)
+++ docume/test/style.css	Wed Sep 27 23:01:31 2006
@@ -1,5 +1,5 @@
 .cssform p{
-width: 300px;
+width: 50%;
 clear: left;
 margin: 0;
 padding: 5px 0 8px 0;
@@ -20,8 +20,8 @@
 }
 
 .cssform textarea{
-width: 300px;
-height: 150px;
+width: 100%;
+height: 300px;
 }
 
 * html .threepxfix{



Projeler-commits mesaj listesiyle ilgili daha fazla bilgi