From 70244cc2cd8e8a4dbf054074c6c765779a5c4593 Mon Sep 17 00:00:00 2001 From: urs_hunkler Date: Sun, 29 Jul 2007 20:46:05 +0000 Subject: [PATCH] MDL-10075 - changes done following Petr's patch and optional_param with default ltr --- lib/setup.php | 2 -- lib/weblib.php | 11 ++++++----- theme/custom_corners/config.php | 27 ++++++++++----------------- theme/custom_corners/styles_rtl.css | 9 +++++++++ 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 6d7b75ea66..0fc392f499 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -588,8 +588,6 @@ global $HTTPSPAGEREQUIRED; } } - $CFG->langdirection = (get_string('thisdirection') == 'rtl') ? 'rtl' : 'ltr'; - // set default locale and themes - might be changed again later from require_login() course_setup(); diff --git a/lib/weblib.php b/lib/weblib.php index 2d2bad0760..9ce7bb8a83 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2456,9 +2456,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $pageclass .= ' drag'; } - if (!empty($CFG->langdirection)) { - $pageclass .= ' ' . $CFG->langdirection; - } + $pageclass .= ' dir-'.get_string('thisdirection'); $pageclass .= ' lang-'.$currentlanguage; @@ -2790,7 +2788,7 @@ function current_category_theme($categoryid=0) { * @param int $lifetime ? * @param string $thename ? */ -function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $forceconfig='', $lang='', $langdir='') { +function style_sheet_setup($lastmodified=0, $lifetime=300, $themename='', $forceconfig='', $lang='', $langdir='ltr') { global $CFG, $THEME; @@ -2977,7 +2975,10 @@ function theme_setup($theme = '', $params=NULL) { } /// Add parameter for the language direction - $params[] = 'langdir='.get_string('thisdirection'); + $langdir = get_string('thisdirection'); + if ($langdir == 'rtl') { + $params[] = 'langdir='.get_string('thisdirection'); + } if ($theme != $CFG->theme) { $params[] = 'forceconfig='.$theme; diff --git a/theme/custom_corners/config.php b/theme/custom_corners/config.php index 8855ea625c..6c3eeed356 100644 --- a/theme/custom_corners/config.php +++ b/theme/custom_corners/config.php @@ -4,21 +4,7 @@ /// how Moodle uses this theme. //////////////////////////////////////////////////////////////////////////////// -//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); - -// $THEME->sheets = array('user_styles'); - -// $THEME->sheets = array('user_styles', 'adminpage_correct'); +$THEME->sheets = array('user_styles', 'styles_rtl'); /// This variable is an array containing the names of all the /// stylesheet files you want included in this theme, and in what order @@ -84,7 +70,7 @@ $THEME->blocksheets = true; /// It is HIGHLY recommended to leave this enabled. -$THEME->langsheets = false; +$THEME->langsheets = false; /// By setting this to true, then this theme will search for /// a file named "styles.php" inside the current language @@ -95,7 +81,7 @@ $THEME->langsheets = false; $THEME->block_l_min_width = 180; $THEME->block_l_max_width = 210; $THEME->block_r_min_width = 180; -$THEME->block_r_max_width = 210;; +$THEME->block_r_max_width = 210; /// These values define the min and max width of the left and right /// sieblocks in the course pages. If not set or false the standard @@ -171,6 +157,13 @@ $THEME->chameleonteachereditenabled = false; /// will allow teachers on that course to edit the theme. +// $CFG->CSSEdit = true; + +/// When this is enabled then Moodle will include all CSS files +/// seperately instead of writing all CSS code into one single +/// CSS file per theme. The single CSS files can then be edited +/// and saved with interactive CSS editors like CSSEdit. + $THEME->resource_mp3player_colors = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. diff --git a/theme/custom_corners/styles_rtl.css b/theme/custom_corners/styles_rtl.css index 361e260908..f6b19980eb 100644 --- a/theme/custom_corners/styles_rtl.css +++ b/theme/custom_corners/styles_rtl.css @@ -7,6 +7,15 @@ div.sideblock div.header div.bt { left: -13px; margin: 0 13px 0 0; } +div.sideblock div.bt div { + background-position: 100% 0; + right: -13px; +} +div.sideblock div.bt { + background-position: 0 0; + left: -13px; + margin: 0 13px 0 0; +} div.sideblock div.bb div { background-position: 100% 100%; right: -13px; -- 2.39.5