SetupPage
class SetupPage extends FormPage (View source)
SetupPage class
Properties
protected string | $head | from Page | |
protected string | $title | from Page | |
protected string | $access_permission | from Page | |
protected array | $tabs | from Page | |
protected array | $main_subtitle | from Page | |
protected string | $tabs_picture | from Page | |
protected string | $tabs_title | from Page | |
protected string | $active_tab | from Page | |
protected boolean | $close_form | from Page | |
protected boolean | $close_table | from Page | |
protected boolean | $add_fiche_end | from Page | |
protected string | $rights_class | from Page | |
protected string | $modulepart | from Page | |
protected array | $assets | from Page | |
object | $form | from FormPage | |
protected string | $body | from FormPage | |
protected array | $fields | from FormPage | |
protected boolean | $odd | ||
protected string | $const_name_prefix | ||
protected string | $num_model_const_name | ||
protected string | $doc_model_const_name | ||
protected string | $doc_model_type | ||
protected string | $doc_model_preview_picture | ||
protected string | $doc_object_class | ||
protected string | $doc_object_path | ||
protected boolean | $disable_default_actions | ||
protected string | $title_link | ||
protected boolean | $add_extrafields_tab | ||
protected boolean | $add_changelog_tab | ||
protected boolean | $use_ajax_to_switch_on_off |
Methods
Constructor
Generate tabs
Add a subtitle
Opens a new html table
Include a template into the page.
Load default actions
Generate page body
Check specified field
Show a confirmation message
Set Title link
Set Document model(s) preview picture
Set $use_ajax_to_switch_on_off attribute to true
Show setup_not_available template (only once)
Create a new table for options
Add a new option
Add a new switch option
Add a new text option
Add a new number only option
Add a new range option
Add a new list option
Add a new multi select list option
Add a new color picker option
Open buttons div (if not already opened)
Close buttons div (if opened)
Add a button to the page
Add a confirmation button to the page
Print numbering models
Print document models
Details
at line 95
__construct($page_title = 'Setup', $access_perm = '$user->admin', $disable_default_actions = false, $add_extrafields_tab = false, $add_changelog_tab = false, $const_name_prefix = '', $doc_model_type = '', $doc_object_class = '', $doc_object_path = '')
Constructor
$this
setTitle($page_title)
Set page title.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setMainSubtitle($title, $picture = 'title_generic.png')
Set page main subtitle.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
loadLangs($lang_files_array, $from_module = false)
Load an array of language files
$this
appendToHead($content)
Append content to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addJsFile($js_file)
Add JS file to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addJsFiles($js_files_array)
Add an array of JS files.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addCssFile($css_file)
Add CSS file to page head.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addCssFiles($css_files_array)
Add an array of CSS files.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
addTab($title, $url, $is_active = false, $position = -1)
Add a tab to the page.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setTabsPicture($picture)
Set tabs picture.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
$this
setTabsTitle($title)
Set tabs title.
Note: this function should be called before $page->begin() function, otherwise it will not work as expected.
at line 394
protected
generateTabs($noheader = -1)
Generate tabs
$this
addSubTitle($title, $picture = 'title_generic.png', $morehtmlright = '')
Add a subtitle
$this
openForm($action = 'create', $enctype = '')
Open a form only if not already opened
$this
openTable($header_columns = array(), $attr = 'class="noborder allwidth"', $print_fiche_head = false, $summary = '')
Opens a new html table
$this
showTemplate($template_path, $path_is_absolute = false, $use_require_once = false, $template_params = array())
Include a template into the page.
Note: the template should be inside module tpl folder when $path_is_absolute parameter equal false.
at line 160
protected
loadDefaultActions()
Load default actions
at line 364
protected
generate()
Generate page body
redirect($url)
Redirect to a url (alias for dolibase_redirect function).
Note: this function should be called before any output, so before $page->begin() function.
end()
Generate page end.
Note: this function should be called after $page->begin() call.
boolean|int
checkField($field_name, $field_trans = '', $field_validation_rules = '', $return_err_number = false)
Check specified field
$this
askForConfirmation($url, $title, $question, $action, $question_param = '', $dialog_id_suffix = '')
Show a confirmation message
at line 132
$this
setTitleLink($link, $label, $enable = '$user->admin')
Set Title link
at line 149
$this
setDocModelPreviewPicture($picture)
Set Document model(s) preview picture
at line 404
$this
useAjaxToSwitchOnOff()
Set $use_ajax_to_switch_on_off attribute to true
at line 416
$this
setupNotAvailable()
Show setup_not_available template (only once)
at line 431
$this
newOptionsTable($first_column_name = 'Option')
Create a new table for options
at line 454
$this
addOption($option_desc, $option_content, $const_name = '', $morehtmlright = '', $width = 300, $form_enctype = '')
Add a new option
at line 486
$this
addSwitchOption($option_desc, $const_name, $disabled = false, $morehtmlright = '')
Add a new switch option
at line 525
$this
addTextOption($option_desc, $const_name, $morehtmlright = '', $size = 16, $width = 300)
Add a new text option
at line 547
$this
addNumberOption($option_desc, $const_name, $min, $max = 100, $morehtmlright = '', $width = 300)
Add a new number only option
at line 569
$this
addRangeOption($option_desc, $const_name, $min, $max = 100, $morehtmlright = '', $width = 300)
Add a new range option
at line 590
$this
addListOption($option_desc, $const_name, $list, $morehtmlright = '', $width = 300)
Add a new list option
at line 612
$this
addMultiSelectListOption($option_desc, $const_name, $list, $morehtmlright = '', $width = 300)
Add a new multi select list option
at line 635
$this
addColorOption($option_desc, $const_name, $morehtmlright = '', $width = 300)
Add a new color picker option
at line 650
protected
openButtonsDiv()
Open buttons div (if not already opened)
at line 664
protected
closeButtonsDiv()
Close buttons div (if opened)
at line 682
$this
addButton($name, $href = '#', $target = '_self', $class = 'butAction', $close_parent_div = false)
Add a button to the page
at line 708
$this
addConfirmButton($name, $id, $href = '#', $target = '_self', $class = 'butAction', $close_parent_div = false)
Add a confirmation button to the page
at line 736
$this
printNumModels($model_name = '')
Print numbering models
at line 847
$this
printDocModels()
Print document models