Commit 52479aac authored by waltermazza's avatar waltermazza
Browse files

Arter namespace

parent feb179fe
......@@ -6,10 +6,10 @@ Translation management.
Insert in config/component-amos
```php
'view' => [
'class' => 'elitedivision\amos\core\components\AmosView',
'class' => 'arter\amos\core\components\AmosView',
'theme' => [
'pathMap' => [
'@vendor/lajax/yii2-translate-manager/views/language/' => '@vendor/elitedivision/amos-translation/src/views/translatemanager/'
'@vendor/lajax/yii2-translate-manager/views/language/' => '@vendor/arter/amos-translation/src/views/translatemanager/'
],
],
],
......
......@@ -6,14 +6,14 @@
"yii2",
"translation"
],
"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-workflow"
"source": "https://github.com/arter/amos-workflow"
},
"minimum-stability": "dev",
"require": {
......@@ -31,7 +31,7 @@
},
"autoload": {
"psr-4": {
"elitedivision\\amos\\translation\\": "src"
"arter\\amos\\translation\\": "src"
}
}
}
\ No newline at end of file
......@@ -4,17 +4,17 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation;
namespace arter\amos\translation;
use elitedivision\amos\core\module\Module;
use elitedivision\amos\core\module\AmosModule;
use elitedivision\amos\core\module\ModuleInterface;
use elitedivision\amos\core\record\Record;
use arter\amos\core\module\Module;
use arter\amos\core\module\AmosModule;
use arter\amos\core\module\ModuleInterface;
use arter\amos\core\record\Record;
use yii\web\Application;
use yii\base\BootstrapInterface;
use Yii;
......@@ -24,7 +24,7 @@ use yii\helpers\FileHelper;
/**
* Class AmosWorkflow
* @package elitedivision\amos\workflow
* @package arter\amos\workflow
*/
class AmosTranslation extends AmosModule implements BootstrapInterface
{
......@@ -40,7 +40,7 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
public $newFileMode = 0666;
public $newDirMode = 0777;
public $languageField = 'language';
public $controllerNamespace = 'elitedivision\amos\translation\controllers';
public $controllerNamespace = 'arter\amos\translation\controllers';
/**
* It set the language source, if is set every saved record is copied in the translation language default
......@@ -113,7 +113,7 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
* ```php
* 'modules' => [
* 'translation' => [
* 'class' => 'elitedivision\amos\translation\AmosTranslation',
* 'class' => 'arter\amos\translation\AmosTranslation',
* 'translationBootstrap' => [
* 'configuration' => [
* 'translationLabels' => [
......@@ -128,12 +128,12 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
* ],
* ],
* 'translationContents' => [
* 'classBehavior' => \elitedivision\amos\translation\behaviors\TranslateableBehavior::className(),
* 'classBehavior' => \arter\amos\translation\behaviors\TranslateableBehavior::className(),
* 'models' => [
* [
* 'namespace' => 'backend\modules\id_plugin\models\NameModel',
* //'connection' => 'db', //if not set it use 'db'
* //'classBehavior' => null,//if not set it use default classBehavior 'elitedivision\amos\translation\behaviors\TranslateableBehavior'
* //'classBehavior' => null,//if not set it use default classBehavior 'arter\amos\translation\behaviors\TranslateableBehavior'
* //'enableWorkflow' => false,//if not set it use default configuration of the plugin
* //'workflow' => 'AmosTranslationWorkflow',
* //'view' => '@backend/modules/module/controller/view,
......@@ -161,8 +161,8 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
* ```php
* 'bootstrap' => [
* 'translation',
* 'elitedivision\amos\translation\bootstrap\EventActiveRecordBootstrap',//fot the translation of the records
* 'elitedivision\amos\translation\bootstrap\EventViewBootstrap',//for the widget in the view file
* 'arter\amos\translation\bootstrap\EventActiveRecordBootstrap',//fot the translation of the records
* 'arter\amos\translation\bootstrap\EventViewBootstrap',//for the widget in the view file
* ],
* ```
*/
......@@ -174,7 +174,7 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
public $eventViewBlackListModels = [];
public $eventViewWhiteListParts = ['_form'];
public $enableWidgetView = true;
public $widgetViewFile = '@vendor/elitedivision/amos-translation/src/views/default/language_status.php';
public $widgetViewFile = '@vendor/arter/amos-translation/src/views/default/language_status.php';
public $actionLanguage = '/translation/default/language';
public $numberGridViewField = 3;
public $enableRTE = true;
......@@ -184,7 +184,7 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
* Model base class will be generated
* @var string
*/
public $modelBaseClass = 'elitedivision\\amos\\core\\record\\Record';
public $modelBaseClass = 'arter\\amos\\core\\record\\Record';
public $modelNs = "backend\\models\\translations";
public $modelGenerateRelation = 'all';
......@@ -263,7 +263,7 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
{
parent::init();
\Yii::setAlias('@elitedivision/amos/'.static::getModuleName().'/controllers', __DIR__.'/controllers');
\Yii::setAlias('@arter/amos/'.static::getModuleName().'/controllers', __DIR__.'/controllers');
// initialize the module with the configuration loaded from config.php
Yii::configure($this, require(__DIR__.DIRECTORY_SEPARATOR.self::$CONFIG_FOLDER.DIRECTORY_SEPARATOR.'config.php'));
$this->configTranslationLabelsByModules();
......@@ -305,12 +305,12 @@ class AmosTranslation extends AmosModule implements BootstrapInterface
'@app',
'@backend',
'@frontend',
'@vendor/elitedivision/',
'@vendor/arter/',
]);
$configuration['scanRootParentDirectory'] = (isset($this->module_translation_labels_options['scanRootParentDirectory'])
? $this->module_translation_labels_options['scanRootParentDirectory'] : true);
$configuration['layout'] = (isset($this->module_translation_labels_options['layout']) ? $this->module_translation_labels_options['layout']
: '@vendor/elitedivision/amos-layout/src/views/layouts/main');
: '@vendor/arter/amos-layout/src/views/layouts/main');
$configuration['allowedIPs'] = (isset($this->module_translation_labels_options['allowedIPs']) ? $this->module_translation_labels_options['allowedIPs']
: ['*']);
$configuration['roles'] = (isset($this->module_translation_labels_options['roles']) ? $this->module_translation_labels_options['roles']
......
......@@ -4,25 +4,25 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\chat
* @package arter\amos\chat
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\assets;
namespace arter\amos\translation\assets;
use yii\web\AssetBundle;
/**
* Class AmosChatAsset
* @package elitedivision\amos\chat\assets
* @package arter\amos\chat\assets
*/
class AmosTranslationAsset extends AssetBundle
{
/**
* @var string
*/
public $sourcePath = '@vendor/elitedivision/amos-translation/src/assets/web';
public $sourcePath = '@vendor/arter/amos-translation/src/assets/web';
/**
* @var array
......@@ -40,6 +40,6 @@ class AmosTranslationAsset extends AssetBundle
* @var array
*/
public $depends = [
'elitedivision\amos\core\views\assets\AmosCoreAsset',
'arter\amos\core\views\assets\AmosCoreAsset',
];
}
\ No newline at end of file
......@@ -4,12 +4,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\behaviors;
namespace arter\amos\translation\behaviors;
use Yii;
use yii\base\Behavior;
......@@ -17,7 +17,7 @@ use yii\base\Event;
use yii\db\ActiveRecord;
use yii\helpers\FileHelper;
use yii\helpers\StringHelper;
use elitedivision\amos\core\record\CachedActiveQuery;
use arter\amos\core\record\CachedActiveQuery;
class TranslateableBehavior extends Behavior
{
......@@ -295,7 +295,7 @@ class TranslateableBehavior extends Behavior
$languages = [];
$module = \Yii::$app->getModule('translation');
$result = true;
$languages = \elitedivision\amos\translation\models\TranslationConf::getStaticAllActiveLanguages($module->byPassPermissionInlineTranslation)->asArray()->all();
$languages = \arter\amos\translation\models\TranslationConf::getStaticAllActiveLanguages($module->byPassPermissionInlineTranslation)->asArray()->all();
$defaultLanguage = (!empty($this->defaultLanguage) ? $this->defaultLanguage : null);
if ($delete) {
if ($this->afterDeleteSource == self::DELETE_ONLY_LANGUAGE_SELECTED) {
......
......@@ -4,22 +4,22 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\bootstrap;
namespace arter\amos\translation\bootstrap;
use elitedivision\amos\translation\AmosTranslation;
use elitedivision\amos\translation\models\LanguageTranslateUserFields;
use arter\amos\translation\AmosTranslation;
use arter\amos\translation\models\LanguageTranslateUserFields;
use Yii;
use yii\base\Event;
use yii\db\ActiveRecord;
/**
* Class EventActiveRecordBootstrap
* @package elitedivision\amos\translation\bootstrap
* @package arter\amos\translation\bootstrap
*/
class EventActiveRecordBootstrap extends \yii\db\ActiveRecord
{
......
......@@ -4,18 +4,18 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\bootstrap;
namespace arter\amos\translation\bootstrap;
use Yii;
use yii\base\Application;
use yii\helpers\FileHelper;
use elitedivision\amos\translation\models\TranslationConf;
use elitedivision\amos\translation\AmosTranslation;
use arter\amos\translation\models\TranslationConf;
use arter\amos\translation\AmosTranslation;
/**
* Class TranslationBootstrap: <br />
......@@ -51,7 +51,7 @@ class EventViewBootstrap extends \yii\web\View
$modelsEnabled = [];
$blackListModels = array_merge([
'elitedivision\amos\translation\bootstrap\EventViewBootstrap',
'arter\amos\translation\bootstrap\EventViewBootstrap',
], $moduleTranslation->eventViewBlackListModels);
$blackListViews = array_merge([
......
......@@ -4,12 +4,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\components;
namespace arter\amos\translation\components;
use Yii;
use yii\gii\CodeFile;
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation
* @package arter\amos\translation
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -4,29 +4,29 @@
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package Open20Package
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\controllers;
namespace arter\amos\translation\controllers;
use elitedivision\amos\translation\utility\TranslationUtility;
use arter\amos\translation\utility\TranslationUtility;
use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\web\Cookie;
use elitedivision\amos\translation\models\TranslationConf;
use arter\amos\translation\models\TranslationConf;
use yii\data\ActiveDataProvider;
use yii\helpers\StringHelper;
use yii\helpers\Inflector;
use elitedivision\amos\translation\AmosTranslation;
use arter\amos\translation\AmosTranslation;
use yii\helpers\Url;
use elitedivision\amos\admin\models\UserProfile;
use elitedivision\amos\translation\models\TranslationUserLanguageMm;
use arter\amos\admin\models\UserProfile;
use arter\amos\translation\models\TranslationUserLanguageMm;
use yii\web\ForbiddenHttpException;
use elitedivision\amos\core\record\CachedActiveQuery;
use arter\amos\core\record\CachedActiveQuery;
/**
* Translation controller
......@@ -204,7 +204,7 @@ class DefaultController extends Controller
$model = new TranslationUserLanguageMm();
}
$languages = \elitedivision\amos\translation\models\TranslationUserLanguageMm::find()
$languages = \arter\amos\translation\models\TranslationUserLanguageMm::find()
->andWhere(['user_id' => $user_id])
->select('language');
$lngs = [];
......@@ -240,7 +240,7 @@ class DefaultController extends Controller
$lang = $this->verifyLang($lang);
$modelSearch = new \elitedivision\amos\translation\models\search\TranslationSearch();
$modelSearch = new \arter\amos\translation\models\search\TranslationSearch();
$model = new $classNameTrans;
$pkSource = \Yii::$app->{$module->dbSource}->getTableSchema($namespace::tableName())->primaryKey;
......@@ -482,7 +482,7 @@ class DefaultController extends Controller
$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,18 +4,18 @@
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package Open20Package
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\controllers;
namespace arter\amos\translation\controllers;
use Yii;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\helpers\Url;
use elitedivision\amos\dashboard\controllers\base\DashboardController;
use arter\amos\dashboard\controllers\base\DashboardController;
/**
* Translation controller
......@@ -85,7 +85,7 @@ class TranslateController 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;
}
......
......@@ -4,22 +4,22 @@
* Art-ER Attrattività, ricerca e territorio dell’Emilia-Romagna
* OPEN 2.0
*
* @package Open20Package
* @package arter
* @category CategoryName
* @author Elite Division S.r.l.
*/
namespace elitedivision\amos\translation\controllers;
namespace arter\amos\translation\controllers;
use elitedivision\amos\core\helpers\BreadcrumbHelper;
use arter\amos\core\helpers\BreadcrumbHelper;
use Yii;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
use yii\helpers\FileHelper;
use yii\helpers\Url;
use elitedivision\amos\dashboard\controllers\base\DashboardController;
use arter\amos\dashboard\controllers\base\DashboardController;
use yii\web\Controller;
use elitedivision\amos\translation\AmosTranslation;
use arter\amos\translation\AmosTranslation;
/**
* Translation controller
......
......@@ -4,7 +4,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\i18n\en-GB
* @package arter\amos\translation\i18n\en-GB
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -4,7 +4,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\i18n\en-US
* @package arter\amos\translation\i18n\en-US
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -4,7 +4,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\i18n\it-IT
* @package arter\amos\translation\i18n\it-IT
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\migrations
* @package arter\amos\translation\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\migrations
* @package arter\amos\translation\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,7 +5,7 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\migrations
* @package arter\amos\translation\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
......
......@@ -5,12 +5,12 @@
* OPEN 2.0
*
*
* @package elitedivision\amos\translation\migrations
* @package arter\amos\translation\migrations
* @category CategoryName
* @author Elite Division S.r.l.
*/
use elitedivision\amos\core\migration\AmosMigrationPermissions;
use arter\amos\core\migration\AmosMigrationPermissions;
use yii\rbac\Permission;
/**
......@@ -28,7 +28,7 @@ class m170613_145155_permission_translation extends AmosMigrationPermissions
'name' => 'CanTranslateRule',
'type' => Permission::TYPE_PERMISSION,
'description' => 'Rule to translate',
'ruleName' => \elitedivision\amos\translation\rules\CanTranslateRule::className(),
'ruleName' => \arter\amos\translation\rules\CanTranslateRule::className(),
'parent' => ['CONTENT_TRANSLATOR']
],
[
......
Markdown is supported
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