Class lispa\amos\translation\AmosTranslation

Inheritancelispa\amos\translation\AmosTranslation » lispa\amos\core\module\AmosModule » lispa\amos\core\module\BaseAmosModule » yii\base\Module » yii\di\ServiceLocator » yii\base\Component » yii\base\Object
Implementslispa\amos\core\module\ModuleInterface, yii\base\BootstrapInterface, yii\base\Configurable

Class AmosWorkflow

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$CONFIG_FOLDER lispa\amos\translation\AmosTranslation
$actionLanguage lispa\amos\translation\AmosTranslation
$aliases array List of path aliases to be defined. yii\base\Module
$amosUniqueId string lispa\amos\core\module\AmosModule
$appLanguage string lispa\amos\translation\AmosTranslation
$arrayDbTranslation array Array of the tables for the translatemanager plugin lispa\amos\translation\AmosTranslation
$availableLanguages \lispa\amos\translation\type lispa\amos\translation\AmosTranslation
$basePath string The root directory of the module. yii\base\Module
$behaviors yii\base\Behavior[] List of behaviors attached to this component yii\base\Component
$browserLanguage string Language lispa\amos\translation\AmosTranslation
$cacheDuration integer lispa\amos\translation\AmosTranslation
$cached boolean lispa\amos\translation\AmosTranslation
$clientOptionsRTE lispa\amos\translation\AmosTranslation
$components lispa\amos\translation\AmosTranslation
$controllerMap array Mapping from controller ID to controller configurations. yii\base\Module
$controllerNamespace lispa\amos\translation\AmosTranslation
$controllerPath string The directory that contains the controller classes. yii\base\Module
$dbSource lispa\amos\translation\AmosTranslation
$dbTranslation lispa\amos\translation\AmosTranslation
$defaultLanguage lispa\amos\translation\AmosTranslation
$defaultListViews array This set the default views in lists lispa\amos\core\module\AmosModule
$defaultModels lispa\amos\translation\AmosTranslation
$defaultRoute string The default route of this module. yii\base\Module
$defaultTypeAttributesToTranslate lispa\amos\translation\AmosTranslation
$defaultUserLanguage string lispa\amos\translation\AmosTranslation
$enableRTE lispa\amos\translation\AmosTranslation
$enableUserLanguage lispa\amos\translation\AmosTranslation
$enableWidgetView lispa\amos\translation\AmosTranslation
$enableWorkflow boolean lispa\amos\translation\AmosTranslation
$eventViewBlackListModels lispa\amos\translation\AmosTranslation
$eventViewBlackListViews lispa\amos\translation\AmosTranslation
$eventViewWhiteListParts lispa\amos\translation\AmosTranslation
$forceTranslation lispa\amos\translation\AmosTranslation
$i18nDirPath string lispa\amos\core\module\AmosModule
$id string An ID that uniquely identifies this module among other modules which have the same parent. yii\base\Module
$languageField lispa\amos\translation\AmosTranslation
$layout string|boolean The layout that should be applied for views within this module. lispa\amos\translation\AmosTranslation
$layoutPath string The root directory of layout files. yii\base\Module
$modelBaseClass string lispa\amos\translation\AmosTranslation
$modelGenerateRelation lispa\amos\translation\AmosTranslation
$modelMap array lispa\amos\core\module\AmosModule
$modelNs lispa\amos\translation\AmosTranslation
$modelOwnerPlatformTrIdField lispa\amos\translation\AmosTranslation
$modelOwnerPlatformTrLanguageField lispa\amos\translation\AmosTranslation
$modelOwnerPlatformTranslation string lispa\amos\translation\AmosTranslation
$module yii\base\Module The parent module of this module. yii\base\Module
$moduleTranslationLabelsOptions lispa\amos\translation\AmosTranslation
$module_translation_labels lispa\amos\translation\AmosTranslation
$module_translation_labels_options lispa\amos\translation\AmosTranslation
$modules lispa\amos\translation\AmosTranslation
$name lispa\amos\translation\AmosTranslation
$nameCreatedBy lispa\amos\translation\AmosTranslation
$newDirMode lispa\amos\translation\AmosTranslation
$newFileMode lispa\amos\translation\AmosTranslation
$numberGridViewField lispa\amos\translation\AmosTranslation
$params array Custom module parameters (name => value). yii\base\Module
$pathsForceTranslation lispa\amos\translation\AmosTranslation
$queryCache \lispa\amos\translation\type lispa\amos\translation\AmosTranslation
$rbacEnabled boolean lispa\amos\core\module\BaseAmosModule
$statusWorkflowApproved lispa\amos\translation\AmosTranslation
$statusWorkflowInitial lispa\amos\translation\AmosTranslation
$supportedLanguages lispa\amos\translation\AmosTranslation
$surnameCreatedBy lispa\amos\translation\AmosTranslation
$systemBlackListAttributes lispa\amos\translation\AmosTranslation
$translationBootstrap Add this module to /common/config/main.php `php 'modules' => [ 'translation' => [ 'class' => 'lispa\amos\translation\AmosTranslation', 'translationBootstrap' => [ 'configuration' => [ 'translationLabels' => [ 'classBehavior' => \lajax\translatemanager\behaviors\TranslateBehavior::className(), 'models' => [ [ 'namespace' => 'cornernote\workflow\manager\models\Status', //'connection' => 'db', //if not set it use 'db' //'classBehavior' => null,//if not set it use default classBehavior 'lajax\translatemanager\behaviors\TranslateBehavior' 'attributes' => ['field'], ], ], ], 'translationContents' => [ 'classBehavior' => \lispa\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 'lispa\amos\translation\behaviors\TranslateableBehavior' //'enableWorkflow' => false,//if not set it use default configuration of the plugin //'workflow' => 'AmosTranslationWorkflow', //'view' => '@backend/modules/module/controller/view, //'forceTranslation' => true, 'rteAttributes' => ['field'], //only if $this->enableRTE is true it set the RTE for the specified attributes 'attributes' => ['field'], 'plugin' => 'id_plugin' ] ], ], ], ], 'module_translation_labels' => 'translatemanager', //'module_translation_labels_options' => [];//all the options of the translatemanager 'components' => [ 'translatemanager' => [ 'class' => 'lajax\translatemanager\Component' ], ], ], ], ` lispa\amos\translation\AmosTranslation
$uniqueId string The unique ID of the module. yii\base\Module
$userLanguage string For example 'it-IT', 'en-GB', 'en-US' lispa\amos\translation\AmosTranslation
$version string The version of this module. yii\base\Module
$viewPath string The root directory of view files. yii\base\Module
$widgetGraphics lispa\amos\translation\AmosTranslation
$widgetIcons lispa\amos\translation\AmosTranslation
$widgetViewFile lispa\amos\translation\AmosTranslation
$workflowBehavior string lispa\amos\translation\AmosTranslation

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Component
__clone() This method is called after the object is created by cloning an existing one. yii\base\Component
__construct() Constructor. yii\base\Module
__get() Getter magic method. yii\di\ServiceLocator
__isset() Checks if a property value is null. yii\di\ServiceLocator
__set() Sets the value of a component property. yii\base\Component
__unset() Sets a component property to be null. yii\base\Component
afterAction() This method is invoked right after an action within this module is executed. yii\base\Module
attachBehavior() Attaches a behavior to this component. yii\base\Component
attachBehaviors() Attaches a list of behaviors to the component. yii\base\Component
beforeAction() This method is invoked right before an action within this module is executed. yii\base\Module
beginCreateNewSessionKey() This method return the session key that must be used to add in session the url from the user have started the content creation. lispa\amos\core\module\AmosModule
beginCreateNewSessionKeyDateTime() This method return the session key that must be used to add in session the url date and time creation from the user have started the content creation. lispa\amos\core\module\AmosModule
behaviors() Returns a list of behaviors that this component should behave as. yii\base\Component
bootstrap() lispa\amos\translation\AmosTranslation
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Component
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Component
className() Returns the fully qualified name of this class. yii\base\Object
clear() Removes the component from the locator. yii\di\ServiceLocator
createController() Creates a controller instance based on the given route. yii\base\Module
createControllerByID() Creates a controller based on the given controller ID. yii\base\Module
createModel() lispa\amos\core\module\AmosModule
defineModelClasses() Merges the default and user defined model classes Also let's the developer to set new ones with the parameter being those the ones with most preference. lispa\amos\core\module\AmosModule
detachBehavior() Detaches a behavior from the component. yii\base\Component
detachBehaviors() Detaches all behaviors from the component. yii\base\Component
ensureBehaviors() Makes sure that the behaviors declared in behaviors() are attached to this component. yii\base\Component
generateTranslationModels() lispa\amos\translation\AmosTranslation
generateTranslationTables() lispa\amos\translation\AmosTranslation
get() Returns the component instance with the specified ID. yii\di\ServiceLocator
getAmosUniqueId() lispa\amos\core\module\AmosModule
getArrayDbTranslation() lispa\amos\translation\AmosTranslation
getAvailableLanguages() lispa\amos\translation\AmosTranslation
getBasePath() Returns the root directory of the module. yii\base\Module
getBehavior() Returns the named behavior object. yii\base\Component
getBehaviors() Returns all behaviors attached to this component. yii\base\Component
getBrowserLanguage() Get browser language lispa\amos\translation\AmosTranslation
getComponents() Returns the list of the component definitions or the loaded component instances. yii\di\ServiceLocator
getControllerPath() Returns the directory that contains the controller classes according to $controllerNamespace. yii\base\Module
getDefaultModels() lispa\amos\translation\AmosTranslation
getI18nDirPath() lispa\amos\core\module\AmosModule
getInstance() Returns the currently requested instance of this module class. yii\base\Module
getLayoutPath() Returns the directory that contains layout view files for this module. yii\base\Module
getModelAttributes() lispa\amos\translation\AmosTranslation
getModule() Retrieves the child module of the specified ID. yii\base\Module
getModuleName() lispa\amos\translation\AmosTranslation
getModuleTranslationLabelsOptions() lispa\amos\translation\AmosTranslation
getModules() Returns the sub-modules in this module. yii\base\Module
getRbacEnabled() lispa\amos\core\module\BaseAmosModule
getUniqueId() Returns an ID that uniquely identifies this module among all modules within the current application. yii\base\Module
getUserLanguage() lispa\amos\translation\AmosTranslation
getVersion() Returns current module version. yii\base\Module
getViewPath() Returns the directory that contains the view files for this module. yii\base\Module
getWidgetGraphics() lispa\amos\translation\AmosTranslation
getWidgetIcons() lispa\amos\translation\AmosTranslation
has() Returns a value indicating whether the locator has the specified component definition or has instantiated the component. yii\di\ServiceLocator
hasEventHandlers() Returns a value indicating whether there is any handler attached to the named event. yii\base\Component
hasMethod() Returns a value indicating whether a method is defined. yii\base\Component
hasModule() Checks whether the child module of the specified ID exists. yii\base\Module
hasProperty() Returns a value indicating whether a property is defined for this component. yii\base\Component
init() lispa\amos\translation\AmosTranslation
instance() Return an instance of module lispa\amos\core\module\AmosModule
model() Get defined className of model lispa\amos\core\module\AmosModule
off() Detaches an existing event handler from this component. yii\base\Component
on() Attaches an event handler to an event. yii\base\Component
runAction() Runs a controller action specified by a route. yii\base\Module
set() Registers a component definition with this locator. yii\di\ServiceLocator
setAliases() Defines path aliases. yii\base\Module
setAppLanguage() lispa\amos\translation\AmosTranslation
setBasePath() Sets the root directory of the module. yii\base\Module
setComponents() Registers a set of component definitions in this locator. yii\di\ServiceLocator
setInstance() Sets the currently requested instance of this module class. yii\base\Module
setLayoutPath() Sets the directory that contains the layout files. yii\base\Module
setModule() Adds a sub-module to this module. yii\base\Module
setModules() Registers sub-modules in the current module. yii\base\Module
setRbacEnabled() lispa\amos\core\module\BaseAmosModule
setUserLanguage() Set user language lispa\amos\translation\AmosTranslation
setVersion() Sets current module version. yii\base\Module
setViewPath() Sets the directory that contains the view files. yii\base\Module
t() lispa\amos\core\module\BaseAmosModule
tHtml() Metodo da usare per tutte le traduzioni che non fanno parte di attributi dei tag html (es. Non si può usare nell'attributo "title" del tag "a") lispa\amos\core\module\BaseAmosModule
tOld() Metodo vecchio stile com'era nei plugin prima di introdurre le traduzioni a db. lispa\amos\core\module\BaseAmosModule
trigger() Triggers an event. yii\base\Component

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_AFTER_ACTION yii\base\ActionEvent An event raised after executing a controller action. yii\base\Module
EVENT_BEFORE_ACTION yii\base\ActionEvent An event raised before executing a controller action. yii\base\Module

Property Details

$CONFIG_FOLDER public static property
public static $CONFIG_FOLDER 'config'
$actionLanguage public property
public $actionLanguage '/translation/default/language'
$appLanguage public write-only property
public void setAppLanguage ( $language )
$arrayDbTranslation public read-only property

Array of the tables for the translatemanager plugin

$availableLanguages public read-only property
public \lispa\amos\translation\type getAvailableLanguages ( )
$browserLanguage public read-only property

Language

$cacheDuration public property
public integer $cacheDuration 86400
$cached public property
public boolean $cached true
$clientOptionsRTE public property
public $clientOptionsRTE = []
$components public property
public array getComponents ( $returnDefinitions true )
public void setComponents ( $components )
$controllerNamespace public property
public $controllerNamespace 'lispa\amos\translation\controllers'
$dbSource public property
public $dbSource 'db'
$dbTranslation public property
public $dbTranslation 'db'
$defaultLanguage public property
public $defaultLanguage null
$defaultModels public read-only property
public void getDefaultModels ( )
$defaultTypeAttributesToTranslate public property
public $defaultTypeAttributesToTranslate = ['string''text']
$defaultUserLanguage public property
public string $defaultUserLanguage 'en-GB'
$enableRTE public property
public $enableRTE true
$enableUserLanguage public property
public $enableUserLanguage true
$enableWidgetView public property
public $enableWidgetView true
$enableWorkflow public property
public boolean $enableWorkflow true
$eventViewBlackListModels public property
$eventViewBlackListViews public property
$eventViewWhiteListParts public property
public $eventViewWhiteListParts = ['_form']
$forceTranslation public property
public $forceTranslation true
$languageField public property
public $languageField 'language'
$layout public property

The layout that should be applied for views within this module. This refers to a view name relative to $layoutPath. If this is not set, it means the layout value of the parent module will be taken. If this is false, layout will be disabled within this module.

public string|boolean $layout 'main'
$modelBaseClass public property
public string $modelBaseClass 'lispa\\amos\\core\\record\\Record'
$modelGenerateRelation public property
public $modelGenerateRelation 'all'
$modelNs public property
public $modelNs "backend\\models\\translations"
$modelOwnerPlatformTrIdField public property
$modelOwnerPlatformTrLanguageField public property
$modelOwnerPlatformTranslation public property
public string $modelOwnerPlatformTranslation 'lajax\translatemanager\models\LanguageTranslate'
$moduleTranslationLabelsOptions public read-only property
$module_translation_labels public property
$module_translation_labels_options public property
$modules public property
public array getModules ( $loadedOnly false )
public void setModules ( $modules )
$name public property
public $name 'Translation'
$nameCreatedBy public property
public $nameCreatedBy 'nome'
$newDirMode public property
public $newDirMode 511
$newFileMode public property
public $newFileMode 438
$numberGridViewField public property
$pathsForceTranslation public property
public $pathsForceTranslation = ['@frontend']
$queryCache public property
public \lispa\amos\translation\type $queryCache 'cache'
$statusWorkflowApproved public property
public $statusWorkflowApproved 'AmosTranslationWorkflow/APPROVED'
$statusWorkflowInitial public property
public $statusWorkflowInitial 'AmosTranslationWorkflow/DRAFT'
$supportedLanguages public property
public $supportedLanguages = []
$surnameCreatedBy public property
public $surnameCreatedBy 'cognome'
$systemBlackListAttributes public property
public $systemBlackListAttributes = ['id''status''created_at''updated_at''deleted_at''created_by''updated_by''deleted_by']
$translationBootstrap public property

Add to bootstrap array in the /backend/config/main.php and/or /frontend/config/main.php the follow class `php 'bootstrap' => [

 'translation',
 'lispa\amos\translation\bootstrap\EventActiveRecordBootstrap',//fot the translation of the records
 'lispa\amos\translation\bootstrap\EventViewBootstrap',//for the widget in the view file

], `

public $translationBootstrap null
$userLanguage public property

For example 'it-IT', 'en-GB', 'en-US'

public string getUserLanguage ( $userId null )
public void setUserLanguage ( $language )
$widgetGraphics public read-only property
public void getWidgetGraphics ( )
$widgetIcons public read-only property
public void getWidgetIcons ( )
$widgetViewFile public property
public $widgetViewFile '@vendor/lispa/amos-translation/src/views/default/language_status.php'
$workflowBehavior public property
public string $workflowBehavior 'workflow'

Method Details

bootstrap() public method

public void bootstrap ( $app )
$app
executeSql() protected method

protected void executeSql ( $classname, $force false )
$classname
$force
generateTranslationModels() public method

public void generateTranslationModels ( $force false )
$force
generateTranslationTables() public method

public void generateTranslationTables ( $force false )
$force
getArrayDbTranslation() public method

public array getArrayDbTranslation ( )
return array

Array of the tables for the translatemanager plugin

getAvailableLanguages() public method

public \lispa\amos\translation\type getAvailableLanguages ( )
getBrowserLanguage() public method

Get browser language

public string getBrowserLanguage ( )
return string

Language

getChangeAttributes() protected method

protected void getChangeAttributes ( $classname )
$classname
getDefaultModels() public method

public void getDefaultModels ( )
getModelAttributes() public method

public void getModelAttributes ( $classname, $translation false )
$classname
$translation
getModuleName() public static method

public static void getModuleName ( )
getModuleTranslationLabelsOptions() public method

public void getModuleTranslationLabelsOptions ( )
getUserLanguage() public method

public string getUserLanguage ( $userId null )
$userId integer|null
getWidgetGraphics() public method

public void getWidgetGraphics ( )
getWidgetIcons() public method

public void getWidgetIcons ( )
init() public method

public void init ( )
setAppLanguage() public method

public void setAppLanguage ( $language )
$language string
setUserLanguage() public method

Set user language

public void setUserLanguage ( $language )
$language string

For example 'it-IT', 'en-GB', 'en-US'