Passed
Push — developer ( c475b4...5772fb )
by Mariusz
69:56 queued 34:42
created

Pdf::getModalIcon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * PDF view modal.
4
 *
5
 * @copyright YetiForce Sp. z o.o.
6
 * @license   YetiForce Public License 3.0 (licenses/LicenseEN.txt or yetiforce.com)
7
 * @author    Radosław Skrzypczak <[email protected]>
8
 */
9
10
namespace YF\Modules\Base\View;
11
12
/**
13
 * Pdf class.
14
 */
15
class Pdf extends \App\Controller\Modal
16
{
17
	/** {@inheritdoc} */
18
	protected function getTitle()
19
	{
20
		return \App\Language::translate('LBL_AVAILABLE_PDF_TEMPLATES', $this->request->getModule());
21
	}
22
23
	/** {@inheritdoc} */
24
	protected function getModalSize()
25
	{
26
		return 'modal-md';
27
	}
28
29
	/** {@inheritdoc} */
30
	protected function getModalIcon(): string
31
	{
32
		return 'fas fa-file-pdf';
33
	}
34
35
	/** {@inheritdoc} */
36
	public function process()
37
	{
38
		$moduleName = $this->request->getModule();
39
		$recordId = $this->request->getInteger('record');
40
		$this->viewer->assign('TEMPLATES', \App\Pdf::getTemplates($this->moduleName, $recordId));
41
		$this->viewer->assign('RECORD_ID', $recordId);
42
		$this->viewer->view($this->processTplName(), $moduleName);
43
	}
44
45
	/** {@inheritdoc} */
46
	public function postProcessAjax()
47
	{
48
	}
49
50
	/** {@inheritdoc} */
51
	public function processTplName(): string
52
	{
53
		return 'Modal/Pdf.tpl';
54
	}
55
}
56