API Joomla 1.5.26
Documentation des API du CMS Joomla en version 1.5

Référence de la classe gacl_api

Graphe d'héritage de gacl_api:
Graphe de collaboration de gacl_api:

Liste de tous les membres

Fonctions membres publiques

Fonctions membres protégées


Documentation des fonctions membres

gacl_api::_defaultGenID ( table) [protected]

Calculates the start number for a sequence table

Paramètres:
stringThe name of the table
Renvoie:
int The highest id plus one

Références $id, et $query.

gacl_api::_rebuild_tree ( table,
group_id,
left = 1 
)

_rebuild_tree ()

Utility recursive function called by rebuild_tree()

Renvoie:
int Returns right value of this node + 1
Paramètres:
stringTable name of group type
intGroup ID #
intLeft value of Group

Références $query.

gacl_api::add_acl ( aco_array,
aro_array,
aro_group_ids = NULL,
axo_array = NULL,
axo_group_ids = NULL,
allow = 1,
enabled = 1,
return_value = NULL,
note = NULL,
section_value = NULL,
acl_id = FALSE 
)

add_acl()

Add's an ACL. ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.

Renvoie:
bool Return ACL ID of new ACL if successful, FALSE otherewise.
Paramètres:
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
intAllow flag
intEnabled flag
stringReturn Value
stringNote
stringACL Section Value
intACL ID # Specific Request

Références $query.

gacl_api::add_group ( value,
name,
parent_id = 0,
group_type = 'ARO' 
)

REMOVED REMOVED REMOVED REMOVED add_group()

Inserts a group, defaults to be on the "root" branch.

Since v3.3.x you can only create one group with Parent_ID=0 So, its a good idea to create a "Virtual Root" group with Parent_ID=0 Then assign other groups to that.

Renvoie:
int New Group ID # if successful, FALSE if otherwise.
Paramètres:
stringGroup Value
stringGroup Name
intParent Group ID #
stringGroup Type, either 'ARO' or 'AXO'
gacl_api::add_group_object ( group_id,
object_section_value,
object_value,
group_type = 'ARO' 
)

add_group_object()

Assigns an Object to a group

Renvoie:
bool Returns TRUE if successful, FALSE otherwise.
Paramètres:
intGroup ID #
stringObject Section Value
stringObject Value
stringGroup Type, either 'ARO' or 'AXO'

Références $query.

gacl_api::add_object ( section_value,
name,
value = 0,
order = 0,
hidden = 0,
object_type = NULL 
)

add_object()

Inserts a new object

Renvoie:
int Returns the ID # of the new object if successful, FALSE otherwise
Paramètres:
stringObject Section Value
stringObject Name
stringObject Value
intDisplay Order
intHidden Flag, either 1 to hide, or 0 to show.
stringObject Type, either 'ACO', 'ARO', or 'AXO'

Références $name, et $query.

gacl_api::add_object_section ( name,
value = 0,
order = 0,
hidden = 0,
object_type = NULL 
)

add_object_section()

Inserts an object Section

Renvoie:
int Object Section ID of new section
Paramètres:
stringObject Name
stringObject Value
intDisplay Order
intHidden flag, hides section if 1, shows section if 0
stringObject Type, either 'ACO', 'ARO', 'AXO', or 'ACL'

Références $name, et $query.

gacl_api::append_acl ( acl_id,
aro_array = NULL,
aro_group_ids = NULL,
axo_array = NULL,
axo_group_ids = NULL,
aco_array = NULL 
)

append_acl()

Appends objects on to a specific ACL.

Renvoie:
bool TRUE if successful, FALSE otherwise.
Paramètres:
intACL ID #
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
gacl_api::clear_database ( )

clear_database()

Deletes all data from the phpGACL tables. USE WITH CAUTION.

Renvoie:
bool Returns TRUE if successful, FALSE otherwise

Références $query.

