Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MOODLE_25_STABLE' into install_25_STABLE

  • Loading branch information...
commit 035b6840d98e63ea058e20db2451958085caff3c 2 parents 5db57bd + 689f9aa
AMOS bot authored
Showing with 230 additions and 60 deletions.
  1. +2 −0  auth/shibboleth/index.php
  2. +4 −4 backup/util/ui/renderer.php
  3. +1 −1  grade/import/xml/lib.php
  4. +3 −3 lang/en/badges.php
  5. +2 −0  lib/alfresco/README_MOODLE.txt
  6. +2 −2 lib/alfresco/Service/WebService/AlfrescoWebService.php
  7. +6 −1 lib/blocklib.php
  8. +1 −0  lib/filelib.php
  9. +4 −1 lib/form/dndupload.js
  10. +2 −2 lib/weblib.php
  11. +23 −9 lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
  12. +2 −2 lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js
  13. +23 −9 lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
  14. +1 −1  lib/yui/src/blocks/js/blocks.js
  15. +21 −8 lib/yui/src/blocks/js/manager.js
  16. +2 −2 mod/chat/lib.php
  17. +70 −0 mod/wiki/tests/behat/edit_tags.feature
  18. +42 −0 my/tests/behat/restrict_available_blocks.feature
  19. +3 −0  report/completion/styles.css
  20. +1 −0  report/progress/styles.css
  21. +1 −1  repository/alfresco/lang/en/repository_alfresco.php
  22. +1 −1  user/filters/courserole.php
  23. +2 −2 user/profile/definelib.php
  24. +7 −7 user/profile/index.php
  25. +2 −2 user/profile/index_category_form.php
  26. +2 −2 version.php
