|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @copyright Copyright (c) Flipbox Digital Limited |
|
5
|
|
|
* @license https://flipboxfactory.com/software/patron/license |
|
6
|
|
|
* @link https://www.flipboxfactory.com/software/patron/ |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace flipbox\patron\cp\controllers\view; |
|
10
|
|
|
|
|
11
|
|
|
use Craft; |
|
12
|
|
|
use craft\helpers\UrlHelper; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @author Flipbox Factory <[email protected]> |
|
16
|
|
|
* @since 1.0.0 |
|
17
|
|
|
*/ |
|
18
|
|
|
class SettingsController extends AbstractViewController |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* The index view template path |
|
22
|
|
|
*/ |
|
23
|
|
|
const TEMPLATE_INDEX = AbstractViewController::TEMPLATE_BASE . '/settings'; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Index |
|
27
|
|
|
* |
|
28
|
|
|
* @return \yii\web\Response |
|
29
|
|
|
*/ |
|
30
|
|
|
public function actionIndex() |
|
31
|
|
|
{ |
|
32
|
|
|
$variables = []; |
|
33
|
|
|
$this->baseVariables($variables); |
|
34
|
|
|
|
|
35
|
|
|
$variables['fullPageForm'] = true; |
|
36
|
|
|
|
|
37
|
|
|
return $this->renderTemplate(static::TEMPLATE_INDEX, $variables); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
|
|
41
|
|
|
/******************************************* |
|
42
|
|
|
* BASE PATHS |
|
43
|
|
|
*******************************************/ |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* @return string |
|
47
|
|
|
*/ |
|
48
|
|
|
protected function getBaseActionPath(): string |
|
49
|
|
|
{ |
|
50
|
|
|
return parent::getBaseActionPath() . '/settings'; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return string |
|
55
|
|
|
*/ |
|
56
|
|
|
protected function getBaseCpPath(): string |
|
57
|
|
|
{ |
|
58
|
|
|
return parent::getBaseCpPath() . '/settings'; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/******************************************* |
|
62
|
|
|
* VARIABLES |
|
63
|
|
|
*******************************************/ |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @inheritdoc |
|
67
|
|
|
*/ |
|
68
|
|
|
protected function baseVariables(array &$variables = []) |
|
69
|
|
|
{ |
|
70
|
|
|
parent::baseVariables($variables); |
|
71
|
|
|
|
|
72
|
|
|
$variables['crumbs'][] = [ |
|
73
|
|
|
'label' => Craft::t('patron', 'Settings'), |
|
74
|
|
|
'url' => UrlHelper::url($variables['baseCpPath']) |
|
75
|
|
|
]; |
|
76
|
|
|
} |
|
77
|
|
|
} |
|
78
|
|
|
|