gacl_api::consolidated_edit_acl ( aco_section_value,
aco_value,
aro_section_value,
aro_value,
return_value 
)

consolidated_edit_acl()

Add's an ACL but checks to see if it can consolidate it with another one first.

This ONLY works with ACO's and ARO's. Groups, and AXO are excluded. As well this function is designed for handling ACLs with return values, and consolidating on the return_value, in hopes of keeping the ACL count to a minimum.

A return value of false must _always_ be handled outside this function. As this function will remove AROs from ACLs and return false, in most cases you will need to a create a completely new ACL on a false return.

Renvoie:
bool Special boolean return value. See note.
Paramètres:
stringACO Section Value
stringACO Value
stringARO Section Value
stringARO Value
stringReturn Value of ACL

Références elseif.

gacl_api::count_all ( arg = NULL)

count_all()

Recursively counts elements in an array and sub-arrays.

This is different from count($arg, COUNT_RECURSIVE) in PHP >= 4.2.0, which includes sub-arrays in the count.

Renvoie:
int The returned count is a count of all scalar elements found.
Paramètres:
arrayArray to count

Références $count.

gacl_api::del_acl ( acl_id)

del_acl()

Deletes a given ACL

Renvoie:
bool Returns TRUE if successful, FALSE otherwise.
Paramètres:
intACL ID # to delete

Références $query.

gacl_api::del_group ( group_id,
reparent_children = TRUE,
group_type = 'ARO' 
)

del_group()

deletes a given group

Renvoie:
bool Returns TRUE if successful, FALSE otherwise.
Paramètres:
intGroup ID #
boolIf TRUE, child groups of this group will be reparented to the current group's parent.
stringGroup Type, either 'ARO' or 'AXO'

Références $query.

gacl_api::del_group_object ( group_id,
object_section_value,
object_value,
group_type = 'ARO' 
)

del_group_object()

Removes an Object from a group.

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
intGroup ID #
stringObject Section Value
stringObject Value
stringGroup Type, either 'ARO' or 'AXO'

Références $query.

gacl_api::del_object ( object_id,
object_type = NULL,
erase = FALSE 
)

del_object()

Deletes a given Object and, if instructed to do so, erase all referencing objects

ERASE feature by: Martino Piccinato

Renvoie:
bool Returns TRUE if successful, FALSE otherwise.
Paramètres:
intObject ID #
stringObject Type, either 'ACO', 'ARO', or 'AXO'
boolErases all referencing objects if TRUE, leaves them alone otherwise.

Références $acl, et $query.

gacl_api::del_object_section ( object_section_id,
object_type = NULL,
erase = FALSE 
)

del_object_section()

Deletes a given Object Section and, if explicitly asked, all the section objects

ERASE feature by: Martino Piccinato

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
intObject Section ID # to delete
stringObject Type, either 'ACO', 'ARO', 'AXO', or 'ACL'
boolErases all section objects assigned to the section

Références $id, et $query.

gacl_api::edit_acl ( acl_id,
aco_array,
aro_array,
aro_group_ids = NULL,
axo_array = NULL,
axo_group_ids = NULL,
allow = 1,
enabled = 1,
return_value = NULL,
note = NULL,
section_value = NULL 
)

edit_acl()

Edit's an ACL, ACO_IDS, ARO_IDS, GROUP_IDS must all be arrays.

Renvoie:
bool Return TRUE if successful, FALSE otherewise.
Paramètres:
intACL ID # to edit
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
intAllow flag
intEnabled flag
stringReturn Value
stringNote
stringACL Section Value
gacl_api::edit_group ( group_id,
value = NULL,
name = NULL,
parent_id = NULL,
group_type = 'ARO' 
)

edit_group()

Edits a group

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
intGroup ID #
stringGroup Value
stringGroup Name
intParent ID #
stringGroup Type, either 'ARO' or 'AXO'

Références $name, et $query.

