-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bootstrap.php
89 lines (72 loc) · 1.88 KB
/
Bootstrap.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
use Doctrine\Common\Collections\ArrayCollection;
class Shopware_Plugins_Frontend_8mzLogoSize_Bootstrap extends Shopware_Components_Plugin_Bootstrap
{
public function getLabel()
{
return 'Logo Größe anpassen';
}
public function getVersion()
{
return '1.0.1';
}
public function getInfo()
{
return array(
'version' => $this->getVersion(),
'copyright' => 'Copyright (c) 2016, Goltfisch GmbH',
'label' => $this->getLabel(),
'description' => 'Ermöglicht die Anpassung des Logos im Backend',
'support' => 'http://8mylez.com',
'link' => 'http://8mylez.com',
'author' => '8mylez'
);
}
public function install()
{
$this->subscribeEvent(
'Theme_Compiler_Collect_Plugin_Less',
'onCollectLessFiles'
);
$this->createConfig();
return true;
}
private function createConfig()
{
$form = $this->Form();
$form->setElement(
'number',
'logoHeight',
[
'scope' => Shopware\Models\Config\Element::SCOPE_SHOP,
'label' => 'Logo Höhe',
'minValue' => 0,
'description' => 'Höhe des Logos in Pixel.'
]
);
$form->setElement(
'number',
'logoHeightCheckout',
[
'scope' => Shopware\Models\Config\Element::SCOPE_SHOP,
'label' => 'Logo Checkout Höhe',
'minValue' => '0',
'description' => 'Höhe des Logos in Pixel im Checkout Prozess.'
]
);
}
public function onCollectLessFiles()
{
$lessDir = __DIR__ . '/Views/frontend/_public/src/less/';
$less = new \Shopware\Components\Theme\LessDefinition(
array(
'logoHeight' => $this->Config()->get('logoHeight'),
'logoHeightCheckout' => $this->Config()->get('logoHeightCheckout'),
),
array(
$lessDir . 'logo-size.less'
)
);
return new ArrayCollection(array($less));
}
}