}
// First delete instances and then block
- $instances = $DB->get_records('block_instance', array('blockid'=>$block->id));
+ $instances = $DB->get_records('block_instance_old', array('blockid'=>$block->id));
if(!empty($instances)) {
foreach($instances as $instance) {
blocks_delete_instance($instance);
// MDL-11167, blocks can be placed on mymoodle, or the blogs page
// and it should not show up on course search page
- $totalcount = $DB->count_records('block_instance', array('blockid'=>$blockid));
- $count = $DB->count_records('block_instance', array('blockid'=>$blockid, 'pagetype'=>'course-view'));
+ $totalcount = $DB->count_records('block_instance_old', array('blockid'=>$blockid));
+ $count = $DB->count_records('block_instance_old', array('blockid'=>$blockid, 'pagetype'=>'course-view'));
if ($count>0) {
$blocklist = "<a href=\"{$CFG->wwwroot}/course/search.php?blocklist=$blockid&sesskey=".sesskey()."\" ";
/// Try to replace some well-known serialised contents (html blocks)
notify('Replacing in html blocks...');
$sql = "SELECT bi.*
- FROM {block_instance} bi
+ FROM {block_instance_old} bi
JOIN {block} b ON b.id = bi.blockid
WHERE b.name = 'html'";
if ($instances = $DB->get_records_sql($sql)) {
break;
case CONTEXT_BLOCK:
- if ($blockinstance = $DB->get_record('block_instance', array('id'=>$context->instanceid))) {
+ if ($blockinstance = $DB->get_record('block_instance_old', array('oldid'=>$context->instanceid))) {
if ($block = $DB->get_record('block', array('id'=>$blockinstance->blockid))) {
$blockname = print_context_name($context);
require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/blocklib.php');
-require_once($CFG->dirroot.'/'.$CFG->admin.'/pagelib.php');
$section = required_param('section', PARAM_SAFEDIR);
$return = optional_param('return','', PARAM_ALPHA);
// add all roles assigned at block context
if ($courseblocks = $DB->get_records_sql("SELECT *
- FROM {block_instance}
+ FROM {block_instance_old}
WHERE pagetype = '".PAGE_COURSE_VIEW."'
AND pageid = ?", array($preferences->backup_course))) {
foreach ($courseblocks as $courseblock) {
- $context = get_context_instance(CONTEXT_BLOCK, $courseblock->id);
+ $context = get_context_instance(CONTEXT_BLOCK, $courseblock->oldid);
$contexts[$context->id] = $context;
}
}
$data = $data;
$this->config = $data;
- $table = 'block_instance';
+ $table = 'block_instance_old';
+ $field = 'oldid';
if (!empty($pinned)) {
- $table = 'block_pinned';
+ $table = 'block_pinned_old';
+ $field = 'id';
}
- return $DB->set_field($table, 'configdata', base64_encode(serialize($data)), array('id'=>$this->instance->id));
+ return $DB->set_field($table, 'configdata', base64_encode(serialize($data)), array($field => $this->instance->id));
}
/**
function instance_config_commit($pinned=false) {
global $DB;
- $table = 'block_instance';
+ $table = 'block_instance_old';
+ $field = 'oldid';
if (!empty($pinned)) {
- $table = 'block_pinned';
+ $table = 'block_pinned_old';
+ $field = 'id';
}
- return $DB->set_field($table, 'configdata', base64_encode(serialize($this->config)), array('id'=>$this->instance->id));
+ return $DB->set_field($table, 'configdata', base64_encode(serialize($this->config)), array($field => $this->instance->id));
}
/**
}
function applicable_formats() {
- return (array('course-view-weeks' => true, 'course-view-topics' => true, 'course-edit-weeks' => true, 'course-edit-topics' => true));
+ return (array('course-view-weeks' => true, 'course-view-topics' => true));
}
function get_content() {
$newblock->position = 'r';
$newblock->weight = 0;
$newblock->visible = 1;
- $DB->insert_record('block_instance', $newblock);
+ $DB->insert_record('block_instance_old', $newblock);
// add blog_tags menu
$newblock -> blockid = $tagsblock->id;
$newblock -> weight = 1;
- $DB->insert_record('block_instance', $newblock);
+ $DB->insert_record('block_instance_old', $newblock);
// finally we set the page size pref
set_user_preference('blogpagesize', 10);
// get list of courses containing blocks if required
if (!empty($blocklist) and confirm_sesskey()) {
$blockid = $blocklist;
- if (!$blocks = $DB->get_records('block_instance', array('blockid'=>$blockid))) {
+ if (!$blocks = $DB->get_records('block_instance_old', array('blockid'=>$blockid))) {
print_error('blockcannotread', '', '', $blockid);
}
$PAGE = page_create_object(PAGE_COURSE_VIEW, $course->id);
$PAGE->set_url('course/view.php', array('id' => $course->id));
+ $PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
// Only non-pinned & course-page based
$sql = "SELECT ctx.path, ctx.depth
FROM {context} ctx
- JOIN {block_instance} bi
+ JOIN {block_instance_old} bi
ON (bi.pageid=ctx.instanceid AND ctx.contextlevel=".CONTEXT_COURSE.")
- WHERE bi.id=? AND bi.pagetype='course-view'";
+ WHERE bi.oldid=? AND bi.pagetype='course-view'";
$params = array($instanceid);
if ($p = $DB->get_record_sql($sql, $params)) {
$basepath = $p->path;
$basedepth = $p->depth;
- } else if ($bi = $DB->get_record('block_instance', array('id'=>$instanceid))) {
+ } else if ($bi = $DB->get_record('block_instance_old', array('oldid'=>$instanceid))) {
if ($bi->pagetype != 'course-view') {
// ok - not a course block
} else if ($parent = get_context_instance(CONTEXT_COURSE, $bi->pageid)) {
if (empty($contextlevel) or $contextlevel == CONTEXT_BLOCK) {
$sql = "INSERT INTO {context} (contextlevel, instanceid)
- SELECT ".CONTEXT_BLOCK.", bi.id
- FROM {block_instance} bi
+ SELECT ".CONTEXT_BLOCK.", bi.oldid
+ FROM {block_instance_old} bi
WHERE NOT EXISTS (SELECT 'x'
FROM {context} cx
WHERE bi.id = cx.instanceid AND cx.contextlevel=".CONTEXT_BLOCK.")";
SELECT c.contextlevel,
c.instanceid
FROM {context} c
- LEFT OUTER JOIN {block_instance} t
- ON c.instanceid = t.id
+ LEFT OUTER JOIN {block_instance_old} t
+ ON c.instanceid = t.oldid
WHERE t.id IS NULL AND c.contextlevel = ".CONTEXT_BLOCK."
";
if ($rs = $DB->get_recordset_sql($sql)) {
UNION ALL
SELECT x.instanceid, x.id, x.contextlevel, x.path, x.depth
- FROM {block_instance} bi
- JOIN {context} x ON x.instanceid=bi.id
+ FROM {block_instance_old} bi
+ JOIN {context} x ON x.instanceid=bi.oldid
WHERE bi.pageid=? AND bi.pagetype='course-view'
AND x.contextlevel=".CONTEXT_BLOCK."
break;
case CONTEXT_BLOCK: // not necessarily 1 to 1 to course
- if ($blockinstance = $DB->get_record('block_instance', array('id'=>$context->instanceid))) {
+ if ($blockinstance = $DB->get_record('block_instance_old', array('oldid'=>$context->instanceid))) {
if ($block = $DB->get_record('block', array('id'=>$blockinstance->blockid))) {
global $CFG;
require_once("$CFG->dirroot/blocks/moodleblock.class.php");
break;
case CONTEXT_BLOCK: // block caps
- $cb = $DB->get_record('block_instance', array('id'=>$context->instanceid));
+ $cb = $DB->get_record('block_instance_old', array('oldid'=>$context->instanceid));
$block = $DB->get_record('block', array('id'=>$cb->blockid));
$extra = "";
LEFT JOIN {course_categories} cat ON ctx.contextlevel = 40 AND cat.id = ctx.instanceid
LEFT JOIN {course} c ON ctx.contextlevel = 50 AND c.id = ctx.instanceid
LEFT JOIN {course_modules} cm ON ctx.contextlevel = 70 AND cm.id = ctx.instanceid
- LEFT JOIN {block_instance} bi ON ctx.contextlevel = 80 AND bi.id = ctx.instanceid
+ LEFT JOIN {block_instance_old} bi ON ctx.contextlevel = 80 AND bi.oldid = ctx.instanceid
$select
ORDER BY ctx.contextlevel, bi.position, COALESCE(cat.sortorder, c.sortorder, cm.section, bi.weight), u.lastname, u.firstname, cm.id
", $params);
$sql = "INSERT INTO {context_temp} (id, path, depth)
SELECT ctx.id, ".$DB->sql_concat('pctx.path', "'/'", 'ctx.id').", pctx.depth+1
FROM {context} ctx
- JOIN {block_instance} bi ON ctx.instanceid = bi.id
+ JOIN {block_instance_old} bi ON ctx.instanceid = bi.oldid
JOIN {context} pctx ON bi.pageid=pctx.instanceid
WHERE ctx.contextlevel=".CONTEXT_BLOCK."
AND pctx.contextlevel=".CONTEXT_COURSE."
SET depth=2, path=".$DB->sql_concat("'$base/'", 'id')."
WHERE contextlevel=".CONTEXT_BLOCK."
AND EXISTS (SELECT 'x'
- FROM {block_instance} bi
- WHERE bi.id = {context}.instanceid
+ FROM {block_instance_old} bi
+ WHERE bi.oldid = {context}.instanceid
AND bi.pagetype!='course-view')
$emptyclause ";
$DB->execute($sql);
}
if (!empty($pinned)) {
- $DB->delete_records('block_pinned', array('id'=>$instance->id));
+ $DB->delete_records('block_pinned_old', array('id'=>$instance->id));
// And now, decrement the weight of all blocks after this one
- $sql = "UPDATE {block_pinned}
+ $sql = "UPDATE {block_pinned_old}
SET weight = weight - 1
WHERE pagetype = ? AND position = ? AND weight > ?";
$params = array($instance->pagetype, $instance->position, $instance->weight);
$DB->execute($sql, $params);
} else {
// Now kill the db record;
- $DB->delete_records('block_instance', array('id'=>$instance->id));
+ $DB->delete_records('block_instance_old', array('oldid'=>$instance->id));
delete_context(CONTEXT_BLOCK, $instance->id);
// And now, decrement the weight of all blocks after this one
- $sql = "UPDATE {block_instance}
+ $sql = "UPDATE {block_instance_old}
SET weight = weight - 1
WHERE pagetype = ? AND pageid = ?
AND position = ? AND weight > ?";
}
$instance->visible = ($instance->visible) ? 0 : 1;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $instance);
+ $DB->update_record('block_pinned_old', $instance);
} else {
- $DB->update_record('block_instance', $instance);
+ $DB->update_record('block_instance_old', $instance);
}
break;
case 'delete':
if(!empty($other)) {
++$other->weight;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $other);
+ $DB->update_record('block_pinned_old', $other);
} else {
- $DB->update_record('block_instance', $other);
+ $DB->update_record('block_instance_old', $other);
}
}
--$instance->weight;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $instance);
+ $DB->update_record('block_pinned_old', $instance);
} else {
- $DB->update_record('block_instance', $instance);
+ $DB->update_record('block_instance_old', $instance);
}
}
break;
if(!empty($other)) {
--$other->weight;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $other);
+ $DB->update_record('block_pinned_old', $other);
} else {
- $DB->update_record('block_instance', $other);
+ $DB->update_record('block_instance_old', $other);
}
}
++$instance->weight;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $instance);
+ $DB->update_record('block_pinned_old', $instance);
} else {
- $DB->update_record('block_instance', $instance);
+ $DB->update_record('block_instance_old', $instance);
}
}
break;
$newpos = $page->blocks->get_default_position();
if (!empty($pinned)) {
$sql = "SELECT 1, MAX(weight) + 1 AS nextfree
- FROM {block_pinned}
+ FROM {block_pinned_old}
WHERE pagetype = ? AND position = ?";
$params = array($page->pagetype, $newpos);
} else {
$sql = "SELECT 1, MAX(weight) + 1 AS nextfree
- FROM {block_instance}
+ FROM {block_instance_old}
WHERE pageid = ? AND pagetype = ? AND position = ?";
$params = array($page->get_id(), $page->pagetype, $newpos);
}
$newinstance->visible = 1;
$newinstance->configdata = '';
if (!empty($pinned)) {
- $newinstance->id = $DB->insert_record('block_pinned', $newinstance);
+ $newinstance->id = $DB->insert_record('block_pinned_old', $newinstance);
} else {
- $newinstance->id = $DB->insert_record('block_instance', $newinstance);
+ $newinstance->id = $DB->insert_record('block_instance_old', $newinstance);
}
// If the new instance was created, allow it to do additional setup
// Close the weight gap we 'll leave behind
if (!empty($pinned)) {
- $sql = "UPDATE {block_instance}
+ $sql = "UPDATE {block_instance_old}
SET weight = weight - 1
WHERE pagetype = ? AND position = ? AND weight > ?";
$params = array($instance->pagetype, $instance->position, $instance->weight);
} else {
- $sql = "UPDATE {block_instance}
+ $sql = "UPDATE {block_instance_old}
SET weight = weight - 1
WHERE pagetype = ? AND pageid = ?
AND position = ? AND weight > ?";
$instance->weight = $newweight;
if (!empty($pinned)) {
- $DB->update_record('block_pinned', $instance);
+ $DB->update_record('block_pinned_old', $instance);
} else {
- $DB->update_record('block_instance', $instance);
+ $DB->update_record('block_instance_old', $instance);
}
}
// First we close the gap that will be left behind when we take out the
// block from it's current column.
if ($pinned) {
- $closegapsql = "UPDATE {block_instance}
+ $closegapsql = "UPDATE {block_instance_old}
SET weight = weight - 1
WHERE weight > ? AND position = ? AND pagetype = ?";
$params = array($instance->weight, $instance->position, $instance->pagetype);
} else {
- $closegapsql = "UPDATE {block_instance}
+ $closegapsql = "UPDATE {block_instance_old}
SET weight = weight - 1
WHERE weight > ? AND position = ?
AND pagetype = ? AND pageid = ?";
// Now let's make space for the block being moved.
if ($pinned) {
- $opengapsql = "UPDATE {block_instance}
+ $opengapsql = "UPDATE {block_instance_old}
SET weight = weight + 1
WHERE weight >= ? AND position = ? AND pagetype = ?";
$params = array($destweight, $destpos, $instance->pagetype);
} else {
- $opengapsql = "UPDATE {block_instance}
+ $opengapsql = "UPDATE {block_instance_old}
SET weight = weight + 1
WHERE weight >= ? AND position = ?
AND pagetype = ? AND pageid = ?";
$instance->weight = $destweight;
if ($pinned) {
- $table = 'block_pinned';
+ $table = 'block_pinned_old';
} else {
- $table = 'block_instance';
+ $table = 'block_instance_old';
}
return $DB->update_record($table, $instance);
}
$select .= " AND visible = 1";
}
- $blocks = $DB->get_records_select('block_pinned', $select, $params, 'position, weight');
+ $blocks = $DB->get_records_select('block_pinned_old', $select, $params, 'position, weight');
$positions = $page->blocks->get_positions();
$arr = array();
function blocks_get_by_page($page) {
global $DB;
- $blocks = $DB->get_records_select('block_instance', "pageid = ? AND ? LIKE (" . $DB->sql_concat('pagetype', "'%'") . ")",
+ $blocks = $DB->get_records_select('block_instance_old', "pageid = ? AND ? LIKE (" . $DB->sql_concat('pagetype', "'%'") . ")",
array($page->get_id(), $page->pagetype), 'position, weight');
$positions = $page->blocks->get_positions();
*/
function blocks_delete_all_on_page($pagetype, $pageid) {
global $DB;
- if ($instances = $DB->get_records('block_instance', array('pageid' => $pageid, 'pagetype' => $pagetype))) {
+ if ($instances = $DB->get_records('block_instance_old', array('pageid' => $pageid, 'pagetype' => $pagetype))) {
foreach ($instances as $instance) {
delete_context(CONTEXT_BLOCK, $instance->id); // Ingore any failures here.
}
}
- return $DB->delete_records('block_instance', array('pageid' => $pageid, 'pagetype' => $pagetype));
+ return $DB->delete_records('block_instance_old', array('pageid' => $pageid, 'pagetype' => $pagetype));
}
// Dispite what this function is called, it seems to be mostly used to populate
if(!empty($newinstance->blockid)) {
// Only add block if it was recognized
- $DB->insert_record('block_instance', $newinstance);
+ $DB->insert_record('block_instance_old', $newinstance);
++$weight;
}
}
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20090403" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20090501" COMMENT="XMLDB file for core Moodle tables"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
<KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="backup_courses" REFFIELDS="courseid" PREVIOUS="primary"/>
</KEYS>
</TABLE>
- <TABLE NAME="block" COMMENT="contains all installed blocks" PREVIOUS="backup_log" NEXT="block_pinned">
+ <TABLE NAME="block" COMMENT="contains all installed blocks" PREVIOUS="backup_log" NEXT="block_instances">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
<FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="version"/>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
+ <INDEXES>
+ <INDEX NAME="name" UNIQUE="true" FIELDS="name"/>
+ </INDEXES>
</TABLE>
- <TABLE NAME="block_pinned" COMMENT="to pin blocks" PREVIOUS="block" NEXT="block_instance">
+ <TABLE NAME="block_instances" COMMENT="This table stores block instances. The type of block this is is given by the block name column. The places this block instance appears is controlled by the contextid, showinsubcontexts, pagetypepattern and subpagepattern fields. Where the block appears on the page (by default) is controlled by the defaultposition and defaultweight columns. The block's own configuration is stored serialized in configdata." PREVIOUS="block" NEXT="block_positions">
<FIELDS>
- <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockid"/>
- <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="pagetype"/>
- <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="blockid" NEXT="position"/>
- <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="pagetype" NEXT="weight"/>
- <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="position" NEXT="visible"/>
- <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="weight" NEXT="configdata"/>
- <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="visible"/>
+ <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockname"/>
+ <FIELD NAME="blockname" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="The type of block this is. Foreign key, references block.name." PREVIOUS="id" NEXT="contextid"/>
+ <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The context within which this block appears. Foreign key, references context.id." PREVIOUS="blockname" NEXT="showinsubcontexts"/>
+ <FIELD NAME="showinsubcontexts" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="If 1, this block appears on all matching pages in subcontexts of this contextid, as well in contextid." PREVIOUS="contextid" NEXT="pagetypepattern"/>
+ <FIELD NAME="pagetypepattern" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" COMMENT="The types of page this block appears on. Either an exact page type like mod-quiz-view, or a pattern like mod-quiz-* or course-view-*. Note that course-view-* will match course-view." PREVIOUS="showinsubcontexts" NEXT="subpagepattern"/>
+ <FIELD NAME="subpagepattern" TYPE="char" LENGTH="16" NOTNULL="false" SEQUENCE="false" COMMENT="Further restrictions on where this block appears. In some places, e.g. during a quiz or lesson attempt, different pages have different subpage ids. If this field is not null, the block only appears on that particular subpage." PREVIOUS="pagetypepattern" NEXT="defaultregion"/>
+ <FIELD NAME="defaultregion" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="Which block region this block should appear in on each page, in the absence of a specific position in the block_positions table." PREVIOUS="subpagepattern" NEXT="defaultweight"/>
+ <FIELD NAME="defaultweight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Used to order the blocks within a block region. Again, may be overridden by the block_positions table for a specific page where this block appears." PREVIOUS="defaultregion" NEXT="configdata"/>
+ <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="A serialized blob of configuration data for this block instance." PREVIOUS="defaultweight"/>
</FIELDS>
<KEYS>
- <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
- <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
+ <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextid"/>
+ <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary"/>
</KEYS>
<INDEXES>
- <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype"/>
+ <INDEX NAME="contextid-showinsubcontexts-pagetypepattern-subpagepattern" UNIQUE="false" FIELDS="contextid, showinsubcontexts, pagetypepattern, subpagepattern"/>
</INDEXES>
</TABLE>
- <TABLE NAME="block_instance" COMMENT="to store block instances in pages" PREVIOUS="block_pinned">
+ <TABLE NAME="block_positions" COMMENT="Stores the position of a sticky block_instance on a another page than the one where it was added." PREVIOUS="block_instances">
<FIELDS>
- <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockid"/>
- <FIELD NAME="blockid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="pageid"/>
- <FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="blockid" NEXT="pagetype"/>
- <FIELD NAME="pagetype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="pageid" NEXT="position"/>
- <FIELD NAME="position" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="pagetype" NEXT="weight"/>
- <FIELD NAME="weight" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="position" NEXT="visible"/>
- <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="weight" NEXT="configdata"/>
- <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="visible"/>
+ <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockinstanceid"/>
+ <FIELD NAME="blockinstanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The block_instance this position relates to." PREVIOUS="id" NEXT="contextid"/>
+ <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="With pagetype and subpage, defines the page we are setting the position for." PREVIOUS="blockinstanceid" NEXT="pagetype"/>
+ <FIELD NAME="pagetype" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" COMMENT="With contextid and subpage, defines the page we are setting the position for." PREVIOUS="contextid" NEXT="subpage"/>
+ <FIELD NAME="subpage" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="With contextid and pagetype, defines the page we are setting the position for." PREVIOUS="pagetype" NEXT="visible"/>
+ <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Whether this block instance is visible on this page." PREVIOUS="subpage" NEXT="region"/>
+ <FIELD NAME="region" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="Which block region on this page this block should appear in." PREVIOUS="visible" NEXT="weight"/>
+ <FIELD NAME="weight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Used to order the blocks within a block region." PREVIOUS="region"/>
</FIELDS>
<KEYS>
- <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockid"/>
- <KEY NAME="blockid" TYPE="foreign" FIELDS="blockid" REFTABLE="block" REFFIELDS="id" PREVIOUS="primary"/>
+ <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockinstanceid"/>
+ <KEY NAME="blockinstanceid" TYPE="foreign" FIELDS="blockinstanceid" REFTABLE="block_instances" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
+ <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="blockinstanceid"/>
</KEYS>
<INDEXES>
- <INDEX NAME="pageid" UNIQUE="false" FIELDS="pageid" NEXT="pagetype"/>
- <INDEX NAME="pagetype" UNIQUE="false" FIELDS="pagetype" PREVIOUS="pageid"/>
+ <INDEX NAME="blockinstanceid-contextid-pagetype-subpage" UNIQUE="true" FIELDS="blockinstanceid, contextid, pagetype, subpage"/>
</INDEXES>
</TABLE>
</TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
upgrade_main_savepoint($result, 2009042800);
}
+ if ($result && $oldversion < 2009042801) {
+
+ /// Define table block_instance to be renamed to block_instance_old
+ $table = new xmldb_table('block_instance');
+
+ /// Launch rename table for block_instance
+ $dbman->rename_table($table, 'block_instances');
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042801);
+ }
+
+ if ($result && $oldversion < 2009042802) {
+
+ /// Define table block_instance to be renamed to block_instance_old
+ $table = new xmldb_table('block_pinned');
+
+ /// Launch rename table for block_instance
+ $dbman->rename_table($table, 'block_pinned_old');
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042802);
+ }
+
+ if ($result && $oldversion < 2009042803) {
+
+ /// Define table block_instance_old to be created
+ $table = new xmldb_table('block_instance_old');
+
+ /// Adding fields to table block_instance_old
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
+ $table->add_field('oldid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('blockid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
+ $table->add_field('pageid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0');
+ $table->add_field('pagetype', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('region', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('weight', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, null, null, '0');
+ $table->add_field('visible', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null, null, '0');
+ $table->add_field('configdata', XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null);
+
+ /// Adding keys to table block_instance_old
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+ $table->add_key('blockid', XMLDB_KEY_FOREIGN, array('blockid'), 'block', array('id'));
+
+ /// Adding indexes to table block_instance_old
+ $table->add_index('pageid', XMLDB_INDEX_NOTUNIQUE, array('pageid'));
+ $table->add_index('pagetype', XMLDB_INDEX_NOTUNIQUE, array('pagetype'));
+
+ /// Conditionally launch create table for block_instance_old
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042803);
+ }
+
+ if ($result && $oldversion < 2009042804) {
+ /// Copy current blocks data from block_instances to block_instance_old
+ $DB->execute('INSERT INTO {block_instance_old} (oldid, blockid, pageid, pagetype, position, weight, visible, configdata)
+ SELECT id, blockid, pageid, pagetype, position, weight, visible, configdata FROM {block_instances} ORDER BY id');
+
+ upgrade_main_savepoint($result, 2009042804);
+ }
+
+ if ($result && $oldversion < 2009042805) {
+
+ /// Define field multiple to be dropped from block
+ $table = new xmldb_table('block');
+ $field = new xmldb_field('multiple');
+
+ /// Conditionally launch drop field multiple
+ if ($dbman->field_exists($table, $field)) {
+ $dbman->drop_field($table, $field);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042805);
+ }
+
+ if ($result && $oldversion < 2009042806) {
+ $table = new xmldb_table('block_instances');
+
+ /// Rename field weight on table block_instances to defaultweight
+ $field = new xmldb_field('weight', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, null, null, '0', 'position');
+ $dbman->rename_field($table, $field, 'defaultweight');
+
+ /// Rename field position on table block_instances to defaultregion
+ $field = new xmldb_field('position', XMLDB_TYPE_CHAR, '10', null, XMLDB_NOTNULL, null, null, null, null, 'pagetype');
+ $dbman->rename_field($table, $field, 'defaultregion');
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042806);
+ }
+
+ if ($result && $oldversion < 2009042807) {
+
+ /// Changing precision of field defaultregion on table block_instances to (16)
+ $table = new xmldb_table('block_instances');
+ $field = new xmldb_field('defaultregion', XMLDB_TYPE_CHAR, '16', null, XMLDB_NOTNULL, null, null, null, null, 'subpagepattern');
+
+ /// Launch change of precision for field defaultregion
+ $dbman->change_field_precision($table, $field);
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042807);
+ }
+
+ if ($result && $oldversion < 2009042808) {
+ /// Change regions to the new notation
+ $DB->set_field('block_instances', 'defaultregion', 'side-pre', array('defaultregion' => 'l'));
+ $DB->set_field('block_instances', 'defaultregion', 'side-post', array('defaultregion' => 'r'));
+ $DB->set_field('block_instances', 'defaultregion', 'course-view-top', array('defaultregion' => 'c'));
+ // This third one is a custom value from contrib/patches/center_blocks_position_patch and the
+ // flex page course format. Hopefully this new value is an adequate alternative.
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042808);
+ }
+
+ if ($result && $oldversion < 2009042809) {
+
+ /// Define key blockname (unique) to be added to block
+ $table = new xmldb_table('block');
+ $key = new xmldb_key('blockname', XMLDB_KEY_UNIQUE, array('name'));
+
+ /// Launch add key blockname
+ $dbman->add_key($table, $key);
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042809);
+ }
+
+ if ($result && $oldversion < 2009042810) {
+ $table = new xmldb_table('block_instances');
+
+ /// Define field blockname to be added to block_instances
+ $field = new xmldb_field('blockname', XMLDB_TYPE_CHAR, '40', null, null, null, null, null, null, 'blockid');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ /// Define field contextid to be added to block_instances
+ $field = new xmldb_field('contextid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'blockname');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ /// Define field showinsubcontexts to be added to block_instances
+ $field = new xmldb_field('showinsubcontexts', XMLDB_TYPE_INTEGER, '4', null, null, null, null, null, null, 'contextid');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ /// Define field subpagepattern to be added to block_instances
+ $field = new xmldb_field('subpagepattern', XMLDB_TYPE_CHAR, '16', null, null, null, null, null, null, 'pagetype');
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042810);
+ }
+
+ if ($result && $oldversion < 2009042811) {
+ $table = new xmldb_table('block_instances');
+
+ /// Fill in blockname from blockid
+ $DB->execute("UPDATE {block_instances} SET blockname = (SELECT name FROM {block} WHERE id = blockid)");
+
+ /// Set showinsubcontexts = 0 for all rows.
+ $DB->execute("UPDATE {block_instances} SET showinsubcontexts = 0");
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042811);
+ }
+
+ if ($result && $oldversion < 2009042812) {
+
+ /// Rename field pagetype on table block_instances to pagetypepattern
+ $table = new xmldb_table('block_instances');
+ $field = new xmldb_field('pagetype', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, null, null, null, 'pageid');
+
+ /// Launch rename field pagetype
+ $dbman->rename_field($table, $field, 'pagetypepattern');
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042812);
+ }
+
+ if ($result && $oldversion < 2009042813) {
+ /// fill in contextid and subpage, and update pagetypepattern from pagetype and pageid
+
+ /// site-index
+ $frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ (" . $frontpagecontext->id . ", 'site-index', NULL) WHERE pagetypepattern = 'site-index'");
+
+ /// course-view
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ ((
+ SELECT {context}.id
+ FROM {context}
+ JOIN {course} ON instanceid = {course}.id AND contextlevel = " . CONTEXT_COURSE . "
+ WHERE {course}.id = pageid
+ ), 'course-view-*', NULL) WHERE pagetypepattern = 'course-view'");
+
+ /// admin
+ $syscontext = get_context_instance(CONTEXT_SYSTEM);
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ (" . $syscontext->id . ", 'admin-*', NULL) WHERE pagetypepattern = 'admin'");
+
+ /// my-index
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ ((
+ SELECT {context}.id
+ FROM {context}
+ JOIN {user} ON instanceid = {user}.id AND contextlevel = " . CONTEXT_USER . "
+ WHERE {user}.id = pageid
+ ), 'my-index', NULL) WHERE pagetypepattern = 'my-index'");
+
+ /// tag-index
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ (" . $syscontext->id . ", 'tag-index', pageid) WHERE pagetypepattern = 'tag-index'");
+
+ /// blog-view
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ ((
+ SELECT {context}.id
+ FROM {context}
+ JOIN {user} ON instanceid = {user}.id AND contextlevel = " . CONTEXT_USER . "
+ WHERE {user}.id = pageid
+ ), 'blog-index', NULL) WHERE pagetypepattern = 'blog-view'");
+
+ /// mod-xxx-view
+ $moduleswithblocks = array('chat', 'data', 'lesson', 'quiz', 'dimdim', 'game', 'wiki', 'oublog');
+ foreach ($moduleswithblocks as $modname) {
+ if (!$dbman->table_exists($modname)) {
+ continue;
+ }
+ $DB->execute("UPDATE {block_instances} SET (contextid, pagetypepattern, subpagepattern) =
+ ((
+ SELECT {context}.id
+ FROM {context}
+ JOIN {course_modules} ON instanceid = {course_modules}.id AND contextlevel = " . CONTEXT_MODULE . "
+ JOIN {modules} ON {modules}.id = {course_modules}.module AND {modules}.name = '$modname'
+ JOIN {{$modname}} ON {course_modules}.instance = {{$modname}}.id
+ WHERE {{$modname}}.id = pageid
+ ), 'blog-index', NULL) WHERE pagetypepattern = 'blog-view'");
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042813);
+ }
+
+ if ($result && $oldversion < 2009042814) {
+ /// fill in any missing contextids with a dummy value, so we can add the not-null constraint.
+ $DB->execute("UPDATE {block_instances} SET contextid = -1 WHERE contextid IS NULL");
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042814);
+ }
+
+ if ($result && $oldversion < 2009042815) {
+ $table = new xmldb_table('block_instances');
+
+ /// Changing nullability of field blockname on table block_instances to not null
+ $field = new xmldb_field('blockname', XMLDB_TYPE_CHAR, '40', null, XMLDB_NOTNULL, null, null, null, null, 'id');
+ $dbman->change_field_notnull($table, $field);
+
+ /// Changing nullability of field contextid on table block_instances to not null
+ $field = new xmldb_field('contextid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null, 'blockname');
+ $dbman->change_field_notnull($table, $field);
+
+ /// Changing nullability of field showinsubcontexts on table block_instances to not null
+ $field = new xmldb_field('showinsubcontexts', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, null, null, null, 'contextid');
+ $dbman->change_field_notnull($table, $field);
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042815);
+ }
+
+ if ($result && $oldversion < 2009042816) {
+ /// Add exiting sticky blocks.
+ $blocks = $DB->get_records('block');
+ $syscontext = get_context_instance(CONTEXT_SYSTEM);
+ $newregions = array(
+ 'l' => 'side-pre',
+ 'r' => 'side-post',
+ 'c' => 'course-view-top',
+ );
+ $stickyblocks = $DB->get_recordset('block_pinned_old');
+ foreach ($stickyblocks as $stickyblock) {
+ $newblock = stdClass;
+ $newblock->blockname = $blocks[$stickyblock]->name;
+ $newblock->contextid = $syscontext->id;
+ $newblock->showinsubcontexts = 1;
+ switch ($stickyblock->pagetype) {
+ case 'course-view':
+ $newblock->pagetypepattern = 'course-view-*';
+ break;
+ default:
+ $newblock->pagetypepattern = $stickyblock->pagetype;
+ }
+ $newblock->defaultregion = $newregions[$stickyblock->position];
+ $newblock->defaultweight = $stickyblock->weight;
+ $newblock->configdata = $stickyblock->configdata;
+ $DB->insert_record('block_instances', $newblock);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042816);
+ }
+
+ if ($result && $oldversion < 2009042817) {
+
+ /// Define table block_positions to be created
+ $table = new xmldb_table('block_positions');
+
+ /// Adding fields to table block_positions
+ $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null, null, null);
+ $table->add_field('blockinstanceid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('contextid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('pagetype', XMLDB_TYPE_CHAR, '64', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('subpage', XMLDB_TYPE_CHAR, '16', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('visible', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, null, null, '1');
+ $table->add_field('region', XMLDB_TYPE_CHAR, '16', null, XMLDB_NOTNULL, null, null, null, null);
+ $table->add_field('weight', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, null, null);
+
+ /// Adding keys to table block_positions
+ $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
+ $table->add_key('blockinstanceid', XMLDB_KEY_FOREIGN, array('blockinstanceid'), 'block_instances', array('id'));
+ $table->add_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));
+
+ /// Adding indexes to table block_positions
+ $table->add_index('blockinstanceid-contextid-pagetype-subpage', XMLDB_INDEX_UNIQUE, array('blockinstanceid', 'contextid', 'pagetype', 'subpage'));
+
+ /// Conditionally launch create table for block_positions
+ if (!$dbman->table_exists($table)) {
+ $dbman->create_table($table);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042817);
+ }
+
+ if ($result && $oldversion < 2009042818) {
+ /// And block instances with visible = 0, copy that information to block_positions
+ $DB->execute("INSERT INTO {block_positions} (blockinstanceid, contextid, pagetype, subpage, visible, region, weight)
+ SELECT id, contextid,
+ CASE WHEN pagetypepattern = 'course-view-*' THEN
+ (SELECT " . $DB->sql_concat("'course-view-'", 'format') . "
+ FROM {course}
+ JOIN {context} ON {course}.id = {context}.instanceid
+ WHERE {context}.id = contextid)
+ ELSE pagetypepattern END,
+ CASE WHEN subpagepattern IS NULL THEN ''
+ ELSE subpagepattern END,
+ 0, defaultregion, defaultweight
+ FROM {block_instances} WHERE visible = 0 AND pagetypepattern <> 'admin-*'");
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042818);
+ }
+
+ if ($result && $oldversion < 2009042819) {
+ $table = new xmldb_table('block_instances');
+
+ /// Define field blockid to be dropped from block_instances
+ $field = new xmldb_field('blockid');
+ if ($dbman->field_exists($table, $field)) {
+ $dbman->drop_field($table, $field);
+ }
+
+ /// Define field pageid to be dropped from block_instances
+ $field = new xmldb_field('pageid');
+ if ($dbman->field_exists($table, $field)) {
+ $dbman->drop_field($table, $field);
+ }
+
+ /// Define field visible to be dropped from block_instances
+ $field = new xmldb_field('visible');
+ if ($dbman->field_exists($table, $field)) {
+ $dbman->drop_field($table, $field);
+ }
+
+ /// Main savepoint reached
+ upgrade_main_savepoint($result, 2009042819);
+ }
+
if ($result && $oldversion < 2009043000) {
unset_config('grade_report_showgroups');
upgrade_main_savepoint($result, 2009043000);
/// Delete course blocks
if ($blocks = $DB->get_records_sql("SELECT *
- FROM {block_instance}
+ FROM {block_instance_old}
WHERE pagetype = '".PAGE_COURSE_VIEW."'
AND pageid = ?", array($course->id))) {
- if ($DB->delete_records('block_instance', array('pagetype'=>PAGE_COURSE_VIEW, 'pageid'=>$course->id))) {
+ if ($DB->delete_records('block_instance_old', array('pagetype'=>PAGE_COURSE_VIEW, 'pageid'=>$course->id))) {
if ($showfeedback) {
- notify($strdeleted .' block_instance');
+ notify($strdeleted .' block_instance_old');
}
require_once($CFG->libdir.'/blocklib.php');
margin-left: 0px;
}
-#course-view .section td.right {
+.course-view .section td.right {
border-left-width: 1px;
border-left-style: solid;
border-right-width: 0px;
border-color:#DDDDDD;
}
-#course-view .weeks .section,
-#course-view .topics .section,
-#course-view .section td {
+.course-view .weeks .section,
+.course-view .topics .section,
+.course-view .section td {
border-color:#DDDDDD;
}
/* .content should match the body background, sides are white. */
-#course-view .weeks .content ,
-#course-view .topics .content,
-#course-view .weeks .section,
-#course-view .topics .section {
+.course-view .weeks .content ,
+.course-view .topics .content,
+.course-view .weeks .section,
+.course-view .topics .section {
background: #FAFAFA;
}
-#course-view .section td.side {
+.course-view .section td.side {
background: #FFFFFF;
}
-#course-view .section .side {
+.course-view .section .side {
}
-#course-view .section .left {
+.course-view .section .left {
}
-#course-view .section .right {
+.course-view .section .right {
}
-#course-view .weeks .current,
-#course-view .topics .current,
-#course-view .current td.side {
+.course-view .weeks .current,
+.course-view .topics .current,
+.course-view .current td.side {
background: #FFD991;
}
-#course-view .weeks .hidden,
-#course-view .topics .hidden,
-#course-view .hidden td.side {
+.course-view .weeks .hidden,
+.course-view .topics .hidden,
+.course-view .hidden td.side {
background: #DDDDDD;
}
-#course-view .section .spacer {
+.course-view .section .spacer {
}
-#course-view .section .weekdates {
+.course-view .section .weekdates {
color: #777777;
}
-#course-view .weeks .weekdates ,
-#course-view .topics .weekdates {
+.course-view .weeks .weekdates ,
+.course-view .topics .weekdates {
color: #333333;
}
}
#site-index .subscribelink,
-#course-view .subscribelink {
+.course-view .subscribelink {
font-size: 0.8em;
}
/***
*** Course
***/
-#course-view .section {
+.course-view .section {
font-size:0.95em;
line-height:1.2em;
}
-#course-view .section .activity {
+.course-view .section .activity {
padding:0.2em 0;
}
-#course-view .section .activity a {
+.course-view .section .activity a {
line-height:1em;
}
-#course-view .section .weekdates {
+.course-view .section .weekdates {
margin: 0;
font-weight: normal;
font-size: 1em;
}
-#course-view .section .left {
+.course-view .section .left {
font-weight:bold;
}
color: #666666;
}
-#course-view .availabilityinfo {
+.course-view .availabilityinfo {
font-size:0.85em;
color:#aaa;
}
-#course-view .availabilityinfo strong {
+.course-view .availabilityinfo strong {
font-weight:normal;
color:black;
}
-#course-view .dimmed_text img {
+.course-view .dimmed_text img {
opacity:0.3;
filter: alpha(opacity='30');
}
display:inline-block; padding-left:2px;
}
-#course-view li.activity {
+.course-view li.activity {
height:0;
}
#mod-quiz-review #middle-column {
text-align:center;
}
-#course-view .section td {
+.course-view .section td {
vertical-align:top;
}
-#course-view .section td.content {
+.course-view .section td.content {
padding:5px;
border-style:solid;
border-width:1px;
border-right:0px;
}
-#course-view .section td.side {
+.course-view .section td.side {
padding:5px;
border-style:solid;
border-width:1px;
}
-#course-view .section td.left {
+.course-view .section td.left {
border-right:0px;
text-align:center;
width: 1.5em;
}
-#course-view .section td.right {
+.course-view .section td.right {
border-left:0px;
text-align:center;
width: 1.5em;
}
-#course-view .current .side {
+.course-view .current .side {
}
-#course-view .section .spacer {
+.course-view .section .spacer {
height:0.5em;
}
-#course-view .section .weekdates {
+.course-view .section .weekdates {
}
-#course-view li.activity {
+.course-view li.activity {
margin-right:20px; /* Space allowed for completion icons if enabled */
position:relative;
}
-.dir-rtl#course-view li.activity {
+.dir-rtl.course-view li.activity {
margin-right:0px;
margin-left:20px;
}
-#course-view li.activity form.togglecompletion,
-#course-view li.activity span.autocompletion {
+.course-view li.activity form.togglecompletion,
+.course-view li.activity span.autocompletion {
display:inline;
position:absolute;
right:-20px;
z-index:10;
padding:0.2em 0;
}
-.dir-rtl#course-view li.activity form.togglecompletion,
-.dir-rtl#course-view li.activity span.autocompletion {
+.dir-rtl.course-view li.activity form.togglecompletion,
+.dir-rtl.course-view li.activity span.autocompletion {
right:auto;
left:-20px;
}
-#course-view li.activity form.togglecompletion div {
+.course-view li.activity form.togglecompletion div {
display:inline;
}
-#course-view .completion-saved-display {
+.course-view .completion-saved-display {
position:absolute;
top:0; left:0;
border:1px solid black;
background:white;
font-size:0.85em;
}
-#course-view form.togglecompletion img.iconhelp,
-#course-view span.autocompletion img.iconhelp {
+.course-view form.togglecompletion img.iconhelp,
+.course-view span.autocompletion img.iconhelp {
vertical-align:top;
}
-#course-view ul.section,
+.course-view ul.section,
#site-index ul.section {
margin: 0;
padding: 0;
margin-top: 8px;
}
-/*#course-view ul.section li.activity ul li,
+/*.course-view ul.section li.activity ul li,
#site-index ul.section li.activity ul li {
list-style: disc;
}*/
/*Accessibility: No-tables course format. */
-#course-view ul.weeks , #course-view ul.topics{
+.course-view ul.weeks , .course-view ul.topics{
margin: 0;
padding: 0;
list-style: none;
width:80px;
}
-body#course-view .unread {
+body.course-view .unread {
margin-left: 3em;
}
-body#course-view .sideblock.drag .header {
+body.course-view .sideblock.drag .header {
cursor: move;
}
}
#site-index .subscribelink,
-#course-view .subscribelink {
+.course-view .subscribelink {
text-align:right;
}
body#site-index .headingblock,
-body#course-view .headingblock {
+body.course-view .headingblock {
margin-bottom: 9px;
}