Gitlab CSE Unil

Commit a6f55f4e authored by M. Chardon's avatar M. Chardon
Browse files

correction bug:

- creation new tool (display canevas)
- menu access for configuration
parent 11e3d7f4
define(["jquery","jqueryui","core/notification","core/templates","core/fragment","core/ajax","core/str","assignfeedback_editpdfplus/tool","assignfeedback_editpdfplus/tooltype","assignfeedback_editpdfplus/annotationhighlightplus","assignfeedback_editpdfplus/annotationstampplus","assignfeedback_editpdfplus/annotationframe","assignfeedback_editpdfplus/annotationcommentplus","assignfeedback_editpdfplus/annotationverticalline","assignfeedback_editpdfplus/annotationstampcomment"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=null,q=null,r=null,s=null,t=null,u=function(a,b){p=a,this.initTypeTool(b),this.init()};u.messageDelOk="",u.messageDelKo="",u.messageko="",u.messageaddok="",u.messageaddlibelleko="",u.messageEditOk="",u.prototype.selectTool=null;var v=function(){g.get_string("admindeltool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageDelOk=a}).fail(c.exception),g.get_string("admindeltool_messageko","assignfeedback_editpdfplus").done(function(a){u.messageDelKo=a}).fail(c.exception),g.get_string("adminaddtool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageaddok=a}).fail(c.exception),g.get_string("admin_messageko","assignfeedback_editpdfplus").done(function(a){u.messageko=a}).fail(c.exception),g.get_string("adminedittool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageEditOk=a}).fail(c.exception),g.get_string("adminaddtool_messagelibelleko","assignfeedback_editpdfplus").done(function(a){u.messageaddlibelleko=a}).fail(c.exception)};u.prototype.initTypeTool=function(a){var b=JSON.parse(a);s=[];for(var c=0;c<b.length;c++){var d=new i;d.initAdmin(b[c]),s[c]=d}},u.prototype.init=function(){a("#editpdlplus_axes").on("change",function(){a(".toolbar").hide();var b=a("#editpdlplus_axes").val();if(b&&""!==b){a("#editpdlplus_toolbar_"+b).show();var c=a("#editpdlplus_axes option:selected").data("delete");c?parseInt(c)>0?a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").prop("disabled",!0):a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeAttr("disabled"):(a("#editpdlplus_axes option[value='"+b+"']").data("delete",0),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeAttr("disabled"))}else a("#assignfeedback_editpdfplus_widget_admin_workspace").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide();a("#toolworkspace").html("")}),a("#editpdlplus_axes").change(),a(".editpdlplus_tool").on("click",B),this.selectTool=a(".editpdlplus_tool").first(),this.initToolUI(),a("#assignfeedback_editpdfplus_widget_admin_button_addaxis").on("click",this.openDivAddAxis),a("#assignfeedback_editpdfplus_widget_admin_button_editaxis").on("click",this.openDivEditAxis),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").on("click",this.openDivDelAxis),a("#assignfeedback_editpdfplus_widget_admin_button_addtool").on("click",this.openDivAddTool),a(".btn-primary").click(),a(".btnimport").on("click",this.importAxis),v()},u.prototype.initToolUI=function(){a(this.selectTool).addClass("btn-primary"),w()};var w=function(){a(".sortable").sortable({placeholder:"alert-warning",handle:"button",cancel:"",stop:function(b,d){var e=a(d.item).prev().find("button").val(),g=a(d.item).next().find("button").val(),h=a(d.item).find("button").val();a("input[name^='previoustoolid']").val(e),a("input[name^='toolid']").val(h),a("input[name^='nexttoolid']").val(g);var i=a("#assignfeedback_editpdfplus_order_tool"),j=i.serialize()+"&contextid="+p;f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_order_form",args:{jsonformdata:JSON.stringify(j)}}])[0].done(function(b){"ok"===b.message?(a("#message_order_tool").show(),a("#message_order_tool").html(u.messageEditOk),a("#message_order_tool").addClass("alert-success"),a("#message_order_tool").removeClass("alert-danger"),a("#message_order_tool").removeClass("alert-warning"),a("#message_order_tool").fadeOut(5e3)):(a("#message_order_tool").show(),a("#message_order_tool").html(u.messageko),a("#message_order_tool").addClass("alert-danger"),a("#message_order_tool").removeClass("alert-success"),a("#message_order_tool").fadeOut(5e3))}).fail(c.exception)}}),a(".sortable").disableSelection()};u.prototype.refreshPrevisu=function(){q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val(),q.colors=a("#color").val(),q.cartridge=a("#libelle").val(),q.cartridgeColor=a("#cartridgecolor").val();var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1)),q.texts=a("#texts").val(),q.label=a("#button").val(),q.enabled=a("#enabled").val(),q.reply=0,a("#reply").is(":checked")&&(q.reply=1),q.orderTool=a("#order").val(),z(),y()};var x=function(a){for(var b=0;b<s.length;b++)if(s[b].id==a)return s[b]},y=function(){var b=parseInt(a("#typetool").val()),c=x(b),d=!1,e=!1;c.configurableCartridge&&0===parseInt(c.configurableCartridge)?(a("#libelle").hide(),a("label[for='libelle']").hide(),d=!0):(a("#libelle").show(),a("label[for='libelle']").show()),c.configurableCartridgeColor&&0===parseInt(c.configurableCartridgeColor)?(a("#cartridgecolor").hide(),a("label[for='cartridgecolor']").hide(),e=!0):(a("#cartridgecolor").show(),a("label[for='cartridgecolor']").show()),d&&e?a("#collapse3").parent().hide():a("#collapse3").parent().show();var f=!1,g=!1,h=!1;c.configurableColor&&0===parseInt(c.configurableColor)?(a("#color").hide(),a("label[for='color']").hide(),f=!0):(a("#color").show(),a("label[for='color']").show()),c.configurableTexts&&0===parseInt(c.configurableTexts)?(a(".textform").hide(),a("label[for='texts']").hide(),g=!0):(a(".textform").show(),a("label[for='texts']").show()),c.configurableQuestion&&0===parseInt(c.configurableQuestion)?(a("#reply").hide(),a("label[for='reply']").hide(),h=!0):(a("#reply").show(),a("label[for='reply']").show()),f&&h&&g?a("#collapse4").parent().hide():a("#collapse4").parent().show()},z=function(){a("#canevas").html(""),t=null;var b=parseInt(a("#typetool").val());if(3===b||4===b||7===b?a("#canevas").css("background-image","url("+a("#map01").val()+")"):1===b||6===b?a("#canevas").css("background-image","url("+a("#map02").val()+")"):5===b&&a("#canevas").css("background-image","url("+a("#map03").val()+")"),1===b)t=new j;else if(3===b)t=new k;else if(4===b){t=new l;var c=new l}else 5===b?t=new n:6===b?t=new o:7===b&&(t=new m);if(t){var d=x(b);q.type=d,q.reply=0,a("#reply").is(":checked")&&(q.reply=1),t.initAdminDemo(q),t.draw(a("#canevas")),c&&(c.initChildAdminDemo(t),c.draw(a("#canevas")))}};u.prototype.openDivAddAxis=function(){var b=a("#editpdlplus_axes").val();b&&""!==b?(a("#message_edit_tool").hide(),a("#axistool").hide()):(a("#assignfeedback_editpdfplus_widget_admin_workspace").show(),a("#editpdlplus_axes_worspace").hide()),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var f={};e.loadFragment("assignfeedback_editpdfplus","axisadd",p,f).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis",a,b)}.bind(this)).fail(c.exception)},u.prototype.openDivEditAxis=function(){a("#message_edit_tool").hide(),a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var b=a("#editpdlplus_axes option:selected").val(),f={axeid:b};e.loadFragment("assignfeedback_editpdfplus","axisedit",p,f).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis",a,b)}.bind(this)).fail(c.exception)},u.prototype.openDivDelAxis=function(){var b=a("#editpdlplus_axes option:selected").data("delete");if(null!==b&&0===parseInt(b)){a("#message_edit_tool").hide(),a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var f=a("#editpdlplus_axes option:selected").val(),g={axeid:f};e.loadFragment("assignfeedback_editpdfplus","axisdel",p,g).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis",a,b)}.bind(this)).fail(c.exception)}};var A=function(b,c,e){var f=a.Deferred();return b.fadeOut("fast",function(){d.replaceNodeContents(b,c,e),b.fadeIn("fast",function(){f.resolve()})}),f.promise()};u.prototype.importAxis=function(){var b=a(this).data("axis");if(b&&parseInt(b)>0){a("#assignfeedback_editpdfplus_import_axis > div > input[name^='axeid']").val(b);var d=a("#assignfeedback_editpdfplus_import_axis"),e=d.serialize()+"&contextid="+p;f.call([{methodname:"assignfeedback_editpdfplus_submit_axis_import_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_import_axis").show(),a("#message_import_axis").html(u.messageaddok),a("#message_import_axis").addClass("alert-success"),a("#message_import_axis").removeClass("alert-danger"),a("#message_import_axis").removeClass("alert-warning"),a("#message_import_axis").fadeOut(5e3);var c="<div id='editpdlplus_toolbar_"+b[0].axeid+"' class='btn-group toolbar' style='display: none;'><ul class='sortable' style='list-style-type: none;margin: 0;padding: 0;width: 100%;'></ul></div>";a("#editpdlplus_toolbars").append(c),w();var d=new Option(b[0].axelabel,b[0].axeid,(!0),(!0));a("#editpdlplus_axes").append(d);var e=a("#editpdlplus_axes option[value='"+b[0].axeid+"']");e.data("delete",1);var f=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");if(f.prop("disabled",!0),a("#editpdlplus_tool_item").html(""),b[0].toolid&&b[0].toolid>0)for(var g=0;g<b.length;g++){var i=new h;i.initAdmin(b[g]);var j=i.getButtonSortable(b[g].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(j)}else{var k=b[0].axeid,e=a("#editpdlplus_axes option[value='"+k+"']");e.data("delete",0);var f=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");f.removeAttr("disabled")}a(".editpdlplus_tool").on("click",B),a("#editpdlplus_axes").change(),a("a[href^='#collapseadmin1'").click(),a("#axistool").show(),a("#assignfeedback_editpdfplus_widget_admin_toolheader").show(),a("#assignfeedback_editpdfplus_widget_admin_workspace").show(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").show()}else a("#message_import_axis").show(),a("#message_import_axis").html(b[0].message),a("#message_import_axis").addClass("alert-danger"),a("#message_import_axis").removeClass("alert-success"),a("#message_import_axis").fadeOut(5e3)}).fail(c.exception)}};var B=function(){var b=a(this).val();a(".editpdlplus_tool").each(function(){a(this).removeClass("btn-primary"),a(this).css("background-image",""),a(this).css("background-color","");var c=a(this).data("enable");1!==c&&a(this).val()!==b&&(a(this).css("background-image","none"),a(this).css("background-color","#CCCCCC"))}),a(this).addClass("btn-primary"),q&&q.id===b||a("#message_edit_tool").hide(),a("#editpdlplus_tool_item").html("");var d={toolid:b};e.loadFragment("assignfeedback_editpdfplus","tooledit",p,d).done(function(d,e){A(a("#editpdlplus_tool_item"),d,e).done(function(){q=new h,q.id=b,q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val();var d=x(q.typetool);q.type=d;var e=a("#realcolor").val();e.length>0?q.colors=a("#color").val():(a("#color").val(d.color),q.colors=null),q.cartridge=a("#libelle").val(),a("#realcartridgecolor").val()&&a("#realcartridgecolor").val().length>0?q.cartridgeColor=a("#cartridgecolor").val():(a("#cartridgecolor").val(d.get_color_cartridge()),q.cartridgeColor=null),q.texts=a("#texts").val(),q.label=a("#button").val(),q.enabled=a("#enabled").val(),q.reply=a("#reply").val(),q.orderTool=a("#order").val(),a("#typetool").on("change",function(){q.typetool=a("#typetool").val();var b=x(q.typetool);q.type=b,q.colors=b.get_color(),q.cartridgeColor=b.get_color_cartridge(),a("#color").val(q.colors),a("#cartridgecolor").val(q.cartridgeColor),y(),z()}),a("#toolFormSubmit").on("click",function(){var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1));var d=a("#assignfeedback_editpdfplus_edit_tool"),e=d.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_edit_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageEditOk),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_tool_"+b[0].selecttool).remove(),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html("");for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B);var f=a("#axisid").val();f!==b[0].axeid&&(a("#editpdlplus_axes").val(b[0].axeid),a("#editpdlplus_axes").change()),a("#editpdlplus_tool_"+b[0].selecttool).click()}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}),a("#toolEnabled").on("click",function(){var b=a("#toolenabled").val();1==b?(a("#toolEnabled > i").addClass("fa-eye-slash"),a("#toolEnabled > i").removeClass("fa-eye"),a("#toolenabled").val(0)):(a("#toolEnabled > i").addClass("fa-eye"),a("#toolEnabled > i").removeClass("fa-eye-slash"),a("#toolenabled").val(1)),a("#toolFormSubmit").click()}),a("#toolClone").on("click",function(){r="clone",a("#assignfeedback_editpdfplus_widget_admin_button_addtool").click()}),a("#toolRemove").on("click",function(){if(!a(this).prop("disabled")){var b=a("#assignfeedback_editpdfplus_edit_tool"),d=b.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_del_form",args:{jsonformdata:JSON.stringify(d)}}])[0].done(function(b){if(""===b[0].message||"1"===b[0].message){if(a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageDelOk),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html(""),parseInt(b[0].toolid)>0){for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B)}else{var f=b[0].axeid,g=a("#editpdlplus_axes option[value='"+f+"']");g.data("delete",0);var i=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");i.removeAttr("disabled")}a("#toolworkspace").html("")}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}}),a("#toolRefesh").on("click",function(){u.prototype.refreshPrevisu()}),z(),y()}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception)};return u.prototype.openDivAddTool=function(){a("#message_edit_tool").hide(),a("#editpdlplus_tool_item").html(""),a(".editpdlplus_tool").removeClass("btn-primary");var b=a("#editpdlplus_axes option:selected").val(),d={axisid:b};e.loadFragment("assignfeedback_editpdfplus","tooladd",p,d).done(function(d,e){A(a("#editpdlplus_tool_item"),d,e).done(function(){a("#canevas").hide(),a("#toolaxis").val(b),"clone"===r?(a("#toolaxis").val(q.axis),a("#typetool").val(q.typetool),a("#color").val(q.colors),a("#libelle").val(q.cartridge),a("#cartridgecolor").val(q.cartridgeColor),a("#texts").val(q.texts),a("#button").val(q.label),a("#enabled").val(q.enabled),a("#reply").val(q.reply),a("#order").val(q.orderTool),q=new h,r=null):(q=new h,a("#typetool").on("change",function(){q=new h,q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val();var b=x(q.typetool);q.type=b,q.colors=b.get_color(),q.cartridgeColor=b.get_color_cartridge(),a("#color").val(q.colors),a("#cartridgecolor").val(q.cartridgeColor),y()}),a("#typetool").change()),a("#toolFormSubmit").on("click",function(){if(""===a("#button").val())a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageaddlibelleko),a("#message_edit_tool").addClass("alert-warning"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success");else{var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1));var d=a("#assignfeedback_editpdfplus_edit_tool"),e=d.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_add_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageaddok),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html("");for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B),a("#toolworkspace").html("");var f=b[0].axeid,g=a("#editpdlplus_axes option[value='"+f+"']");g.data("delete",1);var i=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");i.prop("disabled",!0)}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}})}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception)},u});
\ No newline at end of file
define(["jquery","jqueryui","core/notification","core/templates","core/fragment","core/ajax","core/str","assignfeedback_editpdfplus/tool","assignfeedback_editpdfplus/tooltype","assignfeedback_editpdfplus/annotationhighlightplus","assignfeedback_editpdfplus/annotationstampplus","assignfeedback_editpdfplus/annotationframe","assignfeedback_editpdfplus/annotationcommentplus","assignfeedback_editpdfplus/annotationverticalline","assignfeedback_editpdfplus/annotationstampcomment"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){var p=null,q=null,r=null,s=null,t=null,u=function(a,b){p=a,this.initTypeTool(b),this.init()};u.messageDelOk="",u.messageDelKo="",u.messageko="",u.messageaddok="",u.messageaddlibelleko="",u.messageEditOk="",u.prototype.selectTool=null;var v=function(){g.get_string("admindeltool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageDelOk=a}).fail(c.exception),g.get_string("admindeltool_messageko","assignfeedback_editpdfplus").done(function(a){u.messageDelKo=a}).fail(c.exception),g.get_string("adminaddtool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageaddok=a}).fail(c.exception),g.get_string("admin_messageko","assignfeedback_editpdfplus").done(function(a){u.messageko=a}).fail(c.exception),g.get_string("adminedittool_messageok","assignfeedback_editpdfplus").done(function(a){u.messageEditOk=a}).fail(c.exception),g.get_string("adminaddtool_messagelibelleko","assignfeedback_editpdfplus").done(function(a){u.messageaddlibelleko=a}).fail(c.exception)};u.prototype.initTypeTool=function(a){var b=JSON.parse(a);s=[];for(var c=0;c<b.length;c++){var d=new i;d.initAdmin(b[c]),s[c]=d}},u.prototype.init=function(){a("#editpdlplus_axes").on("change",function(){a(".toolbar").hide();var b=a("#editpdlplus_axes").val();if(b&&""!==b){a("#editpdlplus_toolbar_"+b).show();var c=a("#editpdlplus_axes option:selected").data("delete");c?parseInt(c)>0?a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").prop("disabled",!0):a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeAttr("disabled"):(a("#editpdlplus_axes option[value='"+b+"']").data("delete",0),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").removeAttr("disabled"))}else a("#assignfeedback_editpdfplus_widget_admin_workspace").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide();a("#toolworkspace").html("")}),a("#editpdlplus_axes").change(),a(".editpdlplus_tool").on("click",B),this.selectTool=a(".editpdlplus_tool").first(),this.initToolUI(),a("#assignfeedback_editpdfplus_widget_admin_button_addaxis").on("click",this.openDivAddAxis),a("#assignfeedback_editpdfplus_widget_admin_button_editaxis").on("click",this.openDivEditAxis),a("#assignfeedback_editpdfplus_widget_admin_button_delaxis").on("click",this.openDivDelAxis),a("#assignfeedback_editpdfplus_widget_admin_button_addtool").on("click",this.openDivAddTool),a(".btn-primary").click(),a(".btnimport").on("click",this.importAxis),v()},u.prototype.initToolUI=function(){a(this.selectTool).addClass("btn-primary"),w()};var w=function(){a(".sortable").sortable({placeholder:"alert-warning",handle:"button",cancel:"",stop:function(b,d){var e=a(d.item).prev().find("button").val(),g=a(d.item).next().find("button").val(),h=a(d.item).find("button").val();a("input[name^='previoustoolid']").val(e),a("input[name^='toolid']").val(h),a("input[name^='nexttoolid']").val(g);var i=a("#assignfeedback_editpdfplus_order_tool"),j=i.serialize()+"&contextid="+p;f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_order_form",args:{jsonformdata:JSON.stringify(j)}}])[0].done(function(b){"ok"===b.message?(a("#message_order_tool").show(),a("#message_order_tool").html(u.messageEditOk),a("#message_order_tool").addClass("alert-success"),a("#message_order_tool").removeClass("alert-danger"),a("#message_order_tool").removeClass("alert-warning"),a("#message_order_tool").fadeOut(5e3)):(a("#message_order_tool").show(),a("#message_order_tool").html(u.messageko),a("#message_order_tool").addClass("alert-danger"),a("#message_order_tool").removeClass("alert-success"),a("#message_order_tool").fadeOut(5e3))}).fail(c.exception)}}),a(".sortable").disableSelection()};u.prototype.refreshPrevisu=function(){q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val(),q.colors=a("#color").val(),q.cartridge=a("#libelle").val(),q.cartridgeColor=a("#cartridgecolor").val();var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1)),q.texts=a("#texts").val(),q.label=a("#button").val(),q.enabled=a("#enabled").val(),q.reply=0,a("#reply").is(":checked")&&(q.reply=1),q.orderTool=a("#order").val(),z(),y()};var x=function(a){for(var b=0;b<s.length;b++)if(s[b].id==a)return s[b]},y=function(){var b=parseInt(a("#typetool").val()),c=x(b),d=!1,e=!1;c.configurableCartridge&&0===parseInt(c.configurableCartridge)?(a("#libelle").hide(),a("label[for='libelle']").hide(),d=!0):(a("#libelle").show(),a("label[for='libelle']").show()),c.configurableCartridgeColor&&0===parseInt(c.configurableCartridgeColor)?(a("#cartridgecolor").hide(),a("label[for='cartridgecolor']").hide(),e=!0):(a("#cartridgecolor").show(),a("label[for='cartridgecolor']").show()),d&&e?a("#collapse3").parent().hide():a("#collapse3").parent().show();var f=!1,g=!1,h=!1;c.configurableColor&&0===parseInt(c.configurableColor)?(a("#color").hide(),a("label[for='color']").hide(),f=!0):(a("#color").show(),a("label[for='color']").show()),c.configurableTexts&&0===parseInt(c.configurableTexts)?(a(".textform").hide(),a("label[for='texts']").hide(),g=!0):(a(".textform").show(),a("label[for='texts']").show()),c.configurableQuestion&&0===parseInt(c.configurableQuestion)?(a("#reply").hide(),a("label[for='reply']").hide(),h=!0):(a("#reply").show(),a("label[for='reply']").show()),f&&h&&g?a("#collapse4").parent().hide():a("#collapse4").parent().show()},z=function(){a("#canevas").html(""),t=null;var b=parseInt(a("#typetool").val());if(3===b||4===b||7===b?a("#canevas").css("background-image","url("+a("#map01").val()+")"):1===b||6===b?a("#canevas").css("background-image","url("+a("#map02").val()+")"):5===b&&a("#canevas").css("background-image","url("+a("#map03").val()+")"),1===b)t=new j;else if(3===b)t=new k;else if(4===b){t=new l;var c=new l}else 5===b?t=new n:6===b?t=new o:7===b&&(t=new m);if(t){var d=x(b);q.type=d,q.reply=0,a("#reply").is(":checked")&&(q.reply=1),t.initAdminDemo(q),t.draw(a("#canevas")),c&&(c.initChildAdminDemo(t),c.draw(a("#canevas")))}};u.prototype.openDivAddAxis=function(){var b=a("#editpdlplus_axes").val();b&&""!==b?(a("#message_edit_tool").hide(),a("#axistool").hide()):(a("#assignfeedback_editpdfplus_widget_admin_workspace").show(),a("#editpdlplus_axes_worspace").hide()),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_addaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var f={};e.loadFragment("assignfeedback_editpdfplus","axisadd",p,f).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_addaxis",a,b)}.bind(this)).fail(c.exception)},u.prototype.openDivEditAxis=function(){a("#message_edit_tool").hide(),a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_editaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var b=a("#editpdlplus_axes option:selected").val(),f={axeid:b};e.loadFragment("assignfeedback_editpdfplus","axisedit",p,f).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_editaxis",a,b)}.bind(this)).fail(c.exception)},u.prototype.openDivDelAxis=function(){var b=a("#editpdlplus_axes option:selected").data("delete");if(null!==b&&0===parseInt(b)){a("#message_edit_tool").hide(),a("#axistool").hide(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").show(),a("#assignfeedback_editpdfplus_widget_admin_div_delaxis").html(""),a("#assignfeedback_editpdfplus_widget_admin_toolheader").hide(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").hide(),a("#editpdlplus_axes").prop("disabled",!0);var f=a("#editpdlplus_axes option:selected").val(),g={axeid:f};e.loadFragment("assignfeedback_editpdfplus","axisdel",p,g).done(function(a,b){d.appendNodeContents("#assignfeedback_editpdfplus_widget_admin_div_delaxis",a,b)}.bind(this)).fail(c.exception)}};var A=function(b,c,e){var f=a.Deferred();return b.fadeOut("fast",function(){d.replaceNodeContents(b,c,e),b.fadeIn("fast",function(){f.resolve()})}),f.promise()};u.prototype.importAxis=function(){var b=a(this).data("axis");if(b&&parseInt(b)>0){a("#assignfeedback_editpdfplus_import_axis > div > input[name^='axeid']").val(b);var d=a("#assignfeedback_editpdfplus_import_axis"),e=d.serialize()+"&contextid="+p;f.call([{methodname:"assignfeedback_editpdfplus_submit_axis_import_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_import_axis").show(),a("#message_import_axis").html(u.messageaddok),a("#message_import_axis").addClass("alert-success"),a("#message_import_axis").removeClass("alert-danger"),a("#message_import_axis").removeClass("alert-warning"),a("#message_import_axis").fadeOut(5e3);var c="<div id='editpdlplus_toolbar_"+b[0].axeid+"' class='btn-group toolbar' style='display: none;'><ul class='sortable' style='list-style-type: none;margin: 0;padding: 0;width: 100%;'></ul></div>";a("#editpdlplus_toolbars").append(c),w();var d=new Option(b[0].axelabel,b[0].axeid,(!0),(!0));a("#editpdlplus_axes").append(d);var e=a("#editpdlplus_axes option[value='"+b[0].axeid+"']");e.data("delete",1);var f=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");if(f.prop("disabled",!0),a("#editpdlplus_tool_item").html(""),b[0].toolid&&b[0].toolid>0)for(var g=0;g<b.length;g++){var i=new h;i.initAdmin(b[g]);var j=i.getButtonSortable(b[g].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(j)}else{var k=b[0].axeid,e=a("#editpdlplus_axes option[value='"+k+"']");e.data("delete",0);var f=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");f.removeAttr("disabled")}a(".editpdlplus_tool").on("click",B),a("#editpdlplus_axes").change(),a("a[href^='#collapseadmin1'").click(),a("#axistool").show(),a("#assignfeedback_editpdfplus_widget_admin_toolheader").show(),a("#assignfeedback_editpdfplus_widget_admin_workspace").show(),a("#assignfeedback_editpdfplus_widget_admin_toolworkspace").show()}else a("#message_import_axis").show(),a("#message_import_axis").html(b[0].message),a("#message_import_axis").addClass("alert-danger"),a("#message_import_axis").removeClass("alert-success"),a("#message_import_axis").fadeOut(5e3)}).fail(c.exception)}};var B=function(){var b=a(this).val();a(".editpdlplus_tool").each(function(){a(this).removeClass("btn-primary"),a(this).css("background-image",""),a(this).css("background-color","");var c=a(this).data("enable");1!==c&&a(this).val()!==b&&(a(this).css("background-image","none"),a(this).css("background-color","#CCCCCC"))}),a(this).addClass("btn-primary"),q&&q.id===b||a("#message_edit_tool").hide(),a("#editpdlplus_tool_item").html("");var d={toolid:b};e.loadFragment("assignfeedback_editpdfplus","tooledit",p,d).done(function(d,e){A(a("#editpdlplus_tool_item"),d,e).done(function(){q=new h,q.id=b,q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val();var d=x(q.typetool);q.type=d;var e=a("#realcolor").val();e.length>0?q.colors=a("#color").val():(a("#color").val(d.color),q.colors=null),q.cartridge=a("#libelle").val(),a("#realcartridgecolor").val()&&a("#realcartridgecolor").val().length>0?q.cartridgeColor=a("#cartridgecolor").val():(a("#cartridgecolor").val(d.get_color_cartridge()),q.cartridgeColor=null),q.texts=a("#texts").val(),q.label=a("#button").val(),q.enabled=a("#enabled").val(),q.reply=a("#reply").val(),q.orderTool=a("#order").val(),a("#typetool").on("change",function(){q.typetool=a("#typetool").val();var b=x(q.typetool);q.type=b,q.colors=b.get_color(),q.cartridgeColor=b.get_color_cartridge(),a("#color").val(q.colors),a("#cartridgecolor").val(q.cartridgeColor),y(),z()}),a("#toolFormSubmit").on("click",function(){var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1));var d=a("#assignfeedback_editpdfplus_edit_tool"),e=d.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_edit_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageEditOk),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_tool_"+b[0].selecttool).remove(),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html("");for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B);var f=a("#axisid").val();f!==b[0].axeid&&(a("#editpdlplus_axes").val(b[0].axeid),a("#editpdlplus_axes").change()),a("#editpdlplus_tool_"+b[0].selecttool).click()}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}),a("#toolEnabled").on("click",function(){var b=a("#toolenabled").val();1==b?(a("#toolEnabled > i").addClass("fa-eye-slash"),a("#toolEnabled > i").removeClass("fa-eye"),a("#toolenabled").val(0)):(a("#toolEnabled > i").addClass("fa-eye"),a("#toolEnabled > i").removeClass("fa-eye-slash"),a("#toolenabled").val(1)),a("#toolFormSubmit").click()}),a("#toolClone").on("click",function(){r="clone",a("#assignfeedback_editpdfplus_widget_admin_button_addtool").click()}),a("#toolRemove").on("click",function(){if(!a(this).prop("disabled")){var b=a("#assignfeedback_editpdfplus_edit_tool"),d=b.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_del_form",args:{jsonformdata:JSON.stringify(d)}}])[0].done(function(b){if(""===b[0].message||"1"===b[0].message){if(a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageDelOk),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html(""),parseInt(b[0].toolid)>0){for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B)}else{var f=b[0].axeid,g=a("#editpdlplus_axes option[value='"+f+"']");g.data("delete",0);var i=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");i.removeAttr("disabled")}a("#toolworkspace").html("")}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}}),a("#toolRefesh").on("click",function(){u.prototype.refreshPrevisu()}),z(),y()}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception)};return u.prototype.openDivAddTool=function(){a("#message_edit_tool").hide(),a("#editpdlplus_tool_item").html(""),a(".editpdlplus_tool").removeClass("btn-primary");var b=a("#editpdlplus_axes option:selected").val(),d={axisid:b};e.loadFragment("assignfeedback_editpdfplus","tooladd",p,d).done(function(d,e){A(a("#editpdlplus_tool_item"),d,e).done(function(){a("#toolaxis").val(b),"clone"===r?(a("#toolaxis").val(q.axis),a("#typetool").val(q.typetool),a("#color").val(q.colors),a("#libelle").val(q.cartridge),a("#cartridgecolor").val(q.cartridgeColor),a("#texts").val(q.texts),a("#button").val(q.label),a("#enabled").val(q.enabled),a("#reply").val(q.reply),a("#order").val(q.orderTool),q=new h,r=null):(q=new h,a("#typetool").on("change",function(){q=new h,q.axis=a("#toolaxis").val(),q.typetool=a("#typetool").val();var b=x(q.typetool);q.type=b,q.colors=b.get_color(),q.cartridgeColor=b.get_color_cartridge(),a("#color").val(q.colors),a("#cartridgecolor").val(q.cartridgeColor),u.prototype.refreshPrevisu()}),a("#typetool").change()),a("#toolFormSubmit").on("click",function(){if(""===a("#button").val())a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageaddlibelleko),a("#message_edit_tool").addClass("alert-warning"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success");else{var b="";a("input[name^='text[']").each(function(){a(this).val()&&a(this).val().length>0&&(b+='"'+a(this).val().replace(/"/g,"")+'",')}),b.length>0&&a("#texts").val(b.substring(0,b.length-1));var d=a("#assignfeedback_editpdfplus_edit_tool"),e=d.serialize();f.call([{methodname:"assignfeedback_editpdfplus_submit_tool_add_form",args:{jsonformdata:JSON.stringify(e)}}])[0].done(function(b){if(""===b[0].message){a("#message_edit_tool").show(),a("#message_edit_tool").html(u.messageaddok),a("#message_edit_tool").addClass("alert-success"),a("#message_edit_tool").removeClass("alert-danger"),a("#message_edit_tool").removeClass("alert-warning"),a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").html("");for(var c=0;c<b.length;c++){var d=new h;d.initAdmin(b[c]);var e=d.getButtonSortable(b[c].selecttool);a("#editpdlplus_toolbar_"+b[0].axeid+" > ul").append(e)}a(".editpdlplus_tool").on("click",B),a("#toolworkspace").html("");var f=b[0].axeid,g=a("#editpdlplus_axes option[value='"+f+"']");g.data("delete",1);var i=a("#assignfeedback_editpdfplus_widget_admin_button_delaxis");i.prop("disabled",!0)}else a("#message_edit_tool").show(),a("#message_edit_tool").html(b[0].message),a("#message_edit_tool").addClass("alert-danger"),a("#message_edit_tool").removeClass("alert-success")}).fail(c.exception)}})}.bind(this)).fail(c.exception)}.bind(this)).fail(c.exception)},u});
\ No newline at end of file
......@@ -781,7 +781,6 @@ define(['jquery', 'jqueryui', 'core/notification', 'core/templates', 'core/fragm
.done(function (html, js) {
fillResultAjax($('#editpdlplus_tool_item'), html, js)
.done(function () {
$("#canevas").hide();
$("#toolaxis").val(axeid);
if (action === "clone") {
$("#toolaxis").val(currentTool.axis);
......@@ -808,7 +807,7 @@ define(['jquery', 'jqueryui', 'core/notification', 'core/templates', 'core/fragm
currentTool.cartridgeColor = typetoolEntity.get_color_cartridge();
$("#color").val(currentTool.colors);
$("#cartridgecolor").val(currentTool.cartridgeColor);
initToolDisplay();
AdminPanel.prototype.refreshPrevisu();
});
$("#typetool").change();
}
......
......@@ -61,6 +61,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool1b->color = "red";
$tytool1b->contextid = 1;
$tytool1b->label = "lineplus";
$tytool1b->configurable = 0;
$tytool2 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool2->cartridge_color = null;
$tytool2->cartridge_x = null;
......@@ -68,6 +69,10 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool2->color = "red";
$tytool2->contextid = 1;
$tytool2->label = "stampplus";
$tytool2->configurable_cartridge = 0;
$tytool2->configurable_cartridge_color = 0;
$tytool2->configurable_texts = 0;
$tytool2->configurable_question = 0;
$tytool3 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool3->cartridge_color = null;
$tytool3->cartridge_x = 5;
......@@ -75,6 +80,8 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool3->color = "#FF0000";
$tytool3->contextid = 1;
$tytool3->label = "frame";
$tytool3->configurable_cartridge_color = 0;
$tytool3->configurable_color = 0;
$tytool4 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool4->cartridge_color = "#0000FF";
$tytool4->cartridge_x = 5;
......@@ -89,6 +96,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool5->color = "#000099";
$tytool5->contextid = 1;
$tytool5->label = "stampcomment";
$tytool5->configurable_color = 0;
$tytool6 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool6->cartridge_color = "#000000";
$tytool6->cartridge_x = null;
......@@ -96,6 +104,8 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool6->color = null;
$tytool6->contextid = 1;
$tytool6->label = "commentplus";
$tytool6->configurable_texts = 0;
$tytool6->configurable_color = 0;
$tytool7 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool7->cartridge_color = null;
$tytool7->cartridge_x = null;
......@@ -103,6 +113,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool7->color = null;
$tytool7->contextid = 1;
$tytool7->label = "pen";
$tytool7->configurable = 0;
$tytool8 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool8->cartridge_color = null;
$tytool8->cartridge_x = null;
......@@ -110,6 +121,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool8->color = null;
$tytool8->contextid = 1;
$tytool8->label = "line";
$tytool8->configurable = 0;
$tytool9 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool9->cartridge_color = null;
$tytool9->cartridge_x = null;
......@@ -117,6 +129,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool9->color = null;
$tytool9->contextid = 1;
$tytool9->label = "rectangle";
$tytool9->configurable = 0;
$tytool10 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool10->cartridge_color = null;
$tytool10->cartridge_x = null;
......@@ -124,6 +137,7 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool10->color = null;
$tytool10->contextid = 1;
$tytool10->label = "oval";
$tytool10->configurable = 0;
$tytool11 = new assignfeedback_editpdfplus\bdd\type_tool();
$tytool11->cartridge_color = null;
$tytool11->cartridge_x = null;
......@@ -131,7 +145,8 @@ function xmldb_assignfeedback_editpdfplus_install() {
$tytool11->color = null;
$tytool11->contextid = 1;
$tytool11->label = "highlight";
$tytools = array($tytool1,$tytool1b, $tytool2, $tytool3, $tytool4, $tytool5, $tytool6, $tytool7, $tytool8, $tytool9, $tytool10, $tytool11);
$tytool11->configurable = 0;
$tytools = array($tytool1, $tytool1b, $tytool2, $tytool3, $tytool4, $tytool5, $tytool6, $tytool7, $tytool8, $tytool9, $tytool10, $tytool11);
$DB->insert_records('assignfeedback_editpp_typet', $tytools);
//tools
$tool1 = new assignfeedback_editpdfplus\bdd\tool();
......
......@@ -80,7 +80,7 @@ function assignfeedback_editpdfplus_pluginfile($course, $cm, context $context, $
* @param context_course $context
*/
function assignfeedback_editpdfplus_extend_navigation_course(navigation_node $navigation, stdClass $course, context_course $context) {
if (has_capability('assignfeedback/editpdfplus:use', $context, null, false) && has_capability('assignfeedback/editpdfplus:managetools', $context)) {
if (has_capability('assignfeedback/editpdfplus:managetools', $context)) {
$url = new moodle_url('/mod/assign/feedback/editpdfplus/view_admin.php', array('id' => $context->id));
$feedbackadminnode = navigation_node::create('Feedback : configuration', $url, navigation_node::TYPE_CUSTOM, 'Bars d\'outils', 'editpdfplusadmin', new pix_icon('i/grades', ""));
$navigation->add_node($feedbackadminnode);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment