[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 require_once(dirname(__FILE__). "/dxs_object.php"); 20 21 require_once(dirname(__FILE__). "/../bd/inc_rubrique_factory.php"); 22 23 //XXX BUG dans Agora: 24 //require_once (dirname(__FILE__)."../../../mes_options.php"); 25 26 define('MY_NAMESPACE', 'http://www.clever-age.com/DXS:1.2'); 27 /** 28 * The representation of an item. 29 * XXX Hmm... Does is make sense to inherit from DXS_Object ?? 30 * @package DXS 31 * @author Maciek Borowka <maciek@clever-age.com> 32 * @access public 33 */ 34 class DXS_Item { 35 36 // {{{ properties 37 38 var $_url; 39 var $_titre; 40 var $_description; 41 var $_itemType; 42 var $_pubDate; 43 var $_updateDate; 44 45 // }}} 46 47 // {{{ constructor 48 49 /** 50 * DXS_Item constructor. 51 * @access public 52 */ 53 function DXS_Item () { } 54 55 // }}} 56 57 // {{{ initItem 58 59 /** 60 * Intializes the item from the data 61 * in the xml tree node. 62 * Warning, no error checking is performed in this method. 63 * Returns true or false if operation fails. 64 * @access public 65 */ 66 function initItem ($xmlTreeNode) { 67 $max_child = count($xmlTreeNode->children); 68 69 if ($xmlTreeNode->getAttribute('xmlns') != MY_NAMESPACE) 70 return FALSE; 71 //echo "<p>namespace du item: '".$xmlTreeNode->getAttribute('xmlns')."'</p>"; 72 73 //echo "<p>DXS_Item:parseItem we have $max_child children</p>"; 74 75 for ($i = 0; $i < $max_child; $i++) { 76 //echo '<p>DXS_Item: child: '.$xmlTreeNode->children[$i]->name.' Value: '; 77 //echo $xmlTreeNode->children[$i]->content.'</p>'; 78 switch ($xmlTreeNode->children[$i]->name) { 79 case "type": 80 { 81 $this->_itemType = $xmlTreeNode->children[$i]->content; 82 break; 83 } 84 85 case "pubDate": 86 { 87 $this->_pubDate = $xmlTreeNode->children[$i]->content; 88 break; 89 } 90 91 case "updateDate": 92 { 93 $this->_updateDate = $xmlTreeNode->children[$i]->content; 94 break; 95 } 96 97 case "url": 98 { 99 $this->_url = $xmlTreeNode->children[$i]->content; 100 break; 101 } 102 103 case "title": 104 { 105 $this->_titre = $xmlTreeNode->children[$i]->content; 106 break; 107 } 108 109 case "description": 110 { 111 $this->_description = $xmlTreeNode->children[$i]->content; 112 break; 113 } 114 } 115 } 116 117 return TRUE; 118 } 119 120 // }}} 121 122 } 123 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |