<?php
/**
 * @package			No Boss Extensions
 * @subpackage  	No Boss Calendar
 * @author			No Boss Technology <contact@nobosstechnology.com>
 * @copyright		Copyright (C) 2020 No Boss Technology. All rights reserved.
 * @license			GNU Lesser General Public License version 3 or later; see <https://www.gnu.org/licenses/lgpl-3.0.en.html>
 */

defined('_JEXEC') or die();

if(empty($event->event_category->category_color) && (!empty($tmplPrimaryColor))){
    $event->event_category->category_color = $tmplPrimaryColor;
}

$s = "";

if(!empty($event->event_category->category_color)){
    $s .= ".{$moduleName} [module-item-id={$moduleName}_{$idModule}_{$date->month}_{$count}]:before{";
        $s .= "background-color: {$event->event_category->category_color};";
    $s .= "}"; 
}

$s .= ".{$moduleName} [module-item-id={$moduleName}_{$idModule}_{$date->month}_{$count}] .nb-event__end:before{";
    $s .= "background-color: " . (!empty($event->event_text_color) ? $event->event_text_color : $custom->events_texts_color) . ";";
$s .= "}"; 

// chama função que adiciona prefixo em todo o estilo que foi concatenado na variável $s 
$assetsObject->addStyleWithPrefix($s);
