[ 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 /** 20 * class PDF_SPIP extends PDF : 21 */ 22 23 class PDF_SPIP extends PDF { 24 function Header () { 25 global $titre; 26 27 //Logo 28 // $this->Image('logo.gif',10,8,33); 29 $this->SetY(10); 30 $this->SetLineWidth(0.3); 31 $this->Line($this->lMargin - 5, 20, $this->w - $this->rMargin + 5, 20); 32 33 //Police helvetica gras 8 34 $this->SetFont('helvetica', 'B', 12); 35 $this->SetTextColor(0, 0, 0); 36 37 $this->Cell(0, 10, $titre, 0, 0, 'L'); 38 $this->Ln(20); 39 } 40 41 /* /// Pied de page du document) 42 /* ///////////////////////////// */ 43 function Footer () { 44 global $conf_nom_site, $conf_url_site; 45 46 //Positionnement à 2.0 cm du bas 47 $this->SetY(-20); 48 $this->SetLineWidth(0.3); 49 $this->Line($this->lMargin - 5, $this->GetY(), $this->w - $this->rMargin + 5, $this->GetY()); 50 51 //Police helvetica 8 52 $this->SetFont('helvetica', 'I', 8); 53 $this->SetTextColor(0, 0, 0); 54 55 $this->Cell(0, 6, $conf_nom_site, 0, 0, 'L', 0, $conf_url_site); 56 57 //Numéro de page 58 $this->Cell(0, 6, 'Page ' . $this->PageNo(). '/{nb}', 0, 1, 'C'); 59 } 60 61 function TitreChapitre () { 62 global $site, $rubrique, $yahoo, $surtitre, $titre, $soustitre, $logo_fichier, $logo_lien, $date, $auteur, $descriptif; 63 64 $z = 55; 65 66 $this->Ln(45); 67 $this->SetFont('courier', '', 26); 68 $this->SetTextColor(128); 69 //Titre centré 70 $this->unhtmlentities($site); 71 $this->MultiCell(0, 9, $site, 0, 'C', 0); 72 $this->SetFont('helvetica', '', 8); 73 $this->MultiCell(0, 5, $yahoo, 0, 'C', 0); 74 //Saut de ligne 75 $this->Ln(60); 76 77 $this->SetLineWidth(0.3); 78 79 //Rubriques 80 $this->unhtmlentities($rubrique); 81 $this->SetFont('courier', '', 20); 82 $this->MultiCell($z + 20, 9, $rubrique, 0, 'L', 0); 83 $this->Ln(); 84 85 // Logo 86 $x = $this->GetX(); 87 $y = $this->GetY(); 88 89 if ($logo_fichier != "") { 90 $this->SetLink($link); 91 $this->Image('IMG/' . $logo_fichier, $x, $y, '', 20, '', $logo_lien); 92 } 93 94 $this->SetXY($x + $z + 25, $y - 16); 95 96 if ($surtitre) { 97 //Surtitre 98 $this->unhtmlentities($surtitre); 99 $this->SetX($x + $z + 25); 100 $this->SetFont('times', '', 16); 101 $this->MultiCell(0, 6, $surtitre . "\n\n", L, 'L', 0); 102 } 103 104 $this->SetTextColor(0); 105 106 //Titre 107 $this->unhtmlentities($titre); 108 $this->SetX($x + $z + 25); 109 $this->SetFont('times', 'B', 22); 110 $this->MultiCell(0, 8, $titre . "\n\n", L, 'L', 0); 111 112 if ($soustitre) { 113 //Soustitre 114 $this->unhtmlentities($soustitre); 115 $this->SetX($x + $z + 25); 116 $this->SetFont('times', '', 18); 117 $this->MultiCell(0, 6, $soustitre . "\n\n", L, 'L', 0); 118 } 119 120 if ($auteur) { 121 //Auteur 122 $this->unhtmlentities($auteur); 123 $this->SetX($x + $z + 25); 124 $this->SetFont('times', '', 16); 125 $this->MultiCell(0, 6, $auteur . "\n", L, 'R', 0); 126 } 127 128 if ($date) { 129 //Date 130 $this->unhtmlentities($date); 131 $this->SetX($x + $z + 25); 132 $this->SetFont('times', '', 12); 133 $this->MultiCell(0, 6, $date . "\n", L, 'R', 0); 134 } 135 136 if ($descriptif) { 137 // Descriptif $this->SetFont('helvetica','B',10) ; 138 $this->SetXY($this->lMargin, $y + $z - 10); 139 $this->SetFont('helvetica', 'BU', 10); 140 $this->Write(5, 'Résumé :'); 141 $this->Ln(); 142 $this->SetFont('times', '', 8); 143 $this->WriteHTML($descriptif); 144 $this->Ln(12); 145 } 146 147 $this->Ln(25); 148 } 149 150 function CorpsChapitre () { 151 global $texte, $chapo, $ps, $notes; 152 153 $this->SetFont('times'); 154 155 if ($chapo) { 156 // Chapeau 157 $this->SetFont('helvetica', 'B', 10); 158 $this->WriteHTML($chapo); 159 $this->Ln(12); 160 } 161 162 //Texte - justifie 163 $this->SetFont('helvetica', '', 10); 164 $this->WriteHTML($texte); 165 $this->Ln(12); 166 167 if ($ps) { 168 //ps 169 $this->SetFont('', 'I', 8); 170 $this->WriteHTML("Post-scriptum : "); 171 $this->WriteHTML($ps); 172 $this->Ln(8); 173 } 174 175 if ($notes) { 176 //notes 177 $this->SetFont('', '', 8); 178 $this->WriteHTML($notes); 179 $this->Ln(); 180 } 181 } 182 183 function AjouterChapitre () { 184 $this->AddPage(); 185 $this->TitreChapitre(); 186 $this->AddPage(); 187 $this->CorpsChapitre(); 188 189 // On repasse en police à la bonne taille pour le nombre de pages. 190 $this->SetFont('helvetica', 'I', 8); 191 $this->AliasNbPages(); 192 } 193 // 194 } 195 ?>
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 |