| 1 |
<?php |
<?php |
| 2 |
/** |
/** |
| 3 |
* @version $Id: pdf.php,v 1.1 2005/07/22 01:57:13 eddieajau Exp $ |
* @package Mambo Open Source |
| 4 |
* @package Mambo |
* @copyright (C) 2005 - 2006 Mambo Foundation Inc. |
|
* @copyright (C) 2000 - 2005 Miro International Pty Ltd |
|
| 5 |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL |
| 6 |
|
* |
| 7 |
|
* Mambo was originally developed by Miro (www.miro.com.au) in 2000. Miro assigned the copyright in Mambo to The Mambo Foundation in 2005 to ensure |
| 8 |
|
* that Mambo remained free Open Source software owned and managed by the community. |
| 9 |
* Mambo is Free Software |
* Mambo is Free Software |
| 10 |
* Created by Phil Taylor me@phil-taylor.com |
*/ |
|
* Support file to display PDF Text Only using class from - http://www.ros.co.nz/pdf/readme.pdf |
|
|
* HTMLDoc is available from: http://www.easysw.com/htmldoc and needs installing on the server for better HTML to PDF conversion |
|
|
**/ |
|
| 11 |
|
|
| 12 |
/** ensure this file is being included by a parent file */ |
/** ensure this file is being included by a parent file */ |
| 13 |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); |
| 14 |
|
|
| 15 |
|
require_once($mosConfig_absolute_path.'/components/com_content/content.class.php'); |
| 16 |
global $mosConfig_offset, $mosConfig_hideAuthor, $mosConfig_hideModifyDate, $mosConfig_hideCreateDate, $mosConfig_live_site; |
global $mosConfig_offset, $mosConfig_hideAuthor, $mosConfig_hideModifyDate, $mosConfig_hideCreateDate, $mosConfig_live_site; |
| 17 |
|
|
| 18 |
function dofreePDF ( $database ) { |
function dofreePDF ( $database ) { |
| 63 |
$pdf->line( 10, 40, 578, 40 ); |
$pdf->line( 10, 40, 578, 40 ); |
| 64 |
$pdf->line( 10, 822, 578, 822 ); |
$pdf->line( 10, 822, 578, 822 ); |
| 65 |
$pdf->addText( 30, 34, 6, $mosConfig_live_site .' - '. $mosConfig_sitename ); |
$pdf->addText( 30, 34, 6, $mosConfig_live_site .' - '. $mosConfig_sitename ); |
| 66 |
$pdf->addText( 250, 34, 6, 'Powered by Mambo' ); |
$pdf->addText( 250, 34, 6, T_('Powered by Mambo') ); |
| 67 |
$pdf->addText( 450, 34, 6, 'Generated: '. date( 'j F, Y, H:i', time() + $mosConfig_offset*60*60 ) ); |
$pdf->addText( 450, 34, 6, T_('Generated:'). date( 'j F, Y, H:i', time() + $mosConfig_offset*60*60 ) ); |
| 68 |
|
|
| 69 |
$pdf->restoreState(); |
$pdf->restoreState(); |
| 70 |
$pdf->closeObject(); |
$pdf->closeObject(); |
| 91 |
if ( $mosConfig_hideAuthor == "0" ) { |
if ( $mosConfig_hideAuthor == "0" ) { |
| 92 |
if ( $row->author != '' && $mosConfig_hideAuthor == '0' ) { |
if ( $row->author != '' && $mosConfig_hideAuthor == '0' ) { |
| 93 |
if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') { |
if ($row->usertype == 'administrator' || $row->usertype == 'superadministrator') { |
| 94 |
$txt2 .= _WRITTEN_BY .' '. ( $row->created_by_alias ? $row->created_by_alias : $row->author ); |
$txt2 .= T_('Written by') .' '. ( $row->created_by_alias ? $row->created_by_alias : $row->author ); |
| 95 |
} else { |
} else { |
| 96 |
$txt2 .= _AUTHOR_BY .' '. ( $row->created_by_alias ? $row->created_by_alias : $row->author ); |
$txt2 .= T_('Contributed by') .' '. ( $row->created_by_alias ? $row->created_by_alias : $row->author ); |
| 97 |
} |
} |
| 98 |
} |
} |
| 99 |
} |
} |
| 100 |
|
|
| 101 |
if ( $mosConfig_hideModifyDate == "0" ) { |
if ( $mosConfig_hideModifyDate == "0" ) { |
| 102 |
$txt2 .= ' - '. _LAST_UPDATED .' ('. $mod_date .') '; |
$txt2 .= ' - '. T_('Last Updated') .' ('. $mod_date .') '; |
| 103 |
} |
} |
| 104 |
|
|
| 105 |
$txt2 .= "\n\n"; |
$txt2 .= "\n\n"; |
| 117 |
|
|
| 118 |
function get_php_setting ($val ) { |
function get_php_setting ($val ) { |
| 119 |
$r = ( ini_get( $val ) == '1' ? 1 : 0 ); |
$r = ( ini_get( $val ) == '1' ? 1 : 0 ); |
| 120 |
return $r ? 'ON' : 'OFF'; |
return $r ? T_('ON') : T_('OFF'); |
| 121 |
} |
} |
| 122 |
|
|
| 123 |
dofreePDF ( $database ); |
dofreePDF ( $database ); |