better help support
This commit is contained in:
parent
150e6158dc
commit
ee795fa42e
|
@ -3729,6 +3729,8 @@ class htmlResponsiveInputField extends htmlInputField {
|
||||||
private $label;
|
private $label;
|
||||||
/** help ID */
|
/** help ID */
|
||||||
private $helpID;
|
private $helpID;
|
||||||
|
/** help module name */
|
||||||
|
private $helpModule = null;
|
||||||
/** render HTML of parent class */
|
/** render HTML of parent class */
|
||||||
private $renderParentHtml = false;
|
private $renderParentHtml = false;
|
||||||
|
|
||||||
|
@ -3738,13 +3740,21 @@ class htmlResponsiveInputField extends htmlInputField {
|
||||||
* @param String $label descriptive label
|
* @param String $label descriptive label
|
||||||
* @param String $fieldName unique field name
|
* @param String $fieldName unique field name
|
||||||
* @param String $fieldValue value of input field (optional)
|
* @param String $fieldValue value of input field (optional)
|
||||||
* @param String $helpID help ID (optional)
|
* @param String|array $helpID help ID or array of help ID + module name (optional)
|
||||||
|
* @param bool $required field is required
|
||||||
*/
|
*/
|
||||||
function __construct($label, $fieldName, $fieldValue = null, $helpID = null) {
|
function __construct($label, $fieldName, $fieldValue = null, $helpID = null, $required = false) {
|
||||||
parent::__construct($fieldName, $fieldValue);
|
parent::__construct($fieldName, $fieldValue);
|
||||||
$this->label = $label;
|
$this->label = $label;
|
||||||
|
if (is_string($helpID)) {
|
||||||
$this->helpID = $helpID;
|
$this->helpID = $helpID;
|
||||||
|
}
|
||||||
|
elseif (is_array($helpID)) {
|
||||||
|
$this->helpID = $helpID[0];
|
||||||
|
$this->helpModule = $helpID[1];
|
||||||
|
}
|
||||||
$this->fieldSize = null;
|
$this->fieldSize = null;
|
||||||
|
$this->required = $required;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3767,7 +3777,7 @@ class htmlResponsiveInputField extends htmlInputField {
|
||||||
$labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required')));
|
$labelGroup->addElement(new htmlImage($graphicsPath . '/required.png', 16, 16, _('required'), _('required')));
|
||||||
}
|
}
|
||||||
if (!empty($this->helpID)) {
|
if (!empty($this->helpID)) {
|
||||||
$helpLinkLabel = new htmlHelpLink($this->helpID);
|
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
$helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5'));
|
$helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5'));
|
||||||
$labelGroup->addElement($helpLinkLabel);
|
$labelGroup->addElement($helpLinkLabel);
|
||||||
}
|
}
|
||||||
|
@ -3776,7 +3786,7 @@ class htmlResponsiveInputField extends htmlInputField {
|
||||||
$fieldGroup = new htmlGroup();
|
$fieldGroup = new htmlGroup();
|
||||||
$fieldGroup->addElement($this);
|
$fieldGroup->addElement($this);
|
||||||
if (!empty($this->helpID)) {
|
if (!empty($this->helpID)) {
|
||||||
$helpLinkField = new htmlHelpLink($this->helpID);
|
$helpLinkField = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
$helpLinkField->setCSSClasses(array('hide-on-mobile'));
|
$helpLinkField->setCSSClasses(array('hide-on-mobile'));
|
||||||
$fieldGroup->addElement($helpLinkField);
|
$fieldGroup->addElement($helpLinkField);
|
||||||
}
|
}
|
||||||
|
@ -3878,6 +3888,8 @@ class htmlResponsiveSelect extends htmlSelect {
|
||||||
private $label;
|
private $label;
|
||||||
/** help ID */
|
/** help ID */
|
||||||
private $helpID;
|
private $helpID;
|
||||||
|
/** help module name */
|
||||||
|
private $helpModule = null;
|
||||||
/** render HTML of parent class */
|
/** render HTML of parent class */
|
||||||
private $renderParentHtml = false;
|
private $renderParentHtml = false;
|
||||||
|
|
||||||
|
@ -3888,14 +3900,20 @@ class htmlResponsiveSelect extends htmlSelect {
|
||||||
* @param array $elements list of elememts
|
* @param array $elements list of elememts
|
||||||
* @param array $selectedElements list of selected elements
|
* @param array $selectedElements list of selected elements
|
||||||
* @param String $label descriptive label
|
* @param String $label descriptive label
|
||||||
* @param String $helpID help ID (optional, default none)
|
* @param String|array $helpID help ID or array of help ID + module name (optional)
|
||||||
* @param int $size size (optional, default = 1)
|
* @param int $size size (optional, default = 1)
|
||||||
*/
|
*/
|
||||||
function __construct($name, $elements, $selectedElements, $label, $helpID = null, $size = 1) {
|
function __construct($name, $elements, $selectedElements, $label, $helpID = null, $size = 1) {
|
||||||
parent::__construct($name, $elements, $selectedElements, $size);
|
parent::__construct($name, $elements, $selectedElements, $size);
|
||||||
$this->label = htmlspecialchars($label);
|
$this->label = htmlspecialchars($label);
|
||||||
|
if (is_string($helpID)) {
|
||||||
$this->helpID = $helpID;
|
$this->helpID = $helpID;
|
||||||
}
|
}
|
||||||
|
elseif (is_array($helpID)) {
|
||||||
|
$this->helpID = $helpID[0];
|
||||||
|
$this->helpModule = $helpID[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -3912,7 +3930,7 @@ class htmlResponsiveSelect extends htmlSelect {
|
||||||
$labelGroup = new htmlGroup();
|
$labelGroup = new htmlGroup();
|
||||||
$labelGroup->addElement(new htmlOutputText($this->label));
|
$labelGroup->addElement(new htmlOutputText($this->label));
|
||||||
if (!empty($this->helpID)) {
|
if (!empty($this->helpID)) {
|
||||||
$helpLinkLabel = new htmlHelpLink($this->helpID);
|
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
$helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5'));
|
$helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5'));
|
||||||
$labelGroup->addElement($helpLinkLabel);
|
$labelGroup->addElement($helpLinkLabel);
|
||||||
}
|
}
|
||||||
|
@ -3921,7 +3939,7 @@ class htmlResponsiveSelect extends htmlSelect {
|
||||||
$fieldGroup = new htmlGroup();
|
$fieldGroup = new htmlGroup();
|
||||||
$fieldGroup->addElement($this);
|
$fieldGroup->addElement($this);
|
||||||
if (!empty($this->helpID)) {
|
if (!empty($this->helpID)) {
|
||||||
$helpLink = new htmlHelpLink($this->helpID);
|
$helpLink = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
$helpLink->setCSSClasses(array('hide-on-mobile'));
|
$helpLink->setCSSClasses(array('hide-on-mobile'));
|
||||||
$fieldGroup->addElement($helpLink);
|
$fieldGroup->addElement($helpLink);
|
||||||
}
|
}
|
||||||
|
@ -4014,6 +4032,8 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox {
|
||||||
private $label;
|
private $label;
|
||||||
/** help ID */
|
/** help ID */
|
||||||
private $helpID;
|
private $helpID;
|
||||||
|
/** help module name */
|
||||||
|
private $helpModule = null;
|
||||||
/** render HTML of parent class */
|
/** render HTML of parent class */
|
||||||
private $renderParentHtml = false;
|
private $renderParentHtml = false;
|
||||||
/** long label */
|
/** long label */
|
||||||
|
@ -4025,13 +4045,19 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox {
|
||||||
* @param String $name unique name
|
* @param String $name unique name
|
||||||
* @param boolean $checked checked
|
* @param boolean $checked checked
|
||||||
* @param String $label descriptive label
|
* @param String $label descriptive label
|
||||||
* @param String $helpID help ID
|
* @param String|array $helpID help ID or array of help ID + module name (optional)
|
||||||
* @param bool $longLabel more space for label (default: false)
|
* @param bool $longLabel more space for label (default: false)
|
||||||
*/
|
*/
|
||||||
function __construct($name, $checked, $label, $helpID = null, $longLabel = false) {
|
function __construct($name, $checked, $label, $helpID = null, $longLabel = false) {
|
||||||
parent::__construct($name, $checked);
|
parent::__construct($name, $checked);
|
||||||
$this->label = $label;
|
$this->label = $label;
|
||||||
|
if (is_string($helpID)) {
|
||||||
$this->helpID = $helpID;
|
$this->helpID = $helpID;
|
||||||
|
}
|
||||||
|
elseif (is_array($helpID)) {
|
||||||
|
$this->helpID = $helpID[0];
|
||||||
|
$this->helpModule = $helpID[1];
|
||||||
|
}
|
||||||
$this->longLabel = $longLabel;
|
$this->longLabel = $longLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4060,7 +4086,7 @@ class htmlResponsiveInputCheckbox extends htmlInputCheckbox {
|
||||||
$fieldGroup = new htmlGroup();
|
$fieldGroup = new htmlGroup();
|
||||||
$fieldGroup->addElement($this);
|
$fieldGroup->addElement($this);
|
||||||
if (!empty($this->helpID)) {
|
if (!empty($this->helpID)) {
|
||||||
$helpLink = new htmlHelpLink($this->helpID);
|
$helpLink = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
$helpLink->setCSSClasses(array('margin-left5 align-unset-img'));
|
$helpLink->setCSSClasses(array('margin-left5 align-unset-img'));
|
||||||
$fieldGroup->addElement($helpLink);
|
$fieldGroup->addElement($helpLink);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue