Compare commits
365 Commits
v2.4.0-rc1
...
v2.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e90b10ad8 | |||
| 8a646b55f7 | |||
| 72cece6ff4 | |||
| 9b7b6fa33c | |||
| 43bfcff941 | |||
| a4611b9d02 | |||
| 5be009245b | |||
| a50bf852e4 | |||
| 9c3ef35763 | |||
| 562782a48d | |||
| b56324b829 | |||
| 47ee76344e | |||
| 844cb63fed | |||
| a668f57e75 | |||
| 543fc34ed9 | |||
| 0a32dca4bb | |||
| 65a550c484 | |||
| 0f83a143b0 | |||
| 793c431543 | |||
| 2e25f806fb | |||
| f923f7aefe | |||
| cb838a36b2 | |||
| 56f4d0ed80 | |||
| 6c806e8384 | |||
| 5b6e74c85f | |||
| c33a96f676 | |||
| 9910a5d7eb | |||
| 7c8fb69b1c | |||
| ef42830b87 | |||
| 05f8741cee | |||
| 9a1ac11640 | |||
| 04ab55dd4f | |||
| b2e3fb3dc9 | |||
| d72a0aa2c8 | |||
| 2be82d5e13 | |||
| 019cc4eae4 | |||
| 2726d2a6a4 | |||
| 0c49b6c445 | |||
| 83a23ea878 | |||
| f849d1f6fc | |||
| 2e8da707a0 | |||
| f4537d5676 | |||
| 850aa189e4 | |||
| c5e96ad32f | |||
| 9acc49eb93 | |||
| d389a2f7f4 | |||
| 321554d35f | |||
| 102903f7ab | |||
| 181b7f5fea | |||
| e04f57c95b | |||
| b9639c524d | |||
| 56003ca491 | |||
| 192cb8f894 | |||
| 2d7c42275f | |||
| ac41913cea | |||
| 359c790b1c | |||
| 49a66d4b68 | |||
| 1a5a5f8e9c | |||
| 3735e3d289 | |||
| 2c6b79365b | |||
| 1565171e07 | |||
| 0c1be2af21 | |||
| e5d70123c9 | |||
| 3d6b1bf4e3 | |||
| b164a8904a | |||
| 78ac8558e0 | |||
| 363ed37e76 | |||
| 3b800be056 | |||
| ef227f1e0f | |||
| 6606784c3f | |||
| a17b3a200e | |||
| d63a406b02 | |||
| e6a3c6e1a1 | |||
| 356513cc80 | |||
| b1dc798512 | |||
| 697871ddcf | |||
| 602150068a | |||
| eeeac779c8 | |||
| c0333c98ea | |||
| d59467dfc9 | |||
| c731018d50 | |||
| e17644cca3 | |||
| d71b142446 | |||
| b61dd8b299 | |||
| 41bbc35471 | |||
| 0af4bf40ee | |||
| b09c5ac837 | |||
| 3f897939b2 | |||
| 3124654247 | |||
| 9a57563b9f | |||
| 190b5e7cbe | |||
| a8f8537965 | |||
| f938b1a89b | |||
| 2a39a4e01c | |||
| ab7d4ea7ba | |||
| ac4404e0cc | |||
| 0fe16db123 | |||
| 5c0dd1fadd | |||
| a7eec81ec6 | |||
| e03782efdd | |||
| eb2d6a23ab | |||
| a48b376978 | |||
| 544f0f9b11 | |||
| 322af447f5 | |||
| ec39bd51dd | |||
| bbb750e1ba | |||
| 73dd2ee2d5 | |||
| a1ccc146ac | |||
| 7a6f073415 | |||
| 76fa287781 | |||
| 94c5a8fe82 | |||
| d3fdafc358 | |||
| 606c07ae3e | |||
| c6b458edce | |||
| a8ccdd2880 | |||
| 656581fa2c | |||
| 785a713b82 | |||
| cf04387947 | |||
| eddec24752 | |||
| f454c9884f | |||
| 53f7c0c641 | |||
| 2de5b09d84 | |||
| 70c31beef7 | |||
| 901dd625f8 | |||
| 7d3341b000 | |||
| 1f60fe8a23 | |||
| 730271af49 | |||
| 8a35efacd7 | |||
| cfa9c7e1d0 | |||
| acb011dc20 | |||
| a7a1adf4e0 | |||
| e60bae3575 | |||
| ddb5fb5980 | |||
| b70a545c88 | |||
| c383f33bbf | |||
| 13683200d6 | |||
| 7be97bd89d | |||
| cd281ce1b4 | |||
| adc1d7b2a5 | |||
| b4454b133f | |||
| 520a601f14 | |||
| 0409483d5f | |||
| 2d07933c17 | |||
| 6eabdb6d8c | |||
| 291455cecd | |||
| b76204d589 | |||
| e8e9393e76 | |||
| 231f758404 | |||
| e92d664dd2 | |||
| 973fe984cd | |||
| 4548df3155 | |||
| c874cee03a | |||
| caeb7f90b0 | |||
| da264959f2 | |||
| 41e1109c5f | |||
| 209b2f7b3e | |||
| 503325ddcb | |||
| 41575c5571 | |||
| 73f60c1886 | |||
| dc7c91ae67 | |||
| 15dbd27efa | |||
| 9a05bd0f8f | |||
| 524e1ce789 | |||
| 3d4de0bc4e | |||
| 1264dd11a0 | |||
| 599e7fe006 | |||
| b768c6f77a | |||
| 4651e4e464 | |||
| 4c7e6ea021 | |||
| 46b0673732 | |||
| 9c2d41fce2 | |||
| c5148e0ab6 | |||
| 8bd65e7aaa | |||
| 4dbdc18fd8 | |||
| 9789d825c2 | |||
| 8f0019214e | |||
| 45cff73a1b | |||
| aa0cd4a7ef | |||
| 785e3deb4d | |||
| 7a4b7c5e18 | |||
| dc5c56e90c | |||
| 26679bee33 | |||
| 1076d79905 | |||
| 0034f04164 | |||
| 1ff2b56319 | |||
| 4d9b4e9782 | |||
| f51fdc9bb7 | |||
| f1c403dcec | |||
| ab1f9aa3a4 | |||
| 1ce6bdd1dd | |||
| e20e67161c | |||
| c545dcad4f | |||
| 9e9dd64c35 | |||
| c6c7a7be8c | |||
| e958133ca6 | |||
| 9261144beb | |||
| 71cc181bac | |||
| cf617e112f | |||
| 865485fc54 | |||
| a595b4dacb | |||
| 7c431a345f | |||
| 4dbc9b0a64 | |||
| 9242214612 | |||
| 4832c70022 | |||
| 54fdd4c0e9 | |||
| 0324045e4f | |||
| fac9ba991b | |||
| ae5ecea065 | |||
| 6357dd08b6 | |||
| c15b286f88 | |||
| 4afa0b50c7 | |||
| b90b9b83bd | |||
| 79bf1e37ca | |||
| 95ae9d9e5e | |||
| 7027fe4538 | |||
| 50f3d7b5ea | |||
| 22fc0c5e9b | |||
| 6ff1745873 | |||
| 505530eaf5 | |||
| a2630c08ae | |||
| fddbdb79db | |||
| 1c90b9976d | |||
| 35cb0e4a4c | |||
| ada098890b | |||
| 2e8b836243 | |||
| b004c163ee | |||
| 6d0c04c208 | |||
| 415b15ccd6 | |||
| 8a592bd551 | |||
| 29a7d7a1c1 | |||
| eda1d3f37a | |||
| 6466396f38 | |||
| 5b2313c26c | |||
| 473eadfe10 | |||
| 52d4168038 | |||
| c6bd16545e | |||
| 517a2dbe84 | |||
| 88d48cd51f | |||
| a5ff28cc9f | |||
| 1b2cf98bb0 | |||
| 86e28894f4 | |||
| c125bb553d | |||
| 4ac455d9a4 | |||
| 3b7a18f2e5 | |||
| a13a1707bc | |||
| 6812769f8f | |||
| 2f860b4ded | |||
| d84c21dfcc | |||
| 0e3c1231da | |||
| 71e8ee1c33 | |||
| 8938f0848e | |||
| 0e73e16460 | |||
| 9321379b10 | |||
| c91c7fcded | |||
| 0663096dc6 | |||
| 7a9e253405 | |||
| 5e6b64571c | |||
| c446a0fca2 | |||
| 07f89a017c | |||
| b8b1926e2f | |||
| 4d5970ea63 | |||
| 656cea20a6 | |||
| e9f8261131 | |||
| d87a55fc2b | |||
| b0c87306a6 | |||
| 38ab68e6ab | |||
| 0e7cadca03 | |||
| efd08cdc2b | |||
| 7e61737f3d | |||
| 138025470f | |||
| 8b72167d0e | |||
| f92305bfa9 | |||
| 0b4767ca50 | |||
| 1c50e53a05 | |||
| a3301036d6 | |||
| c7a34ab704 | |||
| 1b696de61b | |||
| f4d4c73899 | |||
| da0cf7f883 | |||
| 7c3f70812e | |||
| f5eabd12db | |||
| db1dd3e550 | |||
| f48902e139 | |||
| 7b03292e24 | |||
| 2a6e3435d0 | |||
| 0411eed2cb | |||
| 365ef195b5 | |||
| 8c3547554b | |||
| 324efa55e3 | |||
| 0b7c52dd4c | |||
| cf31390c6f | |||
| 5af62aa90a | |||
| cf839b4396 | |||
| 257a5d1299 | |||
| e6d4708fcf | |||
| f9870842bd | |||
| 2d7173d0c7 | |||
| 4682fc7c38 | |||
| 15a77653e4 | |||
| 9b1f784178 | |||
| 44bfbe1e15 | |||
| 0c767bf6cc | |||
| 81c89dd705 | |||
| b46ee168ef | |||
| e399d32694 | |||
| 606e2c8ebe | |||
| c6e0d385c3 | |||
| 31a3bcc933 | |||
| acade5443f | |||
| 113105bf9c | |||
| dd9f2b1cca | |||
| 90d740364b | |||
| 89bc7e7b6e | |||
| 5c58a540ea | |||
| 325e266e95 | |||
| f588fdfcc7 | |||
| b9896f9613 | |||
| b0d9ca18a4 | |||
| e9dab879b6 | |||
| 552160e844 | |||
| 0dcae7cd14 | |||
| bb608148a9 | |||
| ce84cbacb7 | |||
| e1c93ed97b | |||
| 197b314f46 | |||
| 7d1c3abe88 | |||
| 7eebac6c77 | |||
| 72647f09f1 | |||
| 539cc4061d | |||
| 4a67095710 | |||
| c62c77c0e8 | |||
| f92340ed3f | |||
| 28ef36f018 | |||
| 383b89a1e2 | |||
| 58f5646767 | |||
| 50d6ad844a | |||
| de1c8ef58b | |||
| 489f98a662 | |||
| 7e252acff1 | |||
| 63def597a6 | |||
| 42c6731c9f | |||
| 333048e06b | |||
| e428b5e0ae | |||
| 30e2682756 | |||
| 4785c45dd8 | |||
| d75130a1a5 | |||
| c2e10ac08a | |||
| fd7653aa27 | |||
| 01686636ce | |||
| c7859a51b7 | |||
| 0348468bee | |||
| f08c147ef0 | |||
| cfd17b5da7 | |||
| d9f95015f5 | |||
| f9f8a6af6e | |||
| 7428077d4b | |||
| 41058f0a19 | |||
| d81c17f900 | |||
| b84a84258c | |||
| 6e4a2acf93 | |||
| f264499fcf | |||
| 8131a848dd | |||
| eacc63ab57 | |||
| ff56ecd315 | |||
| 912918b5aa |
+8
-3
@@ -691,7 +691,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
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');
|
||||
}
|
||||
@@ -1211,8 +1211,13 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
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'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,5 +34,9 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -285,7 +285,11 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
$userserrors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($user->username !== clean_param($user->username, PARAM_USERNAME)) {
|
||||
$upt->track('status', get_string('invalidusername', 'error', 'username'), 'error');
|
||||
$upt->track('username', $errorstr, 'error');
|
||||
$userserrors++;
|
||||
}
|
||||
if ($existinguser = $DB->get_record('user', array('username'=>$user->username, 'mnethostid'=>$CFG->mnet_localhost_id))) {
|
||||
$upt->track('id', $existinguser->id, 'normal', false);
|
||||
}
|
||||
@@ -900,7 +904,11 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
$newgroupdata = new stdClass();
|
||||
$newgroupdata->name = $addgroup;
|
||||
$newgroupdata->courseid = $ccache[$shortname]->id;
|
||||
if ($ccache[$shortname]->groups[$addgroup]->id = groups_create_group($newgroupdata)){
|
||||
$newgroupdata->description = '';
|
||||
$gid = groups_create_group($newgroupdata);
|
||||
if ($gid){
|
||||
$ccache[$shortname]->groups[$addgroup] = new stdClass();
|
||||
$ccache[$shortname]->groups[$addgroup]->id = $gid;
|
||||
$ccache[$shortname]->groups[$addgroup]->name = $newgroupdata->name;
|
||||
} else {
|
||||
$upt->track('enrolments', get_string('unknowngroup', 'error', s($addgroup)), 'error');
|
||||
|
||||
@@ -81,7 +81,7 @@ function user_download_ods($fields) {
|
||||
|
||||
$worksheet = array();
|
||||
|
||||
$worksheet[0] =& $workbook->add_worksheet('');
|
||||
$worksheet[0] = $workbook->add_worksheet('');
|
||||
$col = 0;
|
||||
foreach ($fields as $fieldname) {
|
||||
$worksheet[0]->write(0, $col, $fieldname);
|
||||
@@ -119,7 +119,7 @@ function user_download_xls($fields) {
|
||||
|
||||
$worksheet = array();
|
||||
|
||||
$worksheet[0] =& $workbook->add_worksheet('');
|
||||
$worksheet[0] = $workbook->add_worksheet('');
|
||||
$col = 0;
|
||||
foreach ($fields as $fieldname) {
|
||||
$worksheet[0]->write(0, $col, $fieldname);
|
||||
|
||||
+1
-1
@@ -711,7 +711,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
/// User removal
|
||||
// Find users in DB that aren't in ldap -- to be removed!
|
||||
// this is still not as scalable (but how often do we mass delete?)
|
||||
if ($this->config->removeuser !== AUTH_REMOVEUSER_KEEP) {
|
||||
if ($this->config->removeuser != AUTH_REMOVEUSER_KEEP) {
|
||||
$sql = 'SELECT u.*
|
||||
FROM {user} u
|
||||
LEFT JOIN {tmp_extuser} e ON (u.username = e.username AND u.mnethostid = e.mnethostid)
|
||||
|
||||
@@ -37,5 +37,9 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,5 +38,9 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
$PAGE->set_url('/auth/shibboleth/index.php');
|
||||
|
||||
// Support for WAYFless URLs.
|
||||
$SESSION->wantsurl = optional_param('target', $SESSION->wantsurl, PARAM_LOCALURL);
|
||||
$target = optional_param('target', '', PARAM_LOCALURL);
|
||||
if (!empty($target)) {
|
||||
$SESSION->wantsurl = $target;
|
||||
}
|
||||
|
||||
if (isloggedin() && !isguestuser()) { // Nothing to do
|
||||
if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
|
||||
|
||||
@@ -40,8 +40,7 @@ if ($show_instructions) {
|
||||
</form>
|
||||
<p>
|
||||
<?php
|
||||
print_string("auth_shibboleth_contact_administrator", "auth_shibboleth");
|
||||
echo '<a href="mailto:'.get_admin()->email.'"> Moodle Administrator</a>.';
|
||||
print_string("auth_shib_contact_administrator", "auth_shibboleth", get_admin()->email);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
$string['auth_shib_auth_method'] = 'Authentication method name';
|
||||
$string['auth_shib_auth_method_description'] = 'Provide a name for the Shibboleth authentication method that is familiar to your users. This could be the name of your Shibboleth federation, e.g. <tt>SWITCHaai Login</tt> or <tt>InCommon Login</tt> or similar.';
|
||||
$string['auth_shib_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the <a href="mailto:{$a}">Moodle Administrator</a>.';
|
||||
$string['auth_shibboleth_contact_administrator'] = 'In case you are not associated with the given organizations and you need access to a course on this server, please contact the';
|
||||
$string['auth_shibbolethdescription'] = 'Using this method users are created and authenticated using <a href="http://shibboleth.internet2.edu/">Shibboleth</a>.<br />Be sure to read the <a href="../auth/shibboleth/README.txt">README</a> for Shibboleth on how to set up your Moodle with Shibboleth';
|
||||
$string['auth_shibboleth_errormsg'] = 'Please select the organization you are member of!';
|
||||
|
||||
@@ -109,7 +109,7 @@ abstract class backup implements checksumable {
|
||||
const OPERATION_RESTORE ='restore';// We are performing one restore
|
||||
|
||||
// Version (to keep CFG->backup_version (and release) updated automatically)
|
||||
const VERSION = 2012112900;
|
||||
const VERSION = 2012120300;
|
||||
const RELEASE = '2.4';
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ $PAGE->navbar->add($backup->get_stage_name());
|
||||
$renderer = $PAGE->get_renderer('core','backup');
|
||||
echo $OUTPUT->header();
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display($renderer);
|
||||
|
||||
@@ -33,7 +33,7 @@ $currentcontext = required_param('currentcontext', PARAM_INT);
|
||||
// file parameters
|
||||
$component = optional_param('component', null, PARAM_COMPONENT);
|
||||
$filearea = optional_param('filearea', null, PARAM_AREA);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_URL);
|
||||
$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($currentcontext);
|
||||
$filecontext = context::instance_by_id($contextid, IGNORE_MISSING);
|
||||
|
||||
@@ -88,10 +88,13 @@ abstract class moodle1_handlers_factory {
|
||||
foreach ($plugins as $name => $dir) {
|
||||
$handlerfile = $dir . '/backup/moodle1/lib.php';
|
||||
$handlerclass = "moodle1_{$type}_{$name}_handler";
|
||||
if (!file_exists($handlerfile)) {
|
||||
if (file_exists($handlerfile)) {
|
||||
require_once($handlerfile);
|
||||
} elseif ($type == 'block') {
|
||||
$handlerclass = "moodle1_block_generic_handler";
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
require_once($handlerfile);
|
||||
|
||||
if (!class_exists($handlerclass)) {
|
||||
throw new moodle1_convert_exception('missing_handler_class', $handlerclass);
|
||||
@@ -1989,9 +1992,93 @@ abstract class moodle1_resource_successor_handler extends moodle1_mod_handler {
|
||||
*/
|
||||
abstract class moodle1_block_handler extends moodle1_plugin_handler {
|
||||
|
||||
public function get_paths() {
|
||||
$blockname = strtoupper($this->pluginname);
|
||||
return array(
|
||||
new convert_path('block', "/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/{$blockname}"),
|
||||
);
|
||||
}
|
||||
|
||||
public function process_block(array $data) {
|
||||
$newdata = $this->convert_common_block_data($data);
|
||||
|
||||
$this->write_block_xml($newdata, $data);
|
||||
$this->write_inforef_xml($newdata, $data);
|
||||
$this->write_roles_xml($newdata, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function convert_common_block_data(array $olddata) {
|
||||
$newdata = array();
|
||||
|
||||
$newdata['blockname'] = $olddata['name'];
|
||||
$newdata['parentcontextid'] = $this->converter->get_contextid(CONTEXT_COURSE, 0);
|
||||
$newdata['showinsubcontexts'] = 0;
|
||||
$newdata['pagetypepattern'] = $olddata['pagetype'].='-*';
|
||||
$newdata['subpagepattern'] = null;
|
||||
$newdata['defaultregion'] = ($olddata['position']=='l')?'side-pre':'side-post';
|
||||
$newdata['defaultweight'] = $olddata['weight'];
|
||||
$newdata['configdata'] = $this->convert_configdata($olddata);
|
||||
|
||||
return $newdata;
|
||||
}
|
||||
|
||||
protected function convert_configdata(array $olddata) {
|
||||
return $olddata['configdata'];
|
||||
}
|
||||
|
||||
protected function write_block_xml($newdata, $data) {
|
||||
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $data['id']);
|
||||
|
||||
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/block.xml");
|
||||
$this->xmlwriter->begin_tag('block', array('id' => $data['id'], 'contextid' => $contextid));
|
||||
|
||||
foreach ($newdata as $field => $value) {
|
||||
$this->xmlwriter->full_tag($field, $value);
|
||||
}
|
||||
|
||||
$this->xmlwriter->begin_tag('block_positions');
|
||||
$this->xmlwriter->begin_tag('block_position', array('id' => 1));
|
||||
$this->xmlwriter->full_tag('contextid', $newdata['parentcontextid']);
|
||||
$this->xmlwriter->full_tag('pagetype', $data['pagetype']);
|
||||
$this->xmlwriter->full_tag('subpage', '');
|
||||
$this->xmlwriter->full_tag('visible', $data['visible']);
|
||||
$this->xmlwriter->full_tag('region', $newdata['defaultregion']);
|
||||
$this->xmlwriter->full_tag('weight', $newdata['defaultweight']);
|
||||
$this->xmlwriter->end_tag('block_position');
|
||||
$this->xmlwriter->end_tag('block_positions');
|
||||
$this->xmlwriter->end_tag('block');
|
||||
$this->close_xml_writer();
|
||||
}
|
||||
|
||||
protected function write_inforef_xml($newdata, $data) {
|
||||
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/inforef.xml");
|
||||
$this->xmlwriter->begin_tag('inforef');
|
||||
// Subclasses may provide inforef contents if needed
|
||||
$this->xmlwriter->end_tag('inforef');
|
||||
$this->close_xml_writer();
|
||||
}
|
||||
|
||||
protected function write_roles_xml($newdata, $data) {
|
||||
// This is an empty shell, as the moodle1 converter doesn't handle user data.
|
||||
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/roles.xml");
|
||||
$this->xmlwriter->begin_tag('roles');
|
||||
$this->xmlwriter->full_tag('role_overrides', '');
|
||||
$this->xmlwriter->full_tag('role_assignments', '');
|
||||
$this->xmlwriter->end_tag('roles');
|
||||
$this->close_xml_writer();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Base class for block generic handler
|
||||
*/
|
||||
class moodle1_block_generic_handler extends moodle1_block_handler {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for the activity modules' subplugins
|
||||
*/
|
||||
|
||||
@@ -254,7 +254,7 @@ class moodle1_converter extends base_converter {
|
||||
$path = '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock;
|
||||
|
||||
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
|
||||
}
|
||||
|
||||
if ($path !== $data['path']) {
|
||||
@@ -350,12 +350,12 @@ class moodle1_converter extends base_converter {
|
||||
}
|
||||
|
||||
if ($path === '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') {
|
||||
$this->currentmod = null;
|
||||
$this->currentblock = null;
|
||||
$forbidden = true;
|
||||
|
||||
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
|
||||
// expand the BLOCK paths so that they contain the module name
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
|
||||
}
|
||||
|
||||
if (empty($this->pathelements[$path])) {
|
||||
@@ -397,7 +397,7 @@ class moodle1_converter extends base_converter {
|
||||
$path = '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock;
|
||||
|
||||
} else if (strpos($path, '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK') === 0) {
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentmod, $path);
|
||||
$path = str_replace('/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/' . $this->currentblock, $path);
|
||||
}
|
||||
|
||||
if (empty($this->pathelements[$path])) {
|
||||
@@ -642,7 +642,9 @@ class moodle1_converter extends base_converter {
|
||||
}
|
||||
foreach ($matches[2] as $match) {
|
||||
$file = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
|
||||
$files[] = rawurldecode($file);
|
||||
if ($file === clean_param($file, PARAM_PATH)) {
|
||||
$files[] = rawurldecode($file);
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique($files);
|
||||
@@ -1210,6 +1212,10 @@ class moodle1_file_manager implements loggable {
|
||||
|
||||
$sourcefullpath = $this->basepath.'/'.$sourcepath;
|
||||
|
||||
if ($sourcefullpath !== clean_param($sourcefullpath, PARAM_PATH)) {
|
||||
throw new moodle1_convert_exception('file_invalid_path', $sourcefullpath);
|
||||
}
|
||||
|
||||
if (!is_readable($sourcefullpath)) {
|
||||
throw new moodle1_convert_exception('file_not_readable', $sourcefullpath);
|
||||
}
|
||||
|
||||
@@ -273,6 +273,15 @@ class moodle1_converter_testcase extends advanced_testcase {
|
||||
$fileids = $fileman->get_fileids();
|
||||
$this->assertEquals(gettype($fileids), 'array');
|
||||
$this->assertEquals(0, count($fileids));
|
||||
// try to migrate an invalid file
|
||||
$fileman->itemid = 1;
|
||||
$thrown = false;
|
||||
try {
|
||||
$fileman->migrate_file('/../../../../../../../../../../../../../../etc/passwd');
|
||||
} catch (moodle1_convert_exception $e) {
|
||||
$thrown = true;
|
||||
}
|
||||
$this->assertTrue($thrown);
|
||||
// migrate a single file
|
||||
$fileman->itemid = 4;
|
||||
$fileman->migrate_file('moddata/unittest/4/icon.gif');
|
||||
@@ -435,6 +444,8 @@ class moodle1_converter_testcase extends advanced_testcase {
|
||||
|
||||
$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@$">download image</a><br />
|
||||
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
|
||||
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
|
||||
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />';
|
||||
|
||||
$files = moodle1_converter::find_referenced_files($text);
|
||||
@@ -446,6 +457,8 @@ as it is parsed from the backup file. <br /><br /><img border="0" width="110" vs
|
||||
$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 />
|
||||
<div><a href=\'$@FILEPHP@$/../../../../../../../../../../../../../../../etc/passwd\'>download passwords</a></div>
|
||||
<div><a href=\'$@FILEPHP@$$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$..$@SLASH@$etc$@SLASH@$shadow\'>download shadows</a></div>
|
||||
<br /><a href=\'$@FILEPHP@$$@SLASH@$MANUAL.DOC$@FORCEDOWNLOAD@$\'>download manual</a><br />');
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ $PAGE->navbar->add($backup->get_stage_name());
|
||||
// Display the current stage
|
||||
echo $OUTPUT->header();
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display($renderer);
|
||||
|
||||
@@ -258,7 +258,8 @@ abstract class backup_activity_task extends backup_task {
|
||||
// - 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');
|
||||
|
||||
@@ -278,7 +278,8 @@ abstract class restore_activity_task extends restore_task {
|
||||
// - 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');
|
||||
|
||||
@@ -190,6 +190,15 @@ class restore_gradebook_structure_step extends restore_structure_step {
|
||||
$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)) {
|
||||
@@ -288,8 +297,13 @@ class restore_gradebook_structure_step extends restore_structure_step {
|
||||
|
||||
$data->courseid = $this->get_courseid();
|
||||
|
||||
$newitemid = $DB->insert_record('grade_settings', $data);
|
||||
//$this->set_mapping('grade_setting', $oldid, $newitemid);
|
||||
if (!$DB->record_exists('grade_settings', array('courseid' => $data->courseid, 'name' => $data->name))) {
|
||||
$newitemid = $DB->insert_record('grade_settings', $data);
|
||||
} else {
|
||||
$newitemid = $data->id;
|
||||
}
|
||||
|
||||
$this->set_mapping('grade_setting', $oldid, $newitemid);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1259,11 +1273,11 @@ class restore_section_structure_step extends restore_structure_step {
|
||||
$sectionid = $this->get_task()->get_sectionid();
|
||||
|
||||
// Get data object for current section availability (if any).
|
||||
$data = $DB->get_record('course_sections_availability',
|
||||
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid', IGNORE_MISSING);
|
||||
$records = $DB->get_records('course_sections_availability',
|
||||
array('coursesectionid' => $sectionid), 'id, sourcecmid, gradeitemid');
|
||||
|
||||
// If it exists, update mappings.
|
||||
if ($data) {
|
||||
foreach ($records as $data) {
|
||||
// Only update mappings for entries which are created by this restore.
|
||||
// Otherwise, when you restore to an existing course, it will mess up
|
||||
// existing section availability entries.
|
||||
@@ -3072,9 +3086,6 @@ class restore_create_categories_and_questions extends restore_structure_step {
|
||||
$data->penalty = 1;
|
||||
}
|
||||
|
||||
$data->timecreated = $this->apply_date_offset($data->timecreated);
|
||||
$data->timemodified = $this->apply_date_offset($data->timemodified);
|
||||
|
||||
$userid = $this->get_mappingid('user', $data->createdby);
|
||||
$data->createdby = $userid ? $userid : $this->task->get_userid();
|
||||
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ $PAGE->navbar->add($restore->get_stage_name());
|
||||
$renderer = $PAGE->get_renderer('core','backup');
|
||||
echo $OUTPUT->header();
|
||||
if (!$restore->is_independent() && $restore->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced','backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($restore->get_progress_bar());
|
||||
echo $restore->display($renderer);
|
||||
|
||||
@@ -75,7 +75,7 @@ class file_logger extends base_logger {
|
||||
if (substr($this->fullpath, -5) !== '.html') {
|
||||
$content = $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
|
||||
} else {
|
||||
$content = $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
$content = $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
if (false === fwrite($this->fhandle, $content)) {
|
||||
throw new base_logger_exception('error_writing_file', $this->fullpath);
|
||||
|
||||
@@ -38,7 +38,7 @@ class output_indented_logger extends base_logger {
|
||||
if (defined('STDOUT')) {
|
||||
echo $prefix . str_repeat(' ', $depth) . $message . PHP_EOL;
|
||||
} else {
|
||||
echo $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
echo $prefix . str_repeat(' ', $depth) . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
flush();
|
||||
return true;
|
||||
|
||||
@@ -37,7 +37,7 @@ class output_text_logger extends base_logger {
|
||||
if (defined('STDOUT')) {
|
||||
echo $prefix . $message . PHP_EOL;
|
||||
} else {
|
||||
echo $prefix . htmlentities($message, ENT_QUOTES) . '<br/>' . PHP_EOL;
|
||||
echo $prefix . htmlentities($message, ENT_QUOTES, 'UTF-8') . '<br/>' . PHP_EOL;
|
||||
}
|
||||
flush();
|
||||
return true;
|
||||
|
||||
@@ -329,7 +329,7 @@ class backup_setting_ui_text extends backup_setting_ui {
|
||||
$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));
|
||||
@@ -380,7 +380,7 @@ class backup_setting_ui_checkbox extends backup_setting_ui {
|
||||
$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));
|
||||
}
|
||||
@@ -473,7 +473,7 @@ class backup_setting_ui_radio extends backup_setting_ui {
|
||||
$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));
|
||||
@@ -538,7 +538,7 @@ class backup_setting_ui_select extends backup_setting_ui {
|
||||
$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));
|
||||
|
||||
@@ -322,6 +322,7 @@ abstract class base_moodleform extends moodleform {
|
||||
$config->question = get_string('confirmcancelquestion', 'backup');
|
||||
$config->yesLabel = get_string('confirmcancelyes', 'backup');
|
||||
$config->noLabel = get_string('confirmcancelno', 'backup');
|
||||
$config->closeButtonTitle = get_string('close', 'editor');
|
||||
$PAGE->requires->yui_module('moodle-backup-confirmcancel', 'M.core_backup.watch_cancel_buttons', array($config));
|
||||
|
||||
$PAGE->requires->yui_module('moodle-backup-backupselectall', 'M.core_backup.select_all_init',
|
||||
|
||||
@@ -147,9 +147,9 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$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,
|
||||
);
|
||||
|
||||
@@ -69,7 +69,7 @@ class block_community extends block_list {
|
||||
}
|
||||
|
||||
$icon = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/group'),
|
||||
'class' => 'icon', 'alt' => get_string('addcourse', 'block_community')));
|
||||
'class' => 'icon', 'alt' => ""));
|
||||
$addcourseurl = new moodle_url('/blocks/community/communitycourse.php',
|
||||
array('add' => true, 'courseid' => $this->page->course->id));
|
||||
$searchlink = html_writer::tag('a', $icon . get_string('addcourse', 'block_community'),
|
||||
|
||||
@@ -228,10 +228,10 @@ if (!empty($courses)) {
|
||||
}
|
||||
}
|
||||
$PAGE->requires->yui_module('moodle-block_community-comments', 'M.blocks_community.init_comments',
|
||||
array(array('commentids' => $commentedcourseids)));
|
||||
array(array('commentids' => $commentedcourseids, 'closeButtonTitle' => get_string('close', 'editor'))));
|
||||
$PAGE->requires->yui_module('moodle-block_community-imagegallery', 'M.blocks_community.init_imagegallery',
|
||||
array(array('imageids' => $courseids, 'imagenumbers' => $courseimagenumbers,
|
||||
'huburl' => $huburl)));
|
||||
'huburl' => $huburl, 'closeButtonTitle' => get_string('close', 'editor'))));
|
||||
|
||||
echo highlight($search, $renderer->course_list($courses, $huburl, $courseid));
|
||||
|
||||
|
||||
@@ -50,5 +50,9 @@ function xmldb_block_community_upgrade($oldversion) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
background-color:#F6F6F6;
|
||||
border:1px solid #CCCCCC;
|
||||
overflow: auto;
|
||||
padding: 7px 6px;
|
||||
}
|
||||
|
||||
#page-blocks-community-communitycourse .moodle-dialogue-base .moodle-dialogue-bd {
|
||||
@@ -222,5 +223,5 @@
|
||||
|
||||
#page-blocks-community-communitycourse .moodle-dialogue-base .closebutton {
|
||||
margin-top:4px;
|
||||
width:30px;
|
||||
}
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
+28
-19
@@ -9,8 +9,8 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
Y.extend(COMMENTS, Y.Base, {
|
||||
|
||||
event:null,
|
||||
overlayevent:null,
|
||||
overlays: [], //all the comment boxes
|
||||
panelevent: null,
|
||||
panels: [], //all the comment boxes
|
||||
|
||||
initializer : function(params) {
|
||||
|
||||
@@ -18,17 +18,19 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
for (var i=0;i<this.get('commentids').length;i++)
|
||||
{
|
||||
var commentid = this.get('commentids')[i];
|
||||
this.overlays[commentid] = new M.core.dialogue({
|
||||
headerContent:Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML'),
|
||||
this.panels[commentid] = new M.core.dialogue({
|
||||
headerContent:Y.Node.create('<h1>')
|
||||
.append(Y.one('#commentoverlay-'+commentid+' .commenttitle').get('innerHTML')),
|
||||
bodyContent:Y.one('#commentoverlay-'+commentid).get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
lightbox : false,
|
||||
zIndex:100
|
||||
zIndex:100,
|
||||
closeButtonTitle: this.get('closeButtonTitle')
|
||||
});
|
||||
|
||||
this.overlays[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
this.overlays[commentid].render();
|
||||
this.overlays[commentid].hide();
|
||||
this.panels[commentid].get('contentBox').one('.commenttitle').remove();
|
||||
this.panels[commentid].render();
|
||||
this.panels[commentid].hide();
|
||||
|
||||
Y.one('#comments-'+commentid).on('click', this.show, this, commentid);
|
||||
}
|
||||
@@ -37,34 +39,37 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
|
||||
show : function (e, commentid) {
|
||||
|
||||
//hide all overlays
|
||||
// Hide all panels.
|
||||
for (var i=0;i<this.get('commentids').length;i++)
|
||||
{
|
||||
this.hide(e, this.get('commentids')[i]);
|
||||
}
|
||||
|
||||
this.overlays[commentid].show(); //show the overlay
|
||||
this.panels[commentid].show(); //show the panel
|
||||
|
||||
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
|
||||
e.halt(); // we are going to attach a new 'hide panel' event to the body,
|
||||
// because javascript always propagate event to parent tag,
|
||||
// we need to tell Yahoo to stop to call the event on parent tag
|
||||
// otherwise the hide event will be call right away.
|
||||
|
||||
//we add a new event on the body in order to hide the overlay for the next click
|
||||
// We add a new event on the body in order to hide the panel for the next click.
|
||||
this.event = Y.one(document.body).on('click', this.hide, this, commentid);
|
||||
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
|
||||
this.overlayevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
|
||||
// We add a new event on the panel in order to hide the panel for the next click (touch device).
|
||||
this.panelevent = Y.one("#commentoverlay-"+commentid).on('click', this.hide, this, commentid);
|
||||
|
||||
// Focus on the close button
|
||||
this.panels[commentid].get('buttons').header[0].focus();
|
||||
},
|
||||
|
||||
hide : function (e, commentid) {
|
||||
this.overlays[commentid].hide(); //hide the overlay
|
||||
this.panels[commentid].hide(); //hide the panel
|
||||
if (this.event != null) {
|
||||
this.event.detach(); //we need to detach the body hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
if (this.overlayevent != null) {
|
||||
this.overlayevent.detach(); //we need to detach the overlay hide event
|
||||
if (this.panelevent != null) {
|
||||
this.panelevent.detach(); //we need to detach the panel hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
@@ -74,7 +79,11 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
}, {
|
||||
NAME : COMMENTSNAME,
|
||||
ATTRS : {
|
||||
commentids: {}
|
||||
commentids: {},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,5 +93,5 @@ YUI.add('moodle-block_community-comments', function(Y) {
|
||||
}
|
||||
|
||||
}, '@VERSION@', {
|
||||
requires:['base','overlay', 'moodle-core-notification']
|
||||
requires:['base', 'moodle-core-notification']
|
||||
});
|
||||
|
||||
+48
-41
@@ -11,8 +11,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
event:null,
|
||||
previousevent:null,
|
||||
nextevent:null,
|
||||
overlayevent:null,
|
||||
overlay:null, //all the comment boxes
|
||||
panelevent:null,
|
||||
panel:null, //all the images boxes
|
||||
imageidnumbers: [],
|
||||
imageloadingevent: null,
|
||||
loadingimage: null,
|
||||
@@ -26,15 +26,15 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
+'</div>');
|
||||
objBody.append(this.loadingimage);
|
||||
|
||||
/// create the div for overlay
|
||||
// Create the div for panel.
|
||||
var objBody = Y.one(document.body);
|
||||
var overlaytitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(overlaytitle);
|
||||
var overlay = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(overlay);
|
||||
var paneltitle = Y.Node.create('<div id="imagetitleoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(paneltitle);
|
||||
var panel = Y.Node.create('<div id="imageoverlay" class="hiddenoverlay"></div>');
|
||||
objBody.append(panel);
|
||||
|
||||
/// create the overlay
|
||||
this.overlay = new M.core.dialogue({
|
||||
/// Create the panel.
|
||||
this.panel = new M.core.dialogue({
|
||||
headerContent:Y.one('#imagetitleoverlay').get('innerHTML'),
|
||||
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
@@ -42,8 +42,8 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
zIndex:100
|
||||
});
|
||||
|
||||
this.overlay.render();
|
||||
this.overlay.hide();
|
||||
this.panel.render();
|
||||
this.panel.hide();
|
||||
|
||||
//attach a show event on the image divs (<tag id='image-X'>)
|
||||
for (var i=0;i<this.get('imageids').length;i++)
|
||||
@@ -85,31 +85,31 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
var maxheight = windowheight - 150;
|
||||
|
||||
//load the title + link to next image
|
||||
var overlaytitle = Y.one('#imagetitleoverlay');
|
||||
var paneltitle = Y.one('#imagetitleoverlay');
|
||||
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
|
||||
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";
|
||||
|
||||
/// need to load the images in the overlay
|
||||
var overlay = Y.one('#imageoverlay');
|
||||
overlay.setContent('');
|
||||
// Need to load the images in the panel.
|
||||
var panel = Y.one('#imageoverlay');
|
||||
panel.setContent('');
|
||||
|
||||
|
||||
overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
|
||||
panel.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
|
||||
+ '" style="max-height:' + maxheight + 'px;"></div>'));
|
||||
this.overlay.destroy();
|
||||
this.overlay = new M.core.dialogue({
|
||||
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
|
||||
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
|
||||
this.panel.destroy();
|
||||
this.panel = new M.core.dialogue({
|
||||
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"><h1> Image '
|
||||
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </h1></div>' + nextimagelink,
|
||||
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
|
||||
visible: false, //by default it is not displayed
|
||||
lightbox : false,
|
||||
zIndex:100
|
||||
zIndex:100,
|
||||
closeButtonTitle: this.get('closeButtonTitle')
|
||||
});
|
||||
this.overlay.render();
|
||||
this.overlay.hide(); //show the overlay
|
||||
this.overlay.set("centered", true);
|
||||
this.panel.render();
|
||||
this.panel.hide(); //show the panel
|
||||
this.panel.set("centered", true);
|
||||
|
||||
e.halt(); // we are going to attach a new 'hide overlay' event to the body,
|
||||
e.halt(); // we are going to attach a new 'hide panel' event to the body,
|
||||
// because javascript always propagate event to parent tag,
|
||||
// we need to tell Yahoo to stop to call the event on parent tag
|
||||
// otherwise the hide event will be call right away.
|
||||
@@ -123,14 +123,17 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
var screenshot = new Image();
|
||||
screenshot.src = url;
|
||||
|
||||
var overlaywidth = windowwidth - 100;
|
||||
if(overlaywidth > screenshot.width) {
|
||||
overlaywidth = screenshot.width;
|
||||
var panelwidth = windowwidth - 100;
|
||||
if(panelwidth > screenshot.width) {
|
||||
panelwidth = screenshot.width;
|
||||
}
|
||||
|
||||
this.overlay.set('width', overlaywidth);
|
||||
this.overlay.set("centered", true);
|
||||
this.overlay.show();
|
||||
this.panel.set('width', panelwidth);
|
||||
this.panel.set("centered", true);
|
||||
this.panel.show();
|
||||
|
||||
// Focus on the close button
|
||||
this.panel.get('buttons').header[0].focus();
|
||||
|
||||
}, this, url);
|
||||
|
||||
@@ -147,12 +150,12 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
Y.one('#nextarrow').on('click', this.show, this, imageid, nextnumber);
|
||||
Y.one('#imagenumber').on('click', this.show, this, imageid, nextnumber);
|
||||
|
||||
//we add a new event on the body in order to hide the overlay for the next click
|
||||
// We add a new event on the body in order to hide the panel for the next click.
|
||||
this.event = Y.one(document.body).on('click', this.hide, this);
|
||||
//we add a new event on the overlay in order to hide the overlay for the next click (touch device)
|
||||
this.overlayevent = Y.one("#imageoverlay").on('click', this.hide, this);
|
||||
// We add a new event on the panel in order to hide the panel for the next click (touch device).
|
||||
this.panelevent = Y.one("#imageoverlay").on('click', this.hide, this);
|
||||
|
||||
this.overlay.on('visibleChange',function(e){
|
||||
this.panel.on('visibleChange',function(e){
|
||||
if(e.newVal == 0){
|
||||
this.get('maskNode').remove()
|
||||
}
|
||||
@@ -167,14 +170,14 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
//hide the loading image
|
||||
Y.one('#hubloadingimage').setStyle('display', 'none');
|
||||
|
||||
this.overlay.hide(); //hide the overlay
|
||||
this.panel.hide(); //hide the panel
|
||||
if (this.event != null) {
|
||||
this.event.detach(); //we need to detach the body hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
if (this.overlayevent != null) {
|
||||
this.overlayevent.detach(); //we need to detach the overlay hide event
|
||||
if (this.panelevent != null) {
|
||||
this.panelevent.detach(); //we need to detach the panel hide event
|
||||
//Note: it would work without but create js warning everytime
|
||||
//we click on the body
|
||||
}
|
||||
@@ -185,7 +188,11 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
ATTRS : {
|
||||
imageids: {},
|
||||
imagenumbers: {},
|
||||
huburl: {}
|
||||
huburl: {},
|
||||
closeButtonTitle : {
|
||||
validator : Y.Lang.isString,
|
||||
value : 'Close'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -195,5 +202,5 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
|
||||
}
|
||||
|
||||
}, '@VERSION@', {
|
||||
requires:['base','node','overlay', 'moodle-core-notification']
|
||||
requires:['base','node', 'moodle-core-notification']
|
||||
});
|
||||
|
||||
@@ -38,6 +38,10 @@ class block_completionstatus extends block_base {
|
||||
$this->title = get_string('pluginname', 'block_completionstatus');
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
public function get_content() {
|
||||
global $USER;
|
||||
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/completionstatus:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/completionstatus:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the completion status block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'completionstatus', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'completionstatus');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
$string['completionprogressdetails'] = 'Completion progress details';
|
||||
$string['completionstatus:addinstance'] = 'Add a new course completion status block';
|
||||
$string['completionstatus:myaddinstance'] = 'Add a new course completion status block to the My Moodle page';
|
||||
$string['criteriagroup'] = 'Criteria group';
|
||||
$string['firstofsecond'] = '{$a->first} of {$a->second}';
|
||||
$string['pluginname'] = 'Course completion status';
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_completionstatus';
|
||||
$plugin->dependencies = array('report_completion' => 2012112900);
|
||||
$plugin->dependencies = array('report_completion' => 2012112900);
|
||||
|
||||
@@ -34,18 +34,5 @@ $capabilities = array(
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/course_overview:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_BLOCK,
|
||||
'archetypes' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'manager' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:manageblocks'
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -27,7 +27,6 @@ $string['alwaysshowall'] = 'Always Show All';
|
||||
$string['collapseall'] = 'Collapse All Course Lists';
|
||||
$string['configotherexpanded'] = 'If enabled, Other Courses will be expanded by default unless overriden by user preferences.';
|
||||
$string['configpreservestates'] = 'If enabled, the collapsed/expanded states set by the user are stored and used on each load.';
|
||||
$string['course_overview:addinstance'] = 'Add a new course overview block';
|
||||
$string['course_overview:myaddinstance'] = 'Add a new course overview block to the My Moodle page';
|
||||
$string['defaultmaxcourses'] = 'Default maximum courses';
|
||||
$string['defaultmaxcoursesdesc'] = 'Maximum courses which should be displayed on course overview block, 0 will show all courses';
|
||||
|
||||
@@ -106,7 +106,9 @@ class block_course_overview_renderer extends plugin_renderer_base {
|
||||
|
||||
$attributes = array('title' => s($course->fullname));
|
||||
if ($course->id > 0) {
|
||||
$link = html_writer::link(new moodle_url('/course/view.php', array('id' => $course->id)), format_string($course->shortname, true, $course->id), $attributes);
|
||||
$courseurl = new moodle_url('/course/view.php', array('id' => $course->id));
|
||||
$coursefullname = format_string($course->fullname, true, $course->id);
|
||||
$link = html_writer::link($courseurl, $coursefullname, $attributes);
|
||||
$html .= $this->output->heading($link, 2, 'title');
|
||||
} else {
|
||||
$html .= $this->output->heading(html_writer::link(
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012121000; // 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)
|
||||
$plugin->component = 'block_course_overview'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -5,6 +5,10 @@ class block_course_summary extends block_base {
|
||||
$this->title = get_string('pluginname', 'block_course_summary');
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
function specialization() {
|
||||
if($this->page->pagetype == PAGE_COURSE_VIEW && $this->page->course->id != SITEID) {
|
||||
$this->title = get_string('coursesummary', 'block_course_summary');
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/course_summary:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/course_summary:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the course summary block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'course_summary', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'course_summary');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -25,5 +25,4 @@
|
||||
|
||||
$string['coursesummary'] = 'Course summary';
|
||||
$string['course_summary:addinstance'] = 'Add a new course/site description block';
|
||||
$string['course_summary:myaddinstance'] = 'Add a new course/site description block to the My Moodle page';
|
||||
$string['pluginname'] = 'Course/Site description';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // 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)
|
||||
|
||||
+2
-2
@@ -516,7 +516,7 @@ M.core_dock.fixTitleOrientation = function(item, title, text) {
|
||||
// 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');
|
||||
@@ -936,7 +936,7 @@ M.core_dock.genericblock.prototype = {
|
||||
}, this);
|
||||
// Add a close icon
|
||||
// Must set the image src seperatly of we get an error with XML strict headers
|
||||
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="" /></span>');
|
||||
var closeicon = Y.Node.create('<span class="hidepanelicon" tabindex="0"><img alt="'+M.str.block.hidepanel+'" title="'+M.str.block.hidedockpanel+'" /></span>');
|
||||
closeicon.one('img').setAttribute('src', M.util.image_url('t/dockclose', 'moodle'));
|
||||
closeicon.on('forceclose|click', this.hide, this);
|
||||
closeicon.on('dock:actionkey',this.hide, this, {actions:{enter:true,toggle:true}});
|
||||
|
||||
@@ -5,10 +5,15 @@ define('BGR_LASTMODIFIED', '1');
|
||||
define('BGR_NEXTONE', '2');
|
||||
|
||||
class block_glossary_random extends block_base {
|
||||
|
||||
function init() {
|
||||
$this->title = get_string('pluginname','block_glossary_random');
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
function specialization() {
|
||||
global $CFG, $DB;
|
||||
|
||||
@@ -137,6 +142,7 @@ class block_glossary_random extends block_base {
|
||||
$this->config->cache = '';
|
||||
$this->instance_config_commit();
|
||||
|
||||
$this->content = new stdClass();
|
||||
$this->content->text = get_string('notyetconfigured','block_glossary_random');
|
||||
$this->content->footer = '';
|
||||
return $this->content;
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/glossary_random:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/glossary_random:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the glossary random block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_glossary_random_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'glossary_random', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'glossary_random');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -28,7 +28,6 @@ $string['askaddentry'] = 'When users can add entries to the glossary, show a lin
|
||||
$string['askinvisible'] = 'When users cannot edit or view the glossary, show this text (without link)';
|
||||
$string['askviewglossary'] = 'When users can view the glossary but not add entries, show a link with this text';
|
||||
$string['glossary_random:addinstance'] = 'Add a new random glossary entry block';
|
||||
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to the My Moodle page';
|
||||
$string['intro'] = 'Make sure you have at least one glossary with at least one entry added to this course. Then you can adjust the following settings';
|
||||
$string['invisible'] = '(to be continued)';
|
||||
$string['lastmodified'] = 'Last modified entry';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_glossary_random'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Provides support for the conversion of moodle1 backup to the moodle2 format
|
||||
*
|
||||
* @package block_html
|
||||
* @copyright 2012 Paul Nicholls
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Block conversion handler for html
|
||||
*/
|
||||
class moodle1_block_html_handler extends moodle1_block_handler {
|
||||
private $fileman = null;
|
||||
protected function convert_configdata(array $olddata) {
|
||||
$instanceid = $olddata['id'];
|
||||
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $olddata['id']);
|
||||
$configdata = unserialize(base64_decode($olddata['configdata']));
|
||||
|
||||
// get a fresh new file manager for this instance
|
||||
$this->fileman = $this->converter->get_file_manager($contextid, 'block_html');
|
||||
|
||||
// convert course files embedded in the block content
|
||||
$this->fileman->filearea = 'content';
|
||||
$this->fileman->itemid = 0;
|
||||
$configdata->text = moodle1_converter::migrate_referenced_files($configdata->text, $this->fileman);
|
||||
$configdata->format = FORMAT_HTML;
|
||||
|
||||
return base64_encode(serialize($configdata));
|
||||
}
|
||||
|
||||
protected function write_inforef_xml($newdata, $data) {
|
||||
$this->open_xml_writer("course/blocks/{$data['name']}_{$data['id']}/inforef.xml");
|
||||
$this->xmlwriter->begin_tag('inforef');
|
||||
$this->xmlwriter->begin_tag('fileref');
|
||||
foreach ($this->fileman->get_fileids() as $fileid) {
|
||||
$this->write_xml('file', array('id' => $fileid));
|
||||
}
|
||||
$this->xmlwriter->end_tag('fileref');
|
||||
$this->xmlwriter->end_tag('inforef');
|
||||
$this->close_xml_writer();
|
||||
}
|
||||
}
|
||||
@@ -36,5 +36,9 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ class block_mentees extends block_base {
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'tag' => false);
|
||||
return array('all' => true, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
function specialization() {
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/mentees:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/mentees:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the mentees block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_mentees_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'mentees', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'mentees');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -27,6 +27,5 @@ $string['configtitle'] = 'Block title';
|
||||
$string['configtitleblankhides'] = 'Block title (no title if blank)';
|
||||
$string['leaveblanktohide'] = 'leave blank to hide the title';
|
||||
$string['mentees:addinstance'] = 'Add a new mentees block';
|
||||
$string['mentees:myaddinstance'] = 'Add a new mentees block to the My Moodle page';
|
||||
$string['newmenteesblock'] = '(new Mentees block)';
|
||||
$string['pluginname'] = 'Mentees';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_mentees'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -62,5 +62,9 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -5,6 +5,10 @@ class block_news_items extends block_base {
|
||||
$this->title = get_string('pluginname', 'block_news_items');
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
function get_content() {
|
||||
global $CFG, $USER;
|
||||
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/news_items:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/news_items:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the latest news block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_news_items_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'news_items', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'news_items');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -24,5 +24,4 @@
|
||||
*/
|
||||
|
||||
$string['news_items:addinstance'] = 'Add a new latest news block';
|
||||
$string['news_items:myaddinstance'] = 'Add a new navigation block to the My Moodle page';
|
||||
$string['pluginname'] = 'Latest news';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_news_items'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -10,7 +10,13 @@ class block_online_users extends block_base {
|
||||
$this->title = get_string('pluginname','block_online_users');
|
||||
}
|
||||
|
||||
function has_config() {return true;}
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
function has_config() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_content() {
|
||||
global $USER, $CFG, $DB, $OUTPUT;
|
||||
@@ -151,12 +157,13 @@ class block_online_users extends block_base {
|
||||
$timeago = format_time($now - $user->lastaccess); //bruno to calculate correctly on frontpage
|
||||
|
||||
if (isguestuser($user)) {
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false));
|
||||
$this->content->text .= get_string('guestuser').'</div>';
|
||||
|
||||
} else {
|
||||
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->page->course->id.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
|
||||
$this->content->text .= '<div class="user">';
|
||||
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&course='.$this->page->course->id.'" title="'.$timeago.'">';
|
||||
$this->content->text .= $OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false, 'link'=>false)) .$user->fullname.'</a></div>';
|
||||
}
|
||||
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
|
||||
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />';
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/online_users:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/online_users:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the online users block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_online_users_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'online_users', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'online_users');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
$string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.';
|
||||
$string['online_users:addinstance'] = 'Add a new online users block';
|
||||
$string['online_users:myaddinstance'] = 'Add a new online users block to the My Moodle page';
|
||||
$string['online_users:viewlist'] = 'View list of online users';
|
||||
$string['periodnminutes'] = 'last {$a} minutes';
|
||||
$string['pluginname'] = 'Online users';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_online_users'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Provides support for the conversion of moodle1 backup to the moodle2 format
|
||||
*
|
||||
* @package block_rss_client
|
||||
* @copyright 2012 Paul Nicholls
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Block conversion handler for rss_client
|
||||
*/
|
||||
class moodle1_block_rss_client_handler extends moodle1_block_handler {
|
||||
public function process_block(array $data) {
|
||||
parent::process_block($data);
|
||||
$instanceid = $data['id'];
|
||||
$contextid = $this->converter->get_contextid(CONTEXT_BLOCK, $data['id']);
|
||||
|
||||
// Moodle 1.9 backups do not include sufficient data to restore feeds, so we need an empty shell rss_client.xml
|
||||
// for the restore process to find
|
||||
$this->open_xml_writer("course/blocks/{$data['name']}_{$instanceid}/rss_client.xml");
|
||||
$this->xmlwriter->begin_tag('block', array('id' => $instanceid, 'contextid' => $contextid, 'blockname' => 'rss_client'));
|
||||
$this->xmlwriter->begin_tag('rss_client', array('id' => $instanceid));
|
||||
$this->xmlwriter->full_tag('feeds', '');
|
||||
$this->xmlwriter->end_tag('rss_client');
|
||||
$this->xmlwriter->end_tag('block');
|
||||
$this->close_xml_writer();
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -78,6 +78,9 @@ class restore_rss_client_block_structure_step extends restore_structure_step {
|
||||
$configdata = $DB->get_field('block_instances', 'configdata', array('id' => $this->task->get_blockid()));
|
||||
// Extract configdata
|
||||
$config = unserialize(base64_decode($configdata));
|
||||
if (empty($config)) {
|
||||
$config = new stdClass();
|
||||
}
|
||||
// Set array of used rss feeds
|
||||
$config->rssid = $feedsarr;
|
||||
// Serialize back the configdata
|
||||
|
||||
@@ -36,7 +36,11 @@ require_once($CFG->libdir.'/completionlib.php');
|
||||
class block_selfcompletion extends block_base {
|
||||
|
||||
public function init() {
|
||||
$this->title = get_string('pluginname', 'block_selfcompletion');
|
||||
$this->title = get_string('pluginname', 'block_selfcompletion');
|
||||
}
|
||||
|
||||
function applicable_formats() {
|
||||
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
|
||||
}
|
||||
|
||||
public function get_content() {
|
||||
|
||||
@@ -26,16 +26,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$capabilities = array(
|
||||
|
||||
'block/selfcompletion:myaddinstance' => array(
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_SYSTEM,
|
||||
'archetypes' => array(
|
||||
'user' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/my:manageblocks'
|
||||
),
|
||||
|
||||
'block/selfcompletion:addinstance' => array(
|
||||
'riskbitmask' => RISK_SPAM | RISK_XSS,
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* This file keeps track of upgrades to the self completion block
|
||||
*
|
||||
* Sometimes, changes between versions involve alterations to database structures
|
||||
* and other major things that may break installations.
|
||||
*
|
||||
* The upgrade function in this file will attempt to perform all the necessary
|
||||
* actions to upgrade your older installation to the current version.
|
||||
*
|
||||
* If there's something it cannot do itself, it will tell you what you need to do.
|
||||
*
|
||||
* The commands in here will all be database-neutral, using the methods of
|
||||
* database_manager class
|
||||
*
|
||||
* Please do not forget to use upgrade_set_timeout()
|
||||
* before any action that may take longer time to finish.
|
||||
*
|
||||
* @since 2.0
|
||||
* @package blocks
|
||||
* @copyright 2012 Mark Nelson <markn@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* Handles upgrading instances of this block.
|
||||
*
|
||||
* @param int $oldversion
|
||||
* @param object $block
|
||||
*/
|
||||
function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
|
||||
global $DB;
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2012112901) {
|
||||
// Get the instances of this block.
|
||||
if ($blocks = $DB->get_records('block_instances', array('blockname' => 'selfcompletion', 'pagetypepattern' => 'my-index'))) {
|
||||
// Loop through and remove them from the My Moodle page.
|
||||
foreach ($blocks as $block) {
|
||||
blocks_delete_instance($block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Savepoint reached.
|
||||
upgrade_block_savepoint(true, 2012112901, 'selfcompletion');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -28,4 +28,3 @@ $string['completecourse'] = 'Complete course';
|
||||
$string['pluginname'] = 'Self completion';
|
||||
$string['selfcompletionnotenabled'] = 'The self completion criteria has not been enabled for this course';
|
||||
$string['selfcompletion:addinstance'] = 'Add a new self completion block';
|
||||
$string['selfcompletion:myaddinstance'] = 'Add a new self completion block to the My Moodle page';
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2012112900; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
|
||||
$plugin->requires = 2012112900; // Requires this Moodle version
|
||||
$plugin->component = 'block_selfcompletion'; // Full name of the plugin (used for diagnostics)
|
||||
|
||||
@@ -62,5 +62,9 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class block_tags_edit_form extends block_edit_form {
|
||||
// Fields for editing HTML block title and contents.
|
||||
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
|
||||
|
||||
$mform->addElement('text', 'config_title', get_string('pluginname', 'block_tags'));
|
||||
$mform->addElement('text', 'config_title', get_string('configtitle', 'block_tags'));
|
||||
$mform->setType('config_title', PARAM_TEXT);
|
||||
$mform->setDefault('config_title', get_string('pluginname', 'block_tags'));
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
$string['add'] = 'Add';
|
||||
$string['alltags'] = 'All tags:';
|
||||
$string['arrowtitle'] = 'Click here to enter the suggested text (grey letters).';
|
||||
$string['configtitle'] = 'Block title';
|
||||
$string['coursetags'] = 'Course tags:';
|
||||
$string['disabledtags'] = 'Tags are disabled';
|
||||
$string['defaultdisplay'] = 'Tag type to display';
|
||||
|
||||
@@ -158,11 +158,23 @@ function blog_rss_get_params($filters) {
|
||||
function blog_rss_get_feed($context, $args) {
|
||||
global $CFG, $SITE, $DB;
|
||||
|
||||
if (empty($CFG->enableblogs)) {
|
||||
debugging('Blogging disabled on this site, RSS feeds are not available');
|
||||
return null;
|
||||
}
|
||||
|
||||
if (empty($CFG->enablerssfeeds)) {
|
||||
debugging('Sorry, RSS feeds are disabled on this site');
|
||||
return '';
|
||||
}
|
||||
|
||||
if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
|
||||
if (isguestuser()) {
|
||||
debugging(get_string('nopermissiontoshow','error'));
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
$sitecontext = context_system::instance();
|
||||
if (!has_capability('moodle/blog:view', $sitecontext)) {
|
||||
return null;
|
||||
|
||||
Vendored
+1
-1
@@ -750,7 +750,7 @@ class cache_definition {
|
||||
if (!empty($this->identifiers)) {
|
||||
$identifiers = array();
|
||||
foreach ($this->identifiers as $key => $value) {
|
||||
$identifiers[] = htmlentities($key).'='.htmlentities($value);
|
||||
$identifiers[] = htmlentities($key, ENT_QUOTES, 'UTF-8').'='.htmlentities($value, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
$this->keyprefixmulti['identifiers'] = join('&', $identifiers);
|
||||
}
|
||||
|
||||
Vendored
+4
@@ -1093,6 +1093,10 @@ class cache_application extends cache implements cache_loader_with_locking {
|
||||
$todelete = array();
|
||||
// Iterate the returned data for the events.
|
||||
foreach ($events as $event => $keys) {
|
||||
if ($keys === false) {
|
||||
// There are no keys.
|
||||
continue;
|
||||
}
|
||||
// Look at each key and check the timestamp.
|
||||
foreach ($keys as $key => $timestamp) {
|
||||
// If the timestamp of the event is more than or equal to the last invalidation (happened between the last
|
||||
|
||||
Vendored
+7
-1
@@ -101,7 +101,13 @@ class cachestore_addinstance_form extends moodleform {
|
||||
}
|
||||
|
||||
if (method_exists($this, 'configuration_validation')) {
|
||||
$errors = $this->configuration_validation($data, $files);
|
||||
$newerrors = $this->configuration_validation($data, $files, $errors);
|
||||
// We need to selectiviliy merge here
|
||||
foreach ($newerrors as $element => $error) {
|
||||
if (!array_key_exists($element, $errors)) {
|
||||
$errors[$element] = $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
|
||||
Vendored
+1
@@ -357,6 +357,7 @@ class cachestore_static extends static_data_store implements cache_is_key_aware
|
||||
*/
|
||||
public function purge() {
|
||||
$this->flush_store_by_id($this->storeid);
|
||||
$this->store = &self::register_store_id($this->storeid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -61,7 +61,7 @@ foreach (get_plugin_list_with_file('cachestore', 'lib.php', true) as $plugin =>
|
||||
$class = 'cachestore_'.$plugin;
|
||||
$plugin = get_string('pluginname', 'cachestore_'.$plugin);
|
||||
|
||||
if (!class_exists($class) || !method_exists($class, 'initialise_test_instance')) {
|
||||
if (!class_exists($class) || !method_exists($class, 'initialise_test_instance') || !$class::are_requirements_met()) {
|
||||
$applicationtable->data[] = array($plugin, $strinvalidplugin, '-', '-', '-', '-');
|
||||
$sessiontable->data[] = array($plugin, $strinvalidplugin, '-', '-', '-', '-');
|
||||
$requesttable->data[] = array($plugin, $strinvalidplugin, '-', '-', '-', '-');
|
||||
|
||||
@@ -2977,6 +2977,48 @@ function calendar_update_subscription_events($subscriptionid) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the user can edit a given subscription feed.
|
||||
*
|
||||
* @param mixed $subscriptionorid Subscription object or id
|
||||
* @return bool true if current user can edit the subscription else false
|
||||
*/
|
||||
function calendar_can_edit_subscription($subscriptionorid) {
|
||||
global $DB;
|
||||
|
||||
if (is_array($subscriptionorid)) {
|
||||
$subscription = (object)$subscriptionorid;
|
||||
} else if (is_object($subscriptionorid)) {
|
||||
$subscription = $subscriptionorid;
|
||||
} else {
|
||||
$subscription = $DB->get_record('event_subscriptions', array('id' => $subscriptionorid), '*', MUST_EXIST);
|
||||
}
|
||||
$allowed = new stdClass;
|
||||
$courseid = $subscription->courseid;
|
||||
$groupid = $subscription->groupid;
|
||||
calendar_get_allowed_types($allowed, $courseid);
|
||||
switch ($subscription->eventtype) {
|
||||
case 'user':
|
||||
return $allowed->user;
|
||||
case 'course':
|
||||
if (isset($allowed->courses[$courseid])) {
|
||||
return $allowed->courses[$courseid];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
case 'site':
|
||||
return $allowed->site;
|
||||
case 'group':
|
||||
if (isset($allowed->groups[$groupid])) {
|
||||
return $allowed->groups[$groupid];
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update calendar subscriptions.
|
||||
*
|
||||
|
||||
@@ -78,11 +78,15 @@ if (!empty($formdata)) {
|
||||
$importresults = calendar_update_subscription_events($subscriptionid);
|
||||
}
|
||||
// Redirect to prevent refresh issues.
|
||||
redirect($PAGE->url);
|
||||
redirect($PAGE->url, $importresults);
|
||||
} else if (!empty($subscriptionid)) {
|
||||
// The user is wanting to perform an action upon an existing subscription.
|
||||
require_sesskey(); // Must have sesskey for all actions.
|
||||
$importresults = calendar_process_subscription_row($subscriptionid, $pollinterval, $action);
|
||||
if (calendar_can_edit_subscription($subscriptionid)) {
|
||||
$importresults = calendar_process_subscription_row($subscriptionid, $pollinterval, $action);
|
||||
} else {
|
||||
print_error('nopermissions', 'error', $PAGE->url, get_string('managesubscriptions', 'calendar'));
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'SELECT *
|
||||
|
||||
@@ -736,6 +736,7 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
$table->head = array(
|
||||
get_string('colcalendar', 'calendar'),
|
||||
get_string('collastupdated', 'calendar'),
|
||||
get_string('eventkind', 'calendar'),
|
||||
get_string('colpoll', 'calendar'),
|
||||
get_string('colactions', 'calendar')
|
||||
);
|
||||
@@ -762,10 +763,12 @@ class core_calendar_renderer extends plugin_renderer_base {
|
||||
|
||||
$cell = new html_table_cell($this->subscription_action_form($sub, $courseid));
|
||||
$cell->colspan = 2;
|
||||
$type = $sub->eventtype . 'events';
|
||||
|
||||
$table->data[] = new html_table_row(array(
|
||||
new html_table_cell($label),
|
||||
new html_table_cell($lastupdated),
|
||||
new html_table_cell(get_string($type, 'calendar')),
|
||||
$cell
|
||||
));
|
||||
}
|
||||
|
||||
+4
-2
@@ -101,8 +101,10 @@ YUI.add('moodle-calendar-eventmanager', function(Y) {
|
||||
},
|
||||
node : {
|
||||
setter : function(node) {
|
||||
var n = Y.one('#'+node);
|
||||
return n;
|
||||
if (typeof(node) === 'string') {
|
||||
node = Y.one('#'+node);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
},
|
||||
title : {
|
||||
|
||||
+1
-1
@@ -184,7 +184,7 @@ bodyContent: '<div class="comment-delete-confirm"><a href="#" id="confirmdelete-
|
||||
val = val.replace('___name___', list[i].fullname);
|
||||
}
|
||||
if (list[i]['delete']||newcmt) {
|
||||
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
list[i].content = '<div class="comment-delete"><a href="#" id ="comment-delete-'+this.client_id+'-'+list[i].id+'" title="'+M.str.moodle.deletecomment+'"><img alt="" src="'+M.util.image_url('t/delete', 'core')+'" /></a></div>' + list[i].content;
|
||||
}
|
||||
val = val.replace('___time___', list[i].time);
|
||||
val = val.replace('___picture___', list[i].avatar);
|
||||
|
||||
@@ -38,7 +38,7 @@ $action = optional_param('action', '', PARAM_ALPHA);
|
||||
$area = optional_param('area', '', PARAM_AREA);
|
||||
$content = optional_param('content', '', PARAM_RAW);
|
||||
$itemid = optional_param('itemid', '', PARAM_INT);
|
||||
$returnurl = optional_param('returnurl', '/', PARAM_URL);
|
||||
$returnurl = optional_param('returnurl', '/', PARAM_LOCALURL);
|
||||
$component = optional_param('component', '', PARAM_COMPONENT);
|
||||
|
||||
// Currently this script can only add comments
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"require": {
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "3.7.*",
|
||||
"phpunit/dbUnit": "1.2.*"
|
||||
}
|
||||
|
||||
@@ -191,6 +191,7 @@ if ($editingon && can_edit_in_category()) {
|
||||
// Integrate into the admin tree only if the user can edit categories at the top level,
|
||||
// otherwise the admin block does not appear to this user, and you get an error.
|
||||
require_once($CFG->libdir . '/adminlib.php');
|
||||
navigation_node::override_active_url(new moodle_url('/course/category.php', array('id' => $id)));
|
||||
admin_externalpage_setup('coursemgmt', '', $urlparams, $CFG->wwwroot . '/course/category.php');
|
||||
$PAGE->set_context($context); // Ensure that we are actually showing blocks etc for the cat context
|
||||
|
||||
|
||||
+8
-8
@@ -442,6 +442,7 @@ M.course_dndupload = {
|
||||
parent: modsel,
|
||||
li: document.createElement('li'),
|
||||
div: document.createElement('div'),
|
||||
indentdiv: document.createElement('div'),
|
||||
a: document.createElement('a'),
|
||||
icon: document.createElement('img'),
|
||||
namespan: document.createElement('span'),
|
||||
@@ -452,24 +453,23 @@ M.course_dndupload = {
|
||||
|
||||
resel.li.className = 'activity resource modtype_resource';
|
||||
|
||||
resel.div.className = 'mod-indent';
|
||||
resel.li.appendChild(resel.div);
|
||||
resel.indentdiv.className = 'mod-indent';
|
||||
resel.li.appendChild(resel.indentdiv);
|
||||
|
||||
resel.div.className = 'activityinstance';
|
||||
resel.indentdiv.appendChild(resel.div);
|
||||
|
||||
resel.a.href = '#';
|
||||
resel.div.appendChild(resel.a);
|
||||
|
||||
resel.icon.src = M.util.image_url('i/ajaxloader');
|
||||
resel.icon.className = 'activityicon';
|
||||
resel.icon.className = 'activityicon iconlarge';
|
||||
resel.a.appendChild(resel.icon);
|
||||
|
||||
resel.a.appendChild(document.createTextNode(' '));
|
||||
|
||||
resel.namespan.className = 'instancename';
|
||||
resel.namespan.innerHTML = name;
|
||||
resel.a.appendChild(resel.namespan);
|
||||
|
||||
resel.div.appendChild(document.createTextNode(' '));
|
||||
|
||||
resel.groupingspan.className = 'groupinglabel';
|
||||
resel.div.appendChild(resel.groupingspan);
|
||||
|
||||
@@ -738,7 +738,7 @@ M.course_dndupload = {
|
||||
|
||||
resel.div.removeChild(resel.progressouter);
|
||||
resel.li.id = result.elementid;
|
||||
resel.div.innerHTML += result.commands;
|
||||
resel.indentdiv.innerHTML += result.commands;
|
||||
if (result.onclick) {
|
||||
resel.a.onclick = result.onclick;
|
||||
}
|
||||
|
||||
@@ -555,6 +555,15 @@ class dndupload_ajax_processor {
|
||||
$this->cm->groupmode = $this->course->groupmode;
|
||||
$this->cm->groupingid = $this->course->defaultgroupingid;
|
||||
|
||||
// Set the correct default for completion tracking.
|
||||
$this->cm->completion = COMPLETION_TRACKING_NONE;
|
||||
$completion = new completion_info($this->course);
|
||||
if ($completion->is_enabled()) {
|
||||
if (plugin_supports('mod', $this->cm->modulename, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) {
|
||||
$this->cm->completion = COMPLETION_TRACKING_MANUAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->cm->id = add_course_module($this->cm)) {
|
||||
throw new coding_exception("Unable to create the course module");
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ class core_course_external extends external_api {
|
||||
array(
|
||||
'id' => new external_value(PARAM_INT, 'activity id'),
|
||||
'url' => new external_value(PARAM_URL, 'activity url', VALUE_OPTIONAL),
|
||||
'name' => new external_value(PARAM_TEXT, 'activity module name'),
|
||||
'name' => new external_value(PARAM_RAW, 'activity module name'),
|
||||
'description' => new external_value(PARAM_RAW, 'activity description', VALUE_OPTIONAL),
|
||||
'visible' => new external_value(PARAM_INT, 'is the module visible', VALUE_OPTIONAL),
|
||||
'modicon' => new external_value(PARAM_URL, 'activity icon url'),
|
||||
|
||||
+44
-28
@@ -594,7 +594,7 @@ function print_log_csv($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -665,7 +665,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
|
||||
// Creating worksheets
|
||||
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
|
||||
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
|
||||
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber]->set_column(1, 1, 30);
|
||||
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
|
||||
userdate(time(), $strftimedatetime));
|
||||
@@ -694,7 +694,7 @@ function print_log_xls($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -779,7 +779,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
|
||||
// Creating worksheets
|
||||
for ($wsnumber = 1; $wsnumber <= $nroPages; $wsnumber++) {
|
||||
$sheettitle = get_string('logs').' '.$wsnumber.'-'.$nroPages;
|
||||
$worksheet[$wsnumber] =& $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber] = $workbook->add_worksheet($sheettitle);
|
||||
$worksheet[$wsnumber]->set_column(1, 1, 30);
|
||||
$worksheet[$wsnumber]->write_string(0, 0, get_string('savedat').
|
||||
userdate(time(), $strftimedatetime));
|
||||
@@ -808,7 +808,7 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
|
||||
$ld = $DB->get_record('log_display', array('module'=>$log->module, 'action'=>$log->action));
|
||||
$ldcache[$log->module][$log->action] = $ld;
|
||||
}
|
||||
if ($ld && !empty($log->info)) {
|
||||
if ($ld && is_numeric($log->info)) {
|
||||
// ugly hack to make sure fullname is shown correctly
|
||||
if (($ld->mtable == 'user') and ($ld->field == $DB->sql_concat('firstname', "' '" , 'lastname'))) {
|
||||
$log->info = fullname($DB->get_record($ld->mtable, array('id'=>$log->info)), true);
|
||||
@@ -1516,8 +1516,9 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
$textcss = '';
|
||||
}
|
||||
|
||||
// Get on-click attribute value if specified
|
||||
$onclick = $mod->get_on_click();
|
||||
// Get on-click attribute value if specified and decode the onclick - it
|
||||
// has already been encoded for display (puke).
|
||||
$onclick = htmlspecialchars_decode($mod->get_on_click(), ENT_QUOTES);
|
||||
|
||||
$groupinglabel = '';
|
||||
if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', context_course::instance($course->id))) {
|
||||
@@ -1656,14 +1657,25 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
} else {
|
||||
$extraclass = '';
|
||||
}
|
||||
echo "
|
||||
<form class='togglecompletion$extraclass' method='post' action='".$CFG->wwwroot."/course/togglecompletion.php'><div>
|
||||
<input type='hidden' name='id' value='{$mod->id}' />
|
||||
<input type='hidden' name='modulename' value='".s($mod->name)."' />
|
||||
<input type='hidden' name='sesskey' value='".sesskey()."' />
|
||||
<input type='hidden' name='completionstate' value='$newstate' />
|
||||
<input type='image' src='$imgsrc' alt='$imgalt' title='$imgtitle' />
|
||||
</div></form>";
|
||||
echo html_writer::start_tag('form', array(
|
||||
'class' => 'togglecompletion' . $extraclass,
|
||||
'method' => 'post',
|
||||
'action' => $CFG->wwwroot . '/course/togglecompletion.php'));
|
||||
echo html_writer::start_tag('div');
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'hidden', 'name' => 'id', 'value' => $mod->id));
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'hidden', 'name' => 'modulename',
|
||||
'value' => $mod->name));
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'hidden', 'name' => 'completionstate',
|
||||
'value' => $newstate));
|
||||
echo html_writer::empty_tag('input', array(
|
||||
'type' => 'image', 'src' => $imgsrc, 'alt' => $imgalt, 'title' => $imgtitle));
|
||||
echo html_writer::end_tag('div');
|
||||
echo html_writer::end_tag('form');
|
||||
} else {
|
||||
// In auto mode, or when editing, the icon is just an image
|
||||
echo "<span class='autocompletion'>";
|
||||
@@ -1683,17 +1695,20 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||
if (!$mod->uservisible) {
|
||||
echo '<div class="availabilityinfo">'.$mod->availableinfo.'</div>';
|
||||
} else if ($canviewhidden && !empty($CFG->enableavailability)) {
|
||||
$visibilityclass = '';
|
||||
if (!$mod->visible) {
|
||||
$visibilityclass = 'accesshide';
|
||||
}
|
||||
$ci = new condition_info($mod);
|
||||
$fullinfo = $ci->get_full_information();
|
||||
if($fullinfo) {
|
||||
echo '<div class="availabilityinfo '.$visibilityclass.'">'.get_string($mod->showavailability
|
||||
? 'userrestriction_visible'
|
||||
: 'userrestriction_hidden','condition',
|
||||
$fullinfo).'</div>';
|
||||
// Don't add availability information if user is not editing and activity is hidden.
|
||||
if ($mod->visible || $PAGE->user_is_editing()) {
|
||||
$hidinfoclass = '';
|
||||
if (!$mod->visible) {
|
||||
$hidinfoclass = 'hide';
|
||||
}
|
||||
$ci = new condition_info($mod);
|
||||
$fullinfo = $ci->get_full_information();
|
||||
if($fullinfo) {
|
||||
echo '<div class="availabilityinfo '.$hidinfoclass.'">'.get_string($mod->showavailability
|
||||
? 'userrestriction_visible'
|
||||
: 'userrestriction_hidden','condition',
|
||||
$fullinfo).'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1830,7 +1845,7 @@ function print_section_add_menus($course, $section, $modnames = null, $vertical=
|
||||
// The module chooser link
|
||||
$modchooser = html_writer::start_tag('div', array('class' => 'mdl-right'));
|
||||
$modchooser.= html_writer::start_tag('div', array('class' => 'section-modchooser'));
|
||||
$icon = $OUTPUT->pix_icon('t/add', $straddeither);
|
||||
$icon = $OUTPUT->pix_icon('t/add', '');
|
||||
$span = html_writer::tag('span', $straddeither, array('class' => 'section-modchooser-text'));
|
||||
$modchooser .= html_writer::tag('span', $icon . $span, array('class' => 'section-modchooser-link'));
|
||||
$modchooser.= html_writer::end_tag('div');
|
||||
@@ -4493,6 +4508,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
|
||||
'courseid' => $course->id,
|
||||
'pagetype' => $PAGE->pagetype,
|
||||
'pagelayout' => $PAGE->pagelayout,
|
||||
'subpage' => $PAGE->subpage,
|
||||
'regions' => $PAGE->blocks->get_regions(),
|
||||
);
|
||||
$PAGE->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
|
||||
@@ -4535,7 +4551,7 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
|
||||
// Add the module chooser
|
||||
$PAGE->requires->yui_module('moodle-course-modchooser',
|
||||
'M.course.init_chooser',
|
||||
array(array('courseid' => $course->id))
|
||||
array(array('courseid' => $course->id, 'closeButtonTitle' => get_string('close', 'editor')))
|
||||
);
|
||||
$PAGE->requires->strings_for_js(array(
|
||||
'addresourceoractivity',
|
||||
|
||||
@@ -78,7 +78,7 @@ if ($backup->get_stage() !== backup_ui::STAGE_COMPLETE) {
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('publishcourseon', 'hub', !empty($hubname)?$hubname:$huburl), 3, 'main');
|
||||
if ($backup->enforce_changed_dependencies()) {
|
||||
echo $renderer->dependency_notification(get_string('dependenciesenforced', 'backup'));
|
||||
debugging('Your settings have been altered due to unmet dependencies', DEBUG_DEVELOPER);
|
||||
}
|
||||
echo $renderer->progress_bar($backup->get_progress_bar());
|
||||
echo $backup->display($renderer);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user