gacl_api::edit_object ( object_id,
section_value,
name,
value = 0,
order = 0,
hidden = 0,
object_type = NULL 
)

edit_object()

Edits a given Object

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
intObject ID #
stringObject Section Value
stringObject Name
stringObject Value
intDisplay Order
intHidden Flag, either 1 to hide, or 0 to show
stringObject Type, either 'ACO', 'ARO', or 'AXO'

Références $name, et $query.

gacl_api::edit_object_section ( object_section_id,
name,
value = 0,
order = 0,
hidden = 0,
object_type = NULL 
)

edit_object_section()

Edits a given Object Section

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
intObject Section ID #
stringObject Section Name
stringObject Section Value
intDisplay Order
intHidden Flag, hide object section if 1, show if 0
stringObject Type, either 'ACO', 'ARO', 'AXO', or 'ACL'

Références $name, et $query.

gacl_api::format_groups ( sorted_groups,
type = 'TEXT',
root_id = 0,
level = 0,
formatted_groups = NULL 
)

format_groups()

Takes the array returned by sort_groups() and formats for human consumption. Recursively calls itself to produce the desired output.

Renvoie:
array Array of formatted text, ordered by group id, formatted according to $type
Paramètres:
arrayOutput from gacl_api->sorted_groups($group_type)
arrayOutput type desired, either 'TEXT', 'TEXT_ASSOC', 'HTML', 'ARRAY' or 'ASSOC'
intRoot of tree to produce
intCurrent level of depth
arrayPass the current formatted groups object for appending via recursion.

Références $id, $name, $type, nbsp, et value.

gacl_api::get_acl ( acl_id)

get_acl()

Grabs ACL data.

Renvoie:
mixed bool FALSE if not found, or Associative Array with the following items:
  • 'aco' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • 'aro' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • 'axo' => Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
  • 'aro_groups' => Array of Group IDs
  • 'axo_groups' => Array of Group IDs
  • 'acl_id' => int ACL ID #
  • 'allow' => int Allow flag
  • 'enabled' => int Enabled flag
  • 'return_value' => string Return Value
  • 'note' => string Note
Paramètres:
intACL ID #

Références $query, $rows, et $section.

gacl_api::get_group_children ( group_id,
group_type = 'ARO',
recurse = 'NO_RECURSE' 
)

get_group_children()

Gets a groups child IDs

Renvoie:
array Array of Child ID's of the referenced group
Paramètres:
intGroup ID #
intGroup Type, either 'ARO' or 'AXO'
stringEither 'RECURSE' or 'NO_RECURSE', to recurse while fetching group children.
gacl_api::get_group_data ( group_id,
group_type = 'ARO' 
)

get_group_data()

Gets the group data given the GROUP_ID.

Renvoie:
array Returns numerically indexed array with the following columns:
  • array[0] = (int) Group ID #
  • array[1] = (int) Parent Group ID #
  • array[2] = (string) Group Value
  • array[3] = (string) Group Name
  • array[4] = (int) lft MPTT Value
  • array[5] = (int) rgt MPTT Value
Paramètres:
intGroup ID #
stringGroup Type, either 'ARO' or 'AXO'
gacl_api::get_group_id ( value = NULL,
name = NULL,
group_type = 'ARO' 
)

get_group_id()

Gets the group_id given the name or value.

Will only return one group id, so if there are duplicate names, it will return false.

Renvoie:
int Returns Group ID if found and Group ID is unique in database, otherwise, returns FALSE
Paramètres:
stringGroup Value
stringGroup Name
stringGroup Type, either 'ARO' or 'AXO'
gacl_api::get_group_objects ( group_id,
group_type = 'ARO',
option = 'NO_RECURSE' 
)

get_group_objects()

Gets all objects assigned to a group.

If $option == 'RECURSE' it will get all objects in child groups as well. defaults to omit child groups.

