-
Notifications
You must be signed in to change notification settings - Fork 0
/
PdfthumbPlugin.php
63 lines (53 loc) · 1.21 KB
/
PdfthumbPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace Craft;
class PdfthumbPlugin extends BasePlugin
{
function getName()
{
return Craft::t('PDFThumb');
}
function getVersion()
{
return '1.1';
}
function getDeveloper()
{
return 'Mikhail Emelchenkov';
}
function getDeveloperUrl()
{
return 'https://www.Emelchenkov.pro';
}
/**
* Register Twig extension
*/
public function addTwigExtension()
{
Craft::import('plugins.pdfthumb.twigextensions.PdfthumbTwigExtension');
return new PdfthumbTwigExtension();
}
/**
* Register cache path
*/
public function registerCachePaths()
{
return array(
$_SERVER['DOCUMENT_ROOT'] . $this->getSettings()['cachePath'] => Craft::t('PDFThumb images')
);
}
/**
* Register settings
*/
protected function defineSettings()
{
return array(
'cachePath' => array(AttributeType::String, 'default' => join(DIRECTORY_SEPARATOR, array('', 'resources', 'cache')))
);
}
public function getSettingsHtml()
{
return craft()->templates->render('pdfthumb/settings', array(
'settings' => $this->getSettings()
));
}
}