-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWavecmsComponent.php
40 lines (30 loc) · 930 Bytes
/
WavecmsComponent.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
<?php
namespace mrstroz\wavecms;
use Yii;
use yii\base\Component;
use yii\bootstrap\Html;
class WavecmsComponent extends Component
{
public $languages = [];
public $editedLanguage;
public function languageButtons()
{
$buttons = [];
foreach (Yii::$app->wavecms->languages as $language) {
$class = 'btn-light-gray ';
if (Yii::$app->wavecms->editedLanguage === $language) {
$class = 'btn-primary';
}
$buttons[] = Html::a($language, ['/wavecms/language/change', 'lang' => $language], ['class' => 'btn btn-sm ' . $class]);
}
return $buttons;
}
public function languageCheckboxItems()
{
$items = [];
foreach (Yii::$app->wavecms->languages as $language) {
$items[$language] = Html::tag('span', $language, ['class' => 'country-code']);
}
return $items;
}
}