View
2  auth/shibboleth/index.php
@@ -4,7 +4,9 @@
require('../../config.php');
+ $context = context_system::instance();
$PAGE->set_url('/auth/shibboleth/index.php');
+ $PAGE->set_context($context);
// Support for WAYFless URLs.
$target = optional_param('target', '', PARAM_LOCALURL);
View
8 backup/util/ui/renderer.php
@@ -203,11 +203,11 @@ public function backup_details_nonstandard($nextstageurl, array $details) {
*/
public function backup_details_unknown(moodle_url $nextstageurl) {
- $html = html_writer::start_tag('div', array('class' => 'unknownformat'));
- $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2, 'notifyproblem');
- $html .= html_writer::tag('div', get_string('errorinvalidformatinfo', 'backup'), array('class' => 'notifyproblem'));
+ $html = html_writer::start_div('unknownformat');
+ $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2);
+ $html .= $this->output->notification(get_string('errorinvalidformatinfo', 'backup'), 'notifyproblem');
$html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post');
- $html .= html_writer::end_tag('div');
+ $html .= html_writer::end_div();
return $html;
}
View
2  grade/import/xml/lib.php
@@ -82,7 +82,7 @@ function import_xml_grades($text, $course, &$error) {
$newgrade->importer = $USER->id;
// 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]['#'])) {
$newgrade->finalgrade = $result['#']['score'][0]['#'];
} else {
View
6 lang/en/badges.php
@@ -64,15 +64,15 @@
$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.
-##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).
-##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.
-##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.';
$string['backpackbadges'] = 'You have {$a->totalbadges} badge(s) displayed from {$a->totalcollections} collection(s). <a href="mybackpack.php">Change backpack settings</a>.';
View
2  lib/alfresco/README_MOODLE.txt
@@ -34,6 +34,8 @@
- AlfrescoWebService::__soapCall() 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 ==
Installation and developer documentation for the Alfresco PHP Library can be found on the Alfresco Wiki.
View
4 lib/alfresco/Service/WebService/AlfrescoWebService.php
@@ -79,8 +79,8 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0
// Construct Timestamp Header
$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")));
- $expiresDate = date("Y-m-d\TH:i:s\Z", mktime(date("H")+25, 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 = 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);
$expires = new DOMElement("Expires", $expiresDate, $this->wsUtilityNS);
$timeStamp->appendChild($created);
View
7 lib/blocklib.php
@@ -478,6 +478,7 @@ public function add_fake_block($bc, $region) {
throw new coding_exception('block_manager has already prepared the blocks in region ' .
$region . 'for output. It is too late to add a fake block.');
}
+ $bc->attributes['class'] .= ' block_fake';
$this->extracontent[$region][] = $bc;
}
@@ -515,7 +516,11 @@ public function region_completely_docked($region, $output) {
$this->check_is_loaded();
$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)) {
return false;
}
View
1  lib/filelib.php
@@ -1603,6 +1603,7 @@ function &get_mimetypes_array() {
'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'),
'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'),
'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'),
View
5 lib/form/dndupload.js
@@ -355,7 +355,10 @@ M.form_dndupload.init = function(Y, options) {
* @return boolean true if event has files
*/
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++) {
if (types[i] == 'Files') {
return true;
View
4 lib/weblib.php
@@ -2810,7 +2810,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (!$backtrace) {
$backtrace = debug_backtrace();
}
- $from = format_backtrace($backtrace, CLI_SCRIPT);
+ $from = format_backtrace($backtrace, CLI_SCRIPT || NO_DEBUG_DISPLAY);
if (PHPUNIT_TEST) {
if (phpunit_util::debugging_triggered($message, $level, $from)) {
// We are inside test, the debug message was logged.
@@ -2821,7 +2821,7 @@ function debugging($message = '', $level = DEBUG_NORMAL, $backtrace = null) {
if (NO_DEBUG_DISPLAY) {
// script does not want any errors or debugging in output,
// 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) {
if (!defined('DEBUGGING_PRINTED')) {
View
32 lib/yui/build/moodle-core-blocks/moodle-core-blocks-debug.js
@@ -359,7 +359,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
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');
}
}
@@ -451,7 +451,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
- droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -480,7 +479,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// 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(),
groups: this.groups,
padding: '40 240 40 240'
@@ -492,7 +491,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
- invalid: '.block-hider-hide, .block-hider-show, .moveto',
+ invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -500,9 +499,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
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.
- dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
+
+ // On the DD Manager start operation, we enable all block regions so that they can be drop targets. 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.remove_block_move_icons();
}
@@ -544,12 +544,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
+ *
* @method enable_all_regions
* @returns {undefined}
*/
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) {
+ if (!this.regionobjects.hasOwnProperty(i)) {
+ continue;
+ }
this.regionobjects[i].enable();
}
},
@@ -783,7 +796,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
-});/**
+});
+/**
* This file contains the Block Region class used by the drag and drop manager.
*
* Provides drag and drop functionality for blocks.
View
4 lib/yui/build/moodle-core-blocks/moodle-core-blocks-min.js
@@ -1,2 +1,2 @@
-YUI.add("moodle-core-blocks",function(e,t){var n="/lib/ajax/blocks.php",r={BLOCK:"block",BLOCKREGION:"block-region",BLOCKADMINBLOCK:"block_adminblock",EDITINGMOVE:"editing_move",HEADER:"header",LIGHTBOX:"lightbox",REGIONCONTENT:"region-content",SKIPBLOCK:"skip-block",SKIPBLOCKTO:"skip-block-to",MYINDEX:"page-my-index",REGIONMAIN:"region-main",BLOCKSMOVING:"blocks-moving"},i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.dragdrop,{skipnodetop:null,skipnodebottom:null,dragsourceregion:null,initializer:function(){this.groups=["block"],this.samenodeclass=r.BLOCK,this.parentnodeclass=r.REGIONCONTENT;var t=e.Node.all("body#"+r.MYINDEX+" #"+r.REGIONMAIN+" > ."+r.REGIONCONTENT);if(t.size()>0){var n=t.item(0);n.addClass(r.BLOCKREGION),n.set("id",r.REGIONCONTENT),n.one("div").addClass(r.REGIONCONTENT)}var i=e.Node.all("div."+r.BLOCKREGION);if(i.size()===0)return!1;if(i.size()!==this.get("regions").length){var s=e.Node.create("<div></div>").addClass(r.BLOCKREGION),o=e.Node.create("<div></div>").addClass(r.REGIONCONTENT);s.appendChild(o);var u=i.filter("#region-pre"),a=i.filter("#region-post");u.size()===0&&a.size()===1?(s.setAttrs({id:"region-pre"}),a.item(0).insert(s,"before"),i.unshift(s)):a.size()===0&&u.size()===1&&(s.setAttrs({id:"region-post"}),u.item(0).insert(s,"after"),i.push(s))}i.each(function(t){new e.DD.Drop({node:t.one("div."+r.REGIONCONTENT),groups:this.groups,padding:"40 240 40 240"});var n=new e.DD.Delegate({container:t,nodes:"."+r.BLOCK,target:!0,handles:["."+r.HEADER],invalid:".block-hider-hide, .block-hider-show, .moveto",dragConfig:{groups:this.groups}});n.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1}),n.dd.plug(e.Plugin.DDWinScroll);var i=t.all("."+r.BLOCK);i.each(function(e){var t=e.one("a."+r.EDITINGMOVE);t&&(t.remove(),e.one("."+r.HEADER).setStyle("cursor","move"))},this)},this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(t){var n=t.ancestor("div."+r.BLOCKREGION).get("id").replace(/region-/i,"");return e.Array.indexOf(this.get("regions"),n)===-1?(right_to_left()&&(n==="post"?n="pre":n==="pre"&&(n="post")),"side-"+n):n},get_region_id:function(e){return e.get("id").replace(/region-/i,"")},drag_start:function(t){var n=t.target;this.dragsourceregion=n.get("node").ancestor("div."+r.BLOCKREGION),n.get("node").previous()&&n.get("node").previous().hasClass(r.SKIPBLOCK)&&(this.skipnodetop=n.get("node").previous()),n.get("node").next()&&n.get("node").next().hasClass(r.SKIPBLOCKTO)&&(this.skipnodebottom=n.get("node").next()),e.one("body").addClass(r.BLOCKSMOVING)},drop_over:function(t){var n=t.drag.get("node"),i=t.drop.get("node");i.hasClass(this.parentnodeclass)&&i.one("."+r.BLOCKADMINBLOCK)&&i.one("."+r.BLOCKADMINBLOCK).next("."+r.BLOCK)&&i.prepend(n);if(this.dragsourceregion.contains(i))return!1;var s=e.one("body"),o=this.get_region_id(this.dragsourceregion);s.hasClass("side-"+o+"-only")&&s.removeClass("side-"+o+"-only"),o=this.get_region_id(i.ancestor("div."+r.BLOCKREGION)),this.dragsourceregion.all("."+r.BLOCK).size()===0&&this.dragsourceregion.get("id").match(/(region-pre|region-post)/i)&&(s.hasClass("side-"+o+"-only")||s.addClass("side-"+o+"-only"))},drag_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.dragsourceregion=null,e.one("body").removeClass(r.BLOCKSMOVING)},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(t){var i=t.drag,s=i.get("node"),o=t.drop.get("node");s.previous()&&s.previous().hasClass(r.SKIPBLOCK)&&s.insert(s.previous(),"after"),this.skipnodetop&&s.insert(this.skipnodetop,"before"),this.skipnodebottom&&s.insert(this.skipnodebottom,"after");var u=M.util.add_lightbox(e,s),a={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(s),bui_newregion:this.get_block_region(o)};this.get("cmid")&&(a.cmid=this.get("cmid")),s.next("."+this.samenodeclass)&&!s.next("."+this.samenodeclass).hasClass(r.BLOCKADMINBLOCK)&&(a.bui_beforeid=this.get_block_id(s.next("."+this.samenodeclass))),e.io(M.cfg.wwwroot+n,{method:"POST",data:a,on:{start:function(){u.show()},success:function(t,n){window.setTimeout(function(){u.hide()},250);try{var r=e.JSON.parse(n.responseText);r.error&&new M.core.ajaxException(r)}catch(i){}},failure:function(e,t){this.ajax_failure(t),u.hide()}},context:this})}},{NAME:"core-blocks-dragdrop",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:null}}}),M.core=M.core||{},M.core.blockdraganddrop=M.core.blockdraganddrop||{},M.core.blockdraganddrop._isusingnewblocksmethod=null,M.core.blockdraganddrop.is_using_blocks_render_method=function(){if(this._isusingnewblocksmethod===null){var t=e.all(".block-region[data-blockregion]").size(),n=e.all(".block-region").size();this._isusingnewblocksmethod=n===t,t>0&&n>0}return this._isusingnewblocksmethod},M.core.blockdraganddrop.init=function(e){this.is_using_blocks_render_method()?new s(e):new i(e)},M.core_blocks=M.core_blocks||{},M.core_blocks.init_dragdrop=function(e){M.core.blockdraganddrop.init(e)};var s=function(){s.superclass.constructor.apply(this,arguments)};s.prototype={skipnodetop:null,skipnodebottom:null,regionobjects:{},initializer:function(){var t=this.get("regions"),n=0,i,s,u,a;this.groups=["block"],this.samenodeclass=r.BLOCK,this.parentnodeclass=r.BLOCKREGION;var f=e.Node.all("body#"+r.MYINDEX+" #"+r.REGIONMAIN+" > ."+r.REGIONCONTENT);if(f.size()>0){var l=f.item(0);l.addClass(r.BLOCKREGION),l.set("id",r.REGIONCONTENT),l.one("div").addClass(r.REGIONCONTENT)}for(n in t)s=t[n],i=new o({manager:this,region:s,node:e.one("#block-region-"+s)}),this.regionobjects[s]=i,u=new e.DD.Drop({node:i.get_droptarget(),groups:this.groups,padding:"40 240 40 240"}),a=new e.DD.Delegate({container:i.get_droptarget(),nodes:"."+r.BLOCK,target:!0,handles:["."+r.HEADER],invalid
-:".block-hider-hide, .block-hider-show, .moveto",dragConfig:{groups:this.groups}}),a.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1}),a.dd.plug(e.Plugin.DDWinScroll),a.on("drag:mouseDown",this.enable_all_regions,this),i.remove_block_move_icons()},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){return e.test("[data-blockregion]")||(e=e.ancestor("[data-blockregion]")),e.getData("blockregion")},get_region_object:function(e){return this.regionobjects[this.get_block_region(e)]},enable_all_regions:function(){var e=0;for(e in this.regionobjects)this.regionobjects[e].enable()},disable_regions_if_required:function(){var e=0;for(e in this.regionobjects)this.regionobjects[e].disable_if_required()},drag_start:function(e){var t=e.target;t.get("node").previous()&&t.get("node").previous().hasClass(r.SKIPBLOCK)&&(this.skipnodetop=t.get("node").previous()),t.get("node").next()&&t.get("node").next().hasClass(r.SKIPBLOCKTO)&&(this.skipnodebottom=t.get("node").next())},drop_over:function(e){var t=e.drag.get("node"),n=e.drop.get("node");n.hasClass(r.REGIONCONTENT)&&n.one("."+r.BLOCKADMINBLOCK)&&n.one("."+r.BLOCKADMINBLOCK).next("."+r.BLOCK)&&n.prepend(t)},drop_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.disable_regions_if_required()},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(t){var i=t.drag.get("node"),s=t.drop.get("node");i.previous()&&i.previous().hasClass(r.SKIPBLOCK)&&i.insert(i.previous(),"after"),this.skipnodetop&&i.insert(this.skipnodetop,"before"),this.skipnodebottom&&i.insert(this.skipnodebottom,"after");var o=M.util.add_lightbox(e,i),u={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(i),bui_newregion:this.get_block_region(s)};this.get("cmid")&&(u.cmid=this.get("cmid")),i.next("."+r.BLOCK)&&!i.next("."+r.BLOCK).hasClass(r.BLOCKADMINBLOCK)&&(u.bui_beforeid=this.get_block_id(i.next("."+r.BLOCK))),e.io(M.cfg.wwwroot+n,{method:"POST",data:u,on:{start:function(){o.show()},success:function(t,n){window.setTimeout(function(){o.hide()},250);try{var r=e.JSON.parse(n.responseText);r.error&&new M.core.ajaxException(r)}catch(i){}},failure:function(e,t){this.ajax_failure(t),o.hide()},complete:function(){this.disable_regions_if_required()}},context:this})}},e.extend(s,M.core.dragdrop,s.prototype,{NAME:"core-blocks-dragdrop-manager",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:[]}}});var o=function(){o.superclass.constructor.apply(this,arguments)};o.prototype={initializer:function(){var t=this.get("node");t||(t=this.create_and_add_node());var n=e.one("body"),i=t.all("."+r.BLOCK).size()>0,s=this.get_has_region_class();this.set("hasblocks",i),n.hasClass(s)||n.addClass(s),n.addClass(i?this.get_used_region_class():this.get_empty_region_class()),n.removeClass(i?this.get_empty_region_class():this.get_used_region_class())},create_and_add_node:function(){var t=e.Node.create,n=this.get("region"),i=t('<div id="block-region-'+n+'" data-droptarget="1"></div>').addClass(r.BLOCKREGION).setData("blockregion",n),s=this.get("manager").get("regions"),o,u=!1,a=!1,f=!1,l,c;for(o in s)s[o].match(/(pre|left)/)?u=s[o]:s[o].match(/(post|right)/)&&(a=s[o]);return u!==!1&&a!==!1&&(n===u?(c=e.one("#block-region-"+a),c&&(c.insert(i,"before"),f=!0)):(l=e.one("#block-region-"+u),l&&(l.insert(i,"after"),f=!0))),f===!1&&e.one("body").append(i),this.set("node",i),i},remove_block_move_icons:function(){this.get("node").all("."+r.BLOCK+" a."+r.EDITINGMOVE).each(function(e){e.ancestor("."+r.BLOCK).one("."+r.HEADER).setStyle("cursor","move"),e.remove()})},get_has_region_class:function(){return"has-region-"+this.get("region")},get_empty_region_class:function(){return"empty-region-"+this.get("region")},get_used_region_class:function(){return"used-region-"+this.get("region")},get_droptarget:function(){var e=this.get("node");return e.test('[data-droptarget="1"]')?e:e.one('[data-droptarget="1"]')},enable:function(){e.one("body").addClass(this.get_used_region_class()).removeClass(this.get_empty_region_class())},disable_if_required:function(){this.get("node").all("."+r.BLOCK).size()===0&&e.one("body").addClass(this.get_empty_region_class()).removeClass(this.get_used_region_class())}},e.extend(o,e.Base,o.prototype,{NAME:"core-blocks-dragdrop-blockregion",ATTRS:{manager:{writeOnce:"initOnly",validator:function(t){return e.Lang.isObject(t)&&t instanceof s}},region:{writeOnce:"initOnly",validator:function(t){return e.Lang.isString(t)}},node:{validator:function(t){return e.Lang.isObject(t)||e.Lang.isNull(t)}},hasblocks:{value:!1,validator:function(t){return e.Lang.isBoolean(t)}}}})},"@VERSION@",{requires:["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]});
+YUI.add("moodle-core-blocks",function(e,t){var n="/lib/ajax/blocks.php",r={BLOCK:"block",BLOCKREGION:"block-region",BLOCKADMINBLOCK:"block_adminblock",EDITINGMOVE:"editing_move",HEADER:"header",LIGHTBOX:"lightbox",REGIONCONTENT:"region-content",SKIPBLOCK:"skip-block",SKIPBLOCKTO:"skip-block-to",MYINDEX:"page-my-index",REGIONMAIN:"region-main",BLOCKSMOVING:"blocks-moving"},i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.dragdrop,{skipnodetop:null,skipnodebottom:null,dragsourceregion:null,initializer:function(){this.groups=["block"],this.samenodeclass=r.BLOCK,this.parentnodeclass=r.REGIONCONTENT;var t=e.Node.all("body#"+r.MYINDEX+" #"+r.REGIONMAIN+" > ."+r.REGIONCONTENT);if(t.size()>0){var n=t.item(0);n.addClass(r.BLOCKREGION),n.set("id",r.REGIONCONTENT),n.one("div").addClass(r.REGIONCONTENT)}var i=e.Node.all("div."+r.BLOCKREGION);if(i.size()===0)return!1;if(i.size()!==this.get("regions").length){var s=e.Node.create("<div></div>").addClass(r.BLOCKREGION),o=e.Node.create("<div></div>").addClass(r.REGIONCONTENT);s.appendChild(o);var u=i.filter("#region-pre"),a=i.filter("#region-post");u.size()===0&&a.size()===1?(s.setAttrs({id:"region-pre"}),a.item(0).insert(s,"before"),i.unshift(s)):a.size()===0&&u.size()===1&&(s.setAttrs({id:"region-post"}),u.item(0).insert(s,"after"),i.push(s))}i.each(function(t){new e.DD.Drop({node:t.one("div."+r.REGIONCONTENT),groups:this.groups,padding:"40 240 40 240"});var n=new e.DD.Delegate({container:t,nodes:"."+r.BLOCK,target:!0,handles:["."+r.HEADER],invalid:".block-hider-hide, .block-hider-show, .moveto",dragConfig:{groups:this.groups}});n.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1}),n.dd.plug(e.Plugin.DDWinScroll);var i=t.all("."+r.BLOCK);i.each(function(e){var t=e.one("a."+r.EDITINGMOVE);t&&(t.remove(),e.one("."+r.HEADER).setStyle("cursor","move"))},this)},this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(t){var n=t.ancestor("div."+r.BLOCKREGION).get("id").replace(/region-/i,"");return e.Array.indexOf(this.get("regions"),n)===-1?(right_to_left()&&(n==="post"?n="pre":n==="pre"&&(n="post")),"side-"+n):n},get_region_id:function(e){return e.get("id").replace(/region-/i,"")},drag_start:function(t){var n=t.target;this.dragsourceregion=n.get("node").ancestor("div."+r.BLOCKREGION),n.get("node").previous()&&n.get("node").previous().hasClass(r.SKIPBLOCK)&&(this.skipnodetop=n.get("node").previous()),n.get("node").next()&&n.get("node").next().hasClass(r.SKIPBLOCKTO)&&(this.skipnodebottom=n.get("node").next()),e.one("body").addClass(r.BLOCKSMOVING)},drop_over:function(t){var n=t.drag.get("node"),i=t.drop.get("node");i.hasClass(this.parentnodeclass)&&i.one("."+r.BLOCKADMINBLOCK)&&i.one("."+r.BLOCKADMINBLOCK).next("."+r.BLOCK)&&i.prepend(n);if(this.dragsourceregion.contains(i))return!1;var s=e.one("body"),o=this.get_region_id(this.dragsourceregion);s.hasClass("side-"+o+"-only")&&s.removeClass("side-"+o+"-only"),o=this.get_region_id(i.ancestor("div."+r.BLOCKREGION)),this.dragsourceregion.all("."+r.BLOCK).size()===0&&this.dragsourceregion.get("id").match(/(region-pre|region-post)/i)&&(s.hasClass("side-"+o+"-only")||s.addClass("side-"+o+"-only"))},drag_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.dragsourceregion=null,e.one("body").removeClass(r.BLOCKSMOVING)},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(t){var i=t.drag,s=i.get("node"),o=t.drop.get("node");s.previous()&&s.previous().hasClass(r.SKIPBLOCK)&&s.insert(s.previous(),"after"),this.skipnodetop&&s.insert(this.skipnodetop,"before"),this.skipnodebottom&&s.insert(this.skipnodebottom,"after");var u=M.util.add_lightbox(e,s),a={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(s),bui_newregion:this.get_block_region(o)};this.get("cmid")&&(a.cmid=this.get("cmid")),s.next("."+this.samenodeclass)&&!s.next("."+this.samenodeclass).hasClass(r.BLOCKADMINBLOCK)&&(a.bui_beforeid=this.get_block_id(s.next("."+this.samenodeclass))),e.io(M.cfg.wwwroot+n,{method:"POST",data:a,on:{start:function(){u.show()},success:function(t,n){window.setTimeout(function(){u.hide()},250);try{var r=e.JSON.parse(n.responseText);r.error&&new M.core.ajaxException(r)}catch(i){}},failure:function(e,t){this.ajax_failure(t),u.hide()}},context:this})}},{NAME:"core-blocks-dragdrop",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:null}}}),M.core=M.core||{},M.core.blockdraganddrop=M.core.blockdraganddrop||{},M.core.blockdraganddrop._isusingnewblocksmethod=null,M.core.blockdraganddrop.is_using_blocks_render_method=function(){if(this._isusingnewblocksmethod===null){var t=e.all(".block-region[data-blockregion]").size(),n=e.all(".block-region").size();this._isusingnewblocksmethod=n===t,t>0&&n>0&&t!==n}return this._isusingnewblocksmethod},M.core.blockdraganddrop.init=function(e){this.is_using_blocks_render_method()?new s(e):new i(e)},M.core_blocks=M.core_blocks||{},M.core_blocks.init_dragdrop=function(e){M.core.blockdraganddrop.init(e)};var s=function(){s.superclass.constructor.apply(this,arguments)};s.prototype={skipnodetop:null,skipnodebottom:null,regionobjects:{},initializer:function(){var t=this.get("regions"),n=0,i,s,u;this.groups=["block"],this.samenodeclass=r.BLOCK,this.parentnodeclass=r.BLOCKREGION;var a=e.Node.all("body#"+r.MYINDEX+" #"+r.REGIONMAIN+" > ."+r.REGIONCONTENT);if(a.size()>0){var f=a.item(0);f.addClass(r.BLOCKREGION),f.set("id",r.REGIONCONTENT),f.one("div").addClass(r.REGIONCONTENT)}for(n in t)s=t[n],i=new o({manager:this,region:s,node:e.one("#block-region-"+s)}),this.regionobjects[s]=i,new e.DD.Drop({node:i.get_droptarget(),groups:this.groups,padding:"40 240 40 240"}),u=new e.DD.Delegate({container:i.get_droptarget(),nodes:"."+r.BLOCK,target:!0,handles:["."+r.HEADER
+],invalid:".block-hider-hide, .block-hider-show, .moveto, .block_fake",dragConfig:{groups:this.groups}}),u.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1}),u.dd.plug(e.Plugin.DDWinScroll),e.DD.DDM.on("ddm:start",this.enable_all_regions,this),i.remove_block_move_icons()},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){return e.test("[data-blockregion]")||(e=e.ancestor("[data-blockregion]")),e.getData("blockregion")},get_region_object:function(e){return this.regionobjects[this.get_block_region(e)]},enable_all_regions:function(){var t=e.DD.DDM.activeDrag.get("groups");if(!t||e.Array.indexOf(t,"block")===-1)return;var n;for(n in this.regionobjects){if(!this.regionobjects.hasOwnProperty(n))continue;this.regionobjects[n].enable()}},disable_regions_if_required:function(){var e=0;for(e in this.regionobjects)this.regionobjects[e].disable_if_required()},drag_start:function(e){var t=e.target;t.get("node").previous()&&t.get("node").previous().hasClass(r.SKIPBLOCK)&&(this.skipnodetop=t.get("node").previous()),t.get("node").next()&&t.get("node").next().hasClass(r.SKIPBLOCKTO)&&(this.skipnodebottom=t.get("node").next())},drop_over:function(e){var t=e.drag.get("node"),n=e.drop.get("node");n.hasClass(r.REGIONCONTENT)&&n.one("."+r.BLOCKADMINBLOCK)&&n.one("."+r.BLOCKADMINBLOCK).next("."+r.BLOCK)&&n.prepend(t)},drop_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.disable_regions_if_required()},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(t){var i=t.drag.get("node"),s=t.drop.get("node");i.previous()&&i.previous().hasClass(r.SKIPBLOCK)&&i.insert(i.previous(),"after"),this.skipnodetop&&i.insert(this.skipnodetop,"before"),this.skipnodebottom&&i.insert(this.skipnodebottom,"after");var o=M.util.add_lightbox(e,i),u={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(i),bui_newregion:this.get_block_region(s)};this.get("cmid")&&(u.cmid=this.get("cmid")),i.next("."+r.BLOCK)&&!i.next("."+r.BLOCK).hasClass(r.BLOCKADMINBLOCK)&&(u.bui_beforeid=this.get_block_id(i.next("."+r.BLOCK))),e.io(M.cfg.wwwroot+n,{method:"POST",data:u,on:{start:function(){o.show()},success:function(t,n){window.setTimeout(function(){o.hide()},250);try{var r=e.JSON.parse(n.responseText);r.error&&new M.core.ajaxException(r)}catch(i){}},failure:function(e,t){this.ajax_failure(t),o.hide()},complete:function(){this.disable_regions_if_required()}},context:this})}},e.extend(s,M.core.dragdrop,s.prototype,{NAME:"core-blocks-dragdrop-manager",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:[]}}});var o=function(){o.superclass.constructor.apply(this,arguments)};o.prototype={initializer:function(){var t=this.get("node");t||(t=this.create_and_add_node());var n=e.one("body"),i=t.all("."+r.BLOCK).size()>0,s=this.get_has_region_class();this.set("hasblocks",i),n.hasClass(s)||n.addClass(s),n.addClass(i?this.get_used_region_class():this.get_empty_region_class()),n.removeClass(i?this.get_empty_region_class():this.get_used_region_class())},create_and_add_node:function(){var t=e.Node.create,n=this.get("region"),i=t('<div id="block-region-'+n+'" data-droptarget="1"></div>').addClass(r.BLOCKREGION).setData("blockregion",n),s=this.get("manager").get("regions"),o,u=!1,a=!1,f=!1,l,c;for(o in s)s[o].match(/(pre|left)/)?u=s[o]:s[o].match(/(post|right)/)&&(a=s[o]);return u!==!1&&a!==!1&&(n===u?(c=e.one("#block-region-"+a),c&&(c.insert(i,"before"),f=!0)):(l=e.one("#block-region-"+u),l&&(l.insert(i,"after"),f=!0))),f===!1&&e.one("body").append(i),this.set("node",i),i},remove_block_move_icons:function(){this.get("node").all("."+r.BLOCK+" a."+r.EDITINGMOVE).each(function(e){e.ancestor("."+r.BLOCK).one("."+r.HEADER).setStyle("cursor","move"),e.remove()})},get_has_region_class:function(){return"has-region-"+this.get("region")},get_empty_region_class:function(){return"empty-region-"+this.get("region")},get_used_region_class:function(){return"used-region-"+this.get("region")},get_droptarget:function(){var e=this.get("node");return e.test('[data-droptarget="1"]')?e:e.one('[data-droptarget="1"]')},enable:function(){e.one("body").addClass(this.get_used_region_class()).removeClass(this.get_empty_region_class())},disable_if_required:function(){this.get("node").all("."+r.BLOCK).size()===0&&e.one("body").addClass(this.get_empty_region_class()).removeClass(this.get_used_region_class())}},e.extend(o,e.Base,o.prototype,{NAME:"core-blocks-dragdrop-blockregion",ATTRS:{manager:{writeOnce:"initOnly",validator:function(t){return e.Lang.isObject(t)&&t instanceof s}},region:{writeOnce:"initOnly",validator:function(t){return e.Lang.isString(t)}},node:{validator:function(t){return e.Lang.isObject(t)||e.Lang.isNull(t)}},hasblocks:{value:!1,validator:function(t){return e.Lang.isBoolean(t)}}}})},"@VERSION@",{requires:["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]});
View
32 lib/yui/build/moodle-core-blocks/moodle-core-blocks.js
@@ -359,7 +359,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
this._isusingnewblocksmethod = (allregions === goodregions);
- if (goodregions > 0 && allregions > 0) {
+ if (goodregions > 0 && allregions > 0 && goodregions !== allregions) {
}
}
return this._isusingnewblocksmethod;
@@ -447,7 +447,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
- droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -476,7 +475,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// 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(),
groups: this.groups,
padding: '40 240 40 240'
@@ -488,7 +487,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
- invalid: '.block-hider-hide, .block-hider-show, .moveto',
+ invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -496,9 +495,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
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.
- dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
+
+ // On the DD Manager start operation, we enable all block regions so that they can be drop targets. 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.remove_block_move_icons();
}
@@ -539,12 +539,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
+ *
* @method enable_all_regions
* @returns {undefined}
*/
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) {
+ if (!this.regionobjects.hasOwnProperty(i)) {
+ continue;
+ }
this.regionobjects[i].enable();
}
},
@@ -778,7 +791,8 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
-});/**
+});
+/**
* This file contains the Block Region class used by the drag and drop manager.
*
* Provides drag and drop functionality for blocks.
View
2  lib/yui/src/blocks/js/blocks.js
@@ -357,7 +357,7 @@ M.core.blockdraganddrop.is_using_blocks_render_method = function() {
var goodregions = Y.all('.block-region[data-blockregion]').size();
var allregions = Y.all('.block-region').size();
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');
}
}
View
29 lib/yui/src/blocks/js/manager.js
@@ -58,7 +58,6 @@ MANAGER.prototype = {
i = 0,
region,
regionname,
- droptarget,
dragdelegation;
// Evil required by M.core.dragdrop.
@@ -87,7 +86,7 @@ MANAGER.prototype = {
// Setting blockregion as droptarget (the case when it is empty)
// The region-post (the right one)
// 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(),
groups: this.groups,
padding: '40 240 40 240'
@@ -99,7 +98,7 @@ MANAGER.prototype = {
nodes: '.'+CSS.BLOCK,
target: true,
handles: ['.'+CSS.HEADER],
- invalid: '.block-hider-hide, .block-hider-show, .moveto',
+ invalid: '.block-hider-hide, .block-hider-show, .moveto, .block_fake',
dragConfig: {groups: this.groups}
});
dragdelegation.dd.plug(Y.Plugin.DDProxy, {
@@ -107,9 +106,10 @@ MANAGER.prototype = {
moveOnEnd: false
});
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.
- dragdelegation.on('drag:mouseDown', this.enable_all_regions, this);
+
+ // On the DD Manager start operation, we enable all block regions so that they can be drop targets. 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.remove_block_move_icons();
}
@@ -151,12 +151,25 @@ MANAGER.prototype = {
/**
* Enables all fo the regions so that they are all visible while dragging is occuring.
+ *
* @method enable_all_regions
* @returns {undefined}
*/
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) {
+ if (!this.regionobjects.hasOwnProperty(i)) {
+ continue;
+ }
this.regionobjects[i].enable();
}
},
@@ -390,4 +403,4 @@ Y.extend(MANAGER, M.core.dragdrop, MANAGER.prototype, {
value : []
}
}
-});
+});
View
4 mod/chat/lib.php
@@ -325,7 +325,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
$strftimerecent = get_string('strftimerecent');
if ($past) {
- echo $OUTPUT->heading(get_string("pastchats", 'chat').':');
+ echo $OUTPUT->heading(get_string("pastchats", 'chat').':', 3);
foreach ($past as $cm) {
$link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id;
@@ -336,7 +336,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) {
}
if ($current) {
- echo $OUTPUT->heading(get_string("currentchats", 'chat').':');
+ echo $OUTPUT->heading(get_string("currentchats", 'chat').':', 3);
$oldest = floor((time()-$CFG->chat_old_ping)/10)*10; // better db caching
View
70 mod/wiki/tests/behat/edit_tags.feature
@@ -0,0 +1,70 @@
+@mod @mod_wiki
+Feature: Edited wiki pages handle tags correctly
+ In order to get wiki pages properly labelled
+ As a user
+ I need to introduce the tags while editing
+
+ Background:
+ Given the following "users" exist:
+ | username | firstname | lastname | email |
+ | teacher1 | Teacher | 1 | teacher1@asd.com |
+ | student1 | Student | 1 | student1@asd.com |
+ And the following "courses" exist:
+ | fullname | shortname | category |
+ | Course 1 | C1 | 0 |
+ And the following "course enrolments" exist:
+ | user | course | role |
+ | teacher1 | C1 | editingteacher |
+ | student1 | C1 | student |
+ And I log in as "teacher1"
+ And I follow "Course 1"
+ And I turn editing mode on
+ And I add a "Wiki" to section "1" and I fill the form with:
+ | Wiki name | Test wiki name |
+ | Description | Test wiki description |
+ | First page name | First page |
+ | Wiki mode | Collaborative wiki |
+ And I log out
+
+ Scenario: Wiki page edition of custom tags works as expected
+ Given I log in as "student1"
+ And I follow "Course 1"
+ And I follow "Test wiki name"
+ And I press "Create page"
+ When I set the following fields to these values:
+ | HTML format | Student page contents to be tagged |
+ | Other tags (enter tags separated by commas) | Example, Page, Cool |
+ And I press "Save"
+ Then I should see "Example" in the ".wiki-tags" "css_element"
+ And I should see "Page" in the ".wiki-tags" "css_element"
+ And I should see "Cool" in the ".wiki-tags" "css_element"
+ And I follow "Edit"
+ And the field "Other tags (enter tags separated by commas)" matches value "Example, Page, Cool"
+ And I press "Cancel"
+
+ Scenario: Wiki page edition of official tags works as expected
+ Given I log in as "admin"
+ And I expand "Site administration" node
+ And I expand "Appearance" node
+ And I follow "Manage tags"
+ And I set the field "otagsadd" to "OT1, OT2, OT3"
+ And I press "Add official tags"
+ And I log out
+ And I log in as "student1"
+ And I follow "Course 1"
+ And I follow "Test wiki name"
+ And I press "Create page"
+ And the "tags[officialtags][]" select box should contain "OT1"
+ And the "tags[officialtags][]" select box should contain "OT2"
+ And the "tags[officialtags][]" select box should contain "OT3"
+ When I set the following fields to these values:
+ | HTML format | Student page contents to be tagged |
+ | tags[officialtags][] | OT1, OT3 |
+ And I press "Save"
+ Then I should see "OT1" in the ".wiki-tags" "css_element"
+ And I should see "OT3" in the ".wiki-tags" "css_element"
+ And I should not see "OT2" in the ".wiki-tags" "css_element"
+ And I follow "Edit"
+ And the field "tags[officialtags][]" matches value "OT1, OT3"
+ And the field "tags[officialtags][]" does not match value "OT2"
+ And I press "Cancel"
View
42 my/tests/behat/restrict_available_blocks.feature
@@ -0,0 +1,42 @@
+@core @core_my
+Feature: Restrict which blocks can be added to My home
+ In order to restrict which blocks can be added
+ As a student I need to ensure I can add the blocks
+ As an admin I need to remove the capability to add a blocks
+ As a student I need to ensure I can't add the blocks any more
+
+ Background:
+ Given the following "users" exist:
+ | username | firstname | lastname | email |
+ | student1 | Student | 1 | student1@asd.com |
+ And the following "courses" exist:
+ | fullname | shortname | format |
+ | Course 1 | C1 | topics |
+ And the following "course enrolments" exist:
+ | user | course | role |
+ | student1 | C1 | student |
+
+ Scenario: The comments block can be added to My home by default
+ And I log in as "student1"
+ And I follow "My home"
+ And I press "Customise this page"
+ Then the "Add a block" select box should contain "Comments"
+ And the "Add a block" select box should contain "Courses"
+ And the "Add a block" select box should contain "HTML"
+ And the "Add a block" select box should contain "Tags"
+
+ @javascript
+ Scenario: Remove the ability to add the comments block to My home
+ When I log in as "admin"
+ And I set the following system permissions of "Authenticated user" role:
+ | block/comments:myaddinstance | Prohibit |
+ | block/course_list:myaddinstance | Prohibit |
+ | block/html:myaddinstance | Prohibit |
+ And I log out
+ And I log in as "student1"
+ And I follow "My home"
+ And I press "Customise this page"
+ Then the "Add a block" select box should not contain "Comments"
+ And the "Add a block" select box should not contain "Courses"
+ And the "Add a block" select box should not contain "HTML"
+ And the "Add a block" select box should contain "Tags"
View
3  report/completion/styles.css
@@ -6,3 +6,6 @@
#page-report-completion-index .export-actions {
text-align: center;
}
+#page-report-completion-index.dir-rtl #completion-progress th svg {
+ direction: ltr;
+}
View
1  report/progress/styles.css
@@ -5,3 +5,4 @@
#page-report-progress-index .completion_prev {display:inline;margin-right:2em;}
#page-report-progress-index .completion_pagingbar p {display:inline;margin:0;}
#page-report-progress-index .completion_next {display:inline;margin-left:2em;}
+#page-report-progress-index.dir-rtl #completion-progress th svg {direction:ltr;}
View
2  repository/alfresco/lang/en/repository_alfresco.php
@@ -24,7 +24,7 @@
*/
$string['alfresco_url'] = 'Alfresco URL';
-$string['alfrescourltext'] = 'Afresco API url should be: http://yoursite.com/alfresco/api';
+$string['alfrescourltext'] = 'Afresco API URL should be: http://yoursite.com/alfresco/api or http://yoursite.com/alfresco/soapapi for Alfresco 4.2.d or greater.';
$string['alfresco:view'] = 'View alfresco repository';
$string['configplugin'] = 'Alfresco configuration';
$string['notitle'] = 'notitle';
View
2  user/filters/courserole.php
@@ -46,7 +46,7 @@ function setupForm(&$mform) {
$objs[] =& $mform->createElement('select', $this->_name .'_ct', null, $this->get_course_categories());
$objs[] =& $mform->createElement('text', $this->_name, null);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $mform->setType($this->_name, PARAM_ALPHANUMEXT);
+ $mform->setType($this->_name, PARAM_TEXT);
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
}
View
4 user/profile/definelib.php
@@ -418,7 +418,7 @@ function profile_list_categories() {
function profile_edit_category($id, $redirect) {
global $CFG, $DB, $OUTPUT;
- require_once('index_category_form.php');
+ require_once($CFG->dirroot.'/user/profile/index_category_form.php');
$categoryform = new category_form();
if ($category = $DB->get_record('user_info_category', array('id'=>$id))) {
@@ -474,7 +474,7 @@ function profile_edit_field($id, $datatype, $redirect) {
$field->description = clean_text($field->description, $field->descriptionformat);
$field->description = array('text'=>$field->description, 'format'=>$field->descriptionformat, 'itemid'=>0);
- require_once('index_field_form.php');
+ require_once($CFG->dirroot.'/user/profile/index_field_form.php');
$fieldform = new field_form(null, $field->datatype);
// Convert the data format for
View
14 user/profile/index.php
@@ -87,12 +87,11 @@
//normal form
}
-/// Print the header
-echo $OUTPUT->header();
-echo $OUTPUT->heading(get_string('profilefields', 'admin'));
+// Show all categories.
+$categories = $DB->get_records('user_info_category', null, 'sortorder ASC');
-/// Check that we have at least one category defined
-if ($DB->count_records('user_info_category') == 0) {
+// Check that we have at least one category defined.
+if (empty($categories)) {
$defaultcategory = new stdClass();
$defaultcategory->name = $strdefaultcategory;
$defaultcategory->sortorder = 1;
@@ -100,8 +99,9 @@
redirect($redirect);
}
-/// Show all categories
-$categories = $DB->get_records('user_info_category', null, 'sortorder ASC');
+// Print the header.
+echo $OUTPUT->header();
+echo $OUTPUT->heading(get_string('profilefields', 'admin'));
foreach ($categories as $category) {
$table = new html_table();
View
4 user/profile/index_category_form.php
@@ -37,13 +37,13 @@ function validation($data, $files) {
$data = (object)$data;
- $duplicate = $DB->record_exists('user_info_category', array('name'=>$data->name));
+ $duplicate = $DB->get_field('user_info_category', 'id', array('name' => $data->name));
/// Check the name is unique
if (!empty($data->id)) { // we are editing an existing record
$olddata = $DB->get_record('user_info_category', array('id'=>$data->id));
// name has changed, new name in use, new name in use by another record
- $dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate->id));
+ $dupfound = (($olddata->name !== $data->name) && $duplicate && ($data->id != $duplicate));
}
else { // new profile category
$dupfound = $duplicate;
View
4 version.php
@@ -29,11 +29,11 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2013051405.07; // 20130514 = branching date YYYYMMDD - do not modify!
+$version = 2013051405.08; // 20130514 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
-$release = '2.5.5+ (Build: 20140417)'; // Human-friendly version name
+$release = '2.5.5+ (Build: 20140422)'; // Human-friendly version name
$branch = '25'; // this version's branch
$maturity = MATURITY_STABLE; // this version's maturity level
Please sign in to comment.
Something went wrong with that request. Please try again.