1) I added central var langdirection - is in CVS
set $CFG->langdirection in lib/setup.php line 590
$CFG->langdirection = (get_string('thisdirection') == 'rtl') ? 'rtl' : 'ltr';
2) I added body CLASS for langdirection - is in CVS
add body class in lib/weblib.php - print_header line 2455
if (!empty($CFG->langdirection)) {
$pageclass .= ' ' . $CFG->langdirection;
}
3) I select theme sheets depending on $CFG->langdirection (debugging included) - is in CVS
trigger_error('custom_corners/config.php - $CFG->langdirection: '.$CFG->langdirection, E_USER_NOTICE);
if ($CFG->langdirection == 'rtl') {
$THEME->sheets = array('user_styles', 'styles_rtl');
trigger_error('custom_corners/config.php - is rtl ::: ', E_USER_NOTICE);
} else {
$THEME->sheets = array('user_styles');
trigger_error('custom_corners/config.php - is not rtl ::: ', E_USER_NOTICE);
}
trigger_error('custom_corners/config.php - $THEME->sheets: '.$THEME->sheets[0].', '.$THEME->sheets[1], E_USER_NOTICE);
1 and 2 work perfectly.
3 does not work. Moodle always uses the ltr sheets.
The set of debug messages is written to the error log 4 or more times. The first time correctly with the right langdirection. All following message sets war wirtten with the wrong langdirection. Does this mean that Moodle loads the theme/config.php several times and with different global variables?
1) I added central var langdirection - is in CVS
set $CFG->langdirection in lib/setup.php line 590
$CFG->langdirection = (get_string('thisdirection') == 'rtl') ? 'rtl' : 'ltr';
2) I added body CLASS for langdirection - is in CVS
add body class in lib/weblib.php - print_header line 2455
if (!empty($CFG->langdirection)) { $pageclass .= ' ' . $CFG->langdirection; }
3) I select theme sheets depending on $CFG->langdirection (debugging included) - is in CVS
trigger_error('custom_corners/config.php - $CFG->langdirection: '.$CFG->langdirection, E_USER_NOTICE);
if ($CFG->langdirection == 'rtl') {
$THEME->sheets = array('user_styles', 'styles_rtl');
trigger_error('custom_corners/config.php - is rtl ::: ', E_USER_NOTICE);
} else {
$THEME->sheets = array('user_styles');
trigger_error('custom_corners/config.php - is not rtl ::: ', E_USER_NOTICE);
}
trigger_error('custom_corners/config.php - $THEME->sheets: '.$THEME->sheets[0].', '.$THEME->sheets[1], E_USER_NOTICE);
1 and 2 work perfectly.
3 does not work. Moodle always uses the ltr sheets.
The set of debug messages is written to the error log 4 or more times. The first time correctly with the right langdirection. All following message sets war wirtten with the wrong langdirection. Does this mean that Moodle loads the theme/config.php several times and with different global variables?