Class lispa\amos\community\AmosCommunity

Inheritancelispa\amos\community\AmosCommunity » 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\interfaces\CmsModuleInterface, lispa\amos\core\interfaces\SearchModuleInterface, lispa\amos\core\module\ModuleInterface, yii\base\Configurable

Class AmosCommunity community module definition class

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$CONFIG_FOLDER lispa\amos\community\AmosCommunity
$aliases array List of path aliases to be defined. yii\base\Module
$allCommunityContexts array lispa\amos\community\AmosCommunity
$allCommunityManagerRoles array lispa\amos\community\AmosCommunity
$amosUniqueId string lispa\amos\core\module\BaseAmosModule
$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
$bypassWorkflow boolean|false - if ignore community workflow lispa\amos\community\AmosCommunity
$communityRequiredFields array - mandatory fields in community form lispa\amos\community\AmosCommunity
$communityType integer|null - null if all community types are enabled, to have a fixed community type set this field lispa\amos\community\AmosCommunity
$components array The list of the component definitions or the loaded component instances (ID => definition or instance). yii\di\ServiceLocator
$controllerMap array Mapping from controller ID to controller configurations. yii\base\Module
$controllerNamespace string The namespace that controller classes are in. lispa\amos\community\AmosCommunity
$controllerPath string The directory that contains the controller classes. yii\base\Module
$customInvitationForm boolean|true - if true associate or create user. lispa\amos\community\AmosCommunity
$defaultListViews array This set the default order for the views in lists lispa\amos\community\AmosCommunity
$defaultRoute string The default route of this module. yii\base\Module
$deleteCommunityWithContents boolean lispa\amos\community\AmosCommunity
$deleteCommunityWithSubcommunities boolean lispa\amos\community\AmosCommunity
$disableCommunityAssociationUserProfile boolean|true - hide the butttons community associate, and delete in Network UserProfile lispa\amos\community\AmosCommunity
$enableWizard boolean|true - if wizard for community creation is enabled lispa\amos\community\AmosCommunity
$extendRoles boolean|true - if true additional roles Author and Reader are considered lispa\amos\community\AmosCommunity
$forceDefaultViewType boolean lispa\amos\community\AmosCommunity
$hideCommunityTypeSearchFilter boolean lispa\amos\community\AmosCommunity
$hideContentsModels array - hide this models in tab contents lispa\amos\community\AmosCommunity
$hideWidgetGraphicsActions boolean lispa\amos\community\AmosCommunity
$htmlMailContent array lispa\amos\community\AmosCommunity
$htmlMailSubject array lispa\amos\community\AmosCommunity
$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
$inviteUserOfcommunityParent boolean lispa\amos\community\AmosCommunity
$layout string|boolean The layout that should be applied for views within this module. lispa\amos\community\AmosCommunity
$layoutPath string The root directory of layout files. yii\base\Module
$modelMap array lispa\amos\core\module\AmosModule
$module yii\base\Module The parent module of this module. yii\base\Module
$modules array The modules (indexed by their IDs). yii\base\Module
$name lispa\amos\community\AmosCommunity
$newFileMode lispa\amos\community\AmosCommunity
$params array Custom module parameters (name => value). yii\base\Module
$rbacEnabled boolean lispa\amos\core\module\BaseAmosModule
$showSubcommunities boolean|true lispa\amos\community\AmosCommunity
$showSubcommunitiesWidget boolean lispa\amos\community\AmosCommunity
$uniqueId string The unique ID of the module. yii\base\Module
$version string The version of this module. yii\base\Module
$viewPath string The root directory of view files. yii\base\Module
$viewTabContents boolean|true - if tab contents in community view mode is visible lispa\amos\community\AmosCommunity
$widgetGraphics lispa\amos\community\AmosCommunity
$widgetIcons lispa\amos\community\AmosCommunity

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\community\AmosCommunity
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
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
changeRoleCommunityUser() lispa\amos\community\AmosCommunity
className() Returns the fully qualified name of this class. yii\base\Object
clear() Removes the component from the locator. yii\di\ServiceLocator
createCommunity() Method to create a new validated community and add the current logged user as the manager. lispa\amos\community\AmosCommunity
createCommunityUser() Method to create a new community user if do not exists lispa\amos\community\AmosCommunity
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
deleteCommunityUser() lispa\amos\community\AmosCommunity
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
get() Returns the component instance with the specified ID. yii\di\ServiceLocator
getAllCommunityContexts() This method return a string array of community context classnames present in the community table. lispa\amos\community\AmosCommunity
getAllCommunityManagerRoles() This method return a string array of community managers of all community contexts. lispa\amos\community\AmosCommunity
getAmosUniqueId() lispa\amos\core\module\BaseAmosModule
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
getCommunitiesByUserId() This method return an array of Community objects representing all the communities of a user. lispa\amos\community\AmosCommunity
getCommunitiesManagedByUserId() lispa\amos\community\AmosCommunity
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
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
getModelClassName() lispa\amos\community\AmosCommunity
getModelSearchClassName() lispa\amos\community\AmosCommunity
getModule() Retrieves the child module of the specified ID. yii\base\Module
getModuleIconName() lispa\amos\community\AmosCommunity
getModuleName() lispa\amos\community\AmosCommunity
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
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\community\AmosCommunity
getWidgetIcons() lispa\amos\community\AmosCommunity
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() Initializes the module. lispa\amos\community\AmosCommunity
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
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
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

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
defaultVersion() Returns default module version. yii\base\Module
getDefaultModels() Get default model classes lispa\amos\community\AmosCommunity
verifyUserStatus() If the state is not allowed, it generates an exception lispa\amos\community\AmosCommunity

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'
$allCommunityContexts public read-only property
$allCommunityManagerRoles public read-only property
$bypassWorkflow public property
  • if ignore community workflow
