mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-05-10 14:54:21 +00:00
document categorie may have a color
This commit is contained in:
parent
0192e0c288
commit
04d3251ef4
|
|
@ -108,6 +108,10 @@ else if ($action == "editcategory") {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
$color = $_POST["color"];
|
||||
if (!$category->setColor($color)) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
||||
}
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_edit_category')));
|
||||
add_log_line(".php&action=editcategory&categoryid=".$categoryid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,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("<i class=\"fa fa-save\"></i> ".getMLText('save'));
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -3659,10 +3659,8 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
}
|
||||
if($categories = $document->getCategories()) {
|
||||
$content .= "<br />";
|
||||
foreach($categories as $category) {
|
||||
$color = substr(md5($category->getName()), 0, 6);
|
||||
$content .= "<span class=\"badge\" style=\"background-color: #".$color."; color: #".self::getContrastColor($color).";\">".htmlspecialchars($category->getName())."</span> ";
|
||||
}
|
||||
foreach($categories as $category)
|
||||
$content .= "<span class=\"badge bg-secondary\"".($category->getColor() ? ' style="background-color: #'.$category->getColor().' !important;"' : '').">".$category->getName()."</span> ";
|
||||
}
|
||||
if(!empty($extracontent['bottom_title']))
|
||||
$content .= $extracontent['bottom_title'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user