Renvoie:
array Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
Paramètres:
intGroup ID #
stringGroup Type, either 'ARO' or 'AXO'
stringOption, either 'RECURSE' or 'NO_RECURSE'

Références $option, $query, et $section.

gacl_api::get_group_parent_id ( id,
group_type = 'ARO' 
)

get_group_parent_id()

Grabs the parent_id of a given group

Renvoie:
int Parent ID of the Group
Paramètres:
intGroup ID #
stringGroup Type, either 'ARO' or 'AXO'
gacl_api::get_object ( section_value = null,
return_hidden = 1,
object_type = NULL 
)

get_object()

Grabs all Objects's in the database, or specific to a section_value

Renvoie:
ADORecordSet Returns recordset directly, with object ID only selected:
Paramètres:
stringFilter to this section value
intReturns hidden objects if 1, leaves them out otherwise.
stringObject Type, either 'ACO', 'ARO', 'AXO', or 'ACL'

Références $query, et $where.

gacl_api::get_object_data ( object_id,
object_type = NULL 
)

get_object_data()

Gets all data pertaining to a specific Object.

Renvoie:
array Returns 2-Dimensional array of rows with columns = ( section_value, value, order_value, name, hidden )
Paramètres:
intObject ID #
stringObject Type, either 'ACO', 'ARO', 'AXO'

Références $query.

gacl_api::get_object_groups ( object_id,
object_type = 'ARO',
option = 'NO_RECURSE' 
)

get_object_groups()

Gets all groups an object is a member of.

If $option == 'RECURSE' it will get all ancestor groups. defaults to only get direct parents.

Renvoie:
array Array of Group ID #'s, or FALSE if Failed
Paramètres:
intObject ID #
stringObject Type, either 'ARO' or 'AXO'
stringOption, either 'RECURSE', or 'NO_RECURSE'

Références $option, et $query.

gacl_api::get_object_id ( section_value,
value,
object_type = NULL 
)

get_object_id()

Gets the object_id given the section_value AND value of the object.

Renvoie:
int Object ID #
Paramètres:
stringObject Section Value
stringObject Value
stringObject Type, either 'ACO', 'ARO', 'AXO'

Références $query.

gacl_api::get_object_section_section_id ( name = NULL,
value = NULL,
object_type = NULL 
)

get_object_section_section_id()

Gets the object_section_id given the name AND/OR value of the section.

Will only return one section id, so if there are duplicate names it will return false.

Renvoie:
int Object Section ID if the object section is found AND is unique, or FALSE otherwise.
Paramètres:
stringObject Name
stringObject Value
stringObject Type, either 'ACO', 'ARO', 'AXO', or 'ACL'

Références $name, $query, et $where.

gacl_api::get_object_section_value ( object_id,
object_type = NULL 
)

get_object_section_value()

Gets the object_section_value given object id

Renvoie:
string Object Section Value
Paramètres:
intObject ID #
stringObject Type, either 'ACO', 'ARO', or 'AXO'

Références $query.

gacl_api::get_objects ( section_value = NULL,
return_hidden = 1,
object_type = NULL 
)

get_objects ()

Grabs all Objects in the database, or specific to a section_value

Renvoie:
array Returns objects in format suitable for add_acl and is_conflicting_acl
  • i.e. Associative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
Paramètres:
stringFilter for section value
intReturns hidden objects if 1, does not if 0
stringObject Type, either 'ACO', 'ARO', 'AXO'

Références $query, et $where.

gacl_api::get_root_group_id ( group_type = 'ARO')

get_root_group_id ()

Grabs the id of the root group for the specified tree

Renvoie:
int Root Group ID #
Paramètres:
stringGroup Type, either 'ARO' or 'AXO'
gacl_api::get_schema_version ( )

get_schema_version()

Grabs phpGACL schema version from the database.

Renvoie:
string Schema Version

Références $query, et $version.

gacl_api::get_section_data ( section_value,
object_type = NULL 
)

