Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-10075 - changes done following Petr's patch and optional_param wi…
…th default ltr
  • Loading branch information
urs_hunkler committed Jul 29, 2007
1 parent cb5105a commit 70244cc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
2 changes: 0 additions & 2 deletions lib/setup.php
Expand Up @@ -588,8 +588,6 @@ class object {};
}
}

$CFG->langdirection = (get_string('thisdirection') == 'rtl') ? 'rtl' : 'ltr';

// set default locale and themes - might be changed again later from require_login()
course_setup();

Expand Down
11 changes: 6 additions & 5 deletions lib/weblib.php
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
27 changes: 10 additions & 17 deletions theme/custom_corners/config.php
Expand Up @@ -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
Expand Down Expand Up @@ -84,7 +70,7 @@
/// 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
Expand All @@ -95,7 +81,7 @@
$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
Expand Down Expand Up @@ -171,6 +157,13 @@
/// 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&'.
Expand Down
9 changes: 9 additions & 0 deletions theme/custom_corners/styles_rtl.css
Expand Up @@ -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;
Expand Down

0 comments on commit 70244cc

Please sign in to comment.