diff --git a/op/op.Categories.php b/op/op.Categories.php
index ce54a75e9..5428ed70c 100644
--- a/op/op.Categories.php
+++ b/op/op.Categories.php
@@ -100,6 +100,11 @@ else if ($action == "editcategory") {
if (!$category->setName($name)) {
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
}
+
+ $color = $_POST["color"];
+ if (!$category->setColor($color)) {
+ UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
+ }
}
else {
diff --git a/views/bootstrap/class.Categories.php b/views/bootstrap/class.Categories.php
index e3711fb53..4a44899d6 100644
--- a/views/bootstrap/class.Categories.php
+++ b/views/bootstrap/class.Categories.php
@@ -125,6 +125,15 @@ $(document).ready( function() {
'value'=>($category ? htmlspecialchars($category->getName()) : '')
)
);
+ $this->formField(
+ getMLText("color"),
+ array(
+ 'element'=>'input',
+ 'type'=>'text',
+ 'name'=>'color',
+ 'value'=>($category ? htmlspecialchars($category->getColor()) : '')
+ )
+ );
$this->contentContainerEnd();
$this->formSubmit(" ".getMLText('save'));
?>
diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php
index 621051e70..703bb1eaf 100644
--- a/views/bootstrap4/class.Bootstrap4.php
+++ b/views/bootstrap4/class.Bootstrap4.php
@@ -3007,7 +3007,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
if($categories = $document->getCategories()) {
$content .= "
";
foreach($categories as $category)
- $content .= "".$category->getName()." ";
+ $content .= "getColor() ? ' style="background-color: #'.$category->getColor().' !important;"' : '').">".$category->getName()." ";
}
if(!empty($extracontent['bottom_title']))
$content .= $extracontent['bottom_title'];