provide a possibility to create checklists in bbcode [x] creates a checked checkbox, [] creates an unchecked checkbox

This commit is contained in:
Mario Vavti 2016-08-31 09:38:47 +02:00
parent 202b757bc4
commit 2b9322fc7d
2 changed files with 7 additions and 0 deletions

View File

@ -769,6 +769,8 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
} }
// Check for list text // Check for list text
$Text = str_replace("[*]", "<li>", $Text); $Text = str_replace("[*]", "<li>", $Text);
$Text = str_replace("[]", "<li><input class=\"listcheckbox\" type=\"checkbox\" disabled=\"disabled\">", $Text);
$Text = str_replace("[x]", "<li><input class=\"listcheckbox\" type=\"checkbox\" checked=\"checked\" disabled=\"disabled\">", $Text);
// handle nested lists // handle nested lists
$endlessloop = 0; $endlessloop = 0;

View File

@ -319,3 +319,8 @@ img.smiley.emoji:hover {
width: 32px; width: 32px;
height: 32px; height: 32px;
} }
input.listcheckbox {
margin: 0px;
vertical-align: middle;
}