Commit e9bc5dcc authored by Seamus Lee's avatar Seamus Lee
Browse files

CRM-20860 Add in ability to create field type of password from metadata

parent 2c6536b5
......@@ -1524,6 +1524,9 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
case 'EntityRef':
return $this->addEntityRef($name, $label, $props, $required);
case 'Password':
return $this->add('password', $name, $label, $props, $required);
// Check datatypes of fields
// case 'Int':
//case 'Float':
......
......@@ -179,7 +179,7 @@ class CRM_Core_Form_Renderer extends HTML_QuickForm_Renderer_ArraySmarty {
$class = $element->getAttribute('class');
$type = $element->getType();
if (!$class) {
if ($type == 'text') {
if ($type == 'text' || $type == 'password') {
$size = $element->getAttribute('size');
if (!empty($size)) {
$class = CRM_Utils_Array::value($size, self::$_sizeMapper);
......
......@@ -271,7 +271,8 @@ input.crm-form-entityref {
}
.crm-container input.crm-form-text,
.crm-container .crm-icon-picker-button,
.crm-container input.dateplugin {
.crm-container input.dateplugin,
.crm-container input.crm-form-password {
border: 1px solid #999;
vertical-align: middle;
padding: 1px 2px;
......@@ -285,7 +286,9 @@ input.crm-form-entityref {
.crm-container input.crm-form-text[disabled],
.crm-container input.dateplugin[disabled],
.crm-container select.crm-form-select[disabled],
.crm-container input.crm-form-text[readonly] {
.crm-container input.crm-form-text[readonly],
.crm-container input.crm-form-password[disabled],
.crm-container input.crm-form-password[readonly] {
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #ddd), color-stop(15%, #f2f2f2));
background-image: -webkit-linear-gradient(top, #ddd 1%, #f2f2f2 15%);
background-image: -moz-linear-gradient(top, #ddd 1%, #f2f2f2 15%);
......@@ -294,7 +297,8 @@ input.crm-form-entityref {
.crm-container input.crm-form-text[disabled],
.crm-container input.dateplugin[disabled],
.crm-container select.crm-form-select[disabled] {
.crm-container select.crm-form-select[disabled],
.crm-container input.crm-form-password[disabled] {
color: #a9a9a9;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment