Example #1
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
echo GridView::widget(['id' => 'install-grid', 'dataProvider' => $dataProvider, 'columns' => array(['attribute' => \fgh151\modules\backup\Module::t('backup', 'Имя'), 'format' => 'raw', 'value' => 'name'], ['attribute' => \fgh151\modules\backup\Module::t('backup', 'Размер'), 'format' => 'size', 'value' => 'size'], ['attribute' => \fgh151\modules\backup\Module::t('backup', 'Дата создания'), 'format' => 'raw', 'value' => 'create_time'], ['attribute' => \fgh151\modules\backup\Module::t('backup', 'Дата изменения'), 'format' => 'relativeTime', 'value' => 'modified_time'], array('class' => 'yii\\grid\\ActionColumn', 'template' => '{restore}', 'buttons' => ['restore' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-circle-arrow-left"></span>', $url, ['title' => \fgh151\modules\backup\Module::t('backup', 'Восстановить')]);
}]), array('class' => 'yii\\grid\\ActionColumn', 'template' => '{download}', 'buttons' => ['download' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-download"></span>', $url, ['title' => \fgh151\modules\backup\Module::t('backup', 'Скачать')]);
}]), array('class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}'))]);
Example #2
0
 /**
  * Declares attribute labels.
  */
 public function attributeLabels()
 {
     return array('name' => Module::t('backup', 'Имя'), 'size' => Module::t('backup', 'Размер'), 'create_time' => Module::t('backup', 'Дата создания'), 'modified_time' => Module::t('backup', 'Изменено'));
 }
Example #3
0
?>

	<?php 
if (Yii::$app->session->hasFlash('success')) {
    ?>
		<div class="alert alert-success">
			<?php 
    echo Yii::$app->session->getFlash('success');
    ?>
		</div>
	<?php 
}
?>

	<h1><?php 
echo \fgh151\modules\backup\Module::t('backup', 'Управление резервными копиями');
?>
</h1>

	<div class="row">
		<div class="col-md-8">
			<?php 
echo $this->render('_list', array('dataProvider' => $dataProvider));
?>
		</div>
		<div class="col-md-4">
			<?php 
use yii\widgets\Menu;
echo Menu::widget(['items' => $this->context->menu]);
?>
Example #4
0
<?php

use yii\helpers\Html;
$this->params['breadcrumbs'][] = ['label' => \fgh151\modules\backup\Module::t('backup', 'Резервные копии'), 'url' => array('index')];
$this->params['breadcrumbs'][] = ['label' => \fgh151\modules\backup\Module::t('backup', 'Восстановить'), 'url' => array('restore')];
?>

<p>
	<?php 
if (isset($error)) {
    echo $error;
} else {
    echo \fgh151\modules\backup\Module::t('backup', 'Готово');
}
?>
</p>
Example #5
0
/* @var $model app\models\Document */
/* @var $form yii\widgets\ActiveForm */
$this->params['breadcrumbs'][] = ['label' => \fgh151\modules\backup\Module::t('backup', 'Загрузить'), 'url' => array('upload')];
?>

<h1><?php 
echo \fgh151\modules\backup\Module::t('backup', 'Загрузить');
?>
</h1>


<?php 
$form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]);
?>

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

<div class="form-group">
    <?php 
echo Html::submitButton(\fgh151\modules\backup\Module::t('backup', 'Загрузить'), ['class' => 'btn btn-success']);
?>
</div>

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

<!-- form -->
Example #6
0
 protected function updateMenuItems($model = null)
 {
     // create static model if model is null
     if ($model == null) {
         $model = new UploadForm();
     }
     switch ($this->action->id) {
         case 'restore':
             $this->menu[] = array('label' => Module::t('backup', 'Просмотр сайта'), 'url' => Yii::$app->HomeUrl);
         case 'create':
             $this->menu[] = array('label' => Module::t('backup', 'Список резервных копий'), 'url' => array('index'));
             break;
         case 'upload':
             $this->menu[] = array('label' => Module::t('backup', 'Создать'), 'url' => array('create'));
             break;
         default:
             $this->menu[] = array('label' => Module::t('backup', 'Список резервных копий'), 'url' => array('index'));
             $this->menu[] = array('label' => Module::t('backup', 'Создать'), 'url' => array('create'));
             $this->menu[] = array('label' => Module::t('backup', 'Загрузить'), 'url' => array('upload'));
             //	$this->menu[] = array('label'=>Yii::t('app', 'Restore Backup') , 'url'=>array('restore'));
             $this->menu[] = array('label' => Module::t('backup', 'Очистить БД'), 'url' => array('clean'));
             $this->menu[] = array('label' => Module::t('backup', 'Просмотр сайта'), 'url' => Yii::$app->HomeUrl);
             break;
     }
 }
Example #7
0
 /**
  * Declares attribute labels.
  */
 public function attributeLabels()
 {
     return array('upload_file' => Module::t('backup', 'Загрузить'));
 }