Skip to content

Commit 6e4fcad

Browse files
committed
Merge branch 'master' of github.com:chamilo/chamilo-lms
2 parents 5d39adf + bf5e76c commit 6e4fcad

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

assets/css/scss/atoms/_checkbox.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
}
2626
}
2727

28+
&:has(&-input--legacy:checked) &-box,
2829
&.p-highlight &-box {
2930
@apply border-primary bg-primary;
3031
}
@@ -34,6 +35,7 @@
3435
@apply border-primary;
3536
}
3637

38+
&:has(.p-checkbox-input--legacy:checked) .p-checkbox-box,
3739
&.p-highlight .p-checkbox-box {
3840
@apply border-primary bg-primary text-white;
3941
}

assets/css/scss/atoms/_radio.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
transform: translateZ(0) scale(0.1);
1717
}
1818

19+
&:has(&-input--legacy:checked) &-icon,
1920
&.p-highlight &-icon {
2021
@apply visible;
2122
transform: translateZ(0) scale(1, 1);
@@ -33,6 +34,7 @@
3334
@apply w-1.5 h-1.5 duration-200 bg-white;
3435
}
3536

37+
&:has(&-input--legacy:checked) &-box,
3638
&.p-highlight &-box {
3739
@apply border-primary bg-primary;
3840
}
@@ -42,6 +44,7 @@
4244
@apply border-primary;
4345
}
4446

47+
&:has(.p-radiobutton-input--legacy:checked) .p-radiobutton-box,
4548
&.p-highlight .p-radiobutton-box {
4649
@apply border-primary bg-primary text-white;
4750
}

public/main/inc/lib/pear/HTML/QuickForm/checkbox.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ public function getChecked()
114114
*/
115115
public function toHtml()
116116
{
117-
$extraClass = "appearance-none checked:bg-support-4 outline-none";
117+
$extraClass = "p-checkbox-input p-checkbox-input--legacy";
118+
118119
if (isset($this->_attributes['class'])) {
119120
$this->_attributes['class'] .= $extraClass;
120121
} else {
121122
$this->_attributes['class'] = $extraClass;
122123
}
124+
123125
if (0 == strlen($this->_text)) {
124126
$label = '';
125127
} elseif ($this->_flagFrozen) {
@@ -131,7 +133,14 @@ public function toHtml()
131133
$id = $this->getAttribute('id');
132134

133135
return '<div id="'.$name.'" class="'.$checkClass.'">
136+
<div class="p-checkbox p-component">
134137
'.parent::toHtml().'
138+
<div class="p-checkbox-box" data-pc-section="box">
139+
<div class="p-checkbox-icon" data-pc-section="icon">
140+
<span class="mdi mdi-check" aria-hidden="true"></span>
141+
</div>
142+
</div>
143+
</div>
135144
<label for="'.$id.'" class="'.$labelClass.'">
136145
'.$this->_text.
137146
'</label>

public/main/inc/lib/pear/HTML/QuickForm/radio.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ public function getTemplate(string $layout): string
111111
*/
112112
public function toHtml()
113113
{
114+
$extraClass = "p-radiobutton-input p-radiobutton-input--legacy";
115+
116+
if (isset($this->_attributes['class'])) {
117+
$this->_attributes['class'] .= $extraClass;
118+
} else {
119+
$this->_attributes['class'] = $extraClass;
120+
}
121+
114122
if (0 == strlen($this->_text)) {
115123
$label = '';
116124
} elseif ($this->isFrozen()) {
@@ -126,7 +134,12 @@ public function toHtml()
126134
$id = $this->getAttribute('id');
127135

128136
return '<div class="'.$radioClass.'">
129-
'.parent::toHtml().'
137+
<div class="p-radiobutton p-component">
138+
'.parent::toHtml().'
139+
<div class="p-radiobutton-box" data-pc-section="box">
140+
<div class="p-radiobutton-icon" data-pc-section="icon"></div>
141+
</div>
142+
</div>
130143
<label for="'.$id.'" class="'.$labelClass.'">'.$this->_text.'</label>
131144
</div>';
132145
}

0 commit comments

Comments
 (0)