Skip to content

Commit

Permalink
Merge branch 'MOODLE_26_STABLE' into install_26_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
AMOS bot committed Apr 23, 2014
2 parents 20b0dd3 + 0afcad7 commit 9ae6b73
Show file tree
Hide file tree
Showing 36 changed files with 252 additions and 69 deletions.
2 changes: 2 additions & 0 deletions auth/shibboleth/index.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@


require('../../config.php'); require('../../config.php');


$context = context_system::instance();
$PAGE->set_url('/auth/shibboleth/index.php'); $PAGE->set_url('/auth/shibboleth/index.php');
$PAGE->set_context($context);


// Support for WAYFless URLs. // Support for WAYFless URLs.
$target = optional_param('target', '', PARAM_LOCALURL); $target = optional_param('target', '', PARAM_LOCALURL);
Expand Down
8 changes: 4 additions & 4 deletions backup/util/ui/renderer.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ public function backup_details_nonstandard($nextstageurl, array $details) {
*/ */
public function backup_details_unknown(moodle_url $nextstageurl) { public function backup_details_unknown(moodle_url $nextstageurl) {


$html = html_writer::start_tag('div', array('class' => 'unknownformat')); $html = html_writer::start_div('unknownformat');
$html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2, 'notifyproblem'); $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2);
$html .= html_writer::tag('div', get_string('errorinvalidformatinfo', 'backup'), array('class' => 'notifyproblem')); $html .= $this->output->notification(get_string('errorinvalidformatinfo', 'backup'), 'notifyproblem');
$html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post'); $html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post');
$html .= html_writer::end_tag('div'); $html .= html_writer::end_div();


