[ 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 // Base class for Indexer_Rubrique. 20 // 21 22 require_once dirname(__FILE__). "/../Indexer.php"; 23 24 require_once dirname(__FILE__). "/../../bd/inc_rubrique_factory.php"; 25 require_once dirname(__FILE__). "/../../bd/inc_index_rubriques_factory.php"; 26 27 /** 28 * Indexer_Rubrique_common is an implementation for Common of rubrique indexer. 29 * @package indexer/common 30 * @author Erwan Le Bescond <elebescond@clever-age.com> 31 * @access public 32 */ 33 class Indexer_Rubrique_common extends Indexer { 34 35 // {{{ constructor 36 37 /** 38 * ListeAction constructor. 39 * 40 * @access public 41 */ 42 43 function Indexer_Rubrique_common () { 44 $poids = array(); 45 include (dirname(__FILE__). "/configurationRubriquePoids_common.php"); 46 47 if (file_exists(dirname(__FILE__). "/configurationRubriquePoids_" . $GLOBALS['type_indexer']. ".php")) { 48 include (dirname(__FILE__). "/configurationRubriquePoids_" . $GLOBALS['type_indexer']. ".php"); 49 } 50 51 $this->_poids = $poids; 52 53 $this->_full = false; 54 55 $this->_type = 'rubrique'; 56 } 57 58 // }}} 59 60 // {{{ 61 62 function alreadyIndex ($id_objet) { 63 $indexRubriqueMetier = &recuperer_instance_index_rubriques(); 64 return ($indexRubriqueMetier->howManyIndexRubriqueForRubriqueId($id_objet) > 0); 65 } 66 67 // }}} 68 69 // {{{ 70 71 function _indexData ($id_objet) { 72 $rubriqueMetier = &recuperer_instance_rubrique(); 73 $loadOk = $rubriqueMetier->load($id_objet); 74 75 if (PEAR::isError($loadOk)) { 76 die ($loadOk->getMessage()); 77 } 78 else { 79 $this->_indexer_chaine($rubriqueMetier->getTitre(), $this->_poids['rubrique']['titre']); 80 $this->_indexer_chaine($rubriqueMetier->getDescriptif(), $this->_poids['rubrique']['titre']); 81 if ($this->_full) { 82 $this->_indexer_chaine($rubriqueMetier->getTexte(), $this->_poids['rubrique']['titre']); 83 } 84 } 85 } 86 87 // }}} 88 89 // {{{ 90 91 function _createIndex ($id_objet) { 92 $indexRubriqueCreateMetier = &recuperer_instance_index_rubriques(); 93 94 while (list($hash, $points) = each($this->_index)) { 95 $indexRubriqueCreateMetier->setHash("0x$hash"); 96 $indexRubriqueCreateMetier->setPoints("$points"); 97 $indexRubriqueCreateMetier->setRubriqueId($id_objet); 98 $createOK = $indexRubriqueCreateMetier->create(); 99 } 100 } 101 102 // }}} 103 104 } 105 ?>
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 |