linea21-utils
[ class tree: linea21-utils ] [ index: linea21-utils ] [ all elements ]

Source for file extendedTCPDF.php

Documentation is available at extendedTCPDF.php

  1. <?php
  2. /**
  3.  * @package linea21.utils
  4.  * @subpackage report_sdi
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  *  Define, compose and generate a SDI (Sustainable Development Indicators) PDF report
  10.  */
  11.  
  12. // extended TCPF with custom functions
  13. class eTCPDF extends TCPDF {
  14.  
  15.  
  16.   //Page header
  17.   public function Header() {
  18.  
  19.     global $report_settings;
  20.     global $lang;
  21.     // Logo
  22.     $image_file = themePath('../report_sdi/inc_report/logo_p.png', THEME_ADMIN_PATH);
  23.     $this->Image($image_file, 20, 10, 15, '', '', '', 'T', false, 300, '', false, false, 0, false, false, false);
  24.  
  25.     $today = date("d/m/Y");
  26.     $content = formatText($report_settings['title']) .' - '. SITE_NAME;
  27.  
  28.     $this->SetTextColorArray(getColor('DOC_COLOR_HEADER'));
  29.     $this->SetFont(DOC_POLICE, 'B', MIN_SIZE);
  30.     // Title
  31.     $this->Cell(0, MIN_SIZE, SITE_NAME . ' - ' .$today, 0, 1, 'R', 0, '', 0, false, 'M', 'M');
  32.     $this->SetFont(DOC_POLICE, '', MIN_SIZE);
  33.     $this->Cell(0, MIN_SIZE, $content, 0, 1, 'R', 0, '', 0, false, 'M', 'M');
  34.     $this->SetLineStyle(array('color'=> array(100,100,100)));
  35.     $this->Line($this->GetX(), $this->GetY(), $this->GetX()+180, $this->GetY());
  36.   }
  37.  
  38.  
  39.   // Page footer
  40.   public function Footer() {
  41.  
  42.     global $report_settings;
  43.     global $lang;
  44.     $content = $report_settings['author'];
  45.     if(!empty($report_settings['mail_author']))  {
  46.       $content .= ' ('.$report_settings['mail_author'].')';
  47.       $mailto='mailto:'.$report_settings['mail_author'];
  48.     } else $mailto='';
  49.     $content_comp= !empty($report_settings['service_author']) ? ' -- '.$report_settings['service_author'] : '';
  50.     $content_comp.= !empty($report_settings['adress_author']) ? ' -- '.$report_settings['adress_author'] : '';
  51.  
  52.     $this->SetTextColorArray(getColor('DOC_COLOR_HEADER'));
  53.     $this->SetFont(DOC_POLICE, '', MIN_SIZE);
  54.     $this->SetY(-10);
  55.     $this->SetLineStyle(array('color'=> array(100,100,100)));
  56.     $this->Line($this->GetX(), $this->GetY(), $this->GetX()+180, $this->GetY());
  57.  
  58.     $this->Cell($this->GetStringWidth($content), MIN_SIZE, $content, 0, 0, 'L', 0, $mailto);
  59.       $this->Cell(0, MIN_SIZE, $content_comp, 0, 0, 'L');
  60.       $this->Cell(0, MIN_SIZE, $lang['divers']['page'].' ' . $this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, 0, 'R');
  61.   
  62.   }
  63.  
  64. }
  65. ?>

Documentation generated on Thu, 03 May 2012 15:04:33 +0200 by phpDocumentor 1.4.1