Skip to content

Commit cb0e70a

Browse files
committed
add files controller
1 parent d03b679 commit cb0e70a

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

src/Module.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public static function getAdminMenu()
5757
'icon' => 'clone',
5858
'url' => '/cms/admin/block',
5959
],
60+
[
61+
'label' => Yii::t('cms', 'Files'),
62+
'icon' => 'files-o',
63+
'url' => '/cms/admin/files',
64+
],
6065
]
6166
];
6267
}

src/controllers/admin/BlockController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use nullref\core\interfaces\IAdminController;
99
use Yii;
1010
use yii\caching\TagDependency;
11-
use yii\data\ActiveDataProvider;
1211
use yii\filters\VerbFilter;
1312
use yii\web\Controller;
1413
use yii\web\NotFoundHttpException;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* @author Dmytro Karpovych
4+
* @copyright 2016 NRE
5+
*/
6+
7+
8+
namespace nullref\cms\controllers\admin;
9+
10+
use nullref\core\interfaces\IAdminController;
11+
use yii\web\Controller;
12+
13+
14+
class FilesController extends Controller implements IAdminController
15+
{
16+
public function actionIndex()
17+
{
18+
return $this->render('index');
19+
}
20+
}

src/views/admin/files/index.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* @var $this \yii\web\View
4+
*/
5+
use mihaildev\elfinder\ElFinder;
6+
use yii\helpers\Html;
7+
8+
$this->title = Yii::t('cms', 'Files');
9+
$this->params['breadcrumbs'][] = $this->title;
10+
?>
11+
<div class="files-index">
12+
13+
<div class="row">
14+
<div class="col-lg-12">
15+
<h1 class="page-header">
16+
<?= Html::encode($this->title) ?>
17+
</h1>
18+
</div>
19+
</div>
20+
21+
<?= ElFinder::widget([
22+
'controller' => 'elfinder-backend',
23+
'frameOptions' => [
24+
'style' => 'min-height: 500px; width:100%',
25+
]
26+
]) ?>
27+
28+
</div>

0 commit comments

Comments
 (0)