class InfoBox (View source)

Class to manage boxes on pages. This is an utility class (all is static)

Methods

static string[]
getListOfPagesForBoxes()

Name of positions (See below)

static 
listBoxes($dbs, string $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1)

Return array of boxes qualified for area and user

static 
saveboxorder($dbs, int|string $zone, $boxorder, $userid = 0)

Save order of boxes for area and user

Details

static string[] getListOfPagesForBoxes()

Name of positions (See below)

Return Value

string[]

Array with list of zones

static listBoxes($dbs, string $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1)

Return array of boxes qualified for area and user

@param DoliDB $dbs Database handler

Parameters

$dbs
string $mode

'available' or 'activated' @param int $zone Name or area (-1 for all, 0 for Homepage, 1 for Accountancy, 2 for xxx, ...) @param ?User $user Object user to filter @param int[] $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude @param int $includehidden Include also hidden boxes @return ModeleBoxes[]|array{error:string} Array of boxes or error info

$zone
$user
$excludelist
$includehidden

static saveboxorder($dbs, int|string $zone, $boxorder, $userid = 0)

Save order of boxes for area and user

@param DoliDB $dbs Database handler

Parameters

$dbs
int|string $zone

Key of area ('0' for Homepage, '1', 'pagename', ...) @param string $boxorder List of boxes with correct order 'A:123,456,...-B:789,321...' @param int $userid Id of user @return int Return integer <0 if KO, 0=Nothing done, > 0 if OK

$boxorder
$userid