/.project
/.buildpath
/.cache
-phpunit.xml
\ No newline at end of file
+phpunit.xml
+# Composer support - only composer.json is to be in git, the rest is installed in each checkout.
+composer.phar
+composer.lock
+/vendor/
$visible = '';
} else if ($blocks[$blockid]->visible) {
$visible = '<a href="blocks.php?hide='.$blockid.'&sesskey='.sesskey().'" title="'.$strhide.'">'.
- '<img src="'.$OUTPUT->pix_url('i/hide') . '" class="icon" alt="'.$strhide.'" /></a>';
+ '<img src="'.$OUTPUT->pix_url('t/hide') . '" class="iconsmall" alt="'.$strhide.'" /></a>';
} else {
$visible = '<a href="blocks.php?show='.$blockid.'&sesskey='.sesskey().'" title="'.$strshow.'">'.
- '<img src="'.$OUTPUT->pix_url('i/show') . '" class="icon" alt="'.$strshow.'" /></a>';
+ '<img src="'.$OUTPUT->pix_url('t/show') . '" class="iconsmall" alt="'.$strshow.'" /></a>';
$class = ' class="dimmed_text"'; // Leading space required!
}
$undeletable = '';
} else if (in_array($blockname, $undeletableblocktypes)) {
$undeletable = '<a href="blocks.php?unprotect='.$blockid.'&sesskey='.sesskey().'" title="'.$strunprotect.'">'.
- '<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="icon" alt="'.$strunprotect.'" /></a>';
+ '<img src="'.$OUTPUT->pix_url('t/unlock') . '" class="iconsmall" alt="'.$strunprotect.'" /></a>';
} else {
$undeletable = '<a href="blocks.php?protect='.$blockid.'&sesskey='.sesskey().'" title="'.$strprotect.'">'.
- '<img src="'.$OUTPUT->pix_url('t/unlock_gray') . '" class="icon" alt="'.$strprotect.'" /></a>';
+ '<img src="'.$OUTPUT->pix_url('t/lock') . '" class="iconsmall" alt="'.$strprotect.'" /></a>';
}
$row = array(
/** Used by library scripts to check they are being called by Moodle */
define('MOODLE_INTERNAL', true);
+// Disables caching.. just in case.
+define('CACHE_DISABLE_ALL', true);
+
// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.3.2") < 0) {
$phpversion = phpversion();
// Re-order
$updown = '';
- $spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" /> ';
+ $spacer = '<img src="' . $OUTPUT->pix_url('spacer') . '" class="iconsmall" alt="" />';
if ($filterinfo->active != TEXTFILTER_DISABLED) {
if (!$isfirstrow) {
- $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up')));
+ $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'up'), new pix_icon('t/up', get_string('up'), '', array('class' => 'iconsmall')));
} else {
$updown .= $spacer;
}
if (!$islastactive) {
- $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down')));
+ $updown .= $OUTPUT->action_icon(filters_action_url($filter, 'down'), new pix_icon('t/down', get_string('down'), '', array('class' => 'iconsmall')));
} else {
$updown .= $spacer;
}
if ($version > $CFG->version) { // upgrade
purge_all_caches();
+
$PAGE->set_pagelayout('maintenance');
$PAGE->set_popup_notification_allowed(false);
}
}
+ // Cleanup SESSION to make sure other code does not complain in the future.
+ unset($SESSION->has_timed_out);
+ unset($SESSION->wantsurl);
+
// at this stage there can be only one admin unless more were added by install - users may change username, so do not rely on that
$adminids = explode(',', $CFG->siteadmins);
$adminuser = get_complete_user_data('id', reset($adminids));
$class = '';
} else if ($module->visible) {
$visible = "<a href=\"modules.php?hide=$module->name&sesskey=".sesskey()."\" title=\"$strhide\">".
- "<img src=\"" . $OUTPUT->pix_url('i/hide') . "\" class=\"icon\" alt=\"$strhide\" /></a>";
+ "<img src=\"" . $OUTPUT->pix_url('t/hide') . "\" class=\"iconsmall\" alt=\"$strhide\" /></a>";
$class = '';
} else {
$visible = "<a href=\"modules.php?show=$module->name&sesskey=".sesskey()."\" title=\"$strshow\">".
- "<img src=\"" . $OUTPUT->pix_url('i/show') . "\" class=\"icon\" alt=\"$strshow\" /></a>";
+ "<img src=\"" . $OUTPUT->pix_url('t/show') . "\" class=\"iconsmall\" alt=\"$strshow\" /></a>";
$class = ' class="dimmed_text"';
}
if ($module->name == "forum") {
$rowclass = 'dimmed_text';
}
} else {
- $icons = $OUTPUT->spacer() . ' ';
+ $icons = $OUTPUT->spacer(array('class' => 'iconsmall'));
}
// Move icons.
function question_behaviour_enable_disable_icons($behaviour, $enabled) {
if ($enabled) {
- return question_behaviour_icon_html('disable', $behaviour, 'i/hide',
+ return question_behaviour_icon_html('disable', $behaviour, 't/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
- return question_behaviour_icon_html('enable', $behaviour, 'i/show',
+ return question_behaviour_icon_html('enable', $behaviour, 't/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qbehaviours.php',
array($action => $behaviour, 'sesskey' => sesskey())),
- new pix_icon($icon, $alt, 'moodle', array('title' => '')),
- null, array('title' => $tip)) . ' ';
+ new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
+ null, array('title' => $tip));
}
$rowclass = 'dimmed_text';
}
} else {
- $icons = $OUTPUT->spacer() . ' ';
+ $icons = $OUTPUT->spacer();
}
// Move icons.
function question_types_enable_disable_icons($qtypename, $createable) {
if ($createable) {
- return question_type_icon_html('disable', $qtypename, 'i/hide',
+ return question_type_icon_html('disable', $qtypename, 't/hide',
get_string('enabled', 'question'), get_string('disable'));
} else {
- return question_type_icon_html('enable', $qtypename, 'i/show',
+ return question_type_icon_html('enable', $qtypename, 't/show',
get_string('disabled', 'question'), get_string('enable'));
}
}
global $OUTPUT;
return $OUTPUT->action_icon(new moodle_url('/admin/qtypes.php',
array($action => $qtypename, 'sesskey' => sesskey())),
- new pix_icon($icon, $alt, 'moodle', array('title' => '')),
- null, array('title' => $tip)) . ' ';
+ new pix_icon($icon, $alt, 'moodle', array('title' => '', 'class' => 'iconsmall')),
+ null, array('title' => $tip));
}
function upgrade_reload($url) {
return html_writer::empty_tag('br') .
html_writer::tag('div',
- html_writer::link($url, $this->pix_icon('i/reload', '') .
+ html_writer::link($url, $this->pix_icon('i/reload', '', '', array('class' => 'icon icon-pre')) .
get_string('reload'), array('title' => get_string('reload'))),
array('class' => 'continuebutton')) . html_writer::empty_tag('br');
}
$row->attributes['class'] = 'type-' . $plugin->type . ' name-' . $plugin->type . '_' . $plugin->name;
if ($this->page->theme->resolve_image_location('icon', $plugin->type . '_' . $plugin->name)) {
- $icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'smallicon pluginicon'));
+ $icon = $this->output->pix_icon('icon', '', $plugin->type . '_' . $plugin->name, array('class' => 'icon pluginicon'));
} else {
- $icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'smallicon pluginicon noicon'));
+ $icon = $this->output->pix_icon('spacer', '', 'moodle', array('class' => 'icon pluginicon noicon'));
}
if ($plugin->get_status() === plugin_manager::PLUGIN_STATUS_MISSING) {
$msg = html_writer::tag('span', get_string('status_missing', 'core_plugin'), array('class' => 'notifyproblem'));
} else {
$msg = '';
}
- $pluginname = html_writer::tag('div', $icon . ' ' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
+ $pluginname = html_writer::tag('div', $icon . '' . $plugin->displayname . ' ' . $msg, array('class' => 'displayname')).
html_writer::tag('div', $plugin->component, array('class' => 'componentname'));
$pluginname = new html_table_cell($pluginname);
if (empty($impediments)) {
$widget = $deployer->make_confirm_widget($updateinfo);
$box .= $this->output->render($widget);
- } else if (isset($impediments['notwritable'])) {
- $box .= $this->output->help_icon('notwritable', 'core_plugin', get_string('notwritable', 'core_plugin'));
+ } else {
+ if (isset($impediments['notwritable'])) {
+ $box .= $this->output->help_icon('notwritable', 'core_plugin', get_string('notwritable', 'core_plugin'));
+ }
+ if (isset($impediments['notdownloadable'])) {
+ $box .= $this->output->help_icon('notdownloadable', 'core_plugin', get_string('notdownloadable', 'core_plugin'));
+ }
}
}
$ADMIN->add('appearance', $temp);
// blog
- if (!empty($CFG->enableblogs)) {
- $temp = new admin_settingpage('blog', new lang_string('blog','blog'));
- $temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
- $temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
- BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
- BLOG_USER_LEVEL => new lang_string('personalblogs','blog'))));
- $temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
- $temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
- array(43200 => new lang_string('numhours', '', 12),
- 86400 => new lang_string('numhours', '', 24),
- 172800 => new lang_string('numdays', '', 2),
- 604800 => new lang_string('numdays', '', 7))));
- $temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
- $temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
- $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
- $ADMIN->add('appearance', $temp);
- }
+ $temp = new admin_settingpage('blog', new lang_string('blog','blog'), 'moodle/site:config', empty($CFG->enableblogs));
+ $temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
+ $temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
+ BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
+ BLOG_USER_LEVEL => new lang_string('personalblogs','blog'))));
+ $temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
+ $temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
+ array(43200 => new lang_string('numhours', '', 12),
+ 86400 => new lang_string('numhours', '', 24),
+ 172800 => new lang_string('numdays', '', 2),
+ 604800 => new lang_string('numdays', '', 7))));
+ $temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
+ $temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
+ $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
+ $ADMIN->add('appearance', $temp);
// Navigation settings
$temp = new admin_settingpage('navigation', new lang_string('navigation'));
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'),
new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
-/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
-$temp->add(new admin_setting_special_selectsetup('cachetype', new lang_string('cachetype', 'admin'),
- new lang_string('configcachetype', 'admin'), '',
- array( '' => new lang_string('none'),
- 'internal' => 'internal',
- 'memcached' => 'memcached',
- 'eaccelerator' => 'eaccelerator')));
-// NOTE: $CFG->rcache is forced to bool in lib/setup.php
-$temp->add(new admin_setting_special_selectsetup('rcache', new lang_string('rcache', 'admin'),
- new lang_string('configrcache', 'admin'), 0,
- array( '0' => new lang_string('no'),
- '1' => new lang_string('yes'))));
-$temp->add(new admin_setting_configtext('rcachettl', new lang_string('rcachettl', 'admin'),
- new lang_string('configrcachettl', 'admin'), 10));
-$temp->add(new admin_setting_configtext('intcachemax', new lang_string('intcachemax', 'admin'),
- new lang_string('configintcachemax', 'admin'), 10));
-$temp->add(new admin_setting_configtext('memcachedhosts', new lang_string('memcachedhosts', 'admin'),
- new lang_string('configmemcachedhosts', 'admin'), ''));
-$temp->add(new admin_setting_configselect('memcachedpconn', new lang_string('memcachedpconn', 'admin'),
- new lang_string('configmemcachedpconn', 'admin'), 0,
- array( '0' => new lang_string('no'),
- '1' => new lang_string('yes'))));
-*/
$ADMIN->add('server', $temp);
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700;
-$plugin->requires = 2012061700;
+$plugin->version = 2012112900;
+$plugin->requires = 2012112900;
$plugin->component = 'tool_assignmentupgrade';
-$plugin->dependencies = array('mod_assign' => 2012061700);
+$plugin->dependencies = array('mod_assign' => 2012112900);
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_capability'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700;
-$plugin->requires = 2012061700;
+$plugin->version = 2012112900;
+$plugin->requires = 2012112900;
$plugin->component = 'tool_customlang'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012062200; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->requires = 2012061700; // Requires this Moodle version.
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->requires = 2012112900; // Requires this Moodle version.
$plugin->component = 'tool_dbtransfer'; // Full name of the plugin (used for diagnostics).
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_generator'; // Full name of the plugin (used for diagnostics)
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_health'; // Full name of the plugin (used for diagnostics)
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_innodb'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_langimport'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_multilangupgrade'; // Full name of the plugin (used for diagnostics)
'buildconfig' => false,
'buildcomponentconfigs' => false,
'diag' => false,
- 'phpunitdir' => false,
'run' => false,
'help' => false,
),
)
);
-if ($options['phpunitdir']) {
- // nasty skodak's hack for testing of future PHPUnit versions - intentionally not documented
- if (!file_exists($options['phpunitdir'])) {
- cli_error('Invalid custom PHPUnit lib location');
- }
- $files = scandir($options['phpunitdir']);
- foreach ($files as $file) {
- $path = $options['phpunitdir'].'/'.$file;
- if (!is_dir($path) or strpos($file, '.') === 0) {
- continue;
- }
- ini_set('include_path', $path . PATH_SEPARATOR . ini_get('include_path'));
- }
- unset($files);
- unset($file);
+if (file_exists(__DIR__.'/../../../../vendor/autoload.php')) {
+ // Composer packages present.
+ require_once(__DIR__.'/../../../../vendor/autoload.php');
}
-// verify PHPUnit libs are loaded
+// Verify PHPUnit libs can be loaded.
if (!include_once('PHPUnit/Autoload.php')) {
phpunit_bootstrap_error(PHPUNIT_EXITCODE_PHPUNITMISSING);
}
unset($unrecognized);
foreach ($_SERVER['argv'] as $k=>$v) {
- if (strpos($v, '--run') === 0 or strpos($v, '--phpunitdir') === 0) {
+ if (strpos($v, '--run') === 0) {
unset($_SERVER['argv'][$k]);
$_SERVER['argc'] = $_SERVER['argc'] - 1;
}
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_phpunit'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_profiling'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700;
-$plugin->requires = 2012061700;
+$plugin->version = 2012112900;
+$plugin->requires = 2012112900;
$plugin->component = 'tool_qeupgradehelper'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_replace'; // Full name of the plugin (used for diagnostics)
$plugin->maturity = MATURITY_ALPHA; // this version's maturity level
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700;
-$plugin->requires = 2012061700;
+$plugin->version = 2012112900;
+$plugin->requires = 2012112900;
$plugin->component = 'tool_spamcleaner'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700;
-$plugin->requires = 2012061700;
+$plugin->version = 2012112900;
+$plugin->requires = 2012112900;
$plugin->component = 'tool_timezoneimport'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_unsuproles'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_uploaduser'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'tool_xmldb'; // Full name of the plugin (used for diagnostics)
} else {
$columndir = $dir == "ASC" ? "DESC":"ASC";
if ($column == "lastaccess") {
- $columnicon = $dir == "ASC" ? "up":"down";
+ $columnicon = ($dir == "ASC") ? "sort_desc" : "sort_asc";
} else {
- $columnicon = $dir == "ASC" ? "down":"up";
+ $columnicon = ($dir == "ASC") ? "sort_asc" : "sort_desc";
}
- $columnicon = " <img src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
+ $columnicon = "<img class='iconsort' src=\"" . $OUTPUT->pix_url('t/' . $columnicon) . "\" alt=\"\" />";
}
$$column = "<a href=\"user.php?sort=$column&dir=$columndir\">".$string[$column]."</a>$columnicon";
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_cas'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_db'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die;
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_email'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_fc'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_imap'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_ldap'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_manual'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_mnet'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_nntp'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_nologin'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_none'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_pam'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_pop3'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_radius'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_shibboleth'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'auth_webservice'; // Full name of the plugin (used for diagnostics)
const OPERATION_RESTORE ='restore';// We are performing one restore
// Version (to keep CFG->backup_version (and release) updated automatically)
- const VERSION = 2012061800;
- const RELEASE = '2.3';
+ const VERSION = 2012112900;
+ const RELEASE = '2.5';
}
/*
return $files;
}
foreach ($matches[2] as $match) {
- $files[] = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
+ $file = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
+ $files[] = rawurldecode($file);
}
return array_unique($files);
public static function rewrite_filephp_usage($text, array $files) {
foreach ($files as $file) {
+ // Expect URLs properly encoded by default.
+ $parts = explode('/', $file);
+ $encoded = implode('/', array_map('rawurlencode', $parts));
+ $fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $encoded);
+ $text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
+ $text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
+ // Add support for URLs without any encoding.
$fileref = '$@FILEPHP@$'.str_replace('/', '$@SLASH@$', $file);
- $text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$file.'?forcedownload=1', $text);
- $text = str_replace($fileref, '@@PLUGINFILE@@'.$file, $text);
+ $text = str_replace($fileref.'$@FORCEDOWNLOAD@$', '@@PLUGINFILE@@'.$encoded.'?forcedownload=1', $text);
+ $text = str_replace($fileref, '@@PLUGINFILE@@'.$encoded, $text);
}
return $text;
$this->assertTrue(in_array('/pics/news.gif', $files));
$this->assertTrue(in_array('/MANUAL.DOC', $files));
- $text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'), $files);
+ $text = moodle1_converter::rewrite_filephp_usage($text, array('/pics/news.gif', '/another/file/notused.txt'));
$this->assertEquals($text, 'This is a text containing links to file.php
as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">download image</a><br />
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />');
}
+ public function test_referenced_files_urlencoded() {
+
+ $text = 'This is a text containing links to file.php
+as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif" /><a href="$@FILEPHP@$$@SLASH@$pics$@SLASH@$news.gif$@FORCEDOWNLOAD@$">no space</a><br />
+ <br /><a href=\'$@FILEPHP@$$@SLASH@$pics$@SLASH@$news%20with%20spaces.gif$@FORCEDOWNLOAD@$\'>with urlencoded spaces</a><br />
+<a href="$@FILEPHP@$$@SLASH@$illegal%20pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
+<a href="$@FILEPHP@$$@SLASH@$illegal pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (none encoded)</a>
+<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
+<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>';
+
+ $files = moodle1_converter::find_referenced_files($text);
+ $this->assertEquals(gettype($files), 'array');
+ $this->assertEquals(3, count($files));
+ $this->assertTrue(in_array('/pics/news.gif', $files));
+ $this->assertTrue(in_array('/pics/news with spaces.gif', $files));
+ $this->assertTrue(in_array('/illegal pics+movies/romeo+juliet.avi', $files));
+
+ $text = moodle1_converter::rewrite_filephp_usage($text, $files);
+ $this->assertEquals('This is a text containing links to file.php
+as it is parsed from the backup file. <br /><br /><img border="0" width="110" vspace="0" hspace="0" height="92" title="News" alt="News" src="@@PLUGINFILE@@/pics/news.gif" /><a href="@@PLUGINFILE@@/pics/news.gif?forcedownload=1">no space</a><br />
+ <br /><a href=\'@@PLUGINFILE@@/pics/news%20with%20spaces.gif?forcedownload=1\'>with urlencoded spaces</a><br />
+<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (space and plus encoded)</a>
+<a href="@@PLUGINFILE@@/illegal%20pics%2Bmovies/romeo%2Bjuliet.avi">Download the full AVI for free! (none encoded)</a>
+<a href="$@FILEPHP@$$@SLASH@$illegal%20pics+movies$@SLASH@$romeo+juliet.avi">Download the full AVI for free! (only space encoded)</a>
+<a href="$@FILEPHP@$$@SLASH@$illegal pics%2Bmovies$@SLASH@$romeo%2Bjuliet.avi">Download the full AVI for free! (only plus)</a>', $text);
+ }
+
public function test_question_bank_conversion() {
global $CFG;
// - section_included setting (if exists)
$settingname = $settingprefix . 'included';
$activity_included = new backup_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
- $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename), $this->modulename));
+ $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename),
+ $this->modulename, array('class' => 'iconlarge icon-post')));
$this->add_setting($activity_included);
// Look for "activities" root setting
$activities = $this->plan->get_setting('activities');
// - section_included setting (if exists)
$settingname = $settingprefix . 'included';
$activity_included = new restore_activity_generic_setting($settingname, base_setting::IS_BOOLEAN, true);
- $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename), $this->modulename));
+ $activity_included->get_ui()->set_icon(new pix_icon('icon', get_string('pluginname', $this->modulename),
+ $this->modulename, array('class' => 'iconlarge icon-post')));
$this->add_setting($activity_included);
// Look for "activities" root setting
$activities = $this->plan->get_setting('activities');
$data->id = $newitemid = $existinggradeitem->id;
$DB->update_record('grade_items', $data);
}
+ } else if ($data->itemtype == 'manual') {
+ // Manual items aren't assigned to a cm, so don't go duplicating them in the target if one exists.
+ $gi = array(
+ 'itemtype' => $data->itemtype,
+ 'courseid' => $data->courseid,
+ 'itemname' => $data->itemname,
+ 'categoryid' => $data->categoryid,
+ );
+ $newitemid = $DB->get_field('grade_items', 'id', $gi);
}
if (empty($newitemid)) {
AND ' . $DB->sql_compare_text('hint', 255) . ' = ' . $DB->sql_compare_text('?', 255);
$params = array($newquestionid, $data->hint);
$newitemid = $DB->get_field_sql($sql, $params);
+
+ // Not able to find the hint, let's try cleaning the hint text
+ // of all the question's hints in DB as slower fallback. MDL-33863.
+ if (!$newitemid) {
+ $potentialhints = $DB->get_records('question_hints',
+ array('questionid' => $newquestionid), '', 'id, hint');
+ foreach ($potentialhints as $potentialhint) {
+ // Clean in the same way than {@link xml_writer::xml_safe_utf8()}.
+ $cleanhint = preg_replace('/[\x-\x8\xb-\xc\xe-\x1f\x7f]/is','', $potentialhint->hint); // Clean CTRL chars.
+ $cleanhint = preg_replace("/\r\n|\r/", "\n", $cleanhint); // Normalize line ending.
+ if ($cleanhint === $data->hint) {
+ $newitemid = $data->id;
+ }
+ }
+ }
+
// If we haven't found the newitemid, something has gone really wrong, question in DB
// is missing hints, exception
if (!$newitemid) {
$coursemodule = $DB->get_record('course_modules', array('id'=>$page->cmid));
$this->moduleid = $coursemodule->id;
- $this->sectionid = $DB->get_field("course_sections", 'id', array("section"=>$coursemodule->section, "course"=>$course->id));
+ $this->sectionid = $coursemodule->section;
$this->courseid = $coursemodule->course;
$this->userid = 2; // admin
$icon = $this->get_icon();
$label = $this->get_label($task);
if (!empty($icon)) {
- $label .= ' '.$output->render($icon);
+ $label .= $output->render($icon);
}
// name, label, attributes
return $this->apply_options(array('element'=>'text','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'attributes'=>$this->attributes));
$icon = $this->get_icon();
$label = $this->get_label($task);
if (!empty($icon)) {
- $label .= ' '.$output->render($icon);
+ $label .= $output->render($icon);
}
return $this->apply_options(array('element'=>'checkbox','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'text'=>$this->text, 'attributes'=>$this->attributes));
}
global $OUTPUT;
// Checkboxes are always yes or no
if ($this->get_value()) {
- return $OUTPUT->pix_icon('i/tick_green_big', get_string('yes'));
+ return $OUTPUT->pix_icon('i/valid', get_string('yes'));
} else {
- return $OUTPUT->pix_icon('i/cross_red_big', get_string('no'));
+ return $OUTPUT->pix_icon('i/invalid', get_string('no'));
}
}
$icon = $this->get_icon();
$label = $this->get_label($task);
if (!empty($icon)) {
- $label .= ' '.$output->render($icon);
+ $label .= $output->render($icon);
}
// name, label, text, value, attributes
return $this->apply_options(array('element'=>'radio','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'text'=>$this->text, 'value'=>$this->value, 'attributes'=>$this->attributes));
$icon = $this->get_icon();
$label = $this->get_label($task);
if (!empty($icon)) {
- $label .= ' '.$output->render($icon);
+ $label .= $output->render($icon);
}
// name, label, options, attributes
return $this->apply_options(array('element'=>'select','name'=>self::NAME_PREFIX.$this->name, 'label'=>$label, 'options'=>$this->values, 'attributes'=>$this->attributes));
* @return string
*/
public function backup_details($details, $nextstageurl) {
- $yestick = $this->output->pix_icon('i/tick_green_big', get_string('yes'));
- $notick = $this->output->pix_icon('i/cross_red_big', get_string('no'));
+ $yestick = $this->output->pix_icon('i/valid', get_string('yes'));
+ $notick = $this->output->pix_icon('i/valid', get_string('no'));
$html = html_writer::start_tag('div', array('class'=>'backup-restore'));
$table->data = array();
}
$name = get_string('pluginname', $activity->modulename);
- $icon = new pix_icon('icon', $name, $activity->modulename);
+ $icon = new pix_icon('icon', $name, $activity->modulename, array('class' => 'iconlarge icon-pre'));
$table->data[] = array(
- $this->output->render($icon).' '.$name,
+ $this->output->render($icon).$name,
$activity->title,
($activity->settings[$activitykey.'_userinfo'])?$yestick:$notick,
);
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110800; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_activity_modules'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_admin_bookmarks'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110800; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_blog_menu'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110800; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_blog_recent'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110800; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_blog_tags'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_calendar_month'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_calendar_upcoming'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_comments'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_community'; // Full name of the plugin (used for diagnostics)
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_completionstatus';
-$plugin->dependencies = array('report_completion' => 2012061700);
\ No newline at end of file
+$plugin->dependencies = array('report_completion' => 2012112900);
\ No newline at end of file
-.block_course_list .footer {margin-top: 5px;}
\ No newline at end of file
+.block_course_list .footer {margin-top: 5px;}
+.block_course_list .content li { margin-bottom: .3em;}
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_course_list'; // Full name of the plugin (used for diagnostics)
$output .= html_writer::start_tag('div', array('class' => 'activity_overview'));
$url = new moodle_url("/mod/$module/index.php", array('id' => $cid));
$modulename = get_string('modulename', $module);
- $icontext = html_writer::link($url, $this->output->pix_icon('icon', $modulename, 'mod_'.$module, array('class'=>'icon')).' ');
+ $icontext = html_writer::link($url, $this->output->pix_icon('icon', $modulename, 'mod_'.$module, array('class'=>'iconlarge')));
if (get_string_manager()->string_exists("activityoverview", $module)) {
$icontext .= get_string("activityoverview", $module);
} else {
}
.block_course_overview .content {
- margin-left: 20px;
+ margin: 0 20px;
+}
+.block_course_overview .content .notice {
+ margin: 5px 0;
}
.block_course_overview .coursebox {
- padding: 15px 0 10px 10px;
- width: 98%;
+ padding: 15px;
+ width: auto;
}
.block_course_overview .profilepicture {
.block_course_overview .content h2.title {
float: left;
- margin-bottom: 0;
- margin-top: 0;
+ margin: 0 0 .5em 0;
position: relative;
}
.dir-rtl .block_course_overview .content h2.title {
.block_course_overview .activity_overview {
padding: 2px;
}
+.block_course_overview .activity_overview img.iconlarge { vertical-align: text-bottom; margin-right: 6px; }
+.dir-rtl .block_course_overview .activity_overview img.iconlarge { margin-left: 6px; margin-right: 0;}
.block_course_overview .singleselect {
text-align: left;
border-width: 2px;
border-style: dashed;
}
-
-.block_course_overview .collapsibleregioninner .name {margin-right: 20px;}
-.block_course_overview .collapsibleregioninner .info,
-.block_course_overview .collapsibleregioninner .details {margin-right: 25px;}
\ No newline at end of file
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_course_overview'; // Full name of the plugin (used for diagnostics)
\ No newline at end of file
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_course_summary'; // Full name of the plugin (used for diagnostics)
// We need to fix a font-size - sorry theme designers.
var fontsize = '11px';
var transform = (clockwise) ? 'rotate(90deg)' : 'rotate(270deg)';
- var test = Y.Node.create('<h2><span style="font-size:'+fontsize+';position:absolute;">'+text+'</span></h2>');
+ var test = Y.Node.create('<h2><span class="transform-test-node" style="font-size:'+fontsize+';">'+text+'</span></h2>');
this.nodes.body.insert(test, 0);
var width = test.one('span').get('offsetWidth') * 1.2;
var height = test.one('span').get('offsetHeight');
});
// Positioning is different when in RTL mode.
- if (Y.one(document.body).hasClass('dir-rtl')) {
+ if (right_to_left()) {
title.setStyle('left', width/2 - height);
} else {
title.setStyle('right', width/2 - height);
// Must set the image src seperatly of we get an error with XML strict headers
var moveto = Y.Node.create('<input type="image" class="moveto customcommand requiresjs" alt="'+M.str.block.addtodock+'" title="'+M.str.block.addtodock+'" />');
- moveto.setAttribute('src', M.util.image_url('t/block_to_dock', 'moodle'));
+ var icon = 't/block_to_dock';
+ if (right_to_left()) {
+ icon = 't/block_to_dock_rtl';
+ }
+ moveto.setAttribute('src', M.util.image_url(icon, 'moodle'));
moveto.on('movetodock|click', this.move_to_dock, this, commands);
var blockaction = node.one('.block_action');
// Must set the image src seperatly of we get an error with XML strict headers
var movetoimg = Y.Node.create('<img alt="'+M.str.block.undockitem+'" title="'+M.str.block.undockitem+'" />');
- movetoimg.setAttribute('src', M.util.image_url('t/dock_to_block', 'moodle'));
+ var icon = 't/dock_to_block';
+ if (right_to_left()) {
+ icon = 't/dock_to_block_rtl';
+ }
+ movetoimg.setAttribute('src', M.util.image_url(icon, 'moodle'));
var moveto = Y.Node.create('<a class="moveto customcommand requiresjs"></a>').append(movetoimg);
if (location.href.match(/\?/)) {
moveto.set('href', location.href+'&dock='+this.id);
defined('MOODLE_INTERNAL') || die();
-$plugin->version = 2012110800; // The current plugin version (Date: YYYYMMDDXX)
-$plugin->requires = 2012061700; // Requires this Moodle version
+$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
+$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_feedback'; // Full name of the plugin (used for diagnostics)
$course = $this->page->course;
$modinfo = get_fast_modinfo($course);
$glossaryid = $this->config->glossary;
- $cm = $modinfo->instances['glossary'][$glossaryid];
-
- if (!has_capability('mod/glossary:view', context_module::instance($cm->id))) {
- return '';
- }
if (!isset($modinfo->instances['glossary'][$glossaryid])) {
// we can get here if the glossary has been deleted, so
return $this->content;
}
+ $cm = $modinfo->instances['glossary'][$glossaryid];
+
+ if (!has_capability('mod/glossary:view', context_module::instance($cm->id))) {
+ return '';
+ }
+
if (empty($this->config->cache)) {
$this->config->cache = '';
}