Changeset 2920829
- Timestamp:
- 06/02/2023 09:31:49 PM (3 years ago)
- Location:
- sensei-certificates/trunk
- Files:
-
- 2 added
- 17 edited
-
assets/dist/blocks/index.asset.php (modified) (1 diff)
-
assets/dist/blocks/index.js (modified) (1 diff)
-
assets/dist/css/admin.asset.php (modified) (1 diff)
-
assets/dist/css/admin.css (modified) (1 diff)
-
assets/dist/css/frontend.asset.php (modified) (1 diff)
-
assets/dist/js/admin.asset.php (modified) (1 diff)
-
assets/dist/js/admin.js (modified) (1 diff)
-
assets/dist/js/course.asset.php (modified) (1 diff)
-
assets/dist/js/course.js (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
classes/blocks (added)
-
classes/blocks/class-woothemes-sensei-certificates-view-certificate-link-block.php (added)
-
classes/class-woothemes-sensei-certificates-data-store.php (modified) (1 diff)
-
classes/class-woothemes-sensei-certificates-dependency-checker.php (modified) (1 diff)
-
classes/class-woothemes-sensei-certificates-tfpdf.php (modified) (1 diff)
-
classes/class-woothemes-sensei-certificates.php (modified) (8 diffs)
-
lang/sensei-certificates.pot (modified) (11 diffs)
-
readme.txt (modified) (1 diff)
-
woothemes-sensei-certificates.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sensei-certificates/trunk/assets/dist/blocks/index.asset.php
r2754511 r2920829 1 <?php return array('dependencies' => array('wp-block s', '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()}))})))}))}});1 jQuery((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%"})}))}});1 jQuery(document).ready((function(e){jQuery("#course-certificate-template-options")&&jQuery("#course-certificate-template-options").select2({width:"100%"})})); -
sensei-certificates/trunk/changelog.txt
r2754511 r2920829 1 1 *** Changelog *** 2 3 2023.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 2 9 3 10 2022.07.11 - version 2.3.0 -
sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-data-store.php
r2292649 r2920829 21 21 $certificate_hash = Woothemes_Sensei_Certificates_Utils::get_certificate_hash( $course_id, $user_id ); 22 22 // 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() ) { 25 32 return new WP_Error( 'sensei_certificates_duplicate' ); 26 33 } -
sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-dependency-checker.php
r2754511 r2920829 10 10 */ 11 11 class Woothemes_Sensei_Certificates_Dependency_Checker { 12 const MINIMUM_PHP_VERSION = '7. 0';12 const MINIMUM_PHP_VERSION = '7.2'; 13 13 const MINIMUM_SENSEI_VERSION = '1.11.0'; 14 14 -
sensei-certificates/trunk/classes/class-woothemes-sensei-certificates-tfpdf.php
r2484656 r2920829 24 24 25 25 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'; 27 27 28 28 return new VIP_tFPDF( $orientation, $units, $size ); -
sensei-certificates/trunk/classes/class-woothemes-sensei-certificates.php
r2754511 r2920829 111 111 } 112 112 113 // Load blocks. 114 new WooThemes_Sensei_Certificates_View_Certificate_Link_Block(); 115 113 116 $GLOBALS['woothemes_sensei_certificates'] = self::instance(); 114 117 $GLOBALS['woothemes_sensei_certificate_templates'] = new WooThemes_Sensei_Certificate_Templates(); … … 188 191 add_filter( 'sensei_course_completed_page_template', [ $instance, 'add_certificate_button_to_course_completed_template' ] ); 189 192 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' ] ); 190 195 } 191 196 … … 200 205 require_once dirname( __FILE__ ) . '/class-woothemes-sensei-certificates-data-store.php'; 201 206 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'; 202 208 } 203 209 … … 588 594 add_query_arg( 589 595 array( 590 'page' => 'sensei_ analysis',596 'page' => 'sensei_reports', 591 597 'user_id' => intval( $user_id ), 592 598 'course_id' => intval( $course_id ), … … 600 606 add_query_arg( 601 607 array( 602 'page' => 'sensei_ analysis',608 'page' => 'sensei_reports', 603 609 'course_id' => intval( $course_id ), 604 610 ), … … 1114 1120 1115 1121 /** 1116 * get_certificate_url gets url for certificate 1117 * 1118 * @access private 1122 * Get URL for certificate. 1123 * 1119 1124 * @since 1.0.0 1120 1125 * @param int $course_id course post id … … 1122 1127 * @return string $certificate_url certificate link 1123 1128 */ 1124 p rivatefunction get_certificate_url( $course_id, $user_id ) {1129 public function get_certificate_url( $course_id, $user_id ) { 1125 1130 1126 1131 $certificate_url = ''; … … 1591 1596 1592 1597 /** 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 /** 1593 1613 * It adds the View Certificate button as inner block to the course completed actions. 1594 1614 * 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) 202 2Automattic1 # Copyright (C) 2023 Automattic 2 2 # This file is distributed under the GPLv2+. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Sensei LMS Certificates 2. 2.1\n"5 "Project-Id-Version: Sensei LMS Certificates 2.4.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sensei-certificates\n" 7 7 "Last-Translator: \n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 2-07-11T07:41:08+00:00\n"12 "POT-Creation-Date: 2023-05-31T19:11:53+00:00\n" 13 13 "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" 15 15 "X-Domain: sensei-certificates\n" 16 16 … … 117 117 #: admin/post-types/writepanels/writepanel-certificate_data.php:131 118 118 #: classes/class-woothemes-sensei-certificate-templates.php:462 119 #: classes/class-woothemes-sensei-certificates.php:87 2119 #: classes/class-woothemes-sensei-certificates.php:878 120 120 #: sensei-certificates-functions.php:201 121 121 msgid "Certificate of Completion" … … 361 361 #: admin/woothemes-sensei-certificate-templates-admin-init.php:242 362 362 #: classes/class-woothemes-sensei-certificate-templates.php:192 363 #: classes/class-woothemes-sensei-certificates.php:5 49363 #: classes/class-woothemes-sensei-certificates.php:555 364 364 msgid "Course" 365 365 msgstr "" … … 417 417 msgstr "" 418 418 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 426 msgid "View Certificate" 427 msgstr "" 428 419 429 #: classes/class-woothemes-sensei-certificate-templates.php:143 420 430 msgctxt "post type general name" … … 466 476 467 477 #: classes/class-woothemes-sensei-certificate-templates.php:191 468 #: classes/class-woothemes-sensei-certificates.php:5 48478 #: classes/class-woothemes-sensei-certificates.php:554 469 479 msgid "Learner" 470 480 msgstr "" 471 481 472 482 #: classes/class-woothemes-sensei-certificate-templates.php:193 473 #: classes/class-woothemes-sensei-certificates.php:55 0483 #: classes/class-woothemes-sensei-certificates.php:556 474 484 msgid "Date Completed" 475 485 msgstr "" 476 486 477 487 #: classes/class-woothemes-sensei-certificate-templates.php:194 478 #: classes/class-woothemes-sensei-certificates.php:55 1488 #: classes/class-woothemes-sensei-certificates.php:557 479 489 msgid "Actions" 480 msgstr ""481 482 #: classes/class-woothemes-sensei-certificate-templates.php:260483 #: classes/class-woothemes-sensei-certificates.php:505484 #: classes/class-woothemes-sensei-certificates.php:615485 #: classes/class-woothemes-sensei-certificates.php:1106486 #: classes/class-woothemes-sensei-certificates.php:1191487 #: classes/class-woothemes-sensei-certificates.php:1639488 msgid "View Certificate"489 490 msgstr "" 490 491 … … 494 495 495 496 #: classes/class-woothemes-sensei-certificate-templates.php:470 496 #: classes/class-woothemes-sensei-certificates.php:8 79497 #: classes/class-woothemes-sensei-certificates.php:885 497 498 #: sensei-certificates-functions.php:208 498 499 msgid "This is to certify that" … … 500 501 501 502 #: classes/class-woothemes-sensei-certificate-templates.php:470 502 #: classes/class-woothemes-sensei-certificates.php:8 79503 #: classes/class-woothemes-sensei-certificates.php:885 503 504 #: sensei-certificates-functions.php:208 504 505 msgid "has completed the course" … … 507 508 #. translators: %s is replaced with the site title 508 509 #: classes/class-woothemes-sensei-certificate-templates.php:495 509 #: classes/class-woothemes-sensei-certificates.php:90 3510 #: classes/class-woothemes-sensei-certificates.php:909 510 511 msgid "At %s" 511 512 msgstr "" … … 540 541 msgstr "" 541 542 542 #: classes/class-woothemes-sensei-certificates.php:43 2543 #: classes/class-woothemes-sensei-certificates.php:438 543 544 msgid "Certificate Settings" 544 545 msgstr "" 545 546 546 #: classes/class-woothemes-sensei-certificates.php:43 3547 #: classes/class-woothemes-sensei-certificates.php:439 547 548 msgid "Options for the Certificate Extension." 548 549 msgstr "" 549 550 550 #: classes/class-woothemes-sensei-certificates.php:45 1551 #: classes/class-woothemes-sensei-certificates.php:457 551 552 msgid "View in Courses" 552 553 msgstr "" 553 554 554 #: classes/class-woothemes-sensei-certificates.php:45 2555 #: classes/class-woothemes-sensei-certificates.php:458 555 556 msgid "Show a View Certificate link in the single Course page and the My Courses page." 556 557 msgstr "" 557 558 558 #: classes/class-woothemes-sensei-certificates.php:4 59559 #: classes/class-woothemes-sensei-certificates.php:465 559 560 msgid "View in Learner Profile" 560 561 msgstr "" 561 562 562 #: classes/class-woothemes-sensei-certificates.php:46 0563 #: classes/class-woothemes-sensei-certificates.php:466 563 564 msgid "Show a View Certificate link in the Learner Profile page." 564 565 msgstr "" 565 566 566 #: classes/class-woothemes-sensei-certificates.php:4 67567 #: classes/class-woothemes-sensei-certificates.php:473 567 568 msgid "Public Certificate" 568 569 msgstr "" 569 570 570 #: classes/class-woothemes-sensei-certificates.php:4 68571 #: classes/class-woothemes-sensei-certificates.php:474 571 572 msgid "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})" 572 573 msgstr "" 573 574 574 #: classes/class-woothemes-sensei-certificates.php:4 75575 #: classes/class-woothemes-sensei-certificates.php:481 575 576 msgid "Delete data on uninstall" 576 577 msgstr "" 577 578 578 #: classes/class-woothemes-sensei-certificates.php:4 76579 #: classes/class-woothemes-sensei-certificates.php:482 579 580 msgid "Delete Sensei Certificates data when the plugin is deleted. Once removed, this data cannot be restored." 580 581 msgstr "" 581 582 582 #: classes/class-woothemes-sensei-certificates.php: 498583 #: classes/class-woothemes-sensei-certificates.php:504 583 584 msgctxt "post type general name" 584 585 msgid "Certificates" 585 586 msgstr "" 586 587 587 #: classes/class-woothemes-sensei-certificates.php: 499588 #: classes/class-woothemes-sensei-certificates.php:505 588 589 msgctxt "post type singular name" 589 590 msgid "Certificate" 590 591 msgstr "" 591 592 592 #: classes/class-woothemes-sensei-certificates.php:50 0593 #: classes/class-woothemes-sensei-certificates.php:506 593 594 msgctxt "post type add_new" 594 595 msgid "Add New Certificate" 595 596 msgstr "" 596 597 597 #: classes/class-woothemes-sensei-certificates.php:50 1598 #: classes/class-woothemes-sensei-certificates.php:507 598 599 msgid "Add New Certificate" 599 600 msgstr "" 600 601 601 #: classes/class-woothemes-sensei-certificates.php:50 2602 #: classes/class-woothemes-sensei-certificates.php:508 602 603 msgid "Edit Certificate" 603 604 msgstr "" 604 605 605 #: classes/class-woothemes-sensei-certificates.php:50 3606 #: classes/class-woothemes-sensei-certificates.php:509 606 607 msgid "New Certificate" 607 608 msgstr "" 608 609 609 #: classes/class-woothemes-sensei-certificates.php:504610 610 #: classes/class-woothemes-sensei-certificates.php:510 611 #: classes/class-woothemes-sensei-certificates.php:516 611 612 msgid "Certificates" 612 613 msgstr "" 613 614 614 #: classes/class-woothemes-sensei-certificates.php:5 06615 #: classes/class-woothemes-sensei-certificates.php:512 615 616 msgid "Search Certificates" 616 617 msgstr "" 617 618 618 #: classes/class-woothemes-sensei-certificates.php:5 07619 #: classes/class-woothemes-sensei-certificates.php:513 619 620 msgid "No certificates found" 620 621 msgstr "" 621 622 622 #: classes/class-woothemes-sensei-certificates.php:5 08623 #: classes/class-woothemes-sensei-certificates.php:514 623 624 msgid "No certificates found in Trash" 624 625 msgstr "" 625 626 626 627 #. translators: %1$s is the URL for editing the Course. 627 #: classes/class-woothemes-sensei-certificates.php:62 0628 #: classes/class-woothemes-sensei-certificates.php:626 628 629 msgid "Set a certificate template on the <a href=\"%1$s\">course</a> in order to view this certificate" 629 630 msgstr "" 630 631 631 #: classes/class-woothemes-sensei-certificates.php:7 67632 #: classes/class-woothemes-sensei-certificates.php:773 632 633 msgid "You are not allowed to view this Certificate." 633 634 msgstr "" 634 635 635 #: classes/class-woothemes-sensei-certificates.php:7 67636 #: classes/class-woothemes-sensei-certificates.php:93 2636 #: classes/class-woothemes-sensei-certificates.php:773 637 #: classes/class-woothemes-sensei-certificates.php:938 637 638 msgid "Certificate Error" 638 639 msgstr "" 639 640 640 #: classes/class-woothemes-sensei-certificates.php:93 2641 #: classes/class-woothemes-sensei-certificates.php:938 641 642 msgid "The certificate you are searching for does not exist." 642 643 msgstr "" 643 644 644 #: classes/class-woothemes-sensei-certificates.php:11 65645 #: classes/class-woothemes-sensei-certificates.php:1170 645 646 msgid "Certificate" 646 647 msgstr "" 647 648 648 #: classes/class-woothemes-sensei-certificates.php:13 66649 #: classes/class-woothemes-sensei-certificates.php:1371 649 650 msgid "Allow my Certificates to be publicly viewed" 650 651 msgstr "" 651 652 652 #: classes/class-woothemes-sensei-certificates.php:13 66653 #: classes/class-woothemes-sensei-certificates.php:1371 653 654 msgid "Save" 654 655 msgstr "" 655 656 656 #: classes/class-woothemes-sensei-certificates.php:14 07657 #: classes/class-woothemes-sensei-certificates.php:1412 657 658 msgid "Your Certificates Public View Settings Saved Successfully." 658 659 msgstr "" 659 660 660 #: classes/class-woothemes-sensei-certificates.php:14 68661 #: classes/class-woothemes-sensei-certificates.php:1473 661 662 msgid "View certificate" 662 663 msgstr "" … … 706 707 msgid "You must set a certificate_template primary image before you can preview" 707 708 msgstr "" 709 710 #: assets/blocks/view-certificate-link/block.json 711 msgctxt "block title" 712 msgid "View Certificate" 713 msgstr "" 714 715 #: assets/blocks/view-certificate-link/block.json 716 msgctxt "block description" 717 msgid "Displays a link to the certificate." 718 msgstr "" -
sensei-certificates/trunk/readme.txt
r2754511 r2920829 2 2 Contributors: automattic, alexsanford1, donnapep, jakeom, gikaragia, renathoc, yscik, m1r0, aaronfc 3 3 Tags: certificates, course certificate, sensei lms 4 Requires at least: 5.65 Tested up to: 6. 06 Requires PHP: 7. 07 Stable tag: 2. 3.04 Requires at least: 6.0 5 Tested up to: 6.2 6 Requires PHP: 7.2 7 Stable tag: 2.4.0 8 8 License: GPLv2+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
sensei-certificates/trunk/woothemes-sensei-certificates.php
r2754511 r2920829 4 4 * Plugin URI: https://woocommerce.com/products/sensei-certificates/ 5 5 * Description: Award your students with a certificate of completion and a sense of accomplishment after finishing a course. 6 * Version: 2. 3.06 * Version: 2.4.0 7 7 * Author: Automattic 8 8 * Author URI: https://automattic.com 9 * Requires at least: 5.610 * Tested up to: 6. 011 * Requires PHP: 7. 09 * Requires at least: 6.0 10 * Tested up to: 6.2 11 * Requires PHP: 7.2 12 12 * License: GPLv2+ 13 13 */ … … 17 17 } 18 18 19 define( 'SENSEI_CERTIFICATES_VERSION', '2. 3.0' );19 define( 'SENSEI_CERTIFICATES_VERSION', '2.4.0' ); 20 20 define( 'SENSEI_CERTIFICATES_PLUGIN_FILE', __FILE__ ); 21 21 define( 'SENSEI_CERTIFICATES_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.