Commit c8edee42 authored by Mathew May's avatar Mathew May
Browse files

MDL-64506 theme_bootstrapbase: Remove bootstrapbase from core

parent 48593260
**/yui/build/** -diff
**/amd/build/** -diff
lib/dml/oci_native_moodle_package.sql text eol=lf
theme/bootstrapbase/style/editor.css -diff
theme/bootstrapbase/style/moodle.css -diff
......@@ -25,7 +25,6 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
$temp->add(new admin_setting_configcheckbox('allowcohortthemes', new lang_string('allowcohortthemes', 'admin'), new lang_string('configallowcohortthemes', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
$temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
$temp->add(new admin_setting_configtextarea(
......
This files describes API changes in /admin/*.
=== 3.7 ===
* Admin setting "Allow blocks to use the dock" (allowblockstodock) has been removed & stings deprecated.
Docking of blocks is no longer supported within the core themes (Boost, Classic).
Please see MDL-64506 for further details.
=== 3.3 ===
* The admin settings admin_setting_configselect and admin_setting_configmultiselect now support the optgroup tag.
......
......@@ -653,8 +653,7 @@ class block_base {
* @return bool
*/
public function instance_can_be_docked() {
global $CFG;
return (!empty($CFG->allowblockstodock) && $this->page->theme->enable_dock);
return false;
}
/**
......
......@@ -70,21 +70,6 @@ class behat_blocks extends behat_base {
}
}
/**
* Docks a block. Editing mode should be previously enabled.
*
* @Given /^I dock "(?P<block_name_string>(?:[^"]|\\")*)" block$/
* @param string $blockname
*/
public function i_dock_block($blockname) {
// Looking for both title and alt.
$xpath = "//input[@type='image'][@title='" . get_string('dockblock', 'block', $blockname) . "' or @alt='" . get_string('addtodock', 'block') . "']";
$this->execute('behat_general::i_click_on_in_the',
array($xpath, "xpath_element", $this->escape($blockname), "block")
);
}
/**
* Opens a block's actions menu if it is not already opened.
*
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -156,9 +156,8 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
* Initialise action menu for the element (section or module)
*
* @param {String} elementid CSS id attribute of the element
* @param {Boolean} openmenu whether to open menu - this can be used when re-initiating menu after indent action was pressed
*/
var initActionMenu = function(elementid, openmenu) {
var initActionMenu = function(elementid) {
// Initialise action menu in the new activity.
Y.use('moodle-course-coursebase', function() {
M.course.coursebase.invoke_function('setup_for_resource', '#' + elementid);
......@@ -166,15 +165,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
if (M.core.actionmenu && M.core.actionmenu.newDOMNode) {
M.core.actionmenu.newDOMNode(Y.one('#' + elementid));
}
// Open action menu if the original element had data-keepopen.
if (openmenu) {
// We must use YUI click simulate here so the toggle works in Clean theme. This toggle is not
// needed in Boost because we use standard bootstrapbase action menu.
var toggle = Y.one('#' + elementid + ' ' + SELECTOR.MENU).one(SELECTOR.TOGGLE);
if (toggle && toggle.simulate) {
toggle.simulate('click');
}
}
};
/**
......@@ -227,8 +217,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
* @param {JQuery} target the element (menu item) that was clicked
*/
var editModule = function(moduleElement, cmid, target) {
var keepopen = target.attr('data-keepopen'),
action = target.attr('data-action');
var action = target.attr('data-action');
var spinner = addActivitySpinner(moduleElement);
var promises = ajax.call([{
methodname: 'core_course_edit_module',
......@@ -248,7 +237,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
moduleElement.replaceWith(data);
// Initialise action menu for activity(ies) added as a result of this.
$('<div>' + data + '</div>').find(SELECTOR.ACTIVITYLI).each(function(index) {
initActionMenu($(this).attr('id'), keepopen);
initActionMenu($(this).attr('id'));
if (index === 0) {
focusActionItem($(this).attr('id'), action);
elementToFocus = null;
......@@ -451,7 +440,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
// Find the existing element with the same id and replace its contents with new html.
$(SELECTOR.ACTIVITYLI + '#' + id).replaceWith(activityHTML);
// Initialise action menu.
initActionMenu(id, false);
initActionMenu(id);
});
};
......
@core @core_course
Feature: Open the edit menu when a block is docked
In order to edit an activity with a block docked
As a teacher
I need to open the action menu
@javascript
Scenario: Open the action menu with a block docked
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | weeks |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
And I dock "Navigation" block
When I open "Test glossary name" actions menu
Then "Test glossary name" actions menu should be open
And I reload the page
When I open "Test glossary name" actions menu
Then "Test glossary name" actions menu should be open
......@@ -28,12 +28,8 @@ if (file_exists(__DIR__.'/../config.php')) {
die;
}
// include only the necessary stuff from themes, keep this small otherwise IE will complain...
// MDL-43839 IE9 cannot handle all of our css.
// Once IE9 is no longer supported we can include 'bootstrapbase/style/moodle.css'
// and remove some of the CSS in $content.
$files = array();
$files = array('boost/style/moodle.css');
$content = '';
......@@ -114,268 +110,6 @@ fieldset .alert {
text-align: center;
}
/*
MDL-43839 IE9 cannot handle all of our CSS.
Once IE9 is no longer supported we can include 'bootstrapbase/style/moodle.css' above
and remove the following.
*/
#page-footer {
padding: 1em 0;
margin-top: 1em;
border-top: 2px solid #ddd;
}
.fitem {
clear:both;
text-align:left;
padding: 8px;
}
.fitemtitle {
float: left;
width: 245px;
text-align: right;
}
html[dir=rtl] .fitemtitle {
float: right;
}
label {
font-weight: bold;
display: inline-block;
margin: 5px;
}
.fitemelement {
margin-left: 265px;
}
html[dir=rtl] .fitemelement {
margin-right: 265px;
margin-left: 0;
direction: ltr;
}
.alert, .alert h4 {
color: #c09853;
}
.alert {
padding: 8px 35px 8px 14px;
margin-bottom: 20px;
text-shadow: 0 1px 0 rgba(255,255,255,0.5);
background-color: #fcf8e3;
border: 1px solid #fbeed5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.alert-info {
color: #3a87ad;
background-color: #d9edf7;
border-color: #bce8f1;
}
.alert-success {
color: #468847;
background-color: #dff0d8;
border-color: #d6e9c6;
}
.alert-error {
color: #b94a48;
background-color: #f2dede;
border-color: #eed3d7;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,0.15);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.notifytiny {
font-size: 10.5px;
}
input[type="button"], input[type="submit"] {
margin: 0 0 10px 5px;
display: inline-block;
padding: 4px 12px;
font-size: 14px;
line-height: 20px;
color: #333;
text-align: center;
text-shadow: 0 1px 1px rgba(255,255,255,0.75);
vertical-align: middle;
cursor: pointer;
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top,#fff,#e6e6e6);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));
background-image: -webkit-linear-gradient(top,#fff,#e6e6e6);
background-image: -o-linear-gradient(top,#fff,#e6e6e6);
background-image: linear-gradient(to bottom,#fff,#e6e6e6);
background-repeat: repeat-x;
border: 1px solid #ccc;
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
border-bottom-color: #b3b3b3;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
}
input[type="button"]:hover, input[type="submit"]:hover, input[type="button"]:focus, input[type="submit"]:focus {
color: #333;
text-decoration: none;
background-position: 0 -15px;
-webkit-transition: background-position .1s linear;
-moz-transition: background-position .1s linear;
-o-transition: background-position .1s linear;
transition: background-position .1s linear;
}
input[type="button"]:hover, input[type="submit"]:hover, input[type="button"]:focus, input[type="submit"]:focus, input[type="button"]:active, input[type="submit"]:active, input[type="button"].active, input[type="submit"].active, input[type="button"].disabled, input[type="submit"].disabled, input[type="reset"].disabled, input[type="submit"][disabled], input[type="reset"][disabled] {
color: #333;
background-color: #e6e6e6;
}
button, input, select, textarea {
margin: 0;
}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"] {
display: inline-block;
height: 20px;
padding: 4px 6px;
margin-bottom: 10px;
font-size: 14px;
line-height: 20px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
select {
background-color: #fff;
border: 1px solid #ccc;
}
label, select, button, input[type="button"], input[type="submit"], input[type="radio"], input[type="checkbox"] {
cursor: pointer;
}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"] {
display: inline-block;
height: 20px;
padding: 4px 6px;
margin-bottom: 10px;
font-size: 14px;
line-height: 20px;
color: #555;
vertical-align: middle;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
select, input[type="file"] {
height: 30px;
line-height: 30px;
}
textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"] {
background-color: #fff;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
-webkit-transition: border linear .2s,box-shadow linear .2s;
-moz-transition: border linear .2s,box-shadow linear .2s;
-o-transition: border linear .2s,box-shadow linear .2s;
transition: border linear .2s,box-shadow linear .2s;
}
input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {
cursor: not-allowed;
background-color: #eee;
}
input.btn-primary {
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
background-color: #005aa8;
background-image: -moz-linear-gradient(top,#0070a8,#0038a8);
background-image: -webkit-gradient(linear,0 0,0 100%,from(#0070a8),to(#0038a8));
background-image: -webkit-linear-gradient(top,#0070a8,#0038a8);
background-image: -o-linear-gradient(top,#0070a8,#0038a8);
background-image: linear-gradient(to bottom,#0070a8,#0038a8);
background-repeat: repeat-x;
border-color: #0038a8 #0038a8 #001e5c;
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0070a8',endColorstr='#ff0038a8',GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
input.btn-primary:hover,
input.btn-primary:active,
input.btn-primary:focus {
color: #fff;
background-color: #0038a8;
}
.breadcrumb {
background-color: #f5f5f5;
}
.breadcrumb {
padding: 8px 15px;
margin: 0 0 20px;
list-style: none;
background-color: #f5f5f5;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
text-shadow: 0 1px 0 #fff;
line-height: 20px;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333;
}
.breadcrumb {
background-color: rgb(245, 245, 245);
padding: 8px 15px;
}
/*
End of MDL-43839 IE9 specific CSS.
*/
EOF;
// fix used urls
......
......@@ -47,7 +47,6 @@ $string['allcountrycodes'] = 'All country codes';
$string['allowattachments'] = 'Allow attachments';
$string['allowbeforeblock'] = 'Allowed list will be processed first';
$string['allowbeforeblockdesc'] = 'By default, entries in the blocked IPs list are matched first. If this option is enabled, entries in the allowed IPs list are processed before the blocked list.';
$string['allowblockstodock'] = 'Allow blocks to use the dock';
$string['allowcategorythemes'] = 'Allow category themes';
$string['allowcohortthemes'] = 'Allow cohort themes';
$string['allowcoursethemes'] = 'Allow course themes';
......@@ -146,7 +145,6 @@ $string['configallowattachments'] = 'If enabled, emails sent from the site can h
$string['configenableactivitychooser'] = 'The activity chooser is a dialog box with a short description of each activity and resource. If disabled, separate resource and activity drop-down menus are provided instead.';
$string['configallcountrycodes'] = 'This is the list of countries that may be selected in various places, for example in a user\'s profile. If blank (the default) the list in countries.php in the standard English language pack is used. That is the list from ISO 3166-1. Otherwise, you can specify a comma-separated list of codes, for example \'GB,FR,ES\'. If you add new, non-standard codes here, you will need to add them to countries.php in \'en\' and your language pack.';
$string['configallowassign'] = 'You can allow people who have the roles on the left side to assign some of the column roles to other people';
$string['configallowblockstodock'] = 'If enabled and supported by the selected theme users can choose to move blocks to a special dock.';
$string['configallowcategorythemes'] = 'If you enable this, then themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.';
$string['configallowcohortthemes'] = 'If you enable this, then themes can be set at the cohort level. This will affect all users with only one cohort or more than one but with the same theme.';
$string['configallowcoursethemes'] = 'If you enable this, then courses will be allowed to set their own themes. Course themes override all other theme choices (site, user, or session themes)';
......@@ -1413,3 +1411,6 @@ $string['moodleorghubname'] = 'Moodle.net';
$string['hubs'] = 'Hubs';
$string['configloginhttps'] = 'Turning this on will make Moodle use a secure https connection just for the login page (providing a secure login), and then afterwards revert back to the normal http URL for general speed. CAUTION: this setting REQUIRES https to be specifically enabled on the web server - if it is not then YOU COULD LOCK YOURSELF OUT OF YOUR SITE.';
$string['loginhttps'] = 'Use HTTPS for logins';
// Deprecated since Moodle 3.7.
$string['allowblockstodock'] = 'Allow blocks to use the dock';
$string['configallowblockstodock'] = 'If enabled and supported by the selected theme users can choose to move blocks to a special dock.';
\ No newline at end of file
......@@ -1554,11 +1554,6 @@ class moodle_page {
}
$this->_theme->setup_blocks($this->pagelayout, $this->blocks);
if ($this->_theme->enable_dock && !empty($CFG->allowblockstodock)) {
$this->requires->strings_for_js(array('addtodock', 'undockitem', 'dockblock', 'undockblock', 'undockall', 'hidedockpanel', 'hidepanel'), 'block');
$this->requires->string_for_js('thisdirectionvertical', 'langconfig');
$this->requires->yui_module('moodle-core-dock-loader', 'M.core.dock.loader.initLoader');
}
if ($this === $PAGE) {
$target = null;
......
......@@ -107,6 +107,26 @@ class behat_deprecated extends behat_base {
$this->execute('behat_theme_boost_behat_navigation::select_from_administration_menu', array($nodelist));
}
/**
* Docks a block. Editing mode should be previously enabled.
* @throws ExpectationException
* @param string $blockname
* @return void
* @deprecated since Moodle 3.7 MDL-64506 - please do not use this definition step any more.
* @todo MDL-65215 This will be deleted in Moodle 4.1.
*/
public function i_dock_block($blockname) {
$message = "Block docking is no longer used as of MDL-64506. Please update your tests.";
$this->deprecated_message($message);
// Looking for both title and alt.
$xpath = "//input[@type='image'][@title='" . get_string('dockblock', 'block', $blockname) . "' or @alt='" . get_string('addtodock', 'block') . "']";
$this->execute('behat_general::i_click_on_in_the',
array($xpath, "xpath_element", $this->escape($blockname), "block")
);
}
/**
* Throws an exception if $CFG->behat_usedeprecated is not allowed.
*
......
{
"features": [
"lib/tests/behat/action_menu.feature",
"course/tests/behat/activities_edit_with_block_dock.feature",
"blocks/tests/behat/hide_blocks.feature",
"blocks/tests/behat/move_blocks.feature"
]
......
About this theme
================
This is the Bootstrap theme for Moodle.
* package Moodle Bootstrap theme
* copyright 2013 Bas Brands. www.sonsbeekmedia.nl
* authors Bas Brands, David Scotson
* license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
This theme has been created with the help of:
Stuart Lamour, Mark Aberdour, Paul Hibbitts, Mary Evans
This theme is based on the Twitter Bootstrap CSS framework version 2.3.
It contains all unmodified less* CSS sources from the Twitter Bootstrap CSS
framework in folder /less/bootstrap.
On top of the Bootstrap less CSS sources Moodle CSS is added to create this
theme.
HTML5 is tags are used in the /layout/general.php file. The structure of this file
provides a 2-1-3 layout when looking at your Moodle page source. This improves
accessibility and Search Engine Optimization (SEO).
*less CSS
Less CSS is a Object Oriented way of writing CSS code. All Less CSS files
for this theme are stored in the /less folder. A developer can use grunt
to generate the CSS files in the /style folder. For more
information read /less/README
JavaScript Libraries
html5shiv.js
------------
To provide backwards compatibility for HTML5 for Internet Explorer 7 (IE7) and Internet
Explorer 8 (IE8) a javascript library call /javascript/html5shiv.js was added. This
JavaScript converts HTML tags and CSS into Tag that are understood by IE7 and IE8.
The config.php makes sure these libraries are only loaded for IE7 and IE8.
moodlebootstrap.js
------------------
This file initiates the bootstrap library.
headercollapse.js
-----------------
Workaround for the collapse button on the Moodle custom menu. Without this
Submenu items cannot be opened
Updating Twitter bootstrap and Libraries
========================================
Twitter bootstrap
-----------------
This theme uses the original unmodified version 2.3.0 Twitter bootstrap less files. These are
Object Oriented CSS files. The bootstrap repository is available on:
https://github.com/twitter/bootstrap.git
To update to the latest release of twitter bootstrap remove all files from less/bootstrap,
download the new less files and store them in less/bootstrap
Inclusion of bootstrap files is configured in less/moodle.less. To generate the new
Moodle CSS read /less/README
html5shiv.js
------------
This theme uses the original unmodified html5shiv.js JavaScript library to enable HTML5 tags in IE7 and IE8.
This library is available on:
https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js
To update to the latest release of html5shiv download and replace:
javascript/html5shiv.js
Licenses & Authors
==================
Twitter Bootstrap Copyright and license
---------------------------------------
Authors: Mark Otto, Jacob Thornton
URL: http://twitter.github.com/bootstrap/
License:
Copyright 2012 Twitter, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this work except in compliance with the License.
You may obtain a copy of the License in the LICENSE file, or at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Html5shiv.js
------------
Author: Sjoerd Visscher
URL: http://en.wikipedia.org/wiki/HTML5_Shiv, https://github.com/aFarkas/html5shiv
License: MIT/GPL2 Licensed
moodlebootstrap.js
------------------
Author: 2013 Bas Brands. www.sonsbeekmedia.nl
license: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
This diff is collapsed.
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Privacy Subsystem implementation for theme_bootstrapbase.
*