YUI.add("moodle-backup-backupselectall",function(g,e){M.core_backup=M.core_backup||{},M.core_backup.backupselectall=function(e){var t,n,i,c,o,l,a,u,s=null,d=function(e,t,i,n){var c,o;e.preventDefault(),c="",void 0!==n&&(c="setting_activity_"+n+"_"),o=i.length,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");c&&n.substring(0,c.length)!==c||n.substring(n.length-o)===i&&e.set("checked",t)}),s&&M.form&&M.form.updateFormState(s)},r=function(e,n,t,i){return void 0===i&&(i=""),'<div class="'+e+'"><div class="fitem fitem_fcheckbox backup_selector"><div class="fitemtitle">'+t+'</div><div class="felement"><a id="backup-all-'+n+'" href="#">'+M.util.get_string("all","moodle")+'</a> / <a id="backup-none-'+n+'" href="#">'+M.util.get_string("none","moodle")+"</a>"+i+"</div></div></div>"},p=g.one("fieldset#id_coursesettings .fcontainer.clearfix .grouped_settings.section_level");if(p&&p.one('input[type="checkbox"]')){for(l in s=p.ancestor("form").getAttribute("id"),t=!1,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");"_userdata"===n.substring(n.length-9)?t="_userdata":"_userinfo"===n.substring(n.length-9)&&(t="_userinfo")}),n=r("include_setting section_level","included",M.util.get_string("select","moodle"),' (<a id="backup-bytype" href="#">'+M.util.get_string("showtypes","backup")+"</a>)"),t&&(n+=r("normal_setting","userdata",M.util.get_string("select","moodle"))),i=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),p.insert(i,"before"),c=function(e,n){g.one("#backup-all-mod_"+n).on("click",function(e){d(e,!0,"_included",n)}),g.one("#backup-none-mod_"+n).on("click",function(e){d(e,!1,"_included",n)}),t&&(g.one("#backup-all-userdata-mod_"+n).on("click",function(e){d(e,!0,t,n)}),g.one("#backup-none-userdata-mod_"+n).on("click",function(e){d(e,!1,t,n)}))},(o=g.Node.create('<div id="mod_select_links">')).hide(),o.currentlyshown=!1,i.appendChild(o),e)e.hasOwnProperty(l)&&(n=r("include_setting section_level","mod_"+l,e[l]),t&&(n+=r("normal_setting","userdata-mod_"+l,e[l])),a=g.Node.create('<div class="grouped_settings section_level">'+n+"</div>"),o.appendChild(a),c(a,l));u=function(){var e,n,t=g.one("#backup-bytype");o.currentlyshown?t.setHTML(M.util.get_string("showtypes","backup")):t.setHTML(M.util.get_string("hidetypes","backup")),o.currentlyshown=!o.currentlyshown,e={node:o,duration:.2},o.currentlyshown?(o.show(),e.to={maxHeight:o.get("clientHeight")+"px"},o.setStyle("maxHeight","0px"),(n=new g.Anim(e)).on("end",function(){o.setStyle("maxHeight","none")})):(e.to={maxHeight:"0px"},o.setStyle("maxHeight",o.get("clientHeight")+"px"),(n=new g.Anim(e)).on("end",function(){o.hide(),o.setStyle("maxHeight","none")})),n.run()},g.one("#backup-bytype").on("click",function(e){e.preventDefault(),u()}),g.one("#backup-all-included").on("click",function(e){d(e,!0,"_included")}),g.one("#backup-none-included").on("click",function(e){d(e,!1,"_included")}),t&&(g.one("#backup-all-userdata").on("click",function(e){d(e,!0,t)}),g.one("#backup-none-userdata").on("click",function(e){d(e,!1,t)}))}}},"@VERSION@",{requires:["node","event","node-event-simulate","anim"]});