public boolean|false $bypassWorkflow false
$communityRequiredFields public property
  • mandatory fields in community form
public array $communityRequiredFields = ['name''community_type_id''description']
$communityType public property
  • null if all community types are enabled, to have a fixed community type set this field
public integer|null $communityType null
$controllerNamespace public property

The namespace that controller classes are in. This namespace will be used to load controller classes by prepending it to the controller class name.

If not set, it will use the controllers sub-namespace under the namespace of this module. For example, if the namespace of this module is foo\bar, then the default controller namespace would be foo\bar\controllers.

See also the guide section on autoloading to learn more about defining namespaces and how classes are loaded.

public string $controllerNamespace 'lispa\amos\community\controllers'
$customInvitationForm public property
  • if true associate or create user.
$defaultListViews public property

This set the default order for the views in lists

public array $defaultListViews = ['icon''grid']
$deleteCommunityWithContents public property
$deleteCommunityWithSubcommunities public property
$disableCommunityAssociationUserProfile public property
  • hide the butttons community associate, and delete in Network UserProfile
$enableWizard public property
  • if wizard for community creation is enabled
public boolean|true $enableWizard false
$extendRoles public property
  • if true additional roles Author and Reader are considered
public boolean|true $extendRoles false
$forceDefaultViewType public property
$hideCommunityTypeSearchFilter public property
$hideContentsModels public property
  • hide this models in tab contents
public array $hideContentsModels = ['lispa\amos\showcaseprojects\models\ShowcaseProject''lispa\amos\een\models\EenPartnershipProposal''lispa\amos\events\models\Event']
$hideWidgetGraphicsActions public property
$htmlMailContent public property
public array $htmlMailContent = []
$htmlMailSubject public property
public array $htmlMailSubject = []
$inviteUserOfcommunityParent public property
$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'
$name public property
public $name 'Community'
$newFileMode public property
public $newFileMode 438
$showSubcommunities public property
$showSubcommunitiesWidget public property
$viewTabContents public property
  • if tab contents in community view mode is visible
$widgetGraphics public read-only property
public void getWidgetGraphics ( )
$widgetIcons public read-only property
public void getWidgetIcons ( )

Method Details

beginCreateNewSessionKey() public static method

This method return the session key that must be used to add in session the url from the user have started the content creation.

public static string beginCreateNewSessionKey ( )
changeRoleCommunityUser() public method

public void changeRoleCommunityUser ( $communityId, $userId, $role )
$communityId
$userId
$role
createCommunity() public method

Method to create a new validated community and add the current logged user as the manager.

public integer createCommunity ( $title, $type, $context, $managerRole, $description '', $model null, $managerStatus = \lispa\amos\community\models\CommunityUserMm::STATUS_ACTIVE, $managerId null )
$title string
$type integer
$context string
$managerRole string
$description string
$model lispa\amos\core\record\Record|null
$managerStatus string
$managerId integer|null
throws lispa\amos\community\exceptions\CommunityException
createCommunityUser() public method

Method to create a new community user if do not exists

public void createCommunityUser ( $idCommunity, $userStatus, $userRole, $userId )
$idCommunity integer
$userStatus string
$userRole string
$userId integer
throws lispa\amos\community\exceptions\CommunityException
deleteCommunityUser() public method

public boolean deleteCommunityUser ( $communityId, $userId )
$communityId
$userId
throws yii\db\StaleObjectException
getAllCommunityContexts() public method

This method return a string array of community context classnames present in the community table.

public array getAllCommunityContexts ( )
getAllCommunityManagerRoles() public method

This method return a string array of community managers of all community contexts.

public array getAllCommunityManagerRoles ( )
getCommunitiesByUserId() public method

This method return an array of Community objects representing all the communities of a user.

public lispa\amos\community\models\Community[]|integer[]|yii\db\ActiveQuery getCommunitiesByUserId ( $userId, $onlyIds false )
$userId integer
$onlyIds boolean
throws lispa\amos\community\exceptions\CommunityException
getCommunitiesManagedByUserId() public method

public lispa\amos\community\models\Community[]|integer[] getCommunitiesManagedByUserId ( $userId, $onlyIds false )
$userId integer
$onlyIds boolean
throws lispa\amos\community\exceptions\CommunityException
getDefaultModels() protected method

Get default model classes

protected void getDefaultModels ( )
getModelClassName() public static method

public static void getModelClassName ( )
getModelSearchClassName() public static method

public static void getModelSearchClassName ( )
getModuleIconName() public static method

public static void getModuleIconName ( )
getModuleName() public static method

public static void getModuleName ( )
getWidgetGraphics() public method

public void getWidgetGraphics ( )
getWidgetIcons() public method

public void getWidgetIcons ( )
init() public method

Initializes the module.

This method is called after the module is created and initialized with property values given in configuration. The default implementation will initialize $controllerNamespace if it is not set.

If you override this method, please make sure you call the parent implementation.

public void init ( )
verifyUserStatus() protected static method

If the state is not allowed, it generates an exception

protected static void verifyUserStatus ( $userStatus, $manager false )
$userStatus string
$manager boolean
throws lispa\amos\community\exceptions\CommunityException