Esempio n. 1
0
<?php

/**
 * @link      http://phe.me
 * @copyright Copyright (c) 2014 Pheme
 * @license   MIT http://opensource.org/licenses/MIT
 */
use efureev\settings\Module;
use yii\helpers\Html;
/**
 * @var yii\web\View                    $this
 * @var efureev\settings\models\Setting $model
 */
$this->title = Module::t('settings', 'Update: ', ['modelClass' => Module::t('settings', 'Setting')]) . ' ' . $model->section . '.' . $model->key;
$this->params['breadcrumbs'][] = ['label' => Module::t('settings', 'Settings'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('settings', 'Update');
?>
<div class="setting-update">

	<h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('settings', 'ID'), 'type' => Module::t('settings', 'Type'), 'section' => Module::t('settings', 'Section'), 'key' => Module::t('settings', 'Key'), 'value' => Module::t('settings', 'Value'), 'active' => Module::t('settings', 'Active'), 'created' => Module::t('settings', 'Created'), 'modified' => Module::t('settings', 'Modified')];
 }
Esempio n. 3
0
<?php

/**
 * @link      http://phe.me
 * @copyright Copyright (c) 2014 Pheme
 * @license   MIT http://opensource.org/licenses/MIT
 */
use efureev\settings\Module;
use yii\helpers\Html;
/**
 * @var yii\web\View                  $this
 * @var pheme\settings\models\Setting $model
 */
$this->title = Module::t('settings', 'Create', ['modelClass' => Module::t('settings', 'Setting')]);
$this->params['breadcrumbs'][] = ['label' => Module::t('settings', 'Settings'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="setting-create">

	<h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
Esempio n. 4
0
	<?php 
echo $form->field($model, 'section');
?>

	<?php 
echo $form->field($model, 'key');
?>

	<?php 
echo $form->field($model, 'value');
?>

	<?php 
echo $form->field($model, 'active')->checkbox();
?>

	<div class="form-group">
		<?php 
echo Html::submitButton(Module::t('settings', 'Search'), ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::resetButton(Module::t('settings', 'Reset'), ['class' => 'btn btn-default']);
?>
	</div>

	<?php 
ActiveForm::end();
?>

</div>
Esempio n. 5
0
echo $form->field($model, 'section')->textInput(['maxlength' => 255]);
?>

	<?php 
echo $form->field($model, 'key')->textInput(['maxlength' => 255]);
?>

	<?php 
echo $form->field($model, 'value')->textarea(['rows' => 6]);
?>

	<?php 
echo $form->field($model, 'active')->checkbox(['value' => 1]);
?>

	<?php 
echo $form->field($model, 'type')->dropDownList($model->getTypes())->hint(Module::t('settings', 'Change at your own risk'));
?>

	<div class="form-group">
		<?php 
echo Html::submitButton($model->isNewRecord ? Module::t('settings', 'Create') : Module::t('settings', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
	</div>

	<?php 
ActiveForm::end();
?>

</div>
Esempio n. 6
0
use yii\widgets\DetailView;
/**
 * @var yii\web\View                    $this
 * @var efureev\settings\models\Setting $model
 */
$this->title = $model->section . '.' . $model->key;
$this->params['breadcrumbs'][] = ['label' => Module::t('settings', 'Settings'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="setting-view">

	<h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<p>
		<?php 
echo Html::a(Module::t('settings', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::a(Module::t('settings', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('settings', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
	</p>

	<?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'type', 'section', 'active:boolean', 'key', 'value:ntext', 'created:datetime', 'modified:datetime']]);
?>

</div>
Esempio n. 7
0
 * @var yii\data\ActiveDataProvider           $dataProvider
 */
$this->title = Module::t('settings', 'Settings');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="setting-index">

	<h1><?php 
echo Html::encode($this->title);
?>
</h1>
	<?php 
//echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Module::t('settings', 'Create', ['modelClass' => Module::t('settings', 'Setting')]), ['create'], ['class' => 'btn btn-success']);
?>
	</p>
	<?php 
Pjax::begin();
?>
	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['id', ['attribute' => 'section', 'filter' => ArrayHelper::map(Setting::find()->select('section')->distinct()->where(['<>', 'section', ''])->all(), 'section', 'section')], 'key', 'value:ntext', ['class' => '\\pheme\\grid\\ToggleColumn', 'attribute' => 'active', 'filter' => [1 => Yii::t('yii', 'Yes'), 0 => Yii::t('yii', 'No')]], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
	<?php 
Pjax::end();
?>
</div>