[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/vtlib/Vtiger/PDF/viewers/ -> PagerViewer.php (source)

   1  <?php
   2  /*+**********************************************************************************
   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   ************************************************************************************/
  10  include_once dirname(__FILE__) . '/Viewer.php';
  11  
  12  class Vtiger_PDF_PagerViewer extends Vtiger_PDF_Viewer {
  13      
  14      protected $model;
  15  
  16  	function setModel($m) {
  17          $this->model = $m;
  18      }
  19  
  20  	function totalHeight($parent) {
  21          return 10;
  22      }
  23  
  24  	function initDisplay($parent) {
  25      }
  26      
  27  	function display($parent) {
  28          $pdf = $parent->getPDF();
  29          $contentFrame = $parent->getContentFrame();
  30  
  31          $displayFormat = '-%s-';
  32          if($this->model) {
  33              $displayFormat = $this->model->get('format', $displayFormat);
  34          }
  35          $contentHeight = $pdf->GetStringHeight($displayFormat, $contentFrame->w/2.0);
  36          $pdf->MultiCell($contentFrame->w/2.0, $contentHeight, sprintf($displayFormat, $pdf->getPage()), 0, 'L', 0, 1,
  37              $contentFrame->x+$contentFrame->w/2.0, $parent->getTotalHeight());
  38      }
  39  }
  40  
  41  ?>


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1