-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
AbstractButton.php
53 lines (45 loc) · 1.2 KB
/
AbstractButton.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
<?php
/*
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009 - 2019 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @link https://isotopeecommerce.org
* @license https://opensource.org/licenses/lgpl-3.0.html
*/
namespace Isotope\Frontend\ProductAction;
use Isotope\Interfaces\IsotopeProduct;
use Isotope\Template;
abstract class AbstractButton implements ProductActionInterface
{
/**
* {@inheritdoc}
*/
public function isAvailable(IsotopeProduct $product, array $config = [])
{
return true;
}
/**
* {@inheritdoc}
*/
public function generate(IsotopeProduct $product, array $config = [])
{
/** @var Template|\stdClass $objTemplate */
$objTemplate = new Template('iso_action');
$objTemplate->name = $this->getName();
$objTemplate->classes = $this->getClasses($product);
$objTemplate->label = $this->getLabel($product);
return $objTemplate->parse();
}
/**
* Gets the CSS class(es) for this button.
*
* @param IsotopeProduct $product
*
* @return string
*/
protected function getClasses(IsotopeProduct $product)
{
return '';
}
}