Commit 2685f4c1 authored by waltermazza's avatar waltermazza
Browse files

Arter namespace

parent bfa81caa
......@@ -7,31 +7,31 @@ You need to require this package and enable the module in your configuration.
add to composer requirements in composer.json
```
"elitedivision/amos-news": "dev-master",
"arter/amos-news": "dev-master",
```
or run command bash:
```bash
composer require "elitedivision/amos-news:dev-master"
composer require "arter/amos-news:dev-master"
```
Enable the News modules in modules-amos.php, add :
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
],
```
add news migrations to console modules (console/config/migrations-amos.php):
```
'@vendor/elitedivision/amos-news/src/migrations'
'@vendor/arter/amos-news/src/migrations'
```
If a frontend or a public site are used in your project and news need to be visible outside backend, enable form/wizard fields to allow publication in frontend/home page with params:
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'params' => [
'site_publish_enabled' => true,
'site_featured_enabled' => true
......@@ -55,11 +55,11 @@ for reports:
```
'report' => [
'class' => 'elitedivision\amos\report\AmosReport',
'class' => 'arter\amos\report\AmosReport',
'modelsEnabled' => [
.
.
'elitedivision\amos\news\models\News', //line to add
'arter\amos\news\models\News', //line to add
.
.
]
......@@ -71,11 +71,11 @@ for comments:
```
'comments' => [
'class' => 'elitedivision\amos\comments\AmosComments',
'class' => 'arter\amos\comments\AmosComments',
'modelsEnabled' => [
.
.
'elitedivision\amos\news\models\News', //line to add
'arter\amos\news\models\News', //line to add
.
.
],
......@@ -90,7 +90,7 @@ If some property default is not suitable for your project, you can configure it
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'validatePublicationDate' => false, //changed property (default was true)
],
```
......@@ -107,7 +107,7 @@ In case categories are in association with rbac roles, populate table 'news_cate
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'filterCategoriesByRole' => true
]
```
......@@ -120,7 +120,7 @@ Mandatory fields in news form: by default news category, title and status are ma
If in your platform, for example, you don't want title to be a mandatory field, overwrite newsRequiredFields property as below:
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'newsRequiredFields' => ['news_categorie_id', 'status']
],
```
......@@ -129,7 +129,7 @@ If in your platform, for example, you don't want title to be a mandatory field,
The ID of the default category pre-selected for the new News
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'defaultCategory' => 3
],
```
......@@ -137,7 +137,7 @@ The ID of the default category pre-selected for the new News
This set the auto update of the publication date on the save if the news is published
```php
'news' => [
'class' => 'elitedivision\amos\news\AmosNews',
'class' => 'arter\amos\news\AmosNews',
'autoUpdatePublicationDate' => true
],
```
......@@ -6,14 +6,14 @@
"yii2",
"news"
],
"homepage": "http://www.elitedivision.it/",
"homepage": "http://www.arter.it/",
"type": "component",
"license": "BSD-3-Clause",
"support": {
"issues": "http://www.example.com/",
"forum": "http://www.example.com/forum/",
"wiki": "http://www.example.com/wiki/",
"source": "https://github.com/elitedivision/amos-news"
"source": "https://github.com/arter/amos-news"
},
"require": {
"php": ">=5.4.0",
......@@ -45,7 +45,7 @@
},
"autoload": {
"psr-4": {
"elitedivision\\amos\\news\\": "src"
"arter\\amos\\news\\": "src"
}
},
"require-dev": {
......
......@@ -5,29 +5,29 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news;
use elitedivision\amos\core\interfaces\CmsModuleInterface;
use elitedivision\amos\core\interfaces\SearchModuleInterface;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\ModuleInterface;
use elitedivision\amos\news\widgets\graphics\WidgetGraphicsUltimeNews;
use elitedivision\amos\news\widgets\icons\WidgetIconAllNews;
use elitedivision\amos\news\widgets\icons\WidgetIconNews;
use elitedivision\amos\news\widgets\icons\WidgetIconNewsCategorie;
use elitedivision\amos\news\widgets\icons\WidgetIconNewsCreatedBy;
use elitedivision\amos\news\widgets\icons\WidgetIconNewsDashboard;
use elitedivision\amos\news\widgets\icons\WidgetIconNewsDaValidare;
namespace arter\amos\news;
use arter\amos\core\interfaces\CmsModuleInterface;
use arter\amos\core\interfaces\SearchModuleInterface;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
use arter\amos\news\widgets\graphics\WidgetGraphicsUltimeNews;
use arter\amos\news\widgets\icons\WidgetIconAllNews;
use arter\amos\news\widgets\icons\WidgetIconNews;
use arter\amos\news\widgets\icons\WidgetIconNewsCategorie;
use arter\amos\news\widgets\icons\WidgetIconNewsCreatedBy;
use arter\amos\news\widgets\icons\WidgetIconNewsDashboard;
use arter\amos\news\widgets\icons\WidgetIconNewsDaValidare;
use yii\helpers\ArrayHelper;
/**
* Class AmosNews
* @package elitedivision\amos\news
* @package arter\amos\news
*/
class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterface, CmsModuleInterface
{
......@@ -179,7 +179,7 @@ class AmosNews extends AmosModule implements ModuleInterface, SearchModuleInterf
{
parent::init();
\Yii::setAlias('@elitedivision/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers');
\Yii::setAlias('@arter/amos/' . static::getModuleName() . '/controllers', __DIR__ . '/controllers');
//Configuration: merge default module configurations loaded from config.php with module configurations set by the application
$config = require(__DIR__ . DIRECTORY_SEPARATOR . self::$CONFIG_FOLDER . DIRECTORY_SEPARATOR . 'config.php');
......
......@@ -5,19 +5,19 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\assets;
namespace arter\amos\news\assets;
use yii\web\AssetBundle;
use elitedivision\amos\core\widget\WidgetAbstract;
use arter\amos\core\widget\WidgetAbstract;
class ModuleNewsAsset extends AssetBundle
{
public $sourcePath = '@vendor/elitedivision/amos-news/src/assets/web';
public $sourcePath = '@vendor/arter/amos-news/src/assets/web';
public $css = [
'less/news.less',
......@@ -38,9 +38,9 @@ class ModuleNewsAsset extends AssetBundle
}
if(!empty($moduleL)){
$this->depends [] = 'elitedivision\amos\layout\assets\BaseAsset';
$this->depends [] = 'arter\amos\layout\assets\BaseAsset';
}else{
$this->depends [] = 'elitedivision\amos\core\views\assets\AmosCoreAsset';
$this->depends [] = 'arter\amos\core\views\assets\AmosCoreAsset';
}
parent::init();
}
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/variables.less";
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/utility.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/variables.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/utility.less";
/**
IMPORT STYLE-CUSTOM
*/
......
/**
IMPORT AMOS-LAYOUT VARIABLES
*/
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/v2/variables.less";
@import (optional) "../../vendor/elitedivision/amos-layout/src/assets/resources/base/less/v2/utility.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/v2/variables.less";
@import (optional) "../../vendor/arter/amos-layout/src/assets/resources/base/less/v2/utility.less";
/**
IMPORT STYLE-CUSTOM
*/
......
......@@ -5,23 +5,23 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\components
* @package arter\amos\news\components
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\components;
namespace arter\amos\news\components;
use elitedivision\amos\attachments\models\File;
use elitedivision\amos\core\components\PartQuestionarioAbstract;
use elitedivision\amos\news\AmosNews;
use elitedivision\amos\news\models\News;
use arter\amos\attachments\models\File;
use arter\amos\core\components\PartQuestionarioAbstract;
use arter\amos\news\AmosNews;
use arter\amos\news\models\News;
use Yii;
use yii\web\UploadedFile;
/**
* Class PartsWizardNewsCreation
* @package elitedivision\amos\news\components
* @package arter\amos\news\components
*/
class PartsWizardNewsCreation extends PartQuestionarioAbstract
{
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,14 +5,14 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\controllers;
namespace arter\amos\news\controllers;
use elitedivision\amos\dashboard\controllers\base\DashboardController;
use arter\amos\dashboard\controllers\base\DashboardController;
use yii\helpers\Url;
class DefaultController extends DashboardController
......@@ -67,7 +67,7 @@ class DefaultController extends DashboardController
$module = \Yii::$app->getModule('layout');
if (empty($module)) {
if (strpos($this->layout, '@') === false) {
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
}
return true;
}
......
......@@ -5,25 +5,25 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\controllers;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\helpers\Html;
use elitedivision\amos\core\icons\AmosIcons;
use elitedivision\amos\dashboard\controllers\TabDashboardControllerTrait;
use elitedivision\amos\news\AmosNews;
use elitedivision\amos\news\models\NewsCategorie;
use elitedivision\amos\news\models\NewsCategoryCommunityMm;
use elitedivision\amos\news\models\NewsCategoryRolesMm;
use elitedivision\amos\news\models\search\NewsCategorieSearch;
namespace arter\amos\news\controllers;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\helpers\Html;
use arter\amos\core\icons\AmosIcons;
use arter\amos\dashboard\controllers\TabDashboardControllerTrait;
use arter\amos\news\AmosNews;
use arter\amos\news\models\NewsCategorie;
use arter\amos\news\models\NewsCategoryCommunityMm;
use arter\amos\news\models\NewsCategoryRolesMm;
use arter\amos\news\models\search\NewsCategorieSearch;
use Yii;
use yii\helpers\Url;
use elitedivision\amos\core\widget\WidgetAbstract;
use arter\amos\core\widget\WidgetAbstract;
/**
* Class NewsCategorieController
......@@ -31,7 +31,7 @@ use elitedivision\amos\core\widget\WidgetAbstract;
*
* @property NewsCategorie $model
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
*/
class NewsCategorieController extends CrudController
{
......@@ -217,7 +217,7 @@ class NewsCategorieController extends CrudController
$module = \Yii::$app->getModule('layout');
if (empty($module)) {
if (strpos($this->layout, '@') === false) {
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/' . (!empty($layout) ? $layout : $this->layout);
}
return true;
}
......
......@@ -4,23 +4,23 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\controllers;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\helpers\BreadcrumbHelper;
use elitedivision\amos\core\helpers\Html;
use elitedivision\amos\core\icons\AmosIcons;
use elitedivision\amos\cwh\query\CwhActiveQuery;
use elitedivision\amos\dashboard\controllers\TabDashboardControllerTrait;
use elitedivision\amos\news\AmosNews;
use elitedivision\amos\news\assets\ModuleNewsAsset;
use elitedivision\amos\news\models\News;
use elitedivision\amos\news\models\search\NewsSearch;
namespace arter\amos\news\controllers;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\helpers\BreadcrumbHelper;
use arter\amos\core\helpers\Html;
use arter\amos\core\icons\AmosIcons;
use arter\amos\cwh\query\CwhActiveQuery;
use arter\amos\dashboard\controllers\TabDashboardControllerTrait;
use arter\amos\news\AmosNews;
use arter\amos\news\assets\ModuleNewsAsset;
use arter\amos\news\models\News;
use arter\amos\news\models\search\NewsSearch;
use raoul2000\workflow\base\WorkflowException;
use Yii;
use yii\filters\AccessControl;
......@@ -29,14 +29,14 @@ use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\web\View;
use ReflectionClass;
use elitedivision\amos\core\widget\WidgetAbstract;
use arter\amos\core\widget\WidgetAbstract;
/**
* Class NewsController
*
* NewsController implements the CRUD actions for News model.
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
*/
class NewsController extends CrudController
{
......@@ -250,7 +250,7 @@ class NewsController extends CrudController
if (!empty($this->scope)) {
if (isset($this->scope['community'])) {
$communityId = $this->scope['community'];
$community = \elitedivision\amos\community\models\Community::findOne($communityId);
$community = \arter\amos\community\models\Community::findOne($communityId);
$dashboardCommunityTitle = AmosNews::t('amosnews', "Dashboard").' '.$community->name;
$dasbboardCommunityUrl = Yii::$app->urlManager->createUrl(['community/join', 'id' => $communityId]);
Yii::$app->view->params['breadcrumbs'][] = ['label' => $dashboardCommunityTitle, 'url' => $dasbboardCommunityUrl];
......@@ -259,7 +259,7 @@ class NewsController extends CrudController
}
/**
* Set a view param used in \elitedivision\amos\core\forms\CreateNewButtonWidget
* Set a view param used in \arter\amos\core\forms\CreateNewButtonWidget
*/
private function setCreateNewBtnLabel()
{
......
......@@ -5,20 +5,20 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\news\controllers;
namespace arter\amos\news\controllers;
use elitedivision\amos\core\behaviors\TaggableBehavior;
use elitedivision\amos\core\controllers\CrudController;
use elitedivision\amos\core\module\BaseAmosModule;
use elitedivision\amos\news\AmosNews;
use elitedivision\amos\news\components\PartsWizardNewsCreation;
use elitedivision\amos\news\models\News;
use elitedivision\amos\news\models\search\NewsSearch;
use arter\amos\core\behaviors\TaggableBehavior;
use arter\amos\core\controllers\CrudController;
use arter\amos\core\module\BaseAmosModule;
use arter\amos\news\AmosNews;
use arter\amos\news\components\PartsWizardNewsCreation;
use arter\amos\news\models\News;
use arter\amos\news\models\search\NewsSearch;
use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
......@@ -28,9 +28,9 @@ use yii\helpers\Url;
/**
* Class NewsWizardController
*
* @property \elitedivision\amos\news\models\News $model
* @property \arter\amos\news\models\News $model
*
* @package elitedivision\amos\news\controllers
* @package arter\amos\news\controllers
*/
class NewsWizardController extends CrudController
{
......@@ -313,7 +313,7 @@ class NewsWizardController extends CrudController
$module = \Yii::$app->getModule('layout');
if (empty($module)) {
if (strpos($this->layout, '@') === false) {
$this->layout = '@vendor/elitedivision/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
$this->layout = '@vendor/arter/amos-core/views/layouts/'.(!empty($layout) ? $layout : $this->layout);
}
return true;
}
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\comments\i18n\en-GB
* @package arter\amos\comments\i18n\en-GB
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\comments\i18n\en-GB
* @package arter\amos\comments\i18n\en-GB
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
<?php
namespace elitedivision\amos\news\i18n\grammar;
namespace arter\amos\news\i18n\grammar;
use elitedivision\amos\core\interfaces\ModelGrammarInterface;
use elitedivision\amos\news\AmosNews;
use arter\amos\core\interfaces\ModelGrammarInterface;
use arter\amos\news\AmosNews;
/**
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\comments\i18n\it-IT
* @package arter\amos\comments\i18n\it-IT
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\migrations
* @package arter\amos\news\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTableCreation;
use arter\amos\core\migration\AmosMigrationTableCreation;
/**
* Class m160912_084648_create_news_categorie
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news
* @package arter\amos\news
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\news\migrations
* @package arter\amos\news\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationTableCreation;
use arter\amos\core\migration\AmosMigrationTableCreation;
/**
* Class m160912_084737_create_news_allegati
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment