cvs: docweb /templates/all/www phpt_list.tpl.php /www phpt_generator.php
[email protected] ("Etienne Kneuss")
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <cvscolder1164653421@cvsserver> |
colder Mon Nov 27 18:50:21 2006 UTC
Modified files:
/docweb/templates/all/www phpt_list.tpl.php
/docweb/www phpt_generator.php
Log:
Add a "Generate all" button
http://cvs.php.net/viewvc.cgi/docweb/templates/all/www/phpt_list.tpl.php?r1=1.1&r2=1.2&diff_format=u
Index: docweb/templates/all/www/phpt_list.tpl.php
diff -u docweb/templates/all/www/phpt_list.tpl.php:1.1 docweb/templates/all/www/phpt_list.tpl.php:1.2
--- docweb/templates/all/www/phpt_list.tpl.php:1.1 Tue Oct 3 23:22:29 2006
+++ docweb/templates/all/www/phpt_list.tpl.php Mon Nov 27 18:50:21 2006
@@ -10,7 +10,8 @@
<h1>&docweb.phpt.list;</h1>
-<a href="?import">&docweb.phpt.import;</a><br /><br />
+<a href="?import">&docweb.phpt.import;</a><br />
+<a href="?generateAll">&docweb.phpt.generateall;</a><br /><br />
<form action="phpt_generator.php" method="post" class="phpt">
http://cvs.php.net/viewvc.cgi/docweb/www/phpt_generator.php?r1=1.1&r2=1.2&diff_format=u
Index: docweb/www/phpt_generator.php
diff -u docweb/www/phpt_generator.php:1.1 docweb/www/phpt_generator.php:1.2
--- docweb/www/phpt_generator.php:1.1 Tue Oct 3 23:22:29 2006
+++ docweb/www/phpt_generator.php Mon Nov 27 18:50:21 2006
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: Etienne Kneuss <[email protected]> |
+----------------------------------------------------------------------+
-$Id: phpt_generator.php,v 1.1 2006/10/03 23:22:29 colder Exp $
+$Id: phpt_generator.php,v 1.2 2006/11/27 18:50:21 colder Exp $
*/
require_once '../include/init.inc.php';
@@ -49,7 +49,27 @@
exit;
}
+/**
+ * Generate every tests
+ */
+if (isset($_REQUEST['generateAll'])) {
+
+ $sql_query = 'SELECT id
+ FROM tests
+ WHERE flags & '.PHPT_FLAG_FILLED;
+
+ $results = sqlite_query($sqlite, $sql_query);
+ $ids = array();
+
+ while($row = sqlite_fetch_array($results, SQLITE_ASSOC)) {
+ $ids[] = $row['id'];
+ }
+
+ phpt_generate_list($sqlite, $ids);
+
+ exit;
+}
/**
* Generate one test