class ModeleBoxes (View source)

Class ModeleBoxes

Boxes parent class

Properties

DoliDB $db
""|"development"|"experimental"|"dolibarr" $version

Must be defined in the box class

string $param
array<array{text: string, nbcol?: int, limit?: int, graph?: int<0, 1>, sublink?: string, subtext?: string, picto?: string, target?: string, td?: string}>|array{text: string, nbcol?: int, limit?: int, graph?: int<0, 1>, sublink?: string, subtext?: string, picto?: string, target?: string, td?: string} $info_box_head
array<array<array{td?: string, text: string, asis?: int<0, 1>, maxlength?: int}>>|array<array{td?: string, text: string, asis?: int<0, 1>, maxlength?: int}> $info_box_contents
string $error
int<0, max> $max
bool|int $enabled
bool $hidden
int $rowid
int deprecated $id
int $position
string $box_order
int $fk_user
string $sourcefile
string $class
string $box_id
string $lang
string $boxcode
string $note
string $widgettype
string $boximg

Note $picto is deprecated

string $boxlabel
string[] $depends
string $urltoaddentry
string $msgNoRecords

Methods

__construct(DoliDB $db, string $param = '')

Constructor

void
loadBox($max = 5)

Load data for box to show them later

string
error()

Return last error message

int<-1, 1>
fetch(int $rowid)

Load a box line from its rowid

string
showBox(?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head = null, ?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents = null, int<0, 1> $nooutput = 0)

Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)

static array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}>
getWidgetsList(?string[] $forcedirwidget = null)

Return list of widget. Function used by admin page htdoc/admin/widget.

Details

__construct(DoliDB $db, string $param = '')

Constructor

Parameters

DoliDB $db

Database handler

string $param

More parameters

void loadBox($max = 5)

Load data for box to show them later

@param int<0,max> $max Maximum number of records to load

Parameters

$max

Return Value

void

string error()

Return last error message

Return Value

string

Error message

int<-1, 1> fetch(int $rowid)

Load a box line from its rowid

Parameters

int $rowid

Row id to load

Return Value

int<-1, 1>

Return integer <0 if KO, >0 if OK

string showBox(?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head = null, ?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents = null, int<0, 1> $nooutput = 0)

Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)

Parameters

?array<array{text?: string, sublink?: string, subtext?: string, subpicto?: ?string, picto?: string, nbcol?: int, limit?: int, subclass?: string, graph?: int<0, 1>, target?: string}> $head

Array with properties of box title

?array<array{tr?: string, td?: string, target?: string, text?: string, text2?: string, textnoformat?: string, tooltip?: string, logo?: string, url?: string, maxlength?: int, asis?: int<0, 1>}> $contents

Array with properties of box lines

int<0, 1> $nooutput

No print, only return string

Return Value

string

static array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}> getWidgetsList(?string[] $forcedirwidget = null)

Return list of widget. Function used by admin page htdoc/admin/widget.

List is sorted by widget filename so by priority to run.

Parameters

?string[] $forcedirwidget

null=All default directories. This parameter is used by modulebuilder module only.

Return Value

array<array{picto: string, file: string, fullpath: string, relpath: string, iscoreorexternal: "external"|"internal", version: string, status: string, info: string}>

Array list of widgets