6 function __construct($name) {
9 if (is_a($file, 'SimpleXMLElement')) {
13 $this->source
= Styler
::locate ( $file );
15 catch (Exception
$e) {
19 if (! trim ( $this->source
)) {
20 Log
::warning ( 'Unable to find page contents list!' );
23 function getContents() {
24 if (!$this->source
) return false;
25 $pcl = simplexml_load_file ( $this->source
);
26 if (!$pcl) Log
::fatal('Bad pcl file '.$this->source
, QConst
::X_UNDEFINED
);
27 $ret = $this->recurseXML($pcl);
31 function recurseXML(SimpleXMLElement
$node) {
32 $childs = $node->children();
34 if (count($childs) > 0) {
35 $res = '<'.$node->getName().'>';
36 foreach ( $childs as $content ) {
37 $res .= $this->recurseXML($content);
39 $res .= '</'.$node->getName().'>';
42 $pe = new PageElement ( $node );
43 $res .= $pe->getValue ();