[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qsos-commits] qsos/apps/phpviewer loadremote.php
From: |
Raphaël Semeteys |
Subject: |
[Qsos-commits] qsos/apps/phpviewer loadremote.php |
Date: |
Mon, 11 Dec 2006 18:04:41 +0000 |
CVSROOT: /sources/qsos
Module name: qsos
Changes by: Raphaël Semeteys <rsemeteys> 06/12/11 18:04:41
Added files:
apps/phpviewer : loadremote.php
Log message:
Backend to get list of available QSOS sheet (for xuleditor)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/phpviewer/loadremote.php?cvsroot=qsos&rev=1.1
Patches:
Index: loadremote.php
===================================================================
RCS file: loadremote.php
diff -N loadremote.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ loadremote.php 11 Dec 2006 18:04:41 -0000 1.1
@@ -0,0 +1,54 @@
+<?php
+include("config.php");
+$output = new DOMDocument();
+
+/*
+function newtreeitem($path, $file) {
+ global $output;
+
+ $treeitem = $output->createElement("treeitem");
+ $treeitem->setAttribute("container", "true");
+ $treeitem->setAttribute("open", "true");
+ $treerow = $output->createElement("treerow");
+ $treecell = $output->createElement("treecell");
+ $treecell->setAttribute("id", "http://localhost:88/test/OOo/".$path);
+ $treecell->setAttribute("label", $file);
+ $treerow->appendChild($treecell);
+ $treeitem->appendChild($treerow);
+ return $treeitem;
+}
+*/
+
+function buildtree($path) {
+ global $output;
+ global $delim;
+
+ $children = $output->createElement("children");
+ if (is_dir($path) && $dh = opendir($path)) {
+ while (($file = readdir($dh)) !== false) {
+ $subpath = $path.$delim.$file;
+ if (is_dir($subpath) && ($file != 'CVS') && ($file !=
'.') && ($file != '..') && ($file != 'include') && ($file != 'template') &&
($file != 'templates') && ($file != '.svn')) {
+ $newtreeitem = $output->createElement("item");
+ $newtreeitem->setAttribute("id", $subpath);
+ $newtreeitem->setAttribute("label", $file);
+ $newtreeitem->appendChild(buildtree($subpath,
$file));
+ $children->appendChild($newtreeitem);
+ } elseif (substr($file, -5) == ".qsos") {
+ $newtreeitem = $output->createElement("item");
+ $newtreeitem->setAttribute("id",
"http://localhost:88/test/OOo/".$subpath);
+ $newtreeitem->setAttribute("label", $file);
+ $children->appendChild($newtreeitem);
+ }
+ }
+ closedir($dh);
+ }
+ return $children;
+}
+
+$doc = $output->createElement("Document");
+$output->appendChild(buildtree($sheet));
+
+header('Content-type: text/xml');
+echo $output->saveXML();
+
+?>
\ No newline at end of file
- [Qsos-commits] qsos/apps/phpviewer loadremote.php,
Raphaël Semeteys <=