|
static | verify ($visibilityid, $ownerid, $userid=null) |
|
static | addPrivacySetting ($name, $identifier="", $parent=0, $category=1, $user=null, $default=null, $pluginid=null) |
|
static | addPrivacySettingForAll ($name, $identifier="", $parent_identifier=0, $category=1, $default=null, $pluginid=null) |
|
static | createDefaultCategories ($user=null) |
|
static | getStateDescription ($visibilityid, $owner=null) |
|
static | updatePrivacySetting ($name, $id="", $parent=null, $category=1, $user=null, $default=null, $pluginid=null) |
|
static | updatePrivacySettingWithTest ($test, $name, $id, $parent=null, $category=1, $user=null, $default=null, $pluginid=null) |
|
static | getPrivacyIdByIdentifier ($ident, $user=null) |
|
static | removePrivacySetting ($id, $user=null) |
|
static | removeAllPrivacySettingForIdentifier ($ident) |
|
static | removePlugin ($id) |
|
static | renamePrivacySetting ($id, $new_name, $user=null) |
|
static | removeUserPrivacySettings ($user_id) |
|
static | getSettingsArgs ($userid) |
|
static | updateUserFromRequest ($data, $userid=null) |
|
static | getColCount () |
|
static | getVisibilities () |
|
static | getHTMLArgs ($userid=null) |
|
static | setAllSettingsForUser ($state, $user=null) |
|
static | get_default_homepage_visibility ($user_id=null) |
|
static | exists ($id, $user=null) |
|
static | allowExtendedSettings (\User $user=null) |
|
static | isFieldHideableForUser (string $field, User $user=null) |
|
◆ addPrivacySetting()
static addPrivacySetting |
( |
|
$name, |
|
|
|
$identifier = "" , |
|
|
|
$parent = 0 , |
|
|
|
$category = 1 , |
|
|
|
$user = null , |
|
|
|
$default = null , |
|
|
|
$pluginid = null |
|
) |
| |
|
static |
Adds a privacysetting for a user. The user can change the setting in his privacytab. To check back if a user is allowed to see any content use the verify method
- Parameters
-
string | $name | The setting's name, that will be displayed in the user's settingtab (Important: Don't mix the name up with the identifier) |
string | $identifier | the identifier is used to simplify the usage of the visibilityAPI. An identifier maps a string to a visibilityid (under the usage of a userid) therefore all identifier set for one user MUST be unique. |
int | string | $parent | Determines the parent of the visibility to add. Use the direct visibilityid of the parent visibility or the identifier. If the visibility should be created on the top level the value has to be 0. Plugins creating a privacysetting will automaticly be added to the parent "plugins". Important: If u add a visibility without as a parent and as a category it wont be displayed until it has children that are displayed. |
int | $category | Sets the type of the visibilitysetting. Currently there are only 2 types available: 0 - The setting is only a header without any options 1 (Default) - Normal setting |
string | $user | Userid of the user that should be added the visibility. Default: The current logged on user |
int | $default | int representation of the visibility that should be set. Use with caution since the API provides the easy change of the visibility int representation |
int | $pluginid | Connects the created visibility with a plugin. Important: If addPrivacySetting is called in a file of a plugin there is no need to set the pluginid manually, because the API will normally find it |
- Returns
- int the created visibilityid
◆ addPrivacySettingForAll()
static addPrivacySettingForAll |
( |
|
$name, |
|
|
|
$identifier = "" , |
|
|
|
$parent_identifier = 0 , |
|
|
|
$category = 1 , |
|
|
|
$default = null , |
|
|
|
$pluginid = null |
|
) |
| |
|
static |
Adds a privacysetting for all users. If a parent is given, the function will only add a privacySetting for those users that have an existing parent
- Parameters
-
string | $name | The setting's name, that will be displayed in the user's settingtab (Important: Don't mix the name up with the identifier) |
string | $identifier | the identifier is used to simplify the usage of the visibilityAPI. An identifier maps a string to a visibilityid (under the usage of a userid) therefore all identifier set for one user MUST be unique. |
int | string | $parent_identifier | Determines the parent of the visibility to add. Use the direct visibilityid of the parent visibility or the identifier. If the visibility should be created on the top level the value has to be 0. Plugins creating a privacysetting will automaticly be added to the parent "plugins". Important: If u add a visibility without a parent and without beeing a toplevelpoint itself it will NEVER be displayed. |
int | $category | Sets the type of the visibilitysetting. Currently there are only 2 types available: 0 - The setting is only a header without any options 1 (Default) - Normal setting |
int | $default | int representation of the visibility that should be set. Use with caution since the API provides the easy change of the visibility int representation |
int | $pluginid | Connects the created visibility with a plugin. Important: If addPrivacySetting is called in a file of a plugin there is no need to set the pluginid manually, because the API will normally find it |
◆ allowExtendedSettings()
static allowExtendedSettings |
( |
\User |
$user = null | ) |
|
|
static |
Returns whether the user should be allowed to configure the extended settings.
- Parameters
-
User | null | $user | User object (defaults to current user) |
- Returns
- bool
◆ createDefaultCategories()
static createDefaultCategories |
( |
|
$user = null | ) |
|
|
static |
Creates all nessesary categories for standard usage
- Parameters
-
int | $user | Userid to define what user should create the categories default: current logged on user; |
◆ exists()
static exists |
( |
|
$id, |
|
|
|
$user = null |
|
) |
| |
|
static |
Checks if a specific visibilityID or an identifier & userid combination exists
- Parameters
-
type | $id | id or identifier |
type | $user | user id |
- Returns
- type true if the id exists. false if not
◆ get_default_homepage_visibility()
static get_default_homepage_visibility |
( |
|
$user_id = null | ) |
|
|
static |
Retrieves the standard visibility level for a homepage element if the user hasn't specified anything explicitly. This default can be set via the global configuration (variable "HOMEPAGE_VISIBILITY_DEFAULT").
- Returns
- int Default visibility level.
◆ getColCount()
Helpfunction to calculate how many columns the settingstable needs
- Returns
- int Number of columns
◆ getHTMLArgs()
static getHTMLArgs |
( |
|
$userid = null | ) |
|
|
static |
Helpfunction to get the data for the settingstable
- Returns
- array tree of settingelements
◆ getPrivacyIdByIdentifier()
static getPrivacyIdByIdentifier |
( |
|
$ident, |
|
|
|
$user = null |
|
) |
| |
|
static |
Returns the visibilityID by an identifier and a user
- Parameters
-
string | $ident | The identifier for the visibilityid |
string | $user | The userid. Default: Current logged on user |
- Returns
- int The visibilityID
◆ getSettingsArgs()
static getSettingsArgs |
( |
|
$userid | ) |
|
|
static |
Builds up the htmlArgs for display in Settings
- Parameters
-
- Returns
- array tree of htmlArgs
◆ getStateDescription()
static getStateDescription |
( |
|
$visibilityid, |
|
|
|
$owner = null |
|
) |
| |
|
static |
Returns the description for a specific state set on a visibilityID
- Parameters
-
int | $visibilityid | the visibility id |
- Returns
- string Description of the state or false if visibilityid was not found
◆ getVisibilities()
static getVisibilities |
( |
| ) |
|
|
static |
Helpfunction to get all names for the settingstable
- Returns
- array all visibility names
◆ isFieldHideableForUser()
static isFieldHideableForUser |
( |
string |
$field, |
|
|
User |
$user = null |
|
) |
| |
|
static |
Returns whether the given field is hideable by configuration for the given user permission.
- Parameters
-
string | $field | Field that should be hidden |
User | null | $user | User object (defaults to current user) |
- Returns
- bool
◆ removeAllPrivacySettingForIdentifier()
static removeAllPrivacySettingForIdentifier |
( |
|
$ident | ) |
|
|
static |
Deletes ALL privacySettings for a Identifier (for ALL users!)
- Parameters
-
string | $ident | The Identifier to be removed |
◆ removePlugin()
static removePlugin |
( |
|
$id | ) |
|
|
static |
Removes all PrivacySetting of the given pluginid
- Parameters
-
◆ removePrivacySetting()
static removePrivacySetting |
( |
|
$id, |
|
|
|
$user = null |
|
) |
| |
|
static |
Removes a privacysetting via ID or Identifier and user
- Parameters
-
int | string | $id | ID or Identifier |
string | $user | Userid. Default: Current logged on user |
- Returns
- int state The state the deleted visibility had
◆ removeUserPrivacySettings()
static removeUserPrivacySettings |
( |
|
$user_id | ) |
|
|
static |
Removes all PrivacySettings from a user
- Parameters
-
string | $user_id | the given userid |
◆ renamePrivacySetting()
static renamePrivacySetting |
( |
|
$id, |
|
|
|
$new_name, |
|
|
|
$user = null |
|
) |
| |
|
static |
Renames a PrivacySetting
- Parameters
-
int | string | $id | VisibilityID or Identifier to be renamed |
string | $new_name | the new name |
string | $user | Userid. Default: Current logged on user |
◆ setAllSettingsForUser()
static setAllSettingsForUser |
( |
|
$state, |
|
|
|
$user = null |
|
) |
| |
|
static |
Sets all visibilites of a user to a specific state. This function should ONLY be called from the settingspage or some administration page NOT from a plugin
- Parameters
-
type | $state | The int representation of the state everything should be set to |
type | $user | The user. Default: current logged on user; |
◆ updatePrivacySetting()
static updatePrivacySetting |
( |
|
$name, |
|
|
|
$id = "" , |
|
|
|
$parent = null , |
|
|
|
$category = 1 , |
|
|
|
$user = null , |
|
|
|
$default = null , |
|
|
|
$pluginid = null |
|
) |
| |
|
static |
Updates a privacySetting. Important: The whole privacySetting gets deleted and recreated. Therefore a new visibilityID is created. If you use the privacyID you will have to update it as well.
- Parameters
-
string | $name | The setting's name, that will be displayed in the user's settingtab (Important: Don't mix the name up with the identifier) |
string | $identifier | the identifier is used to simplify the usage of the visibilityAPI. An identifier maps a string to a visibilityid (under the usage of a userid) therefore all identifier set for one user MUST be unique. |
int | string | $parent | Determines the parent of the visibility to add. Use the direct visibilityid of the parent visibility or the identifier. If the visibility should be created on the top level the value has to be 0. Plugins creating a privacysetting will automaticly be added to the parent "plugins". Important: If u add a visibility without a parent and without beeing a toplevelpoint itself it will NEVER be displayed. |
int | $category | Sets the type of the visibilitysetting. Currently there are only 2 types available: 0 - The setting is only a header without any options 1 (Default) - Normal setting |
string | $user | Userid of the user that should be added the visibility. Default: The current logged on user |
int | $default | int representation of the visibility that should be set. Use with caution since the API provides the easy change of the visibility int representation |
int | $pluginid | Connects the created visibility with a plugin. Important: If addPrivacySetting is called in a file of a plugin there is no need to set the pluginid manually, because the API will normally find it |
- Returns
- int the created visibilityid
◆ updatePrivacySettingWithTest()
static updatePrivacySettingWithTest |
( |
|
$test, |
|
|
|
$name, |
|
|
|
$id, |
|
|
|
$parent = null , |
|
|
|
$category = 1 , |
|
|
|
$user = null , |
|
|
|
$default = null , |
|
|
|
$pluginid = null |
|
) |
| |
|
static |
Updates a privacySetting. Important: The whole privacySetting gets deleted and recreated if the teststring is not empty. Therefore a new visibilityID is created. If you use the privacyID you will have to update it as well.
- Parameters
-
string | $test | A teststring to determine if the privacySetting is only deleted or if it is deleted and recreated. Use this with a request- string for example. |
string | $name | The setting's name, that will be displayed in the user's settingtab (Important: Don't mix the name up with the identifier) |
string | $identifier | the identifier is used to simplify the usage of the visibilityAPI. An identifier maps a string to a visibilityid (under the usage of a userid) therefore all identifier set for one user MUST be unique. |
int | string | $parent | Determines the parent of the visibility to add. Use the direct visibilityid of the parent visibility or the identifier. If the visibility should be created on the top level the value has to be 0. Plugins creating a privacysetting will automaticly be added to the parent "plugins". Important: If u add a visibility without a parent and without beeing a toplevelpoint itself it will NEVER be displayed. |
int | $category | Sets the type of the visibilitysetting. Currently there are only 2 types available: 0 - The setting is only a header without any options 1 (Default) - Normal setting |
string | $user | Userid of the user that should be added the visibility. Default: The current logged on user |
int | $default | int representation of the visibility that should be set. Use with caution since the API provides the easy change of the visibility int representation |
int | $pluginid | Connects the created visibility with a plugin. Important: If addPrivacySetting is called in a file of a plugin there is no need to set the pluginid manually, because the API will normally find it |
- Returns
- int the created visibilityid
◆ updateUserFromRequest()
static updateUserFromRequest |
( |
|
$data, |
|
|
|
$userid = null |
|
) |
| |
|
static |
Takes the updaterequestdata and stores it into the database
- Parameters
-
array | $data | Data produced by the settingspage |
string | $userid | the userid. Default: current logged on user |
◆ verify()
static verify |
( |
|
$visibilityid, |
|
|
|
$ownerid, |
|
|
|
$userid = null |
|
) |
| |
|
static |
Basic visibilitycheck to find out if a given user (or the current logged on user) is allowed to view the object that is defined by a visibilityid
- Parameters
-
int | string | $visibilityid | The visibility to check can be defined by the direct id (int) or the predefined identifier (string) |
int | $userid | The user for whom we check the visibility. If no user is given, the system will take the current logged on user |
- Returns
- boolean true if user is allowed to view content according to the current visibilitysetting otherwise false;
The documentation for this class was generated from the following file: