Class humhub\modules\directory\Module

Inheritancehumhub\modules\directory\Module » humhub\components\Module » yii\base\Module
Available since version0.5

Directory Base Module

The directory module adds a menu item "Directory" to the top navigation with some lists about spaces, users or group inside the application.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$active boolean Defines if the directory is active, if not the directory is not visible and can't be accessed humhub\modules\directory\Module
$guestAccess boolean Defines if the directory is available for guest users, this flag will only have effect if guest access is allowed and the module is active humhub\modules\directory\Module
$isCoreModule humhub\modules\directory\Module
$memberListSortField string Sort field (e.g. lastname) of member list humhub\modules\directory\Module
$pageSize integer Default page size for directory pages humhub\modules\directory\Module
$resourcesPath string The path for module resources (images, javascripts) Also module related assets like README. humhub\components\Module
$showUserProfilePosts boolean Show menu entry for user profile posts on directory humhub\modules\directory\Module

Public Methods

Hide inherited methods

MethodDescriptionDefined By
afterUpdate() Called right after the module update. humhub\components\Module
beforeUpdate() Called right before the module is updated. humhub\components\Module
canAccess() humhub\modules\directory\Module
disable() Disables a module humhub\components\Module
enable() Enables this module humhub\components\Module
getActivityClasses() Returns a list of activity class names this modules provides. humhub\components\Module
getAssetClasses() Returns a list of asset class names this modules provides. humhub\components\Module
getAssetPath() humhub\components\Module
getAssetsUrl() Get Assets Url humhub\components\Module
getConfigUrl() URL to the module's configuration action humhub\components\Module
getDescription() Returns modules description provided by module.json file humhub\components\Module
getImage() Returns image url for this module Place your modules image in /module_image.png humhub\components\Module
getName() Returns modules name provided by module.json file humhub\components\Module
getNotifications() Returns a list of notification classes this module provides. humhub\components\Module
getPermissions() Returns a list of permission objects this module provides. humhub\modules\directory\Module
getPublishedUrl() Returns the url of an asset file and publishes all module assets if the file is not published yet. humhub\components\Module
getVersion() Returns modules version number provided by module.json file humhub\components\Module
hasNotifications() Determines whether the module has notification classes or not humhub\components\Module
init() humhub\components\Module
isGroupListingEnabled() Show groups in directory humhub\modules\directory\Module
isPublished() Checks if a specific asset file has already been published humhub\components\Module
migrate() Execute all not applied module migrations humhub\components\Module
onTopMenuInit() On build of the TopMenu, check if module is enabled When enabled add a menu item humhub\modules\directory\Module
publishAssets() Publishes the basePath/resourcesPath (assets) module directory if existing. humhub\components\Module
update() This method is called after an update is performed. humhub\components\Module

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getModuleInfo() Reads module.json which contains basic module information and returns it as array humhub\components\Module

Property Details

$active public property

Defines if the directory is active, if not the directory is not visible and can't be accessed

public boolean $active true
$guestAccess public property

Defines if the directory is available for guest users, this flag will only have effect if guest access is allowed and the module is active

public boolean $guestAccess true
$isCoreModule public property
public $isCoreModule true
$memberListSortField public property

Sort field (e.g. lastname) of member list

public string $memberListSortField 'profile.lastname'
$pageSize public property

Default page size for directory pages

public integer $pageSize 25
$showUserProfilePosts public property

Show menu entry for user profile posts on directory

Method Details

canAccess() public method

public boolean canAccess ( )
return boolean

Checks if the current user can access the directory

getPermissions() public method

Returns a list of permission objects this module provides.

If a content container is provided, the method should only return applicable permissions for the given container. This function should also make sure the module is installed on the given container in case the permission only affects installed features.

public array getPermissions ( $contentContainer null )
$contentContainer humhub\modules\content\components\ContentContainerActiveRecord

Optional contentcontainer

return array

List of permissions

isGroupListingEnabled() public method

Show groups in directory

public boolean isGroupListingEnabled ( )
onTopMenuInit() public static method

On build of the TopMenu, check if module is enabled When enabled add a menu item

public static void onTopMenuInit ( $event )
$event \humhub\modules\directory\type