Commit d0c4b168 authored by Camille Tardy's avatar Camille Tardy
Browse files

Fix color selection for categories : use categ ID and not categ name


Signed-off-by: Camille Tardy's avatarCamille Tardy <camille.tardy@unige.ch>
parent 00f64e17
## University of Geneva Boost child theme
*Author : University of Geneva, 2018*
Boost Child theme for Moodle 3.5.
A related Mahara theme can be found [in our Gitlab](https://gitlab.unige.ch/tardyc/Theme-Mahara)
###How to
To change colors for the top categories :
* edit function : color_fac_category($id_category) in classes/output/core/course_renderer.php
* edit list in : scss/style_post_scss.scss
To change links in menus :
* use the setting view for the theme to update the urls
* use the lanuage files in the source code to edit the links label
*Author : University of Geneva, 2018*
......@@ -323,44 +323,44 @@ class course_renderer extends \core_course_renderer {
} while ($id_category_parent != '0');
// Category name
$category_name = $DB->get_field('course_categories', 'name', array('id' => $id_category));
// $category_name = $DB->get_field('course_categories', 'name', array('id' => $id_category));
// Category color
$color_fac = '';
switch ($category_name) {
case 'Sciences':
switch ($id_category) {
case 2: //'Sciences':
$color_fac = 'color-fac-sciences';
break;
case 'Médecine':
case 13://'Médecine':
$color_fac = 'color-fac-medecine';
break;
case 'Lettres':
case 34://'Lettres':
$color_fac = 'color-fac-lettres';
break;
case 'Sciences de la société':
case 54://'Sciences de la société':
$color_fac = 'color-fac-societe';
break;
case 'Economie et Management (GSEM)':
case 83: //'Economie et Management (GSEM)':
$color_fac = 'color-fac-economie';
break;
case 'Droit':
case 62: //'Droit':
$color_fac = 'color-fac-droit';
break;
case 'Théologie':
case 66: //'Théologie':
$color_fac = 'color-fac-theologie';
break;
case 'Psychologie et Sciences de l\'Éducation':
case 67: //'Psychologie et Sciences de l\'Éducation':
$color_fac = 'color-fac-psychologie';
break;
case 'Traduction et Interprétation':
case 73: //'Traduction et Interprétation':
$color_fac = 'color-fac-traduction';
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment