class FormWebsite (View source)

Class to manage component html for module website

Properties

string $error
int $num

Methods

__construct(DoliDB $db)

Constructor

selectWebsite($selected = '', string $htmlname = 'exportmodelid', $useempty = 0)

Return HTML select list of websites

selectTypeOfContainer($htmlname, string $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')

Return a HTML select list of type of containers from the dictionary

selectSampleOfContainer($htmlname, string $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')

Return a HTML select list of samples of containers content

selectContainer(Website $website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)

Return a HTML select list of containers of a website.

string
getContentPageTemplate(string $htmlContent = 'message')

Return HTML code for selection of page layout

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db

Database handler

selectWebsite($selected = '', string $htmlname = 'exportmodelid', $useempty = 0)

Return HTML select list of websites

@param string $selected Id modele pre-selectionne

Parameters

$selected
string $htmlname

Name of HTML select @param int $useempty Show empty value or not @return string Html component

$useempty

selectTypeOfContainer($htmlname, string $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')

Return a HTML select list of type of containers from the dictionary

@param string $htmlname Name of select zone

Parameters

$htmlname
string $selected

Selected value @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. @param string $moreattrib More attributes on HTML select tag @param int $addjscombo Add js combo @param string $morecss More CSS @return string The HTML select component

$useempty
$moreattrib
$addjscombo
$morecss

selectSampleOfContainer($htmlname, string $selected = '', $useempty = 0, $moreattrib = '', $addjscombo = 0, $morecss = 'minwidth200')

Return a HTML select list of samples of containers content

@param string $htmlname Name of select zone

Parameters

$htmlname
string $selected

Selected value @param int $useempty 1=Add an empty value in list @param string $moreattrib More attributes on HTML select tag @param int $addjscombo Add js combo @param string $morecss More css @return string HTML select component with list of type of containers

$useempty
$moreattrib
$addjscombo
$morecss

selectContainer(Website $website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null)

Return a HTML select list of containers of a website.

Note: $website->lines must have been loaded.

Parameters

Website $website

Object Website @param string $htmlname Name of select zone @param int $pageid Preselected container ID @param int<0,1> $showempty Show empty record @param string $action Action on page that use this select list @param string $morecss More CSS @param ?array<int|string> $excludeids Exclude some ID in list @return string HTML select component with list of block containers

$htmlname
$pageid
$showempty
$action
$morecss
$excludeids

string getContentPageTemplate(string $htmlContent = 'message')

Return HTML code for selection of page layout

Parameters

string $htmlContent

HTML name of WYSIWYG field

Return Value

string

HTML for model page boxes