/
Actions.php
81 lines (73 loc) · 1.8 KB
/
Actions.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
<?php
/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/
namespace OxidEsales\EshopCommunity\Application\Component\Widget;
/**
* Actions widget.
* Access actions in tpl.
*/
class Actions extends \OxidEsales\Eshop\Application\Component\Widget\WidgetController
{
/**
* Current class template name.
*
* @var string
*/
protected $_sThisTemplate = 'widget/product/action.tpl';
/**
* Are actions on
*
* @var bool
*/
protected $_blLoadActions = null;
/**
* Returns article list with action articles
*
* @return object
*/
public function getAction()
{
$actionId = $this->getViewParameter('action');
if ($actionId && $this->_getLoadActionsParam()) {
$artList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$artList->loadActionArticles($actionId);
if ($artList->count()) {
return $artList;
}
}
}
/**
* Returns if actions are ON
*
* @return string
*/
protected function _getLoadActionsParam()
{
$this->_blLoadActions = $this->getConfig()->getConfigParam('bl_perfLoadAktion');
return $this->_blLoadActions;
}
/**
* Returns action name
*
* @return string
*/
public function getActionName()
{
$actionId = $this->getViewParameter('action');
$action = oxNew(\OxidEsales\Eshop\Application\Model\Actions::class);
if ($action->load($actionId)) {
return $action->oxactions__oxtitle->value;
}
}
/**
* Returns products list type
*
* @return string
*/
public function getListType()
{
return $this->getViewParameter('listtype');
}
}