return $html; return $html;
} }
Expand Down
3 changes: 2 additions & 1 deletion blocks/mentees/block_mentees.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function get_content() {
$this->content = new stdClass(); $this->content = new stdClass();


// get all the mentees, i.e. users you have a direct assignment to // get all the mentees, i.e. users you have a direct assignment to
if ($usercontexts = $DB->get_records_sql("SELECT c.instanceid, c.instanceid, u.firstname, u.lastname $allusernames = get_all_user_name_fields(true, 'u');
if ($usercontexts = $DB->get_records_sql("SELECT c.instanceid, c.instanceid, $allusernames
FROM {role_assignments} ra, {context} c, {user} u FROM {role_assignments} ra, {context} c, {user} u
WHERE ra.userid = ? WHERE ra.userid = ?
AND ra.contextid = c.id AND ra.contextid = c.id
Expand Down
2 changes: 1 addition & 1 deletion grade/import/xml/lib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function import_xml_grades($text, $course, &$error) {
$newgrade->importer = $USER->id; $newgrade->importer = $USER->id;


// check grade value exists and is a numeric grade // check grade value exists and is a numeric grade
if (isset($result['#']['score'][0]['#'])) { if (isset($result['#']['score'][0]['#']) && $result['#']['score'][0]['#'] !== '-') {
if (is_numeric($result['#']['score'][0]['#'])) { if (is_numeric($result['#']['score'][0]['#'])) {
$newgrade->finalgrade = $result['#']['score'][0]['#']; $newgrade->finalgrade = $result['#']['score'][0]['#'];
} else { } else {
Expand Down
6 changes: 3 additions & 3 deletions lang/en/badges.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@
$string['backpackavailability'] = 'External badge verification'; $string['backpackavailability'] = 'External badge verification';
$string['backpackavailability_help'] = 'For badge recipients to be able to prove they earned their badges from you, an external backpack service should be able to access your site and verify badges issued from it. Your site does not currently appear to be accessible, which means that badges you have already issued or will issue in the future cannot be verified. $string['backpackavailability_help'] = 'For badge recipients to be able to prove they earned their badges from you, an external backpack service should be able to access your site and verify badges issued from it. Your site does not currently appear to be accessible, which means that badges you have already issued or will issue in the future cannot be verified.
##Why am I seeing this message? **Why am I seeing this message?**
It may be that your firewall prevents access from users outside your network, your site is password protected, or you are running the site on a computer that is not available from the Internet (such as a local development machine). It may be that your firewall prevents access from users outside your network, your site is password protected, or you are running the site on a computer that is not available from the Internet (such as a local development machine).
##Is this a problem? **Is this a problem?**
You should fix this issue on any production site where you are planning to issue badges, otherwise the recipients will not be able to prove they earned their badges from you. If your site is not yet live you can create and issue test badges, as long as the site is accessible before you go live. You should fix this issue on any production site where you are planning to issue badges, otherwise the recipients will not be able to prove they earned their badges from you. If your site is not yet live you can create and issue test badges, as long as the site is accessible before you go live.
##What if I can\'t make my whole site publicly accessible? **What if I can\'t make my whole site publicly accessible?**
The only URL required for verification is [your-site-url]/badges/assertion.php so if you are able to modify your firewall to allow external access to that file, badge verification will still work.'; The only URL required for verification is [your-site-url]/badges/assertion.php so if you are able to modify your firewall to allow external access to that file, badge verification will still work.';
$string['backpackbadges'] = 'You have {$a->totalbadges} badge(s) displayed from {$a->totalcollections} collection(s). <a href="mybackpack.php">Change backpack settings</a>.'; $string['backpackbadges'] = 'You have {$a->totalbadges} badge(s) displayed from {$a->totalcollections} collection(s). <a href="mybackpack.php">Change backpack settings</a>.';
Expand Down
2 changes: 2 additions & 0 deletions lib/alfresco/README_MOODLE.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- AlfrescoWebService::__soapCall() arguments do not match SoapClient::__soapCall() - AlfrescoWebService::__soapCall() arguments do not match SoapClient::__soapCall()
- AlfrescoWebService::__doRequest() arguments do not match SoapClient::__soapCall() - AlfrescoWebService::__doRequest() arguments do not match SoapClient::__soapCall()


6. Apply the changes from MDL-41975 in regard with the timestamp

== Alfresco PHP Library == == Alfresco PHP Library ==


Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki. Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki.
Expand Down
4 changes: 2 additions & 2 deletions lib/alfresco/Service/WebService/AlfrescoWebService.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0


// Construct Timestamp Header // Construct Timestamp Header
$timeStamp = $dom->createElementNS($this->wsUtilityNS, "Timestamp"); $timeStamp = $dom->createElementNS($this->wsUtilityNS, "Timestamp");
$createdDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+24, date("i"), date("s"), date("m"), date("d"), date("Y"))); $createdDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H"), gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
$expiresDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+25, date("i"), date("s"), date("m"), date("d"), date("Y"))); $expiresDate = gmdate("Y-m-d\TH:i:s\Z", gmmktime(gmdate("H")+1, gmdate("i"), gmdate("s"), gmdate("m"), gmdate("d"), gmdate("Y")));
$created = new DOMElement("Created", $createdDate, $this->wsUtilityNS); $created = new DOMElement("Created", $createdDate, $this->wsUtilityNS);
$expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS); $expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS);
$timeStamp->appendChild($created); $timeStamp->appendChild($created);
Expand Down
7 changes: 6 additions & 1 deletion lib/blocklib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ public function add_fake_block($bc, $region) {
if (!isset($bc->attributes['data-block'])) { if (!isset($bc->attributes['data-block'])) {
$bc->attributes['data-block'] = '_fake'; $bc->attributes['data-block'] = '_fake';
} }
$bc->attributes['class'] .= ' block_fake';
$this->extracontent[$region][] = $bc; $this->extracontent[$region][] = $bc;
} }


Expand Down Expand Up @@ -518,7 +519,11 @@ public function region_completely_docked($region, $output) {


$this->check_is_loaded(); $this->check_is_loaded();
$this->ensure_content_created($region, $output); $this->ensure_content_created($region, $output);
foreach($this->visibleblockcontent[$region] as $instance) { if (!$this->region_has_content($region, $output)) {
// If the region has no content then nothing is docked at all of course.
return false;
}
foreach ($this->visibleblockcontent[$region] as $instance) {
if (!empty($instance->content) && !get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) { if (!empty($instance->content) && !get_user_preferences('docked_block_instance_'.$instance->blockinstanceid, 0)) {
return false; return false;
} }
Expand Down
1 change: 1 addition & 0 deletions lib/filelib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1559,6 +1559,7 @@ function &get_mimetypes_array() {
'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'), 'webm' => array ('type'=>'video/webm', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'),
'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), 'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), 'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'),
'wma' => array ('type'=>'audio/x-ms-wma', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'),


'xbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'), 'xbk' => array ('type'=>'application/x-smarttech-notebook', 'icon'=>'archive'),
'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
Expand Down
5 changes: 4 additions & 1 deletion lib/form/dndupload.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@ M.form_dndupload.init = function(Y, options) {
* @return boolean true if event has files * @return boolean true if event has files
*/ */
has_files: function(e) { has_files: function(e) {
var types = e._event.dataTransfer.types; // In some browsers, dataTransfer.types may be null for a
// 'dragover' event, so ensure a valid Array is always
// inspected.
var types = e._event.dataTransfer.types || [];
for (var i=0; i<types.length; i++) { for (var i=0; i<types.length; i++) {
if (types[i] == 'Files') { if (types[i] == 'Files') {
return true; return true;
Expand Down
4 changes: 2 additions & 2 deletions lib/weblib.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2920,7 +2920,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (!$backtrace) { if (!$backtrace) {
$backtrace = debug_backtrace(); $backtrace = debug_backtrace();
} }
$from = format_backtrace($backtrace, CLI_SCRIPT); $from = format_backtrace($backtrace, CLI_SCRIPT || NO_DEBUG_DISPLAY);
if (PHPUNIT_TEST) { if (PHPUNIT_TEST) {
if (phpunit_util::debugging_triggered($message, $level, $from)) { if (phpunit_util::debugging_triggered($message, $level, $from)) {
// We are inside test, the debug message was logged. // We are inside test, the debug message was logged.
Expand All @@ -2931,7 +2931,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (NO_DEBUG_DISPLAY) { if (NO_DEBUG_DISPLAY) {
// Script does not want any errors or debugging in output, // Script does not want any errors or debugging in output,
// we send the info to error log instead. // we send the info to error log instead.
error_log('Debugging: ' . $message . $from); error_log('Debugging: ' . $message . ' in '. PHP_EOL . $from);


} else if ($forcedebug or $CFG->debugdisplay) { } else if ($forcedebug or $CFG->debugdisplay) {
if (!defined('DEBUGGING_PRINTED')) { if (!defined('DEBUGGING_PRINTED')) {
Expand Down
29 changes: 21 additions & 8 deletions lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size(); var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size(); var allregions = Y.all('.block-region').size();
this._isusingnewblocksmethod = (allregions === goodregions); this._isusingnewblocksmethod = (allregions === goodregions);
if (goodregions > 0 && allregions > 0) { if (goodregions > 0 && allregions > 0 && goodregions !== allregions) {
Y.log('Both core_renderer::blocks and core_renderer::blocks_for_region have been used.', 'warn', 'moodle-core_blocks'); Y.log('Both core_renderer::blocks and core_renderer::blocks_for_region have been used.', 'warn', 'moodle-core_blocks');
} }
} }
Expand Down Expand Up @@ -455,7 +455,6 @@ MANAGER.prototype = {
i = 0, i = 0,
region, region,
regionname, regionname,
droptarget,
dragdelegation; dragdelegation;


// Evil required by M.core.dragdrop. // Evil required by M.core.dragdrop.
Expand Down Expand Up @@ -484,7 +483,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty) // Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one) // The region-post (the right one)
// is very narrow, so add extra padding on the left to drop block on it. // is very narrow, so add extra padding on the left to drop block on it.
droptarget = new Y.DD.Drop({ new Y.DD.Drop({
node: region.get_droptarget(), node: region.get_droptarget(),
groups: this.groups, groups: this.groups,
padding: '40 240 40 240' padding: '40 240 40 240'
Expand All @@ -496,17 +495,18 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK, nodes: '.'+CSS.BLOCK,
target: true, target: true,
handles: [SELECTOR.DRAGHANDLE], handles: [SELECTOR.DRAGHANDLE],
invalid: '.block-hider-hide, .block-hider-show, .moveto', invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups} dragConfig: {groups: this.groups}
}); });
dragdelegation.dd.plug(Y.Plugin.DDProxy, { dragdelegation.dd.plug(Y.Plugin.DDProxy, {
// Don't move the node at the end of the drag // Don't move the node at the end of the drag
moveOnEnd: false moveOnEnd: false
}); });
dragdelegation.dd.plug(Y.Plugin.DDWinScroll); dragdelegation.dd.plug(Y.Plugin.DDWinScroll);
// On the mouse down event we will enable all block regions so that they can be dragged to.
// This is VERY important as without it dnd won't work for empty block regions. // On the DD Manager start operation, we enable all block regions so that they can be drop targets. This
dragdelegation.on('drag:mouseDown', this.enable_all_regions, this); // must be done *before* drag:start but after dragging has been initialised.
Y.DD.DDM.on('ddm:start', this.enable_all_regions, this);


region.change_block_move_icons(this); region.change_block_move_icons(this);
} }
Expand Down Expand Up @@ -548,12 +548,25 @@ MANAGER.prototype = {


/** /**
* Enables all fo the regions so that they are all visible while dragging is occuring. * Enables all fo the regions so that they are all visible while dragging is occuring.
*
* @method enable_all_regions * @method enable_all_regions
* @returns {undefined} * @returns {undefined}
*/ */
enable_all_regions : function() { enable_all_regions : function() {
var i = 0; var groups = Y.DD.DDM.activeDrag.get('groups');

// As we're called by Y.DD.DDM, we can't be certain that the call
// relates specifically to a block drag/drop operation. Test
// whether the relevant group applies here.
if (!groups || Y.Array.indexOf(groups, 'block') === -1) {
return;
}

var i;
for (i in this.regionobjects) { for (i in this.regionobjects) {
if (!this.regionobjects.hasOwnProperty(i)) {
continue;
}
this.regionobjects[i].enable(); this.regionobjects[i].enable();
} }
}, },
Expand Down
Loading

0 comments on commit 9ae6b73

Please sign in to comment.