Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Sep 30, 2020
1 parent d5773df commit 51618ac
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 97 deletions.
49 changes: 29 additions & 20 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,42 @@
{
"name": "skeeks/cms-import",
"description": "Universal import data",
"keywords": ["yii", "skeeks", "framework", "component"],
"homepage": "http://cms.skeeks.com/",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"support": {
"name": "skeeks/cms-import",
"description": "Universal import data",
"keywords": [
"yii",
"skeeks",
"framework",
"component"
],
"homepage": "http://cms.skeeks.com/",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"support": {
"issues": "http://skeeks.com/",
"wiki": "http://en.cms.skeeks.com/docs/",
"source": "https://github.com/skeeks-cms/cms-import"
},
"authors": [
{
"name": "Semenov Alexander",
"email": "semenov@skeeks.com"
}
],
"require": {
"skeeks/cms": "^5.0"
},
"authors": [
{
"name": "Semenov Alexander",
"email": "semenov@skeeks.com"
}
],
"require": {
"skeeks/cms": "^5.0"
},
"autoload": {
"psr-4": {
"skeeks\\cms\\import\\": "src/"
}
},
"extra": {
"config-plugin": {
"web": "src/config/web.php",
"console": "src/config/console.php"
}
"web": [
"src/config/common.php",
"src/config/web.php"
],
"console": [
"src/config/common.php",
"src/config/console.php"
]
}
}
43 changes: 12 additions & 31 deletions src/config/admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,19 @@
* @copyright 2010 SkeekS (СкикС)
* @date 15.04.2016
*/
return
[
'exportImport' =>
[
"label" => \Yii::t('skeeks/import', "Export / Import"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/export.png'],
return [
'exportImport' => [
"label" => \Yii::t('skeeks/import', "Export / Import"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/export.png'],

'priority' => 400,
'priority' => 400,

'items' =>
[
"import" =>
[
"label" => \Yii::t('skeeks/import', "Import"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/import.png'],
"url" => ["cmsImport/admin-import-task"],

'items' =>
[
[
"label" => \Yii::t('skeeks/import', "All kinds of imports"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/import.png'],
"url" => ["cmsImport/admin-import-task"],
]/*,
[
"label" => \Yii::t('skeeks/import', "CSV"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/csv.png'],
"url" => ["cmsImport/admin-import-task"],
],*/
],
'items' => [
"import" => [
"label" => \Yii::t('skeeks/import', "Import"),
"img" => ['\skeeks\cms\import\assets\ImportAsset', 'icons/import.png'],
"url" => ["cmsImport/admin-import-task"],
],
]
]
],
],
];
50 changes: 50 additions & 0 deletions src/config/common.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
return [

'components' => [
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportComponent',
],

'i18n' => [
'translations' =>
[
'skeeks/import' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@skeeks/cms/import/messages',
'fileMap' => [
'skeeks/import' => 'main.php',
],
],
],
],

'authManager' => [
'config' => [
'roles' => [
[
'name' => \skeeks\cms\rbac\CmsManager::ROLE_ADMIN,
'child' => [
'permissions' => [
"cmsImport/admin-import-task",
],
],
],
],
'permissions' => [
[
'name' => 'cmsImport/admin-import-task',
'description' => "Импорт",
],
],
],
],

],

'modules' => [
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportModule',
],
],
];
19 changes: 0 additions & 19 deletions src/config/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,9 @@
],
],

'components' => [
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportComponent',
],

'i18n' => [
'translations' =>
[
'skeeks/import' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@skeeks/cms/import/messages',
'fileMap' => [
'skeeks/import' => 'main.php',
],
],
],
],
],

'modules' => [
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportModule',
'controllerNamespace' => 'skeeks\cms\import\console\controllers',
],
],
Expand Down
28 changes: 1 addition & 27 deletions src/config/web.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
<?php
return [

'components' =>
[
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportComponent',
],

'i18n' => [
'translations' =>
[
'skeeks/import' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@skeeks/cms/import/messages',
'fileMap' => [
'skeeks/import' => 'main.php',
],
]
]
]
],

'modules' =>
[
'cmsImport' => [
'class' => 'skeeks\cms\import\ImportModule',
]
]

];
3 changes: 3 additions & 0 deletions src/controllers/AdminImportTaskController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function init()
$this->modelShowAttribute = "id";
$this->modelClassName = ImportTask::class;

$this->generateAccessActions = false;
$this->permissionName = 'cms/admin-cms-content';

parent::init();
}

Expand Down

0 comments on commit 51618ac

Please sign in to comment.