[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qsos-commits] qsos/apps/phpviewer QSOSDocument.php
From: |
Raphaël Semeteys |
Subject: |
[Qsos-commits] qsos/apps/phpviewer QSOSDocument.php |
Date: |
Tue, 14 Nov 2006 00:18:39 +0000 |
CVSROOT: /sources/qsos
Module name: qsos
Changes by: Raphaël Semeteys <rsemeteys> 06/11/14 00:18:39
Modified files:
apps/phpviewer : QSOSDocument.php
Log message:
getParent() function added
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/phpviewer/QSOSDocument.php?cvsroot=qsos&r1=1.3&r2=1.4
Patches:
Index: QSOSDocument.php
===================================================================
RCS file: /sources/qsos/qsos/apps/phpviewer/QSOSDocument.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- QSOSDocument.php 12 Nov 2006 11:03:04 -0000 1.3
+++ QSOSDocument.php 14 Nov 2006 00:18:39 -0000 1.4
@@ -133,6 +133,17 @@
return $authors;
}
+ //Returns the name of a criterion's parent
+ function getParent($name) {
+ $nodes = $this->xpath->query("//address@hidden'".$name."']");
+ if ($nodes->length > 0) {
+ return $nodes->item(0)->parentNode;
+ }
+ else {
+ return null;
+ }
+ }
+
//Returns: tree of QSOSCriterion objects representing the scored criteria
of the QSOS document
public function getTree() {
$tree = array();