class vB_Bitfield_Builder

Class to build array from permissions within XML file

Properties

array $data Array to hold all the compiled data after the bitfield merging
array $datastore Array to hold a datastore compatible object
array $errors Array to hold any error messages during merging of bitfields
array $datastore_total Expected number of groups in the datastore entry

Methods

static object
init()

Singleton Init

array
fetch_errors()

Returns the errors that hapepned during merging

static boolean
build(boolean $layout = true, boolean $include_disabled = false)

Search for bitfield xml files, merge together and search for collisions

static boolean
build_datastore()

Builds XML file into format for datastore

static boolean
save()

Saves Data into database

array
fetch($file, $layout, $include_disabled = false)

Returns array of the XML data parsed into array format

array
bitfield_array_convert($array, $layout)

Changes XML parsed data array into bitfield data array

array
fetch_permission_group(string $permgroup)

Fetches an array from the specified permission group (within the ugp tag).

static array
return_data()

Returns a multi-dimensional array of all defined bitfields, including and disabled products

Details

at line 57
static object init()

Singleton Init

Loads an instance of the object

Return Value

object

at line 72
array fetch_errors()

Returns the errors that hapepned during merging

Return Value

array

at line 86
static boolean build(boolean $layout = true, boolean $include_disabled = false)

Search for bitfield xml files, merge together and search for collisions

Parameters

boolean $layout layout Moves intperm entries into ['misc']['intperm']
boolean $include_disabled Process disabled products?

Return Value

boolean

at line 224
static boolean build_datastore()

Builds XML file into format for datastore

Return Value

boolean True on success, false on failure

at line 271
static boolean save()

Saves Data into database

Return Value

boolean

at line 306
array fetch($file, $layout, $include_disabled = false)

Returns array of the XML data parsed into array format

Parameters

$file
$layout
$include_disabled

Return Value

array

at line 387
array bitfield_array_convert($array, $layout)

Changes XML parsed data array into bitfield data array

Parameters

$array
$layout

Return Value

array

at line 452
array fetch_permission_group(string $permgroup)

Fetches an array from the specified permission group (within the ugp tag).

Note that if you specify an invalid name or the group can't be built errors will be printed. Intperms and non-sub-grouped fields will be ignored.

Parameters

string $permgroup Name of group to fetch.

Return Value

array [subgroup][permtitle] => array(phrase => str, value => int)

at line 495
static array return_data()

Returns a multi-dimensional array of all defined bitfields, including and disabled products

$vbulletin->bf_ugp_forumpermissions['canview'] would be returned as $array['ugp']['forumpermissions']['canview']

Return Value

array