Replace multiple configuration settings for agenda colors with array - refs BT#12892

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 6abdfc3eaa
commit 6fa1f2b5fe
  1. 33
      main/inc/lib/agenda.lib.php
  2. 18
      main/install/configuration.dist.php

@ -103,22 +103,27 @@ class Agenda
$this->setIsAllowedToEdit($isAllowToEdit);
$this->events = [];
$platformColor = api_get_configuration_value('agenda_platform_color') ?: 'red';
$courseColor = api_get_configuration_value('agenda_course_color') ?: '#458B00';
$groupColor = api_get_configuration_value('agenda_group_color') ?: '#A0522D';
$sessionColor = api_get_configuration_value('agenda_session_color') ?: '#00496D';
$otherSessionColor = api_get_configuration_value('agenda_other_session_color') ?: '#999';
$personalColor = api_get_configuration_value('agenda_personal_color') ?: 'steel blue';
$studentPublicationColor = api_get_configuration_value('agenda_student_publication_color') ?: '#FF8C00';
$agendaColors = array_merge(
[
'platform' => 'red', //red
'course' => '#458B00', //green
'group' => '#A0522D', //siena
'session' => '#00496D', // kind of green
'other_session' => '#999', // kind of green
'personal' => 'steel blue', //steel blue
'student_publication' => '#FF8C00' //DarkOrange
],
api_get_configuration_value('agenda_colors') ?: []
);
// Event colors
$this->event_platform_color = $platformColor; //red
$this->event_course_color = $courseColor; //green
$this->event_group_color = $groupColor; //siena
$this->event_session_color = $sessionColor; // kind of green
$this->eventOtherSessionColor = $otherSessionColor;
$this->event_personal_color = $personalColor; //steel blue
$this->eventStudentPublicationColor = $studentPublicationColor; //DarkOrange
$this->event_platform_color = $agendaColors['platform'];
$this->event_course_color = $agendaColors['course'];
$this->event_group_color = $agendaColors['group'];
$this->event_session_color = $agendaColors['session'];
$this->eventOtherSessionColor = $agendaColors['other_session'];
$this->event_personal_color = $agendaColors['personal'];
$this->eventStudentPublicationColor = $agendaColors['student_publication'];
}
/**

@ -371,13 +371,17 @@ $_configuration['agenda_legend'] = [
'#f0f' => 'another caption'
];*/
// Set customs colors to agenda events
//$_configuration['agenda_platform_color'] = 'red';
//$_configuration['agenda_course_color'] = '#458B00';
//$_configuration['agenda_group_color'] = '#A0522D';
//$_configuration['agenda_session_color'] = '#00496D';
//$_configuration['agenda_other_session_color'] = '#999';
//$_configuration['agenda_personal_color'] = 'steel blue';
//$_configuration['agenda_student_publication_color'] = '#FF8C00';
/*
$_configuration['agenda_colors'] = [
'platform' => 'red',
'course' => '#458B00',
'group' => '#A0522D',
'session' => '#00496D',
'other_session' => '#999',
'personal' => 'steel blue',
'student_publication' => '#FF8C00'
];
*/
//
//
// Save some tool titles with HTML editor

Loading…
Cancel
Save