Plugin Directory

Changeset 2920829


Ignore:
Timestamp:
06/02/2023 09:31:49 PM (3 years ago)
Author:
m1r0
Message:

Sensei Certificates 2.4.0

Location:
sensei-certificates/trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • sensei-certificates/trunk/assets/dist/blocks/index.asset.php

    r2754511 r2920829  
    1 <?php return array('dependencies' => array('wp-blocks', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '0c32c7fc713a6cb6381ed200ab11ecb1');
     1<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-primitives'), 'version' => '334d4c1adb376c3337d3');
  • sensei-certificates/trunk/assets/dist/blocks/index.js

    r2754511 r2920829  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=9)}([function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(10),o=r(11),i=r(12),s=r(13);e.exports=function(e){return n(e)||o(e)||i(e)||s()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.hooks},,,,,function(e,t,r){"use strict";r.r(t);var n=r(3),o=r.n(n),i=r(0),s=r(4),c=r(1),a={className:"view-certificate",text:Object(i.__)("View Certificate","sensei-certificates")};Object(c.registerBlockVariation)("core/button",{name:"sensei-certificates/view-certificate-button",title:Object(i.__)("View Certificate","sensei-certificates"),description:Object(i.__)("Enable students to view their course certificate.","sensei-certificates"),keywords:[Object(i.__)("Certificates","sensei-lms")],category:"sensei-lms",attributes:a,isActive:function(e,t){var r;return null===(r=e.className)||void 0===r?void 0:r.match(t.className)}}),Object(s.addFilter)("sensei-lms.Course.completedActions","sensei-certificates",(function(e){return[].concat(o()(e),[["core/button",a]])})),Object(c.registerBlockVariation)("core/buttons",{name:"sensei-certificates/view-certificate-buttons",title:Object(i.__)("View Certificate","sensei-certificates"),description:Object(i.__)("A Buttons block with a View Certificate button.","sensei-certificates"),category:"sensei-lms",keywords:[Object(i.__)("Certificate","sensei-certificates"),Object(i.__)("View Certificate","sensei-certificates")],innerBlocks:[["core/button",a]]})},function(e,t,r){var n=r(2);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var n=r(2);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}]);
     1(()=>{"use strict";const e=window.wp.i18n,t=window.wp.hooks,i=window.wp.blocks,s=window.wp.element,c=window.wp.primitives,n=(0,s.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(c.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),r=window.wp.blockEditor,a=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"sensei-certificates/view-certificate-link","title":"View Certificate","category":"sensei-lms","description":"Displays a link to the certificate.","textdomain":"sensei-certificates","ancestor":["sensei-lms/course-list"],"usesContext":["postType"],"example":{}}'),o={...a,metadata:a,icon:n,edit:t=>{let{context:{postType:i}}=t;const c=(0,r.useBlockProps)();return["course","lesson"].includes(i)?(0,s.createElement)("div",c,(0,s.createElement)("a",{href:"#"},(0,e.__)("View Certificate","sensei-certificates"))):(0,s.createElement)("div",c,(0,s.createElement)(r.Warning,null,(0,e.__)("The View Certificate Link block can only be used inside the Course List block.","sensei-certificates")))}};(0,i.registerBlockType)(o.name,o);const l={className:"view-certificate",text:(0,e.__)("View Certificate","sensei-certificates")};(0,i.registerBlockVariation)("core/button",{name:"sensei-certificates/view-certificate-button",title:(0,e.__)("View Certificate","sensei-certificates"),description:(0,e.__)("Enable students to view their course certificate.","sensei-certificates"),keywords:[(0,e.__)("Certificates","sensei-lms")],category:"sensei-lms",attributes:l,isActive:(e,t)=>e.className?.match(t.className)}),(0,t.addFilter)("sensei-lms.Course.completedActions","sensei-certificates",(e=>[...e,["core/button",l]])),(0,i.registerBlockVariation)("core/buttons",{name:"sensei-certificates/view-certificate-buttons",title:(0,e.__)("View Certificate","sensei-certificates"),description:(0,e.__)("A Buttons block with a View Certificate button.","sensei-certificates"),category:"sensei-lms",keywords:[(0,e.__)("Certificate","sensei-certificates"),(0,e.__)("View Certificate","sensei-certificates")],innerBlocks:[["core/button",l]]})})();
  • sensei-certificates/trunk/assets/dist/css/admin.asset.php

    r2590019 r2920829  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => '95782c934053e929c11fe4010c0c2b61');
     1<?php return array('dependencies' => array(), 'version' => '6bb82011b868abf7277b');
  • sensei-certificates/trunk/assets/dist/css/admin.css

    r2484656 r2920829  
    1 #certificate_image_wrapper .certificate_field{background-color:#ccc;border:1px dashed #888;opacity:.5;position:absolute;text-align:center}.colorpick-form-field{position:relative}.certificate_templates_options_panel,.panel{padding:9px 9px 9px 9px;color:#555}.certificate_templates_options_panel p{margin:0 0 9px;font-size:12px;padding:5px 9px;line-height:24px;clear:both}.certificate_templates_options_panel .checkbox{vertical-align:middle;margin:7px 0;width:auto}.certificate_templates_options_panel p{margin:9px 0 9px}.certificate_templates_options_panel label,legend{float:left;width:150px;padding:0}.certificate_templates_options_panel label.req,legend.req{font-weight:bold;font-style:normal;color:red}.certificate_templates_options_panel .description{padding:0;margin:0 0 0 7px}.certificate_templates_options_panel .description-block{margin-left:0;display:block}.certificate_templates_options_panel textarea,input,select{margin:0}.certificate_templates_options_panel textarea{vertical-align:top;height:10.5em;line-height:1.5em}.certificate_templates_options_panel input{width:50%;float:left}.certificate_templates_options_panel input.button{width:auto;margin-left:8px}.certificate_templates_options_panel select{float:left}.certificate_templates_options_panel .short{width:20%}.certificate_templates_options_panel .form-field input.medium,.certificate_templates_options_panel .form-field textarea.medium{width:40%}.certificate_templates_options_panel .threequarter{width:70%}.certificate_templates_options_panel .sized{width:auto !important;margin-right:6px}.certificate_templates_options_panel .options_group{border-top:1px solid #fff;border-bottom:1px solid #dfdfdf}.certificate_templates_options_panel .options_group:first-child{border-top:0}.certificate_templates_options_panel .options_group:last-child{border-bottom:0}.certificate_templates_options_panel .options_group fieldset{margin:9px 0;font-size:12px;padding:5px 9px;line-height:24px}.certificate_templates_options_panel .options_group fieldset label{width:auto;float:none}.certificate_templates_options_panel .options_group fieldset ul{float:left;width:50%;margin:0;padding:0}.certificate_templates_options_panel .options_group fieldset ul li{margin:0;width:auto}.certificate_templates_options_panel .options_group fieldset ul li input{width:auto;float:none;margin-right:4px}.certificate_templates_options_panel .dimensions_field .wrap input{margin-right:.2%;width:6.6%}.certificate_templates_options_panel .dimensions_field .wrap .last{margin-right:0}.certificate_templates_options_panel .upload_file_button{padding-left:20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==) !important;background-color:#fefefe !important;background-repeat:no-repeat !important;background-position:8px 7px !important}
     1#certificate_image_wrapper .certificate_field{background-color:#ccc;border:1px dashed #888;opacity:.5;position:absolute;text-align:center}.colorpick-form-field{position:relative}.certificate_templates_options_panel,.panel{color:#555;padding:9px}.certificate_templates_options_panel p{clear:both;font-size:12px;line-height:24px;margin:0 0 9px;padding:5px 9px}.certificate_templates_options_panel .checkbox{margin:7px 0;vertical-align:middle;width:auto}.certificate_templates_options_panel p{margin:9px 0}.certificate_templates_options_panel label,legend{float:left;padding:0;width:150px}.certificate_templates_options_panel label.req,legend.req{color:red;font-style:normal;font-weight:700}.certificate_templates_options_panel .description{margin:0 0 0 7px;padding:0}.certificate_templates_options_panel .description-block{display:block;margin-left:0}.certificate_templates_options_panel textarea,input,select{margin:0}.certificate_templates_options_panel textarea{height:10.5em;line-height:1.5em;vertical-align:top}.certificate_templates_options_panel input{float:left;width:50%}.certificate_templates_options_panel input.button{margin-left:8px;width:auto}.certificate_templates_options_panel select{float:left}.certificate_templates_options_panel .short{width:20%}.certificate_templates_options_panel .form-field input.medium,.certificate_templates_options_panel .form-field textarea.medium{width:40%}.certificate_templates_options_panel .threequarter{width:70%}.certificate_templates_options_panel .sized{margin-right:6px;width:auto!important}.certificate_templates_options_panel .options_group{border-bottom:1px solid #dfdfdf;border-top:1px solid #fff}.certificate_templates_options_panel .options_group:first-child{border-top:0}.certificate_templates_options_panel .options_group:last-child{border-bottom:0}.certificate_templates_options_panel .options_group fieldset{font-size:12px;line-height:24px;margin:9px 0;padding:5px 9px}.certificate_templates_options_panel .options_group fieldset label{float:none;width:auto}.certificate_templates_options_panel .options_group fieldset ul{float:left;margin:0;padding:0;width:50%}.certificate_templates_options_panel .options_group fieldset ul li{margin:0;width:auto}.certificate_templates_options_panel .options_group fieldset ul li input{float:none;margin-right:4px;width:auto}.certificate_templates_options_panel .dimensions_field .wrap input{margin-right:.2%;width:6.6%}.certificate_templates_options_panel .dimensions_field .wrap .last{margin-right:0}.certificate_templates_options_panel .upload_file_button{background-color:#fefefe!important;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAQ0lEQVQYV3WPUQoAMAhC1+E6tYdrFBgiW185X7biSAGolpkZfN6GJg1CA7ip0CYo+FzxBTqeE/7J1qGAXsTEAdxQfQHJTymZe4oqiAAAAABJRU5ErkJggg==)!important;background-position:8px 7px!important;background-repeat:no-repeat!important;padding-left:20px}
  • sensei-certificates/trunk/assets/dist/css/frontend.asset.php

    r2590019 r2920829  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'e6cc762ff96901e13b4d4080f91d3767');
     1<?php return array('dependencies' => array(), 'version' => '4aa5ac4e60bf8de6fe3a');
  • sensei-certificates/trunk/assets/dist/js/admin.asset.php

    r2754511 r2920829  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => '7b01659d7612f945b93465eb14bab1be');
     1<?php return array('dependencies' => array(), 'version' => '7897f7fa5485ae5a7f01');
  • sensei-certificates/trunk/assets/dist/js/admin.js

    r2590019 r2920829  
    1 !function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}({5:function(e,t){jQuery((function(e){"use strict";var t,i;window.send_to_editor_default=window.send_to_editor;var n=sensei_certificate_templates_params.primary_image_width,a=sensei_certificate_templates_params.primary_image_height;function r(){e(".field_pos").each((function(t,i){var a=(i=e(i)).attr("id"),r=e("#field"+a),c=e("#certificate_image_0");if(""!=c.attr("src")){var l=1;n!=c.width()&&(l=c.width()/n);var s=i.val()?i.val().split(",").map((function(e){return parseInt(e)*l})):null;0===r.length&&(e("#certificate_image_wrapper").append('<span id="field'+a+'" class="certificate_field" style="display:none;">'+sensei_certificate_templates_params[a]+"</span>"),e("#field"+a).click((function(e){o(e.target.id.substr(6))})),r=e("#field"+a)),s?(r.css({left:s[0]+"px",top:s[1]+"px",width:s[2]+"px",height:s[3]+"px"}),r.show()):r.hide()}else r&&r.hide()}))}function o(t){if(e("img#certificate_image_0").attr("src"))if(c(),e("#"+t).val()!=sensei_certificate_templates_params.done_label){e("#field_"+t).hide();var i=e("#_"+t).val()?e("#_"+t).val().split(",").map((function(e){return parseInt(e)})):[null,null,null,null];e("input.set_position").val(sensei_certificate_templates_params.set_position_label),e("#"+t).val(sensei_certificate_templates_params.done_label),e("img#certificate_image_0").imgAreaSelect({show:!0,handles:!0,instance:!0,imageWidth:n,imageHeight:a,x1:i[0],y1:i[1],x2:i[0]+i[2],y2:i[1]+i[3],onSelectEnd:function(i,n){!function(t,i){t&&0!==t.width&&0!==t.height?e("#_"+i).val(t.x1+","+t.y1+","+t.width+","+t.height):o(i),e("#remove_"+i).show()}(n,t)}}),e(document).scrollTop()>e("img#certificate_image_0").offset().top+e("img#certificate_image_0").height()*(2/3)&&e("html, body").animate({scrollTop:e("#title").offset().top},500)}else e("#"+t).val(sensei_certificate_templates_params.set_position_label)}function c(){e("img#certificate_image_0").imgAreaSelect({remove:!0}),r()}e(document).on("click","#set-certificate-image",(function(r){r.preventDefault(),i=e(this),t||(t=wp.media.frames.file_frame=wp.media({title:"Select an Image",button:{text:"Set Image"},multiple:!1})).on("select",(function(){var r=t.state().get("selection").first().toJSON();n=r.width,a=r.height,"set-certificate-image"==i.attr("id")&&(e("#upload_image_id_0").val(r.id),e("#remove-certificate-image").show(),e("img#certificate_image_0").attr("src",r.url))})),t.open()})),e("#remove-certificate-image").click((function(){return e("#upload_image_id_0").val(""),e("img#certificate_image_0").attr("src",""),e(this).hide(),!1})),e(window).resize((function(){r()})),r(),e("input.set_position").click((function(){o(this.id)})),e("input.remove_position").click((function(){e(this).hide(),e("#_"+this.id.substr(7)).val(""),e("#"+this.id.substr(7)).val(sensei_certificate_templates_params.set_position_label),c()})),"function"!=typeof jQuery.fn.hasParent&&jQuery.extend(jQuery.fn,{hasParent:function(t){return this.filter((function(){return e(t).find(this).length}))}});var l=e(".colorpick");"function"==typeof jQuery.fn.wpColorPicker&&l.length>0&&(l.wpColorPicker(),e(document).mousedown((function(t){e(t.target).hasParent(".wp-picker-holder")||e(t.target).hasParent("mark")||e(".wp-picker-holder").each((function(){e(this).fadeOut()}))})))}))}});
     1jQuery((function(e){"use strict";var t,i;window.send_to_editor_default=window.send_to_editor;var a=sensei_certificate_templates_params.primary_image_width,n=sensei_certificate_templates_params.primary_image_height;function r(){e(".field_pos").each((function(t,i){var n=(i=e(i)).attr("id"),r=e("#field"+n),c=e("#certificate_image_0");if(""!=c.attr("src")){var l=1;a!=c.width()&&(l=c.width()/a);var o=i.val()?i.val().split(",").map((function(e){return parseInt(e)*l})):null;0===r.length&&(e("#certificate_image_wrapper").append('<span id="field'+n+'" class="certificate_field" style="display:none;">'+sensei_certificate_templates_params[n]+"</span>"),e("#field"+n).click((function(e){s(e.target.id.substr(6))})),r=e("#field"+n)),o?(r.css({left:o[0]+"px",top:o[1]+"px",width:o[2]+"px",height:o[3]+"px"}),r.show()):r.hide()}else r&&r.hide()}))}function s(t){if(e("img#certificate_image_0").attr("src"))if(c(),e("#"+t).val()!=sensei_certificate_templates_params.done_label){e("#field_"+t).hide();var i=e("#_"+t).val()?e("#_"+t).val().split(",").map((function(e){return parseInt(e)})):[null,null,null,null];e("input.set_position").val(sensei_certificate_templates_params.set_position_label),e("#"+t).val(sensei_certificate_templates_params.done_label),e("img#certificate_image_0").imgAreaSelect({show:!0,handles:!0,instance:!0,imageWidth:a,imageHeight:n,x1:i[0],y1:i[1],x2:i[0]+i[2],y2:i[1]+i[3],onSelectEnd:function(i,a){!function(t,i){t&&0!==t.width&&0!==t.height?e("#_"+i).val(t.x1+","+t.y1+","+t.width+","+t.height):s(i),e("#remove_"+i).show()}(a,t)}}),e(document).scrollTop()>e("img#certificate_image_0").offset().top+e("img#certificate_image_0").height()*(2/3)&&e("html, body").animate({scrollTop:e("#title").offset().top},500)}else e("#"+t).val(sensei_certificate_templates_params.set_position_label)}function c(){e("img#certificate_image_0").imgAreaSelect({remove:!0}),r()}e(document).on("click","#set-certificate-image",(function(r){r.preventDefault(),i=e(this),t||(t=wp.media.frames.file_frame=wp.media({title:"Select an Image",button:{text:"Set Image"},multiple:!1})).on("select",(function(){var r=t.state().get("selection").first().toJSON();a=r.width,n=r.height,"set-certificate-image"==i.attr("id")&&(e("#upload_image_id_0").val(r.id),e("#remove-certificate-image").show(),e("img#certificate_image_0").attr("src",r.url))})),t.open()})),e("#remove-certificate-image").click((function(){return e("#upload_image_id_0").val(""),e("img#certificate_image_0").attr("src",""),e(this).hide(),!1})),e(window).resize((function(){r()})),r(),e("input.set_position").click((function(){s(this.id)})),e("input.remove_position").click((function(){e(this).hide(),e("#_"+this.id.substr(7)).val(""),e("#"+this.id.substr(7)).val(sensei_certificate_templates_params.set_position_label),c()})),"function"!=typeof jQuery.fn.hasParent&&jQuery.extend(jQuery.fn,{hasParent:function(t){return this.filter((function(){return e(t).find(this).length}))}});const l=e(".colorpick");"function"==typeof jQuery.fn.wpColorPicker&&l.length>0&&(l.wpColorPicker(),e(document).mousedown((function(t){e(t.target).hasParent(".wp-picker-holder")||e(t.target).hasParent("mark")||e(".wp-picker-holder").each((function(){e(this).fadeOut()}))})))}));
  • sensei-certificates/trunk/assets/dist/js/course.asset.php

    r2590019 r2920829  
    1 <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'fbcdc0ca6f7851715507063939111b78');
     1<?php return array('dependencies' => array(), 'version' => 'a49f1d707ce9274f7c1e');
  • sensei-certificates/trunk/assets/dist/js/course.js

    r2590019 r2920829  
    1 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}({6:function(e,t){jQuery(document).ready((function(e){jQuery("#course-certificate-template-options")&&jQuery("#course-certificate-template-options").select2({width:"100%"})}))}});
     1jQuery(document).ready((function(e){jQuery("#course-certificate-template-options")&&jQuery("#course-certificate-template-options").select2({width:"100%"})}));
  • sensei-certificates/trunk/changelog.txt

    r2754511 r2920829  
    11*** Changelog ***
     2
     32023.06.01 - version 2.4.0
     4* New: Add "View Certificate" link to Course List templates - #327
     5* New: Bump minimum PHP version to 7.2
     6* Fix: Error on the certificate page for WP VIP users - #335
     7* Fix: Report links on the certificates listing - #298
     8* Fix: Deprecated function warning - #336
    29
    3102022.07.11 - version 2.3.0
  • sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-data-store.php

    r2292649 r2920829  
    2121        $certificate_hash = Woothemes_Sensei_Certificates_Utils::get_certificate_hash( $course_id, $user_id );
    2222        // check if user certificate already exists
    23         $exists = get_page_by_title( $certificate_hash, OBJECT, 'certificate' );
    24         if ( ! empty( $exists ) ) {
     23        $certificate_query = new WP_Query(
     24            array(
     25                'post_type'      => 'certificate',
     26                'post_status'    => 'any',
     27                'posts_per_page' => 1,
     28                'title'          => $certificate_hash,
     29            )
     30        );
     31        if ( $certificate_query->have_posts() ) {
    2532            return new WP_Error( 'sensei_certificates_duplicate' );
    2633        }
  • sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-dependency-checker.php

    r2754511 r2920829  
    1010 */
    1111class Woothemes_Sensei_Certificates_Dependency_Checker {
    12     const MINIMUM_PHP_VERSION    = '7.0';
     12    const MINIMUM_PHP_VERSION    = '7.2';
    1313    const MINIMUM_SENSEI_VERSION = '1.11.0';
    1414
  • sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-tfpdf.php

    r2484656 r2920829  
    2424
    2525        if ( defined( 'WPCOM_IS_VIP_ENV' ) && true === WPCOM_IS_VIP_ENV ) {
    26             require_once dirname( __FILE__ ) . 'class-vip-tfpdf.php';
     26            require_once dirname( __FILE__ ) . '/class-vip-tfpdf.php';
    2727
    2828            return new VIP_tFPDF( $orientation, $units, $size );
  • sensei-certificates/trunk/classes/class-woothemes-sensei-certificates.php

    r2754511 r2920829  
    111111        }
    112112
     113        // Load blocks.
     114        new WooThemes_Sensei_Certificates_View_Certificate_Link_Block();
     115
    113116        $GLOBALS['woothemes_sensei_certificates']          = self::instance();
    114117        $GLOBALS['woothemes_sensei_certificate_templates'] = new WooThemes_Sensei_Certificate_Templates();
     
    188191        add_filter( 'sensei_course_completed_page_template', [ $instance, 'add_certificate_button_to_course_completed_template' ] );
    189192        add_action( 'init', [ $instance, 'add_certificate_button_to_current_course_completed_page' ] );
     193
     194        add_filter( 'sensei_course_list_block_patterns_extra_links', [ $instance, 'add_view_certificate_link_to_block_patterns' ] );
    190195    }
    191196
     
    200205        require_once dirname( __FILE__ ) . '/class-woothemes-sensei-certificates-data-store.php';
    201206        require_once dirname( __FILE__ ) . '/class-woothemes-sensei-certificates-tfpdf.php';
     207        require_once dirname( __FILE__ ) . '/blocks/class-woothemes-sensei-certificates-view-certificate-link-block.php';
    202208    }
    203209
     
    588594                    add_query_arg(
    589595                        array(
    590                             'page'      => 'sensei_analysis',
     596                            'page'      => 'sensei_reports',
    591597                            'user_id'   => intval( $user_id ),
    592598                            'course_id' => intval( $course_id ),
     
    600606                    add_query_arg(
    601607                        array(
    602                             'page'      => 'sensei_analysis',
     608                            'page'      => 'sensei_reports',
    603609                            'course_id' => intval( $course_id ),
    604610                        ),
     
    11141120
    11151121    /**
    1116      * get_certificate_url gets url for certificate
    1117      *
    1118      * @access private
     1122     * Get URL for certificate.
     1123     *
    11191124     * @since  1.0.0
    11201125     * @param  int $course_id course post id
     
    11221127     * @return string $certificate_url certificate link
    11231128     */
    1124     private function get_certificate_url( $course_id, $user_id ) {
     1129    public function get_certificate_url( $course_id, $user_id ) {
    11251130
    11261131        $certificate_url = '';
     
    15911596
    15921597    /**
     1598     * Add "View Certificate" button to the Course List block patterns. To be
     1599     * used with the sensei_course_list_block_patterns_extra_links filter.
     1600     *
     1601     * @since 2.4.0
     1602     *
     1603     * @param array $extra_links The links to be added.
     1604     *
     1605     * @return array
     1606     */
     1607    public function add_view_certificate_link_to_block_patterns( $extra_links ) {
     1608        $extra_links[] = '<!-- wp:sensei-certificates/view-certificate-link /-->';
     1609        return $extra_links;
     1610    }
     1611
     1612    /**
    15931613     * It adds the View Certificate button as inner block to the course completed actions.
    15941614     * If it's not found or if the button is already added, it's not changed.
  • sensei-certificates/trunk/lang/sensei-certificates.pot

    r2754511 r2920829  
    1 # Copyright (C) 2022 Automattic
     1# Copyright (C) 2023 Automattic
    22# This file is distributed under the GPLv2+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Sensei LMS Certificates 2.2.1\n"
     5"Project-Id-Version: Sensei LMS Certificates 2.4.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sensei-certificates\n"
    77"Last-Translator: \n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2022-07-11T07:41:08+00:00\n"
     12"POT-Creation-Date: 2023-05-31T19:11:53+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.6.0\n"
     14"X-Generator: WP-CLI 2.7.1\n"
    1515"X-Domain: sensei-certificates\n"
    1616
     
    117117#: admin/post-types/writepanels/writepanel-certificate_data.php:131
    118118#: classes/class-woothemes-sensei-certificate-templates.php:462
    119 #: classes/class-woothemes-sensei-certificates.php:872
     119#: classes/class-woothemes-sensei-certificates.php:878
    120120#: sensei-certificates-functions.php:201
    121121msgid "Certificate of Completion"
     
    361361#: admin/woothemes-sensei-certificate-templates-admin-init.php:242
    362362#: classes/class-woothemes-sensei-certificate-templates.php:192
    363 #: classes/class-woothemes-sensei-certificates.php:549
     363#: classes/class-woothemes-sensei-certificates.php:555
    364364msgid "Course"
    365365msgstr ""
     
    417417msgstr ""
    418418
     419#: classes/blocks/class-woothemes-sensei-certificates-view-certificate-link-block.php:69
     420#: classes/class-woothemes-sensei-certificate-templates.php:260
     421#: classes/class-woothemes-sensei-certificates.php:511
     422#: classes/class-woothemes-sensei-certificates.php:621
     423#: classes/class-woothemes-sensei-certificates.php:1112
     424#: classes/class-woothemes-sensei-certificates.php:1196
     425#: classes/class-woothemes-sensei-certificates.php:1659
     426msgid "View Certificate"
     427msgstr ""
     428
    419429#: classes/class-woothemes-sensei-certificate-templates.php:143
    420430msgctxt "post type general name"
     
    466476
    467477#: classes/class-woothemes-sensei-certificate-templates.php:191
    468 #: classes/class-woothemes-sensei-certificates.php:548
     478#: classes/class-woothemes-sensei-certificates.php:554
    469479msgid "Learner"
    470480msgstr ""
    471481
    472482#: classes/class-woothemes-sensei-certificate-templates.php:193
    473 #: classes/class-woothemes-sensei-certificates.php:550
     483#: classes/class-woothemes-sensei-certificates.php:556
    474484msgid "Date Completed"
    475485msgstr ""
    476486
    477487#: classes/class-woothemes-sensei-certificate-templates.php:194
    478 #: classes/class-woothemes-sensei-certificates.php:551
     488#: classes/class-woothemes-sensei-certificates.php:557
    479489msgid "Actions"
    480 msgstr ""
    481 
    482 #: classes/class-woothemes-sensei-certificate-templates.php:260
    483 #: classes/class-woothemes-sensei-certificates.php:505
    484 #: classes/class-woothemes-sensei-certificates.php:615
    485 #: classes/class-woothemes-sensei-certificates.php:1106
    486 #: classes/class-woothemes-sensei-certificates.php:1191
    487 #: classes/class-woothemes-sensei-certificates.php:1639
    488 msgid "View Certificate"
    489490msgstr ""
    490491
     
    494495
    495496#: classes/class-woothemes-sensei-certificate-templates.php:470
    496 #: classes/class-woothemes-sensei-certificates.php:879
     497#: classes/class-woothemes-sensei-certificates.php:885
    497498#: sensei-certificates-functions.php:208
    498499msgid "This is to certify that"
     
    500501
    501502#: classes/class-woothemes-sensei-certificate-templates.php:470
    502 #: classes/class-woothemes-sensei-certificates.php:879
     503#: classes/class-woothemes-sensei-certificates.php:885
    503504#: sensei-certificates-functions.php:208
    504505msgid "has completed the course"
     
    507508#. translators: %s is replaced with the site title
    508509#: classes/class-woothemes-sensei-certificate-templates.php:495
    509 #: classes/class-woothemes-sensei-certificates.php:903
     510#: classes/class-woothemes-sensei-certificates.php:909
    510511msgid "At %s"
    511512msgstr ""
     
    540541msgstr ""
    541542
    542 #: classes/class-woothemes-sensei-certificates.php:432
     543#: classes/class-woothemes-sensei-certificates.php:438
    543544msgid "Certificate Settings"
    544545msgstr ""
    545546
    546 #: classes/class-woothemes-sensei-certificates.php:433
     547#: classes/class-woothemes-sensei-certificates.php:439
    547548msgid "Options for the Certificate Extension."
    548549msgstr ""
    549550
    550 #: classes/class-woothemes-sensei-certificates.php:451
     551#: classes/class-woothemes-sensei-certificates.php:457
    551552msgid "View in Courses"
    552553msgstr ""
    553554
    554 #: classes/class-woothemes-sensei-certificates.php:452
     555#: classes/class-woothemes-sensei-certificates.php:458
    555556msgid "Show a View Certificate link in the single Course page and the My Courses page."
    556557msgstr ""
    557558
    558 #: classes/class-woothemes-sensei-certificates.php:459
     559#: classes/class-woothemes-sensei-certificates.php:465
    559560msgid "View in Learner Profile"
    560561msgstr ""
    561562
    562 #: classes/class-woothemes-sensei-certificates.php:460
     563#: classes/class-woothemes-sensei-certificates.php:466
    563564msgid "Show a View Certificate link in the Learner Profile page."
    564565msgstr ""
    565566
    566 #: classes/class-woothemes-sensei-certificates.php:467
     567#: classes/class-woothemes-sensei-certificates.php:473
    567568msgid "Public Certificate"
    568569msgstr ""
    569570
    570 #: classes/class-woothemes-sensei-certificates.php:468
     571#: classes/class-woothemes-sensei-certificates.php:474
    571572msgid "Allow the Learner to share their Certificate with the public. (The learner will have to enable this in their profile by going to mysite.com/learner/{learner_username})"
    572573msgstr ""
    573574
    574 #: classes/class-woothemes-sensei-certificates.php:475
     575#: classes/class-woothemes-sensei-certificates.php:481
    575576msgid "Delete data on uninstall"
    576577msgstr ""
    577578
    578 #: classes/class-woothemes-sensei-certificates.php:476
     579#: classes/class-woothemes-sensei-certificates.php:482
    579580msgid "Delete Sensei Certificates data when the plugin is deleted. Once removed, this data cannot be restored."
    580581msgstr ""
    581582
    582 #: classes/class-woothemes-sensei-certificates.php:498
     583#: classes/class-woothemes-sensei-certificates.php:504
    583584msgctxt "post type general name"
    584585msgid "Certificates"
    585586msgstr ""
    586587
    587 #: classes/class-woothemes-sensei-certificates.php:499
     588#: classes/class-woothemes-sensei-certificates.php:505
    588589msgctxt "post type singular name"
    589590msgid "Certificate"
    590591msgstr ""
    591592
    592 #: classes/class-woothemes-sensei-certificates.php:500
     593#: classes/class-woothemes-sensei-certificates.php:506
    593594msgctxt "post type add_new"
    594595msgid "Add New Certificate"
    595596msgstr ""
    596597
    597 #: classes/class-woothemes-sensei-certificates.php:501
     598#: classes/class-woothemes-sensei-certificates.php:507
    598599msgid "Add New Certificate"
    599600msgstr ""
    600601
    601 #: classes/class-woothemes-sensei-certificates.php:502
     602#: classes/class-woothemes-sensei-certificates.php:508
    602603msgid "Edit Certificate"
    603604msgstr ""
    604605
    605 #: classes/class-woothemes-sensei-certificates.php:503
     606#: classes/class-woothemes-sensei-certificates.php:509
    606607msgid "New Certificate"
    607608msgstr ""
    608609
    609 #: classes/class-woothemes-sensei-certificates.php:504
    610610#: classes/class-woothemes-sensei-certificates.php:510
     611#: classes/class-woothemes-sensei-certificates.php:516
    611612msgid "Certificates"
    612613msgstr ""
    613614
    614 #: classes/class-woothemes-sensei-certificates.php:506
     615#: classes/class-woothemes-sensei-certificates.php:512
    615616msgid "Search Certificates"
    616617msgstr ""
    617618
    618 #: classes/class-woothemes-sensei-certificates.php:507
     619#: classes/class-woothemes-sensei-certificates.php:513
    619620msgid "No certificates found"
    620621msgstr ""
    621622
    622 #: classes/class-woothemes-sensei-certificates.php:508
     623#: classes/class-woothemes-sensei-certificates.php:514
    623624msgid "No certificates found in Trash"
    624625msgstr ""
    625626
    626627#. translators: %1$s is the URL for editing the Course.
    627 #: classes/class-woothemes-sensei-certificates.php:620
     628#: classes/class-woothemes-sensei-certificates.php:626
    628629msgid "Set a certificate template on the <a href=\"%1$s\">course</a> in order to view this certificate"
    629630msgstr ""
    630631
    631 #: classes/class-woothemes-sensei-certificates.php:767
     632#: classes/class-woothemes-sensei-certificates.php:773
    632633msgid "You are not allowed to view this Certificate."
    633634msgstr ""
    634635
    635 #: classes/class-woothemes-sensei-certificates.php:767
    636 #: classes/class-woothemes-sensei-certificates.php:932
     636#: classes/class-woothemes-sensei-certificates.php:773
     637#: classes/class-woothemes-sensei-certificates.php:938
    637638msgid "Certificate Error"
    638639msgstr ""
    639640
    640 #: classes/class-woothemes-sensei-certificates.php:932
     641#: classes/class-woothemes-sensei-certificates.php:938
    641642msgid "The certificate you are searching for does not exist."
    642643msgstr ""
    643644
    644 #: classes/class-woothemes-sensei-certificates.php:1165
     645#: classes/class-woothemes-sensei-certificates.php:1170
    645646msgid "Certificate"
    646647msgstr ""
    647648
    648 #: classes/class-woothemes-sensei-certificates.php:1366
     649#: classes/class-woothemes-sensei-certificates.php:1371
    649650msgid "Allow my Certificates to be publicly viewed"
    650651msgstr ""
    651652
    652 #: classes/class-woothemes-sensei-certificates.php:1366
     653#: classes/class-woothemes-sensei-certificates.php:1371
    653654msgid "Save"
    654655msgstr ""
    655656
    656 #: classes/class-woothemes-sensei-certificates.php:1407
     657#: classes/class-woothemes-sensei-certificates.php:1412
    657658msgid "Your Certificates Public View Settings Saved Successfully."
    658659msgstr ""
    659660
    660 #: classes/class-woothemes-sensei-certificates.php:1468
     661#: classes/class-woothemes-sensei-certificates.php:1473
    661662msgid "View certificate"
    662663msgstr ""
     
    706707msgid "You must set a certificate_template primary image before you can preview"
    707708msgstr ""
     709
     710#: assets/blocks/view-certificate-link/block.json
     711msgctxt "block title"
     712msgid "View Certificate"
     713msgstr ""
     714
     715#: assets/blocks/view-certificate-link/block.json
     716msgctxt "block description"
     717msgid "Displays a link to the certificate."
     718msgstr ""
  • sensei-certificates/trunk/readme.txt

    r2754511 r2920829  
    22Contributors: automattic, alexsanford1, donnapep, jakeom, gikaragia, renathoc, yscik, m1r0, aaronfc
    33Tags: certificates, course certificate, sensei lms
    4 Requires at least: 5.6
    5 Tested up to: 6.0
    6 Requires PHP: 7.0
    7 Stable tag: 2.3.0
     4Requires at least: 6.0
     5Tested up to: 6.2
     6Requires PHP: 7.2
     7Stable tag: 2.4.0
    88License: GPLv2+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • sensei-certificates/trunk/woothemes-sensei-certificates.php

    r2754511 r2920829  
    44 * Plugin URI: https://woocommerce.com/products/sensei-certificates/
    55 * Description: Award your students with a certificate of completion and a sense of accomplishment after finishing a course.
    6  * Version: 2.3.0
     6 * Version: 2.4.0
    77 * Author: Automattic
    88 * Author URI: https://automattic.com
    9  * Requires at least: 5.6
    10  * Tested up to: 6.0
    11  * Requires PHP: 7.0
     9 * Requires at least: 6.0
     10 * Tested up to: 6.2
     11 * Requires PHP: 7.2
    1212 * License: GPLv2+
    1313 */
     
    1717}
    1818
    19 define( 'SENSEI_CERTIFICATES_VERSION', '2.3.0' );
     19define( 'SENSEI_CERTIFICATES_VERSION', '2.4.0' );
    2020define( 'SENSEI_CERTIFICATES_PLUGIN_FILE', __FILE__ );
    2121define( 'SENSEI_CERTIFICATES_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.