From f25185d7b0ff3d018b282ffce265fede919c8391 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Wed, 9 Nov 2016 09:18:10 +0800 Subject: [PATCH] MDL-56844 scorm: Review styles in boost theme The main change is that in boost we get rid of the random centered text. To compensate we use "container" which is fixed with with auto margins - but the text is still left aligned. --- mod/scorm/locallib.php | 5 +++-- mod/scorm/styles.css | 12 ------------ mod/scorm/view.php | 6 +++--- theme/boost/scss/moodle/modules.scss | 1 + theme/bootstrapbase/less/moodle/modules.less | 14 ++++++++++++++ theme/bootstrapbase/style/moodle.css | 9 +++++++++ 6 files changed, 30 insertions(+), 17 deletions(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 7b71623e5d0..28d1303c3c7 100644 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -897,7 +897,7 @@ function scorm_print_launch ($user, $scorm, $action, $cm) { $organization = optional_param('organization', '', PARAM_INT); if ($scorm->displaycoursestructure == 1) { - echo $OUTPUT->box_start('generalbox boxaligncenter toc', 'toc'); + echo $OUTPUT->box_start('generalbox boxaligncenter toc container', 'toc'); echo html_writer::div(get_string('contents', 'scorm'), 'structurehead'); } if (empty($organization)) { @@ -946,7 +946,8 @@ function scorm_print_launch ($user, $scorm, $action, $cm) { echo html_writer::start_div('scorm-center'); echo html_writer::start_tag('form', array('id' => 'scormviewform', 'method' => 'post', - 'action' => $CFG->wwwroot.'/mod/scorm/player.php')); + 'action' => $CFG->wwwroot.'/mod/scorm/player.php', + 'class' => 'container')); if ($scorm->hidebrowse == 0) { print_string('mode', 'scorm'); echo ': '.html_writer::empty_tag('input', array('type' => 'radio', 'id' => 'b', 'name' => 'mode', diff --git a/mod/scorm/styles.css b/mod/scorm/styles.css index c900bdafdd6..fc6644b0706 100644 --- a/mod/scorm/styles.css +++ b/mod/scorm/styles.css @@ -6,10 +6,6 @@ text-align: left; } -.path-mod-scorm .scorm-center { - text-align: center; -} - .path-mod-scorm .scorm-right { text-align: right; } @@ -187,10 +183,6 @@ overflow: auto; } -.path-mod-scorm.forcejavascript .scorm-center { - display: none; -} - .path-mod-scorm.forcejavascript .toc { display: none; } @@ -203,10 +195,6 @@ display: none; } -.path-mod-scorm.jsenabled .scorm-center { - display: block; -} - .path-mod-scorm.jsenabled .toc { display: block; } diff --git a/mod/scorm/view.php b/mod/scorm/view.php index 7fe22167b6b..21d63b882fa 100644 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -156,20 +156,20 @@ if (empty($launch) && ($scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTAT $scorm->displayattemptstatus == SCORM_DISPLAY_ATTEMPTSTATUS_ENTRY)) { $attemptstatus = scorm_get_attempt_status($USER, $scorm, $cm); } -echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'generalbox boxaligncenter boxwidthwide', 'intro'); +echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'container', 'intro'); // Check if SCORM available. list($available, $warnings) = scorm_get_availability_status($scorm); if (!$available) { $reason = current(array_keys($warnings)); - echo $OUTPUT->box(get_string($reason, "scorm", $warnings[$reason]), "generalbox boxaligncenter"); + echo $OUTPUT->box(get_string($reason, "scorm", $warnings[$reason]), "container"); } if ($available && empty($launch)) { scorm_print_launch($USER, $scorm, 'view.php?id='.$cm->id, $cm); } if (!empty($forcejs)) { - echo $OUTPUT->box(get_string("forcejavascriptmessage", "scorm"), "generalbox boxaligncenter forcejavascriptmessage"); + echo $OUTPUT->box(get_string("forcejavascriptmessage", "scorm"), "container forcejavascriptmessage"); } if (!empty($scorm->popup)) { diff --git a/theme/boost/scss/moodle/modules.scss b/theme/boost/scss/moodle/modules.scss index 1ec5dc3f051..a96f62a1265 100644 --- a/theme/boost/scss/moodle/modules.scss +++ b/theme/boost/scss/moodle/modules.scss @@ -12,6 +12,7 @@ select { .path-mod-feedback .feedback_form .col-form-label { display: block !important; /* stylelint-disable-line declaration-no-important */ } + // Feedback module .path-mod-feedback .itemactions { float: right; diff --git a/theme/bootstrapbase/less/moodle/modules.less b/theme/bootstrapbase/less/moodle/modules.less index 3514265a174..a507f870f39 100644 --- a/theme/bootstrapbase/less/moodle/modules.less +++ b/theme/bootstrapbase/less/moodle/modules.less @@ -917,3 +917,17 @@ div#dock { background-color: @grayLight; } } + +// Scorm. +.path-mod-scorm .scorm-center { + text-align: center; +} + +.path-mod-scorm.forcejavascript .scorm-center { + display: none; +} + +.path-mod-scorm.jsenabled .scorm-center { + display: block; +} + diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index 4c026913cd8..41c731b0305 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -15209,6 +15209,15 @@ div#dock { .path-mod-quiz #mod_quiz_navblock .qnbutton.requiresgrading .trafficlight { background-color: #999; } +.path-mod-scorm .scorm-center { + text-align: center; +} +.path-mod-scorm.forcejavascript .scorm-center { + display: none; +} +.path-mod-scorm.jsenabled .scorm-center { + display: block; +} .yui-skin-sam .yui-layout.path-mod-chat-gui_ajax { background-color: #fff; }