X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/53dea79e14a592c07d0211cb7a7d93949c231fe1..c3b42bba0c46c9510b6ca095dfab862ff97170e6:/lib/MECON/PDF/Marco.php?ds=sidebyside diff --git a/lib/MECON/PDF/Marco.php b/lib/MECON/PDF/Marco.php index 8d70976..397a5ae 100644 --- a/lib/MECON/PDF/Marco.php +++ b/lib/MECON/PDF/Marco.php @@ -44,7 +44,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @var array $conf * @access protected */ - var $_conf = array (); + var $_config = array (); /** * Tamanio de las paginas. @@ -124,8 +124,9 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { $this->_pdf =& new MECON_PDF; $this->_tamanio = $tam; $this->_orientacion = $ori; - $this->_conf = include 'MECON/PDF/Marco/medidas.php' ; - $this->_conf = $this->_conf[$tam][$ori]; + $this->_config = include 'MECON/PDF/Marco/medidas.php' ; + $this->_config = $this->_config[$tam][$ori]; + $this->MECON_HTML_Tabla(); } /** @@ -135,7 +136,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addLogo() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; if ($this->logo) { $this->_pdf->addImage($this->logo, $conf['logo']['X'], $conf['logo']['Y'], null, 'jpg'); @@ -149,7 +150,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addSeccion() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; if ($this->seccion) { $tmp = $this->_pdf->strlen($this->seccion, $conf['seccion']); $tmp2 = $conf['linea2']['Xi'] - $conf['linea1']['Xi']; @@ -171,7 +172,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addSubSeccion() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; if ($this->subseccion) { $tmp = $this->_pdf->strlen($this->subseccion, $conf['subseccion']); $tmp2 = $conf['linea2']['Xi'] - $conf['linea1']['Xi']; @@ -194,7 +195,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addPager() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; if ($this->paginador) { $txt = 'Pagina '.$this->_pdf->numPage().' de '. $this->_pdf->countPages(); @@ -213,7 +214,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addDate() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; if ($this->fecha) { if ($this->fecha === true) { $this->fecha = date("d/m/Y"); @@ -233,7 +234,7 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addHeaderRectangle() { - $conf = $this->_conf['encabezado']; + $conf = $this->_config['encabezado']; //Armo el recuadro $this->_pdf->addRectangle ($conf['Yi'], $conf['Xi'], $conf['Yf'], $conf['Xf']); @@ -250,16 +251,16 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addTitle() { - $conf = $this->_conf['titulo']; + $conf = $this->_config['titulo']; if ($this->titulo) { $tmp = $this->_pdf->strlen($this->titulo, $conf); - $tmp2 = $this->_conf['Xf'] + abs($this->_conf['Xi']); + $tmp2 = $this->_config['Xf'] + abs($this->_config['Xi']); if ($tmp >= $tmp2) { $this->titulo = $this->_pdf->wrapLine ($this->titulo, $tmp2, $conf); $tmp = $this->_pdf->strlen($this->titulo, $conf); } - $init = $this->_conf['Xi'] + ($tmp2 - $tmp) / 2; + $init = $this->_config['Xi'] + ($tmp2 - $tmp) / 2; $this->_pdf->addText($init, $conf['Y'], $this->titulo, $conf); } @@ -272,16 +273,16 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { * @access protected */ function _addSubTitle() { - $conf = $this->_conf['subtitulo']; + $conf = $this->_config['subtitulo']; if ($this->subtitulo) { $tmp = $this->_pdf->strlen($this->subtitulo, $conf); - $tmp2 = $this->_conf['Xf'] + abs($this->_conf['Xi']); + $tmp2 = $this->_config['Xf'] + abs($this->_config['Xi']); if ($tmp >= $tmp2) { $this->subtitulo = $this->_pdf->wrapLine ($this->subtitulo, $tmp2, $conf); $tmp = $this->_pdf->strlen($this->subtitulo, $conf); } - $init = $this->_conf['Xi'] + ($tmp2 - $tmp) / 2; + $init = $this->_config['Xi'] + ($tmp2 - $tmp) / 2; $this->_pdf->addText($init, $conf['Y'], $this->subtitulo, $conf); } @@ -309,6 +310,26 @@ class MECON_PDF_Marco extends MECON_HTML_Tabla { if ($subtitle) { $this->_addSubTitle(); } +// $this->_pdf->addLine($this->_config['Xi'], $this->_config['Yi'], +// $this->_config['Xf'], $this->_config['Yi']); } + + /** + * Funcion que devuelve el espacio dispobible en una pagina. + * + * @param int $pagina Numero de pagina. + * + * @return int + * @access protected + */ + function _getAvailableSpace($pagina) { + if ($pagina === 1) { + return $this->_config['contenido']['Y']; + } + else { + return $this->_config['titulo']['Y']; + } + } + } ?> \ No newline at end of file