24 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
36 protected static $colors = array(
'crs' => array(
91 $this->user_id = $a_user_id;
106 $cat_id = $this->cat_app_ass[$a_cal_id];
107 $cat_id = $this->cat_substitutions[$cat_id];
109 return isset($this->appointment_colors[$cat_id]) ? $this->appointment_colors[$cat_id] :
'red';
124 foreach($this->categories->getCategoriesInfo() as $c_data)
126 if(isset($c_data[
'subitem_ids']) and count($c_data[
'subitem_ids']))
128 foreach($c_data[
'subitem_ids'] as $sub_item_id)
130 $this->cat_substitutions[$sub_item_id] = $c_data[
'cat_id'];
134 $this->cat_substitutions[$c_data[
'cat_id']] = $c_data[
'cat_id'];
137 $query =
"SELECT cat.cat_id,cat.color, ass.cal_id FROM cal_categories cat ".
138 "JOIN cal_cat_assignments ass ON cat.cat_id = ass.cat_id ".
139 "WHERE ".$ilDB->in(
'cat.cat_id',$this->categories->getCategories(
true),
false,
'integer');
144 $this->appointment_colors[
$row->cat_id] =
$row->color;
145 $this->cat_app_ass[
$row->cal_id] =
$row->cat_id;
159 return self::$colors[$a_type][rand(0,count(self::$colors[$a_type]) - 1)];
172 foreach(self::$colors[
'grp'] as $color)
174 echo
'<font color="'.$color.
'">HALLO</font><br/>';
176 foreach(self::$colors[
'crs'] as $color)
178 echo
'<font color="'.$color.
'">HALLO</font><br/>';
192 return self::$colors[$a_type];
static _getColorsByType($a_type)
get selectable colors
static dumpColors()
public
const DB_FETCHMODE_OBJECT
getColorByAppointment($a_cal_id)
get color by appointment
static _getInstance($a_usr_id=0)
get singleton instance
static _getRandomColorByType($a_type)
get random color entry for type
__construct($a_user_id)
Constructor.