|
7 | 7 | */ |
8 | 8 | defined('C5_EXECUTE') or die('Access Denied.'); |
9 | 9 |
|
| 10 | +/* @var Concrete\Core\Application\Service\UserInterface $ui */ |
10 | 11 | /* @var Concrete\Core\Form\Service\Widget\Color $color */ |
11 | 12 | /* @var Concrete\Package\PureCookiesNotice\Block\PureCookiesNotice\Controller $controller */ |
12 | 13 | /* @var Concrete\Core\Form\Service\Form $form */ |
13 | 14 | /* @var Concrete\Core\Block\View\BlockView $this */ |
14 | 15 | /* @var Concrete\Core\Block\View\BlockView $view */ |
| 16 | + |
| 17 | +/* @var string $title */ |
| 18 | +/* @var string $agreeText */ |
| 19 | +/* @var string $textColor */ |
| 20 | +/* @var string $linkColor */ |
| 21 | +/* @var string $backgroundColor */ |
| 22 | +/* @var array $positions */ |
| 23 | +/* @var string $position */ |
| 24 | +/* @var bool $geolocationSupported */ |
| 25 | +/* @var bool|string $onlyForEU */ |
| 26 | +/* @var bool|string $interactionImpliesOk */ |
| 27 | +/* @var bool|string $sitewideCookie */ |
15 | 28 | ?> |
16 | 29 | <div class="pure-cookies-notice-edit-container"> |
17 | | - <ul id="pure-cookies-notice-edit-tabs" class="nav nav-tabs" role="tablist"> |
18 | | - <li role="presentation" class="active"><a href="#pure-cookies-notice-edit-basics" aria-controls="pure-cookies-notice-edit-basics" role="tab" data-toggle="tab"><?php echo t('Basics')?></a></li> |
19 | | - <li role="presentation"><a href="#pure-cookies-notice-edit-colors" aria-controls="pure-cookies-notice-edit-colors" role="tab" data-toggle="tab"><?php echo t('Colors')?></a></li> |
20 | | - <li role="presentation"><a href="#pure-cookies-notice-edit-advanced" aria-controls="pure-cookies-notice-edit-advanced" role="tab" data-toggle="tab"><?php echo t('Advanced')?></a></li> |
21 | | - </ul> |
22 | 30 |
|
23 | | - <div class="tab-content"> |
24 | | - <div role="tabpanel" class="tab-pane fade in active" id="pure-cookies-notice-edit-basics"> |
25 | | - <fieldset> |
26 | | - <div class="form-group"> |
27 | | - <?= $form->label('title', t('Title')) ?> |
28 | | - <?= $form->text('title', $title, ['placeholder' => t('Optional'), 'maxlength' => 255]) ?> |
29 | | - </div> |
| 31 | + <?= $ui->tabs([ |
| 32 | + ['pure-cookies-notice-edit-basics', t('Basics'), true], |
| 33 | + ['pure-cookies-notice-edit-colors', t('Colors')], |
| 34 | + ['pure-cookies-notice-edit-advanced', t('Advanced')], |
| 35 | + ]) ?> |
30 | 36 |
|
31 | | - <div class="form-group"> |
32 | | - <?= $form->label('content', t('Content')) ?> |
33 | | - <?php |
34 | | - $editor = Core::make('editor'); |
35 | | - /* @var Concrete\Core\Editor\CkeditorEditor $editor */ |
36 | | - echo $editor->outputStandardEditor('content', $controller->getContentEditMode()); |
37 | | - ?> |
38 | | - </div> |
| 37 | + <div class="ccm-tab-content" id="ccm-tab-content-pure-cookies-notice-edit-basics"> |
| 38 | + <fieldset> |
| 39 | + <div class="form-group"> |
| 40 | + <?= $form->label('title', t('Title')) ?> |
| 41 | + <?= $form->text('title', $title, ['placeholder' => t('Optional'), 'maxlength' => 255]) ?> |
| 42 | + </div> |
39 | 43 |
|
40 | | - <div class="form-group"> |
41 | | - <?= $form->label('agreeText', t('Consent text')) ?> |
42 | | - <?= $form->text('agreeText', $agreeText, ['placeholder' => t('Optional. \'Ok\' by default'), 'maxlength' => 255]) ?> |
43 | | - </div> |
44 | | - </fieldset> |
45 | | - </div> |
46 | | - <div role="tabpanel" class="tab-pane fade" id="pure-cookies-notice-edit-colors"> |
47 | | - <fieldset> |
48 | | - <div class="form-group"> |
49 | | - <?= $form->label('textColor', t('Text color')) ?> |
50 | | - <?php $color->output('textColor', $textColor, ['appendTo' => 'body']) ?> |
51 | | - <div class="help-block"><?= t('Optional. Leave empty to use the default color from styles.') ?></div> |
52 | | - </div> |
| 44 | + <div class="form-group"> |
| 45 | + <?= $form->label('content', t('Content')) ?> |
| 46 | + <?php |
| 47 | + $editor = Core::make('editor'); |
| 48 | + /* @var Concrete\Core\Editor\CkeditorEditor $editor */ |
| 49 | + echo $editor->outputStandardEditor('content', $controller->getContentEditMode()); |
| 50 | + ?> |
| 51 | + </div> |
53 | 52 |
|
54 | | - <div class="form-group"> |
55 | | - <?= $form->label('linkColor', t('Link color')) ?> |
56 | | - <?php $color->output('linkColor', $linkColor, ['appendTo' => 'body']) ?> |
57 | | - <div class="help-block"><?= t('Optional. Leave empty to use the text color.') ?></div> |
58 | | - </div> |
| 53 | + <div class="form-group"> |
| 54 | + <?= $form->label('agreeText', t('Consent text')) ?> |
| 55 | + <?= $form->text('agreeText', $agreeText, ['placeholder' => t('Optional. \'Ok\' by default'), 'maxlength' => 255]) ?> |
| 56 | + </div> |
| 57 | + </fieldset> |
| 58 | + </div> |
59 | 59 |
|
60 | | - <div class="form-group"> |
61 | | - <?= $form->label('backgroundColor', t('Background color')) ?> |
62 | | - <?php $color->output('backgroundColor', $backgroundColor, ['appendTo' => 'body', 'showAlpha' => true]) ?> |
63 | | - <div class="help-block"><?= t('Optional. Leave empty to use the default color from styles.') ?></div> |
64 | | - </div> |
65 | | - </fieldset> |
66 | | - </div> |
67 | | - <div role="tabpanel" class="tab-pane fade" id="pure-cookies-notice-edit-advanced"> |
68 | | - <fieldset> |
69 | | - <div class="form-group"> |
70 | | - <?= $form->label('position', t('Position')) ?> |
71 | | - <?= $form->select('position', $positions, $position, ['placeholder' => t('Optional. \'Ok\' by default')]) ?> |
72 | | - </div> |
| 60 | + <div class="ccm-tab-content" id="ccm-tab-content-pure-cookies-notice-edit-colors"> |
| 61 | + <fieldset> |
| 62 | + <div class="form-group"> |
| 63 | + <?= $form->label('textColor', t('Text color')) ?> |
| 64 | + <?php $color->output('textColor', $textColor, ['appendTo' => 'body']) ?> |
| 65 | + <div class="help-block"><?= t('Optional. Leave empty to use the default color from styles.') ?></div> |
| 66 | + </div> |
73 | 67 |
|
74 | | - <?php |
75 | | - if ($geolocationSupported) { |
76 | | - ?> |
77 | | - <div class="form-group"> |
78 | | - <?= $form->label('onlyForEU', t('Target visitors')) ?> |
79 | | - <?= $form->select( |
80 | | - 'onlyForEU', |
81 | | - [ |
82 | | - '1' => t('Show only for site visitors from the European Union'), |
83 | | - '0' => t('Show for every site visitor'), |
84 | | - ], |
85 | | - $onlyForEU ? '1' : '0', |
86 | | - ['required' => 'required'] |
87 | | - ) ?> |
88 | | - </div> |
89 | | - <?php |
90 | | - } |
91 | | - ?> |
| 68 | + <div class="form-group"> |
| 69 | + <?= $form->label('linkColor', t('Link color')) ?> |
| 70 | + <?php $color->output('linkColor', $linkColor, ['appendTo' => 'body']) ?> |
| 71 | + <div class="help-block"><?= t('Optional. Leave empty to use the text color.') ?></div> |
| 72 | + </div> |
92 | 73 |
|
93 | | - <div class="form-group"> |
94 | | - <?= $form->label('interactionImpliesOk', t('Closing triggers')) ?> |
95 | | - <?= $form->select( |
96 | | - 'interactionImpliesOk', |
97 | | - [ |
98 | | - '0' => t('Close on click button only'), |
99 | | - '1' => t('Close on any clicks (anywhere) and scrolls'), |
100 | | - ], |
101 | | - empty($interactionImpliesOk) ? '0' : '1', |
102 | | - ['required' => 'required'] |
103 | | - ) ?> |
104 | | - </div> |
| 74 | + <div class="form-group"> |
| 75 | + <?= $form->label('backgroundColor', t('Background color')) ?> |
| 76 | + <?php $color->output('backgroundColor', $backgroundColor, ['appendTo' => 'body', 'showAlpha' => true]) ?> |
| 77 | + <div class="help-block"><?= t('Optional. Leave empty to use the default color from styles.') ?></div> |
| 78 | + </div> |
| 79 | + </fieldset> |
| 80 | + </div> |
| 81 | + |
| 82 | + <div class="ccm-tab-content" id="ccm-tab-content-pure-cookies-notice-edit-advanced"> |
| 83 | + <fieldset> |
| 84 | + <div class="form-group"> |
| 85 | + <?= $form->label('position', t('Position')) ?> |
| 86 | + <?= $form->select('position', $positions, $position, ['placeholder' => t('Optional. \'Ok\' by default')]) ?> |
| 87 | + </div> |
105 | 88 |
|
| 89 | + <?php |
| 90 | + if ($geolocationSupported) { |
| 91 | + ?> |
106 | 92 | <div class="form-group"> |
107 | | - <?= $form->label('sitewideCookie', t('Block instances')) ?> |
| 93 | + <?= $form->label('onlyForEU', t('Target visitors')) ?> |
108 | 94 | <?= $form->select( |
109 | | - 'sitewideCookie', |
| 95 | + 'onlyForEU', |
110 | 96 | [ |
111 | | - '1' => t('Site visitors have to accept the warning of a single block instance'), |
112 | | - '0' => t('Site visitors must accept the warning for every block instance'), |
| 97 | + '1' => t('Show only for site visitors from the European Union'), |
| 98 | + '0' => t('Show for every site visitor'), |
113 | 99 | ], |
114 | | - empty($sitewideCookie) ? '0' : '1', |
| 100 | + $onlyForEU ? '1' : '0', |
115 | 101 | ['required' => 'required'] |
116 | 102 | ) ?> |
117 | 103 | </div> |
118 | | - </fieldset> |
119 | | - </div> |
| 104 | + <?php |
| 105 | + } |
| 106 | + ?> |
| 107 | + |
| 108 | + <div class="form-group"> |
| 109 | + <?= $form->label('interactionImpliesOk', t('Closing triggers')) ?> |
| 110 | + <?= $form->select( |
| 111 | + 'interactionImpliesOk', |
| 112 | + [ |
| 113 | + '0' => t('Close on click button only'), |
| 114 | + '1' => t('Close on any clicks (anywhere) and scrolls'), |
| 115 | + ], |
| 116 | + empty($interactionImpliesOk) ? '0' : '1', |
| 117 | + ['required' => 'required'] |
| 118 | + ) ?> |
| 119 | + </div> |
| 120 | + |
| 121 | + <div class="form-group"> |
| 122 | + <?= $form->label('sitewideCookie', t('Block instances')) ?> |
| 123 | + <?= $form->select( |
| 124 | + 'sitewideCookie', |
| 125 | + [ |
| 126 | + '1' => t('Site visitors have to accept the warning of a single block instance'), |
| 127 | + '0' => t('Site visitors must accept the warning for every block instance'), |
| 128 | + ], |
| 129 | + empty($sitewideCookie) ? '0' : '1', |
| 130 | + ['required' => 'required'] |
| 131 | + ) ?> |
| 132 | + </div> |
| 133 | + </fieldset> |
120 | 134 | </div> |
| 135 | + |
121 | 136 | </div> |
122 | 137 |
|
123 | 138 | <script> |
124 | 139 | $(function() { |
125 | 140 | $().pureInputLengthCounter($('.pure-cookies-notice-edit-container input[maxlength]')); |
126 | | - |
127 | | - $('#pure-cookies-notice-edit-tabs a').click(function (e) { |
128 | | - e.preventDefault(); |
129 | | - $(this).tab('show'); |
130 | | - }) |
131 | 141 | }); |
132 | 142 | </script> |
0 commit comments