diff --git a/plugin/test2pdf/database.php b/plugin/test2pdf/database.php index 274af067c0..242c751d5a 100644 --- a/plugin/test2pdf/database.php +++ b/plugin/test2pdf/database.php @@ -24,4 +24,4 @@ $sql = "CREATE TABLE IF NOT EXISTS $table ( enable INT(1) )"; Database::query($sql); -*/ \ No newline at end of file +*/ diff --git a/plugin/test2pdf/install.php b/plugin/test2pdf/install.php index cc1072c239..aa7790c5ef 100644 --- a/plugin/test2pdf/install.php +++ b/plugin/test2pdf/install.php @@ -10,6 +10,6 @@ */ require_once dirname(__FILE__) . '/config.php'; if (!api_is_platform_admin()) { - die ('You must have admin permissions to install plugins'); + die('You must have admin permissions to install plugins'); } Test2pdfPlugin::create()->install(); diff --git a/plugin/test2pdf/lang/english.php b/plugin/test2pdf/lang/english.php index 4f3a20b834..a89330c870 100644 --- a/plugin/test2pdf/lang/english.php +++ b/plugin/test2pdf/lang/english.php @@ -13,4 +13,3 @@ $strings['PluginDisabledFromAdminPanel'] = "The plugin has been disabled from th $strings['AnswersColumn'] = "Answers: "; $strings['Statement']= "Statement"; $strings['PageX']= "Page %s"; - diff --git a/plugin/test2pdf/plugin.php b/plugin/test2pdf/plugin.php index 5c5704d993..4a862cb5c1 100644 --- a/plugin/test2pdf/plugin.php +++ b/plugin/test2pdf/plugin.php @@ -7,6 +7,6 @@ */ /** * Plugin details (must be present) - */ + */ require_once dirname(__FILE__) . '/config.php'; $plugin_info = Test2pdfPlugin::create()->get_info(); diff --git a/plugin/test2pdf/src/download-pdf.php b/plugin/test2pdf/src/download-pdf.php index 1406e92ec1..47752a5e4b 100644 --- a/plugin/test2pdf/src/download-pdf.php +++ b/plugin/test2pdf/src/download-pdf.php @@ -13,8 +13,8 @@ require_once 'test2pdf_plugin.class.php'; $test2pdfPlugin = Test2pdfPlugin::create(); $enable = $test2pdfPlugin->get('enable_plugin'); -if($enable != "true"){ - header('Location: ../../../index.php'); +if ($enable != "true") { + header('Location: ../../../index.php'); } require('../class/fpdf.php'); @@ -26,214 +26,216 @@ $id_quiz = (int) $_GET['id_quiz']; class PDF extends FPDF { - function Header() - { - global $title_course; - global $title_quiz; + public function Header() + { + global $title_course; + global $title_quiz; - $logo = '../resources/img/logo.png'; - $this->Image($logo,10,0); - - // Title - $this->SetFont('Courier','I',14); - $this->Cell(0,5,$title_course,0,1,'R'); - $this->SetFont('Helvetica','I',14); - $this->Cell(0,5,$title_quiz,0,1,'R'); - - // Line break - $this->SetLineWidth(0.5); - $this->SetDrawColor(60,120,255); - $this->Line(10, 24, 200, 24); - $this->SetLineWidth(0.4); - $this->SetDrawColor(200); - $this->Line(11, 24.5, 199, 24.5); - $this->Ln(10); - } - - function Footer() - { - global $test2pdfPlugin; - // Position at 1.5 cm from bottom - $this->SetY(-15); - $y = $this->GetY(); - // Line break - $this->SetLineWidth(0.5); - $this->SetDrawColor(60,120,255); - $this->Line(10, $y, 200, $y); - $this->SetLineWidth(0.4); - $this->SetDrawColor(200); - $this->Line(11, $y+0.5, 199, $y+0.5); - - - // Arial italic 8 - $this->SetFont('Arial','I',8); - // Text color in gray - $this->SetTextColor(128); - // Page number - $this->Cell(0,10,utf8_decode(sprintf($test2pdfPlugin->get_lang('PageX'), $this->PageNo())),0,0,'C'); - $this->Cell(0,10,date('Y'),0,0,'R'); - } - - var $B; - var $I; - var $U; - var $HREF; - var $fontList; - var $issetfont; - var $issetcolor; - - function PDF($orientation='P', $unit='mm', $format='A4') - { - //Call parent constructor - $this->__construct($orientation,$unit,$format); - //Initialization - $this->B=0; - $this->I=0; - $this->U=0; - $this->HREF=''; - $this->fontlist=array('arial', 'times', 'courier', 'helvetica', 'symbol'); - $this->issetfont=false; - $this->issetcolor=false; - } - - function WriteHTML($html) - { - //HTML parser - $html=strip_tags($html,"