AccessBlocks
extends AccessLib
in package
Info Blocks about Community used in the layout
Tags
Table of Contents
Constants
- MANAGE_GROUPS_ACCESS_ID = 203
- Static Access id to manage the user groups
- MANAGE_USER_ACCESS_ID = 202
- Static Access id to manage the users(add/edit)
Properties
- $_objTpl : Sigma
- $accountAttributeNamePrefix : mixed
- $cx : Cx
- $defaultProfileThumbnailScaleColor : mixed
- $modulePrefix : mixed
- $objUserFW : object
- User FRAMEWORK Object
Methods
- __construct() : mixed
- This library can be used to parse/generate the HTML code of a user's profile attributes from within the whole framework. To do so, follow the following steps: 1. Initialize an object from this class and pass the target \Cx\Core\Html\Sigma object as a paramater to it.
- checkManageGroupAccessPermission() : bool
- Additional permission check for users with access permission MANAGE_GROUPS_ACCESS_ID.
- fetchGroupFilter() : array<string|int, mixed>
- Scan the supplied template for group-filter-placeholders and return the parsed group-IDs.
- getImageUploader() : Uploader
- Initialize the access image uploader and get the uploader instance
- getPasswordInfo() : string
- Returns the password information string
- isSomeonesBirthdayToday() : bool
- Check if any of the active users having their birthday today.
- parseAccountAttributes() : mixed
- parseAttribute() : mixed
- This method has two purposes (see param $return): 1. Parse the \Cx\Core\Html\Sigma template block of a specific profile attribute 2. Generate the HTML code of a specific profile attribute and return it
- parseBasePlaceholders() : mixed
- Parses ACCESS_USER_ID, -USERNAME and -REGDATE placeholders and the user's attributes
- removeUselessImages() : mixed
- setAccountAttributeNamePrefix() : mixed
- When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's account attributes (username, email, password, etc.).
- setAttributeNamePrefix() : mixed
- When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's profile attribute.
- setBirthdayUsers() : mixed
- Parse a list (into the loaded template object) of those users having their birthday today.
- setCurrentlyOnlineUsers() : mixed
- Parse a list (into the loaded template object) of those users currently signed in.
- setLastActiveUsers() : mixed
- Parse a list (into the loaded template object) of those users having signed in the most recent.
- setLatestRegisteredUsers() : mixed
- Parse a list (into the loaded template object) of those users having signed up the most recent.
- setModulePrefix() : mixed
- When using this library from within a different place (not access module), use this method to specify the template placeholder prefix to be used when parsing a user's profile attribute.
- setNextBirthdayUsers() : mixed
- Parse a list (into the loaded template object) of those users having their birthday coming up.
- addUploadedImagesToProfile() : bool
- Move the uploaded images into place and link to the user
- attachJavaScriptFunction() : mixed
- detachAllJavaScriptFunctions() : mixed
- escapeCsvValue() : string
- Escape a value that it could be inserted into a csv file.
- exportUsers() : mixed
- Export users of a group as CSV
- fetchSearchArgumentFromRequest() : array<string|int, mixed>
- getGroupListOfUser() : array<string|int, mixed>
- Get a list of user groups a user is a member of
- getJavaScriptCode() : mixed
- parseAccountAttribute() : mixed
- parseLetterIndexList() : mixed
- parseNewsletterLists() : void
- Parse a user's newsletter-list subscription interface
Constants
MANAGE_GROUPS_ACCESS_ID
Static Access id to manage the user groups
public
mixed
MANAGE_GROUPS_ACCESS_ID
= 203
MANAGE_USER_ACCESS_ID
Static Access id to manage the users(add/edit)
public
mixed
MANAGE_USER_ACCESS_ID
= 202
Properties
$_objTpl
public
Sigma
$_objTpl
Tags
$accountAttributeNamePrefix
protected
mixed
$accountAttributeNamePrefix
= 'access_user_'
$cx
protected
Cx
$cx
$defaultProfileThumbnailScaleColor
protected
mixed
$defaultProfileThumbnailScaleColor
= '#FFFFFF'
$modulePrefix
protected
mixed
$modulePrefix
= 'ACCESS_'
$objUserFW
User FRAMEWORK Object
protected
object
$objUserFW
Tags
Methods
__construct()
This library can be used to parse/generate the HTML code of a user's profile attributes from within the whole framework. To do so, follow the following steps: 1. Initialize an object from this class and pass the target \Cx\Core\Html\Sigma object as a paramater to it.
public
__construct([mixed $objTemplate = null ]) : mixed
- Call to set the \Cx\Core\Html\Sigma's placeholders prefix. Where the passed argument would be like: ACCESS_
- Call to set the \Cx\Core\Html\Sigma's block prefix used in the user's profile attribute template blocks. Where the passed argument would be like: access_profile_attribute
- Finaly, call to parse a user account's profile attribute template block or to return the generated HTML code of a user account's profile attribute.
Example: $objAccessLib = new AccessLib($objTemplate); $objAccessLib->setModulePrefix('shop'); $objAccessLib->setAttributeNamePrefix('shop_customer_profile_attribute'); $objAccessLib->parseAttribute($objUser, 'firstname', 0, false, false, false, false, false);
Parameters
- $objTemplate : mixed = null
Tags
checkManageGroupAccessPermission()
Additional permission check for users with access permission MANAGE_GROUPS_ACCESS_ID.
public
checkManageGroupAccessPermission(int $groupId) : bool
Exists to avoid that the user removes his permission to manage access groups
Will return false when the group which is edited/deactivated/deleted is the only group which grants the user the permission to edit groups
Will return true otherwise (or if the user has administrator privileges)
Parameters
- $groupId : int
-
The id of the group which is edited
Return values
boolfetchGroupFilter()
Scan the supplied template for group-filter-placeholders and return the parsed group-IDs.
public
static fetchGroupFilter(Sigma $template, string $blockName) : array<string|int, mixed>
Scheme of a group-filter-placeholder: ACCESS_FILTER_GROUP_<ID>
Parameters
- $template : Sigma
-
Template to look for group filter placeholders for
- $blockName : string
-
The template block in which to look for the placeholders for
Return values
array<string|int, mixed> —Array of group-IDs
getImageUploader()
Initialize the access image uploader and get the uploader instance
public
getImageUploader() : Uploader
Return values
UploadergetPasswordInfo()
Returns the password information string
public
static getPasswordInfo() : string
The string returned depends on the password complexity setting
Tags
Return values
string —The password complexity information
isSomeonesBirthdayToday()
Check if any of the active users having their birthday today.
public
isSomeonesBirthdayToday() : bool
Return values
bool —TRUE if one user's birthday is today. Otherwise FALSE
parseAccountAttributes()
public
parseAccountAttributes(mixed $objUser[, mixed $edit = false ]) : mixed
Parameters
- $objUser : mixed
- $edit : mixed = false
parseAttribute()
This method has two purposes (see param $return): 1. Parse the \Cx\Core\Html\Sigma template block of a specific profile attribute 2. Generate the HTML code of a specific profile attribute and return it
public
parseAttribute(mixed $objUser, mixed $attributeId[, mixed $historyId = 0 ][, mixed $edit = false ][, mixed $return = false ][, mixed $isChild = false ][, mixed $inFrame = false ][, mixed $useMagicBlock = true ][, mixed $arrAdditionalPlaceholders = null ]) : mixed
Parameters
- $objUser : mixed
- $attributeId : mixed
- $historyId : mixed = 0
- $edit : mixed = false
- $return : mixed = false
- $isChild : mixed = false
- $inFrame : mixed = false
- $useMagicBlock : mixed = true
- $arrAdditionalPlaceholders : mixed = null
parseBasePlaceholders()
Parses ACCESS_USER_ID, -USERNAME and -REGDATE placeholders and the user's attributes
public
parseBasePlaceholders(mixed $objUser) : mixed
Parameters
- $objUser : mixed
removeUselessImages()
public
static removeUselessImages() : mixed
setAccountAttributeNamePrefix()
When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's account attributes (username, email, password, etc.).
public
setAccountAttributeNamePrefix(mixed $prefix) : mixed
For instance when setting the prefix to 'shop_customer_attribute', then the method will try to parse the \Cx\Core\Html\Sigma template block shop_customer_attribute_email in the case of the account attribute email. Defaults to 'access_user'
Parameters
- $prefix : mixed
Tags
setAttributeNamePrefix()
When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's profile attribute.
public
setAttributeNamePrefix(mixed $prefix) : mixed
For instance when setting the prefix to 'shop_customer_profile_attribute', then the method will try to parse the \Cx\Core\Html\Sigma template block shop_customer_profile_attribute_firstname in the case of the profile attribute firstname. Defaults to 'access_profile_attribute'
Parameters
- $prefix : mixed
Tags
setBirthdayUsers()
Parse a list (into the loaded template object) of those users having their birthday today.
public
setBirthdayUsers([string $gender = '' ]) : mixed
Parameters
- $gender : string = ''
-
Optional set to 'female' or 'male' to filter the list by gender
setCurrentlyOnlineUsers()
Parse a list (into the loaded template object) of those users currently signed in.
public
setCurrentlyOnlineUsers([string $gender = '' ]) : mixed
Parameters
- $gender : string = ''
-
Optional set to 'female' or 'male' to filter the list by gender
setLastActiveUsers()
Parse a list (into the loaded template object) of those users having signed in the most recent.
public
setLastActiveUsers([string $gender = '' ]) : mixed
Parameters
- $gender : string = ''
-
Optional set to 'female' or 'male' to filter the list by gender
setLatestRegisteredUsers()
Parse a list (into the loaded template object) of those users having signed up the most recent.
public
setLatestRegisteredUsers([string $gender = '' ]) : mixed
Parameters
- $gender : string = ''
-
Optional set to 'female' or 'male' to filter the list by gender
setModulePrefix()
When using this library from within a different place (not access module), use this method to specify the template placeholder prefix to be used when parsing a user's profile attribute.
public
setModulePrefix(mixed $prefix) : mixed
For instance when setting the prefix to 'SHOP_', then the method will parse the \Cx\Core\Html\Sigma variable SHOP_PROFILE_ATTRIBUTE_FIRSTNAME in the case of the profile attribute firstname. Defaults to 'ACCESS_'
Parameters
- $prefix : mixed
Tags
setNextBirthdayUsers()
Parse a list (into the loaded template object) of those users having their birthday coming up.
public
setNextBirthdayUsers([string $gender = '' ]) : mixed
Parameters
- $gender : string = ''
-
Optional set to 'female' or 'male' to filter the list by gender
Tags
addUploadedImagesToProfile()
Move the uploaded images into place and link to the user
protected
addUploadedImagesToProfile(User $objUser, array<string|int, mixed> &$arrProfile, array<string|int, mixed> $arrImages, string $uploaderId) : bool
Parameters
- $objUser : User
-
\User object
- $arrProfile : array<string|int, mixed>
-
Array profile data
- $arrImages : array<string|int, mixed>
-
Uploaded images array
- $uploaderId : string
-
Uploader id
Return values
bool —TRUE on success false otherwise
attachJavaScriptFunction()
protected
attachJavaScriptFunction(mixed $function) : mixed
Parameters
- $function : mixed
detachAllJavaScriptFunctions()
protected
detachAllJavaScriptFunctions() : mixed
escapeCsvValue()
Escape a value that it could be inserted into a csv file.
protected
escapeCsvValue(string $value) : string
Parameters
- $value : string
Return values
stringexportUsers()
Export users of a group as CSV
protected
exportUsers([int $groupId = 0 ][, int $langId = null ]) : mixed
Parameters
- $groupId : int = 0
-
Id of a user group to filter the export by
- $langId : int = null
-
Id of frontend locale to filter the export by
Tags
fetchSearchArgumentFromRequest()
protected
fetchSearchArgumentFromRequest() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of strings that have been submitted through the GET or POST argument 'search'.
getGroupListOfUser()
Get a list of user groups a user is a member of
protected
getGroupListOfUser(User $objUser) : array<string|int, mixed>
Returns an array of all user groups the supplied user (identified by $objUser) is a member of. In frontend mode, this method does only return frontend user groups. Whereas in every other mode, it does return all associated user groups.
Parameters
- $objUser : User
-
The user of whom the associated groups shall be returned.
Return values
array<string|int, mixed> —An array containing the names of the associated groups.
getJavaScriptCode()
protected
getJavaScriptCode() : mixed
parseAccountAttribute()
protected
parseAccountAttribute(mixed $objUser, mixed $attributeId[, mixed $edit = false ][, mixed $value = null ]) : mixed
Parameters
- $objUser : mixed
- $attributeId : mixed
- $edit : mixed = false
- $value : mixed = null
parseLetterIndexList()
protected
parseLetterIndexList(mixed $URI, mixed $paramName, mixed $selectedLetter) : mixed
Parameters
- $URI : mixed
- $paramName : mixed
- $selectedLetter : mixed
parseNewsletterLists()
Parse a user's newsletter-list subscription interface
protected
parseNewsletterLists(mixed $objUser) : void
Parameters
- $objUser : mixed