mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-12 16:28:42 +00:00
rector fixes + bug fixes
This commit is contained in:
parent
4f50728503
commit
577f423c6a
|
|
@ -73,7 +73,7 @@ final class Installer extends InstallerAbstract
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$app->dbPool->get()->con->query('select 1 from `editor_doc`');
|
$app->dbPool->get()->con->query('select 1 from `editor_doc`');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $_) {
|
||||||
return []; // @codeCoverageIgnore
|
return []; // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||||
|
|
||||||
/** @var \phpOMS\Views\View $this */
|
/** @var \phpOMS\Views\View $this */
|
||||||
require_once $this->getData('defaultTemplates')
|
require_once $this->getData('defaultTemplates')
|
||||||
->findFile('.pdf.php')
|
->findFile('.pdf.php')
|
||||||
->getAbsolutePath();
|
->getAbsolutePath();
|
||||||
|
|
||||||
/** @var \Modules\Editor\Models\EditorDoc $doc */
|
/** @var \Modules\Editor\Models\EditorDoc $doc */
|
||||||
$doc = $this->getData('doc') ?? new NullEditorDoc();
|
$doc = $this->getData('doc') ?? new NullEditorDoc();
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ use phpOMS\Utils\Parser\Markdown\Markdown;
|
||||||
|
|
||||||
/** @var \phpOMS\Views\View $this */
|
/** @var \phpOMS\Views\View $this */
|
||||||
require_once $this->getData('defaultTemplates')
|
require_once $this->getData('defaultTemplates')
|
||||||
->findFile('.pdf.php')
|
->findFile('.pdf.php')
|
||||||
->getAbsolutePath();
|
->getAbsolutePath();
|
||||||
|
|
||||||
/** @var \Modules\Editor\Models\EditorDoc $doc */
|
/** @var \Modules\Editor\Models\EditorDoc $doc */
|
||||||
$doc = $this->getData('doc') ?? new NullEditorDoc();
|
$doc = $this->getData('doc') ?? new NullEditorDoc();
|
||||||
|
|
@ -28,9 +28,9 @@ $doc = $this->getData('doc') ?? new NullEditorDoc();
|
||||||
$pdf = new DefaultPdf();
|
$pdf = new DefaultPdf();
|
||||||
|
|
||||||
$pdf->setHeaderData(
|
$pdf->setHeaderData(
|
||||||
$this->getData('defaultTemplates')->findFile('logo.png')->getAbsolutePath(), 15,
|
$this->getData('defaultTemplates')->findFile('logo.png')->getAbsolutePath(), 15,
|
||||||
$this->getData('logo_name') ?? 'Jingga',
|
$this->getData('logo_name') ?? 'Jingga',
|
||||||
$this->getData('slogan') ?? 'Business solutions made simple.'
|
$this->getData('slogan') ?? 'Business solutions made simple.'
|
||||||
);
|
);
|
||||||
$pdf->setCreator($this->getData('creator') ?? 'Jingga');
|
$pdf->setCreator($this->getData('creator') ?? 'Jingga');
|
||||||
$pdf->setAuthor($this->getData('creator') ?? 'Jingga');
|
$pdf->setAuthor($this->getData('creator') ?? 'Jingga');
|
||||||
|
|
@ -67,6 +67,6 @@ $pdf->writeHTML(Markdown::parse($doc->plain));
|
||||||
|
|
||||||
//Close and output PDF document
|
//Close and output PDF document
|
||||||
$pdf->Output(
|
$pdf->Output(
|
||||||
$this->getData('path') ?? ($doc->createdAt->format('Y-m-d') . '_' . $doc->id . '.pdf'),
|
$this->getData('path') ?? ($doc->createdAt->format('Y-m-d') . '_' . $doc->id . '.pdf'),
|
||||||
'I'
|
'I'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user