color for self service
This commit is contained in:
parent
a804f94d6f
commit
1b198403d7
|
@ -2,6 +2,8 @@ December 2018 6.6
|
||||||
- New import/export in tools menu
|
- New import/export in tools menu
|
||||||
- YubiKey support
|
- YubiKey support
|
||||||
- Windows users: manage "departmentNumber" (needs to be activated via LAM server profile)
|
- Windows users: manage "departmentNumber" (needs to be activated via LAM server profile)
|
||||||
|
- LAM Pro:
|
||||||
|
-> Easy setting of background color in self service profile
|
||||||
|
|
||||||
|
|
||||||
25.09.2018 6.5
|
25.09.2018 6.5
|
||||||
|
|
|
@ -241,6 +241,13 @@
|
||||||
code is permitted.</entry>
|
code is permitted.</entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
|
<row>
|
||||||
|
<entry>Base color</entry>
|
||||||
|
|
||||||
|
<entry>Here you can change the background color for the user
|
||||||
|
pages.</entry>
|
||||||
|
</row>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
<entry>Additional CSS links</entry>
|
<entry>Additional CSS links</entry>
|
||||||
|
|
||||||
|
|
|
@ -309,6 +309,8 @@ $helpArray = array (
|
||||||
"Text" => _('Please enter the site and secret key you got from Google reCAPTCHA.')),
|
"Text" => _('Please enter the site and secret key you got from Google reCAPTCHA.')),
|
||||||
"522" => array ("Headline" => _('Secure login'),
|
"522" => array ("Headline" => _('Secure login'),
|
||||||
"Text" => _('Protect the self service login with a captcha.')),
|
"Text" => _('Protect the self service login with a captcha.')),
|
||||||
|
"523" => array ("Headline" => _('Base color'),
|
||||||
|
"Text" => _('Background color for self service pages.')),
|
||||||
"550" => array ("Headline" => _("From address"),
|
"550" => array ("Headline" => _("From address"),
|
||||||
"Text" => _("This email address will be set as sender address of all password mails. If empty the system default (php.ini) will be used.")),
|
"Text" => _("This email address will be set as sender address of all password mails. If empty the system default (php.ini) will be used.")),
|
||||||
"551" => array ("Headline" => _("Subject"),
|
"551" => array ("Headline" => _("Subject"),
|
||||||
|
|
121
lam/lib/html.inc
121
lam/lib/html.inc
|
@ -2656,6 +2656,127 @@ class htmlTableExtendedInputTextarea extends htmlInputTextarea {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prints the HTML code for a color picker field.
|
||||||
|
*
|
||||||
|
* @package metaHTML
|
||||||
|
*/
|
||||||
|
class htmlInputColorPicker extends htmlElement {
|
||||||
|
|
||||||
|
/** unique name of input element */
|
||||||
|
private $name;
|
||||||
|
/** color value */
|
||||||
|
private $color;
|
||||||
|
/** enabled or disabled */
|
||||||
|
private $isEnabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param string $name unique name
|
||||||
|
* @param string $colorValue color value (e.g. #000000)
|
||||||
|
*/
|
||||||
|
public function __construct($name, $colorValue = '#000000') {
|
||||||
|
$this->name = htmlspecialchars($name);
|
||||||
|
$this->color = htmlspecialchars($colorValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* @see htmlElement::generateHTML()
|
||||||
|
*/
|
||||||
|
public function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
|
||||||
|
$tabindexValue = ' tabindex="' . $tabindex . '"';
|
||||||
|
$tabindex++;
|
||||||
|
$disabled = '';
|
||||||
|
if (!$this->isEnabled) {
|
||||||
|
$disabled = ' disabled';
|
||||||
|
}
|
||||||
|
echo '<input type="color" value="' . $this->color . '" id="' . $this->name . '" name="' . $this->name . '"' . $tabindexValue . $disabled . '>';
|
||||||
|
return array($this->name => 'file');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies if this component is enabled and accepts user modification.
|
||||||
|
*
|
||||||
|
* @param boolean $isEnabled enabled if true
|
||||||
|
*/
|
||||||
|
public function setIsEnabled($isEnabled) {
|
||||||
|
$this->isEnabled = $isEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Color picker with descriptive label and help link.
|
||||||
|
*
|
||||||
|
* @package metaHTML
|
||||||
|
*/
|
||||||
|
class htmlResponsiveInputColorPicker extends htmlInputColorPicker {
|
||||||
|
|
||||||
|
/** descriptive label */
|
||||||
|
private $label;
|
||||||
|
/** help ID */
|
||||||
|
private $helpID;
|
||||||
|
/** help module */
|
||||||
|
private $helpModule = null;
|
||||||
|
/** render HTML of parent class */
|
||||||
|
private $renderParentHtml = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param string $name unique name
|
||||||
|
* @param string $colorValue color value (e.g. #000000)
|
||||||
|
* @param string $label descriptive label
|
||||||
|
* @param string $helpID help ID
|
||||||
|
*/
|
||||||
|
public function __construct($name, $colorValue, $label, $helpID = null) {
|
||||||
|
parent::__construct($name, $colorValue);
|
||||||
|
$this->label = htmlspecialchars($label);
|
||||||
|
if (is_string($helpID)) {
|
||||||
|
$this->helpID = $helpID;
|
||||||
|
}
|
||||||
|
elseif (is_array($helpID)) {
|
||||||
|
$this->helpID = $helpID[0];
|
||||||
|
$this->helpModule = $helpID[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
* @see htmlInputColorPicker::generateHTML()
|
||||||
|
*/
|
||||||
|
public function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
|
||||||
|
if ($this->renderParentHtml) {
|
||||||
|
return parent::generateHTML($module, $input, $values, $restricted, $tabindex, $scope);
|
||||||
|
}
|
||||||
|
// HTML of parent class is rendered on second call (done by htmlResponsiveRow)
|
||||||
|
$this->renderParentHtml = true;
|
||||||
|
$row = new htmlResponsiveRow();
|
||||||
|
// label text
|
||||||
|
$labelGroup = new htmlGroup();
|
||||||
|
$labelGroup->addElement(new htmlOutputText($this->label));
|
||||||
|
if (!empty($this->helpID)) {
|
||||||
|
$helpLinkLabel = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
|
$helpLinkLabel->setCSSClasses(array('hide-on-tablet', 'margin-left5'));
|
||||||
|
$labelGroup->addElement($helpLinkLabel);
|
||||||
|
}
|
||||||
|
$row->add($labelGroup, 12, 6, 6, 'responsiveLabel');
|
||||||
|
// input field
|
||||||
|
$fieldGroup = new htmlGroup();
|
||||||
|
$fieldGroup->addElement($this);
|
||||||
|
if (!empty($this->helpID)) {
|
||||||
|
$helpLinkField = new htmlHelpLink($this->helpID, $this->helpModule);
|
||||||
|
$helpLinkField->setCSSClasses(array('hide-on-mobile'));
|
||||||
|
$fieldGroup->addElement($helpLinkField);
|
||||||
|
}
|
||||||
|
$row->add($fieldGroup, 12, 6, 6, 'responsiveField nowrap');
|
||||||
|
return $row->generateHTML($module, $input, $values, $restricted, $tabindex, $scope);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints the HTML code for an image.
|
* Prints the HTML code for an image.
|
||||||
*
|
*
|
||||||
|
|
|
@ -335,6 +335,9 @@ class selfServiceProfile {
|
||||||
/** header for self service pages */
|
/** header for self service pages */
|
||||||
public $pageHeader;
|
public $pageHeader;
|
||||||
|
|
||||||
|
/** base color */
|
||||||
|
public $baseColor = '#fffde2';
|
||||||
|
|
||||||
/** list of additional CSS links (separated by \n) */
|
/** list of additional CSS links (separated by \n) */
|
||||||
public $additionalCSS;
|
public $additionalCSS;
|
||||||
|
|
||||||
|
@ -416,6 +419,7 @@ class selfServiceProfile {
|
||||||
$this->httpAuthentication = false;
|
$this->httpAuthentication = false;
|
||||||
$this->pageHeader = '<table border=0 width="100%" class="lamHeader ui-corner-all"><tr><td align="left" height="30"><a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a></td></tr></table><br>';
|
$this->pageHeader = '<table border=0 width="100%" class="lamHeader ui-corner-all"><tr><td align="left" height="30"><a class="lamLogo" href="http://www.ldap-account-manager.org/" target="new_window">LDAP Account Manager</a></td></tr></table><br>';
|
||||||
$this->additionalCSS = '';
|
$this->additionalCSS = '';
|
||||||
|
$this->baseColor = '#fffde2';
|
||||||
$this->loginCaption = '<b>' . _("Welcome to LAM self service. Please enter your user name and password.") . '</b>';
|
$this->loginCaption = '<b>' . _("Welcome to LAM self service. Please enter your user name and password.") . '</b>';
|
||||||
$this->loginAttributeText = _('User name');
|
$this->loginAttributeText = _('User name');
|
||||||
$this->passwordLabel = '';
|
$this->passwordLabel = '';
|
||||||
|
|
Loading…
Reference in New Issue