get_section_data()

Gets the section data given the Section Value

Renvoie:
array Returns numerically indexed array with the following columns:
  • array[0] = (int) Section ID #
  • array[1] = (string) Section Value
  • array[2] = (int) Section Order
  • array[3] = (string) Section Name
  • array[4] = (int) Section Hidden?
Paramètres:
stringSection Value
stringObject Type, either 'ACO', 'ARO', or 'AXO'

Références $query.

gacl_api::get_ungrouped_objects ( return_hidden = 1,
object_type = NULL 
)

get_ungrouped_objects()

Grabs ID's of all Objects (ARO's and AXO's only) in the database not assigned to a Group.

This function is useful for applications that synchronize user databases with an outside source. If syncrhonization doesn't automatically place users in an appropriate group, this function can quickly identify them so that they can be assigned to the correct group.

Renvoie:
array Returns an array of object ID's
Paramètres:
intReturns hidden objects if 1, does not if 0.
stringObject Type, either 'ARO' or 'AXO' (groupable types)

Références $query, et $where.

gacl_api::get_version ( )

get_version()

Grabs phpGACL version from the database.

Renvoie:
string Version of phpGACL

Références $query, et $version.

gacl_api::is_conflicting_acl ( aco_array,
aro_array,
aro_group_ids = NULL,
axo_array = NULL,
axo_group_ids = NULL,
ignore_acl_ids = NULL 
)

is_conflicting_acl()

Checks for conflicts when adding a specific ACL.

Renvoie:
bool Returns true if conflict is found.
Paramètres:
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayArray of ACL IDs to ignore from the result set.

Références $query, et item.

gacl_api::rebuild_tree ( group_type = 'ARO',
group_id = NULL,
left = 1 
)

rebuild_tree ()

rebuilds the group tree for the given type

Renvoie:
bool Returns TRUE if successful, FALSE otherwise
Paramètres:
stringGroup Type, either 'ARO' or 'AXO'
intGroup ID #
intLeft value of Group
gacl_api::search_acl ( aco_section_value = NULL,
aco_value = NULL,
aro_section_value = NULL,
aro_value = NULL,
aro_group_name = NULL,
axo_section_value = NULL,
axo_value = NULL,
axo_group_name = NULL,
return_value = NULL 
)

search_acl()

Searches for ACL's with specified objects mapped to them.

NULL values are included in the search, if you want to ignore for instance aro_groups use FALSE instead of NULL.

Renvoie:
array containing ACL IDs if search is successful
Paramètres:
stringACO Section Value
stringACO Value
stringARO Section Value
stringARO Value
stringARO Group Name
stringAXO Section Value
stringAXO Value
stringAXO Group Name
stringReturn Value

Références $query.

gacl_api::shift_acl ( acl_id,
aro_array = NULL,
aro_group_ids = NULL,
axo_array = NULL,
axo_group_ids = NULL,
aco_array = NULL 
)

shift_acl()

Opposite of append_acl(). Removes objects from a specific ACL. (named after PHP's array_shift())

Renvoie:
bool TRUE if successful, FALSE otherwise.
Paramètres:
intACL ID #
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
arrayArray of Group IDs
arrayAssociative array, item={Section Value}, key={Array of Object Values} i.e. ["<Section Value>" => ["<Value 1>", "<Value 2>", "<Value 3>"], ...]
gacl_api::showarray ( array)

showarray()

Dump all contents of an array in HTML (kinda)

Paramètres:
array

Références $array.

gacl_api::sort_groups ( group_type = 'ARO')

sort_groups()

Grabs all the groups from the database doing preliminary grouping by parent

Renvoie:
array Returns 2-Dimensional array: $array[<parent_id>][<group_id>] = <group_name>
Paramètres:
stringGroup Type, either 'ARO' or 'AXO'

Références $id, $name, et $query.


La documentation de cette classe a été générée à partir du fichier suivant :