'
- . $this->Form->label($fn, $label)
+ . (!($labelIsTextOnly) && ($fieldType != 'boolean')
+ ? $this->Form->label($fn, $label)
+ : $label)
. ($this->editable
&& in_array($fn, $this->reqFields)
? ' * '
@@ -408,13 +428,15 @@ protected function formNameDiv(string $fieldName, string $labelText=null): strin
* @param string $status Status text
* @param array $link Link information, including 'url', 'label', 'class', 'confirm'
* @param string $labelText Label text (fieldName language key used by default)
+ * @param array $config Custom FormHelper configuration options
* @return string
*/
public function statusControl(string $fieldName,
string $status,
array $link=[],
- string $labelText=null): string {
+ string $labelText=null,
+ array $config=[]): string {
$linkHtml = $status;
if($link) {
@@ -439,9 +461,12 @@ public function statusControl(string $fieldName,
);
}
}
+
+ // For special fields that should not include markup, allow fields to make the label text only
+ $labelIsTextOnly = !empty($config['labelIsTextOnly']) ? $config['labelIsTextOnly'] : false;
return $this->startLine()
- . $this->formNameDiv($fieldName, $labelText)
+ . $this->formNameDiv($fieldName, $labelText, 'string', $labelIsTextOnly)
. $linkHtml
. $this->endLine();
}
diff --git a/app/templates/ApiUsers/fields.inc b/app/templates/ApiUsers/fields.inc
index 80c0c0e00..065255c24 100644
--- a/app/templates/ApiUsers/fields.inc
+++ b/app/templates/ApiUsers/fields.inc
@@ -36,6 +36,7 @@ if($vv_action == 'add' || $vv_action == 'edit') {
// We link to the "Generate" button on edit only
$generateLink = [];
+ $config = [];
if(!empty($vv_obj->id)) {
$generateLink = [
@@ -45,14 +46,18 @@ if($vv_action == 'add' || $vv_action == 'edit') {
$vv_obj->id
],
'label' => __d('operation', 'api.key.generate'),
- 'class' => 'provisionbutton',
+ 'class' => 'provisionbutton nospin',
'confirm' => __d('operation', 'api.key.generate.confirm')
];
+
+ $config = ['labelIsTextOnly' => true];
}
print $this->Field->statusControl('api_key',
!empty($vv_obj->api_key) ? __d('enumeration', 'SetBooleanEnum.1') : __d('enumeration', 'SetBooleanEnum.0'),
- $generateLink);
+ $generateLink,
+ null,
+ $config);
print $this->Field->control('status', ['empty' => false]);
diff --git a/app/templates/element/menuTop.php b/app/templates/element/menuTop.php
index f41801964..4c797ecb2 100644
--- a/app/templates/element/menuTop.php
+++ b/app/templates/element/menuTop.php
@@ -86,7 +86,7 @@
'action' => 'select',
'plugin' => false],
['escape' => false,
- 'id' => 'login',
+ 'id' => 'login-button',
'class' => 'btn btn-small']);
}
?>
diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css
index 910eae59b..781e92ac3 100644
--- a/app/webroot/css/co-base.css
+++ b/app/webroot/css/co-base.css
@@ -331,7 +331,7 @@ body.cos.select #top-bar {
margin: 0 0 0.25rem;
}
/* LOGIN & LOGOUT */
-#login {
+#login-button {
display: inline-block;
padding: 0.25em 1em;
text-decoration: none;
@@ -1178,19 +1178,8 @@ ul.form-list li.field-stack textarea {
ul.form-list .field-suppliment {
font-size: 0.9em;
}
-.checkbox {
- margin-bottom: 0.5em;
-}
-.checkbox input {
- float: left;
- margin: 4px 4px 0 0;
-}
-.checkbox label {
- margin-left: 1.5em;
- display: block;
-}
-.checkbox label::first-line {
- margin-left: 0;
+.checkbox label input {
+ margin-right: 0.5em;
}
.checkbox .subfield {
margin-left: 1.5em;