/**
  * @return string
  */
 public function actionIndex()
 {
     $module = Module::getInstance();
     /* @var $model \app\modules\admlivechat\models\SettingsForm */
     $model = $module->manager->createSettingsForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         if ($model->save()) {
             Yii::$app->getSession()->setFlash('success', Adm::t('', 'Data successfully changed!'));
             return Adm::redirect(['index']);
         }
     }
     return $this->render('index', ['model' => $model]);
 }
Example #2
0
                                </div>
                            </div>
                        </div>
                    <?php 
}
?>
                </div>
            </div>
        </section>

        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12">
                <div>
                    <?php 
echo $form->field($model, 'active', ["template" => "{input}\n{label}\n{hint}\n{error}"])->widget(CheckboxX::classname(), ['pluginOptions' => ['threeState' => false]]);
?>
                </div>
            </div>
        </div>

        <p>
            <?php 
echo InputButton::widget(['label' => !isset(Yii::$app->params[Module::getInstance()->settingsKey]) ? Adm::t('', 'Create', ['dot' => false]) : Adm::t('', 'Update', ['dot' => false]), 'options' => ['class' => 'btn btn-primary'], 'input' => 'adm-redirect', 'name' => 'redirect', 'formSelector' => $form]);
?>

        </p>
    <?php 
ActiveForm::end();
?>
</div>
Example #3
0
 /**
  * @return bool
  */
 public function save()
 {
     return ParamsManager::getInstance()->manager->staticParams('change', Module::getInstance()->settingsKey, $this->getAttributes());
 }
Example #4
0
<?php

use app\helpers\Url;
use yii\helpers\Html;
/**
 * @var \yii\web\View $this
 * @var string $content
 */
\app\modules\admgoogletools\Module::loadGoogleTools();
\app\modules\admlivechat\Module::loadLiveChat();
if (Yii::$app->params['html.canonical'] === true) {
    $this->registerLinkTag(['rel' => 'canonical', 'href' => Url::canonical()]);
} else {
    if (Yii::$app->params['html.canonical'] !== false) {
        $this->registerLinkTag(['rel' => 'canonical', 'href' => Yii::$app->params['html.canonical']]);
    }
}
if (!in_array(Yii::$app->controller->getRoute(), ['site/login', 'site/signup', 'site/request-password-reset', 'site/reset-password', 'site/user-approve'])) {
    Url::remember(Url::current());
}
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
">
<head>
    <meta charset="<?php 
echo Yii::$app->charset;
?>