plugin updates
Showing
1000 changed files
with
1293 additions
and
1160 deletions
Too many changes to show.
To preserve performance only 1000 of 1000+ files are displayed.
| 1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);document.addEventListener("DOMContentLoaded",()=>{let e=aca_acf_admin.assets+"images/acf.svg";AC_SERVICES.filters.addFilter("column_type_templates",(t,n)=>(n.result.hasOwnProperty("id")&&(e=>{if(e.element){let t=e.element.parentElement;if(t&&"Advanced Custom Fields"===t.label)return!0}let t=e.id;return 0===t.indexOf("field_")||0===t.indexOf("acfgroup__field")||0===t.indexOf("acfclone")})(n.result)&&(t+=`<img src="${e}" alt="Advanced Custom Fields" class="ac-column-type-icon"/>`),t),10)})}]); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | (()=>{"use strict";document.addEventListener("DOMContentLoaded",(()=>{let e=aca_acf_admin.assets+"images/acf.svg";AC_SERVICES.filters.addFilter("column_type_templates",((t,l)=>(l.result.hasOwnProperty("id")&&(e=>{if(e.element){let t=e.element.parentElement;if(t&&"Advanced Custom Fields"===t.label)return!0}let t=e.id;return 0===t.indexOf("field_")||0===t.indexOf("acfgroup__field")||0===t.indexOf("acfclone")})(l.result)&&(t+=`<img src="${e}" alt="Advanced Custom Fields" class="ac-column-type-icon"/>`),t)),10)}))})(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var l=t[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(r,l,function(t){return e[t]}.bind(null,l));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){n(2),n(3)},function(e,t,n){"use strict";n.r(t),AC_SERVICES.addListener("Editing.Editables.Ready",e=>{const t=e.get("_abstract");e.registerEditable("acf_range",class extends t{focus(){this.getElement().querySelector("[name=range]").focus()}getEditableType(){return"acf_range"}render(){let e=this.getElement().querySelector("[name=range]");this.reflect(),e.addEventListener("change",()=>this.reflect()),e.addEventListener("input",()=>this.reflect())}reflect(){this.getElement().querySelector("[name=reflection]").value=this.getElement().querySelector("[name=range]").value}valueToInput(e){this.getElement().querySelector("[name=range]").value=e,this.reflect()}getValue(){return this.getElement().querySelector("[name=range]").value}getTemplate(){return`\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t${this.getEditableTemplate().getFormHelper().input("range",null,this.settings.html_attributes).outerHTML} <input name="reflection">\n\t\t\t\t</div>\n\t\t\t`}getDefaults(){let e=super.getDefaults();return e.html_attributes={type:"range",step:5,min:0,max:100},e}})}),AC_SERVICES.addListener("Editing.Middleware.Ready",e=>{const t=e.getClass("default");e.register("acf_range",class extends t{getEditable(){return this.Editables.get("acf_range")}})})},function(e,t,n){"use strict";n.r(t),AC_SERVICES.addListener("Editing.Editables.Ready",e=>{const t=e.get("_abstract");e.registerEditable("acf_link",class extends t{getEditableType(){return"acf_link"}focus(){this.getElement().querySelector("[name=url]").focus()}valueToInput(e){e&&(this.getElement().querySelector("[name=url]").value=e.url,this.getElement().querySelector("[name=title]").value=e.title,"_blank"===e.target&&(this.getElement().querySelector("[name=target]").checked=!0))}getValue(){return{url:this.getElement().querySelector("[name=url]").value,title:this.getElement().querySelector("[name=title]").value,target:this.getElement().querySelector("[name=target]").checked?"_blank":""}}getTemplate(){return`\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t<label>Url</label>${this.getEditableTemplate().getFormHelper().input("url",null,{placeholder:"http://"}).outerHTML}\n\t\t\t\t</div>\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t<label>Title</label>${this.getEditableTemplate().getFormHelper().input("title",null).outerHTML}\n\t\t\t\t</div>\n\t\t\t\t<div class="input__group -checkbox">\n\t\t\t\t\t<label class="input__checkbox"><input type="checkbox" name="target"> Open link in a new tab</label>\n\t\t\t\t</div>\n\t\t\t`}})}),AC_SERVICES.addListener("Editing.Middleware.Ready",e=>{const t=e.getClass("_abstract");e.register("acf_link",class extends t{getEditable(){return this.Editables.get("acf_link")}})})}]); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | (()=>{var e={133:(e,t,r)=>{"use strict";r.r(t),AC_SERVICES.addListener("Editing.Editables.Ready",(e=>{const t=e.get("_abstract");e.registerEditable("acf_link",class extends t{getEditableType(){return"acf_link"}focus(){this.getElement().querySelector("[name=url]").focus()}valueToInput(e){e&&(this.getElement().querySelector("[name=url]").value=e.url,this.getElement().querySelector("[name=title]").value=e.title,"_blank"===e.target&&(this.getElement().querySelector("[name=target]").checked=!0))}getValue(){return{url:this.getElement().querySelector("[name=url]").value,title:this.getElement().querySelector("[name=title]").value,target:this.getElement().querySelector("[name=target]").checked?"_blank":""}}getTemplate(){return`\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t<label>Url</label>${this.getEditableTemplate().getFormHelper().input("url",null,{placeholder:"http://"}).outerHTML}\n\t\t\t\t</div>\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t<label>Title</label>${this.getEditableTemplate().getFormHelper().input("title",null).outerHTML}\n\t\t\t\t</div>\n\t\t\t\t<div class="input__group -checkbox">\n\t\t\t\t\t<label class="input__checkbox"><input type="checkbox" name="target"> Open link in a new tab</label>\n\t\t\t\t</div>\n\t\t\t`}})})),AC_SERVICES.addListener("Editing.Middleware.Ready",(e=>{const t=e.getClass("_abstract");e.register("acf_link",class extends t{getEditable(){return this.Editables.get("acf_link")}})}))},825:(e,t,r)=>{"use strict";r.r(t),AC_SERVICES.addListener("Editing.Editables.Ready",(e=>{const t=e.get("_abstract");e.registerEditable("acf_range",class extends t{focus(){this.getElement().querySelector("[name=range]").focus()}getEditableType(){return"acf_range"}render(){let e=this.getElement().querySelector("[name=range]");this.reflect(),e.addEventListener("change",(()=>this.reflect())),e.addEventListener("input",(()=>this.reflect()))}reflect(){this.getElement().querySelector("[name=reflection]").value=this.getElement().querySelector("[name=range]").value}valueToInput(e){this.getElement().querySelector("[name=range]").value=e,this.reflect()}getValue(){return this.getElement().querySelector("[name=range]").value}getTemplate(){return`\n\t\t\t\t<div class="input__group">\n\t\t\t\t\t${this.getEditableTemplate().getFormHelper().input("range",null,this.settings.html_attributes).outerHTML} <input name="reflection">\n\t\t\t\t</div>\n\t\t\t`}getDefaults(){let e=super.getDefaults();return e.html_attributes={type:"range",step:5,min:0,max:100},e}})})),AC_SERVICES.addListener("Editing.Middleware.Ready",(e=>{const t=e.getClass("default");e.register("acf_range",class extends t{getEditable(){return this.Editables.get("acf_range")}})}))}},t={};function r(l){var n=t[l];if(void 0!==n)return n.exports;var a=t[l]={exports:{}};return e[l](a,a.exports,r),a.exports}r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(825),r(133)})(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\ACF; | 5 | namespace ACA\ACF; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 8 | use AC\ListScreenRepository\Storage; | ||
| 6 | use AC\Registerable; | 9 | use AC\Registerable; |
| 7 | use AC\Request; | 10 | use AC\Request; |
| 11 | use AC\Services; | ||
| 12 | use AC\Vendor\Psr\Container\ContainerInterface; | ||
| 8 | use ACA\ACF\ConditionalFormatting\FieldFormattableFactory; | 13 | use ACA\ACF\ConditionalFormatting\FieldFormattableFactory; |
| 9 | use ACA\ACF\FieldGroup; | ||
| 10 | use ACA\ACF\ListScreenFactory\FieldGroupFactory; | 14 | use ACA\ACF\ListScreenFactory\FieldGroupFactory; |
| 11 | use ACA\ACF\RequestHandler\MapLegacyListScreen; | 15 | use ACA\ACF\RequestHandler\MapLegacyListScreen; |
| 12 | use ACA\ACF\Search; | ||
| 13 | use ACA\ACF\Service; | ||
| 14 | use ACA\ACF\Sorting; | ||
| 15 | use ACP; | ||
| 16 | use ACP\RequestHandlerFactory; | 16 | use ACP\RequestHandlerFactory; |
| 17 | use ACP\RequestParser; | 17 | use ACP\RequestParser; |
| 18 | use ACP\Service\IntegrationStatus; | ||
| 18 | 19 | ||
| 19 | final class AdvancedCustomFields implements Registerable { | 20 | final class AdvancedCustomFields implements Registerable |
| 21 | { | ||
| 20 | 22 | ||
| 21 | private $location; | 23 | private $location; |
| 22 | 24 | ||
| 23 | public function __construct( AC\Asset\Location\Absolute $location ) { | 25 | private $container; |
| 26 | |||
| 27 | public function __construct(AC\Asset\Location\Absolute $location, ContainerInterface $container) | ||
| 28 | { | ||
| 24 | $this->location = $location; | 29 | $this->location = $location; |
| 30 | $this->container = $container; | ||
| 25 | } | 31 | } |
| 26 | 32 | ||
| 27 | public function register() { | 33 | public function register(): void |
| 28 | if ( ! class_exists( 'acf', false ) ) { | 34 | { |
| 35 | if ( ! class_exists('acf', false)) { | ||
| 29 | return; | 36 | return; |
| 30 | } | 37 | } |
| 31 | 38 | ||
| 32 | AC\ListScreenFactory::add( new FieldGroupFactory() ); | 39 | AC\ListScreenFactory\Aggregate::add(new FieldGroupFactory()); |
| 40 | |||
| 41 | $this->create_services()->register(); | ||
| 42 | } | ||
| 33 | 43 | ||
| 44 | private function create_services(): Services | ||
| 45 | { | ||
| 34 | $column_initiator = new ColumnInstantiator( | 46 | $column_initiator = new ColumnInstantiator( |
| 35 | new ConfigFactory( new FieldFactory() ), | 47 | new ConfigFactory(new FieldFactory()), |
| 36 | new Search\ComparisonFactory(), | 48 | new Search\ComparisonFactory(), |
| 37 | new Sorting\ModelFactory(), | 49 | new Sorting\ModelFactory(), |
| 38 | new Editing\ModelFactory(), | 50 | new Editing\ModelFactory(), |
| ... | @@ -40,11 +52,14 @@ final class AdvancedCustomFields implements Registerable { | ... | @@ -40,11 +52,14 @@ final class AdvancedCustomFields implements Registerable { |
| 40 | new FieldFormattableFactory() | 52 | new FieldFormattableFactory() |
| 41 | ); | 53 | ); |
| 42 | 54 | ||
| 43 | $request_handler_factory = new RequestHandlerFactory( new Request() ); | 55 | $request_handler_factory = new RequestHandlerFactory(new Request()); |
| 44 | $request_handler_factory->add( 'aca-acf-map-legacy-list-screen', new MapLegacyListScreen( AC()->get_storage() ) ); | 56 | $request_handler_factory->add( |
| 57 | 'aca-acf-map-legacy-list-screen', | ||
| 58 | new MapLegacyListScreen($this->container->get(Storage::class)) | ||
| 59 | ); | ||
| 45 | 60 | ||
| 46 | $services = [ | 61 | return new Services([ |
| 47 | new ACP\Service\IntegrationStatus( 'ac-addon-acf' ), | 62 | new IntegrationStatus('ac-addon-acf'), |
| 48 | new ColumnGroup(), | 63 | new ColumnGroup(), |
| 49 | new Service\ColumnSettings(), | 64 | new Service\ColumnSettings(), |
| 50 | new Service\EditingFix(), | 65 | new Service\EditingFix(), |
| ... | @@ -52,18 +67,14 @@ final class AdvancedCustomFields implements Registerable { | ... | @@ -52,18 +67,14 @@ final class AdvancedCustomFields implements Registerable { |
| 52 | new Service\ListScreens(), | 67 | new Service\ListScreens(), |
| 53 | new Service\RemoveDeprecatedColumnFromTypeSelector(), | 68 | new Service\RemoveDeprecatedColumnFromTypeSelector(), |
| 54 | new Service\AddColumns( | 69 | new Service\AddColumns( |
| 55 | new FieldRepository( new FieldGroup\QueryFactory() ), | 70 | new FieldRepository(new FieldGroup\QueryFactory()), |
| 56 | new FieldsFactory(), | 71 | new FieldsFactory(), |
| 57 | new ColumnFactory( $column_initiator ) | 72 | new ColumnFactory($column_initiator) |
| 58 | ), | 73 | ), |
| 59 | new Service\Scripts( $this->location ), | 74 | new Service\Scripts($this->location), |
| 60 | new Service\InitColumn( $column_initiator ), | 75 | new Service\InitColumn($column_initiator), |
| 61 | new RequestParser( $request_handler_factory ), | 76 | new RequestParser($request_handler_factory), |
| 62 | ]; | 77 | ]); |
| 63 | |||
| 64 | array_map( static function ( Registerable $service ) { | ||
| 65 | $service->register(); | ||
| 66 | }, $services ); | ||
| 67 | } | 78 | } |
| 68 | 79 | ||
| 69 | } | 80 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -5,8 +5,6 @@ namespace ACA\ACF; | ... | @@ -5,8 +5,6 @@ namespace ACA\ACF; |
| 5 | use AC; | 5 | use AC; |
| 6 | use AC\MetaType; | 6 | use AC\MetaType; |
| 7 | use ACA\ACF; | 7 | use ACA\ACF; |
| 8 | use ACA\ACF\Export; | ||
| 9 | use ACA\ACF\Value; | ||
| 10 | use ACP\Export\Exportable; | 8 | use ACP\Export\Exportable; |
| 11 | use InvalidArgumentException; | 9 | use InvalidArgumentException; |
| 12 | 10 | ... | ... |
| ... | @@ -4,8 +4,10 @@ namespace ACA\ACF; | ... | @@ -4,8 +4,10 @@ namespace ACA\ACF; |
| 4 | 4 | ||
| 5 | use ACA\ACF\Column\Repeater; | 5 | use ACA\ACF\Column\Repeater; |
| 6 | use ACA\ACF\Column\Unsupported; | 6 | use ACA\ACF\Column\Unsupported; |
| 7 | use LogicException; | ||
| 7 | 8 | ||
| 8 | class ColumnFactory { | 9 | class ColumnFactory |
| 10 | { | ||
| 9 | 11 | ||
| 10 | /** | 12 | /** |
| 11 | * @var ColumnInstantiator | 13 | * @var ColumnInstantiator |
| ... | @@ -17,9 +19,10 @@ class ColumnFactory { | ... | @@ -17,9 +19,10 @@ class ColumnFactory { |
| 17 | */ | 19 | */ |
| 18 | private $clone_column_factory; | 20 | private $clone_column_factory; |
| 19 | 21 | ||
| 20 | public function __construct( ColumnInstantiator $column_initiator ) { | 22 | public function __construct(ColumnInstantiator $column_initiator) |
| 23 | { | ||
| 21 | $this->column_initiator = $column_initiator; | 24 | $this->column_initiator = $column_initiator; |
| 22 | $this->clone_column_factory = new CloneColumnFactory( $this ); | 25 | $this->clone_column_factory = new CloneColumnFactory($this); |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | /** | 28 | /** |
| ... | @@ -27,17 +30,18 @@ class ColumnFactory { | ... | @@ -27,17 +30,18 @@ class ColumnFactory { |
| 27 | * | 30 | * |
| 28 | * @return Column|null | 31 | * @return Column|null |
| 29 | */ | 32 | */ |
| 30 | public function create( array $settings ) { | 33 | public function create(array $settings) |
| 31 | if ( isset( $settings['_clone'] ) ) { | 34 | { |
| 32 | return $this->clone_column_factory->create( $settings ); | 35 | if (isset($settings['_clone'])) { |
| 36 | return $this->clone_column_factory->create($settings); | ||
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | switch ( $settings['type'] ) { | 39 | switch ($settings['type']) { |
| 36 | case FieldType::TYPE_GROUP: | 40 | case FieldType::TYPE_GROUP: |
| 37 | return ( new GroupColumnFactory( $this ) )->create( $settings ); | 41 | return (new GroupColumnFactory($this))->create($settings); |
| 38 | 42 | ||
| 39 | case FieldType::TYPE_REPEATER: | 43 | case FieldType::TYPE_REPEATER: |
| 40 | return $this->create_column( new Repeater(), $settings ); | 44 | return $this->create_column(new Repeater(), $settings); |
| 41 | 45 | ||
| 42 | case FieldType::TYPE_BOOLEAN: | 46 | case FieldType::TYPE_BOOLEAN: |
| 43 | case FieldType::TYPE_BUTTON_GROUP: | 47 | case FieldType::TYPE_BUTTON_GROUP: |
| ... | @@ -68,17 +72,24 @@ class ColumnFactory { | ... | @@ -68,17 +72,24 @@ class ColumnFactory { |
| 68 | case FieldType::TYPE_URL: | 72 | case FieldType::TYPE_URL: |
| 69 | case FieldType::TYPE_USER: | 73 | case FieldType::TYPE_USER: |
| 70 | case FieldType::TYPE_WYSIWYG: | 74 | case FieldType::TYPE_WYSIWYG: |
| 71 | return $this->create_column( new Column(), $settings ); | 75 | return $this->create_column(new Column(), $settings); |
| 72 | default: | 76 | default: |
| 73 | return $this->create_column( new Unsupported(), $settings ); | 77 | return $this->create_column(new Unsupported(), $settings); |
| 74 | } | 78 | } |
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | private function create_column( Column $column, array $settings ) { | 81 | private function create_column(Column $column, array $settings) |
| 78 | $column->set_label( $settings['label'] ) | 82 | { |
| 79 | ->set_type( $settings['key'] ); | 83 | $column = apply_filters('acp/acf/column', $column, $settings['type'], $settings); |
| 80 | 84 | ||
| 81 | $this->column_initiator->initiate( $column ); | 85 | if ( ! $column instanceof Column) { |
| 86 | throw new LogicException('Column must be an instance of ACA\ACF\Column'); | ||
| 87 | } | ||
| 88 | |||
| 89 | $column->set_label($settings['label']) | ||
| 90 | ->set_type($settings['key']); | ||
| 91 | |||
| 92 | $this->column_initiator->initiate($column); | ||
| 82 | 93 | ||
| 83 | return $column; | 94 | return $column; |
| 84 | } | 95 | } | ... | ... |
| ... | @@ -8,7 +8,8 @@ class ColumnGroup implements AC\Registerable { | ... | @@ -8,7 +8,8 @@ class ColumnGroup implements AC\Registerable { |
| 8 | 8 | ||
| 9 | const SLUG = 'acf'; | 9 | const SLUG = 'acf'; |
| 10 | 10 | ||
| 11 | public function register() { | 11 | public function register(): void |
| 12 | { | ||
| 12 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); | 13 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); |
| 13 | } | 14 | } |
| 14 | 15 | ... | ... |
| ... | @@ -5,7 +5,6 @@ namespace ACA\ACF\Editing; | ... | @@ -5,7 +5,6 @@ namespace ACA\ACF\Editing; |
| 5 | use AC\MetaType; | 5 | use AC\MetaType; |
| 6 | use ACA\ACF\CloneColumnFactory; | 6 | use ACA\ACF\CloneColumnFactory; |
| 7 | use ACA\ACF\Column; | 7 | use ACA\ACF\Column; |
| 8 | use ACA\ACF\Editing\Storage; | ||
| 9 | use ACA\ACF\GroupColumnFactory; | 8 | use ACA\ACF\GroupColumnFactory; |
| 10 | 9 | ||
| 11 | class StorageFactory { | 10 | class StorageFactory { | ... | ... |
| ... | @@ -6,16 +6,19 @@ use ACA\ACF; | ... | @@ -6,16 +6,19 @@ use ACA\ACF; |
| 6 | use ACP; | 6 | use ACP; |
| 7 | use ACP\Column; | 7 | use ACP\Column; |
| 8 | 8 | ||
| 9 | class FieldGroup extends ACP\ListScreen\Post { | 9 | class FieldGroup extends ACP\ListScreen\Post |
| 10 | { | ||
| 10 | 11 | ||
| 11 | public function __construct() { | 12 | public function __construct() |
| 12 | parent::__construct( 'acf-field-group' ); | 13 | { |
| 14 | parent::__construct('acf-field-group'); | ||
| 13 | 15 | ||
| 14 | $this->set_group( 'acf' ); | 16 | $this->group = 'acf'; |
| 15 | } | 17 | } |
| 16 | 18 | ||
| 17 | protected function register_column_types() { | 19 | protected function register_column_types(): void |
| 18 | $this->register_column_types_from_list( [ | 20 | { |
| 21 | $this->register_column_types_from_list([ | ||
| 19 | Column\CustomField::class, | 22 | Column\CustomField::class, |
| 20 | Column\Actions::class, | 23 | Column\Actions::class, |
| 21 | Column\Post\Author::class, | 24 | Column\Post\Author::class, |
| ... | @@ -27,7 +30,7 @@ class FieldGroup extends ACP\ListScreen\Post { | ... | @@ -27,7 +30,7 @@ class FieldGroup extends ACP\ListScreen\Post { |
| 27 | Column\Post\Title::class, | 30 | Column\Post\Title::class, |
| 28 | Column\Post\TitleRaw::class, | 31 | Column\Post\TitleRaw::class, |
| 29 | ACF\Column\FieldGroup\Location::class, | 32 | ACF\Column\FieldGroup\Location::class, |
| 30 | ] ); | 33 | ]); |
| 31 | } | 34 | } |
| 32 | 35 | ||
| 33 | } | 36 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\ACF\ListScreenFactory; | 3 | namespace ACA\ACF\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\ACF\ListScreen\FieldGroup; | 7 | use ACA\ACF\ListScreen\FieldGroup; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class FieldGroupFactory implements ListScreenFactoryInterface { | 10 | class FieldGroupFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'acf-field-group' === $key; | 15 | return 'acf-field-group' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new FieldGroup(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new FieldGroup(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'acf-field-group'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'acf-field-group'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return new FieldGroup(); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new FieldGroup(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -24,7 +24,8 @@ class MapLegacyListScreen implements RequestHandler { | ... | @@ -24,7 +24,8 @@ class MapLegacyListScreen implements RequestHandler { |
| 24 | $this->list_screen_repository = $list_screen_repository; | 24 | $this->list_screen_repository = $list_screen_repository; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | public function handle( Request $request ) { | 27 | public function handle( Request $request ): void |
| 28 | { | ||
| 28 | if ( ! current_user_can( Capabilities::MANAGE ) ) { | 29 | if ( ! current_user_can( Capabilities::MANAGE ) ) { |
| 29 | return; | 30 | return; |
| 30 | } | 31 | } | ... | ... |
| ... | @@ -32,7 +32,8 @@ class AddColumns implements Registerable { | ... | @@ -32,7 +32,8 @@ class AddColumns implements Registerable { |
| 32 | $this->column_factory = $column_factory; | 32 | $this->column_factory = $column_factory; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | public function register() { | 35 | public function register(): void |
| 36 | { | ||
| 36 | add_action( 'ac/column_types', [ $this, 'add_columns' ] ); | 37 | add_action( 'ac/column_types', [ $this, 'add_columns' ] ); |
| 37 | } | 38 | } |
| 38 | 39 | ... | ... |
| ... | @@ -9,7 +9,8 @@ use ACA\ACF\Helper; | ... | @@ -9,7 +9,8 @@ use ACA\ACF\Helper; |
| 9 | 9 | ||
| 10 | class ColumnSettings implements Registerable { | 10 | class ColumnSettings implements Registerable { |
| 11 | 11 | ||
| 12 | public function register() { | 12 | public function register(): void |
| 13 | { | ||
| 13 | add_action( 'ac/column/settings', [ $this, 'add_edit_field_link_to_column_type' ] ); | 14 | add_action( 'ac/column/settings', [ $this, 'add_edit_field_link_to_column_type' ] ); |
| 14 | } | 15 | } |
| 15 | 16 | ... | ... |
| ... | @@ -6,7 +6,8 @@ use AC\Registerable; | ... | @@ -6,7 +6,8 @@ use AC\Registerable; |
| 6 | 6 | ||
| 7 | class EditingFix implements Registerable { | 7 | class EditingFix implements Registerable { |
| 8 | 8 | ||
| 9 | public function register() { | 9 | public function register(): void |
| 10 | { | ||
| 10 | add_filter( 'acp/editing/post_statuses', [ $this, 'remove_acf_statuses_for_editing' ] ); | 11 | add_filter( 'acp/editing/post_statuses', [ $this, 'remove_acf_statuses_for_editing' ] ); |
| 11 | } | 12 | } |
| 12 | 13 | ... | ... |
| ... | @@ -18,7 +18,8 @@ class InitColumn implements Registerable { | ... | @@ -18,7 +18,8 @@ class InitColumn implements Registerable { |
| 18 | $this->column_initiator = $column_initiator; | 18 | $this->column_initiator = $column_initiator; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | public function register() { | 21 | public function register(): void |
| 22 | { | ||
| 22 | add_action( 'ac/list_screen/column_created', [ $this, 'initiate_column' ] ); | 23 | add_action( 'ac/list_screen/column_created', [ $this, 'initiate_column' ] ); |
| 23 | } | 24 | } |
| 24 | 25 | ... | ... |
| ... | @@ -16,7 +16,8 @@ use ACA\ACF\Utils\V2ToV3Migration; | ... | @@ -16,7 +16,8 @@ use ACA\ACF\Utils\V2ToV3Migration; |
| 16 | */ | 16 | */ |
| 17 | class LegacyColumnMapper implements Registerable { | 17 | class LegacyColumnMapper implements Registerable { |
| 18 | 18 | ||
| 19 | public function register() { | 19 | public function register(): void |
| 20 | { | ||
| 20 | add_action( 'ac/table/list_screen', [ new V2ToV3Migration(), 'migrate_list_screen_settings' ], 9 ); | 21 | add_action( 'ac/table/list_screen', [ new V2ToV3Migration(), 'migrate_list_screen_settings' ], 9 ); |
| 21 | add_action( 'ac/settings/notice', [ $this, 'render_deprecated_columns_notice' ] ); | 22 | add_action( 'ac/settings/notice', [ $this, 'render_deprecated_columns_notice' ] ); |
| 22 | } | 23 | } | ... | ... |
| ... | @@ -2,28 +2,33 @@ | ... | @@ -2,28 +2,33 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\ACF\Service; | 3 | namespace ACA\ACF\Service; |
| 4 | 4 | ||
| 5 | use AC; | ||
| 5 | use AC\Column; | 6 | use AC\Column; |
| 6 | use AC\Groups; | 7 | use AC\Groups; |
| 7 | use AC\Registerable; | 8 | use AC\Registerable; |
| 8 | use ACA\ACF\ListScreen; | 9 | use ACA\ACF\ListScreen; |
| 9 | 10 | ||
| 10 | class ListScreens implements Registerable { | 11 | class ListScreens implements Registerable |
| 12 | { | ||
| 11 | 13 | ||
| 12 | public function register() { | 14 | public function register(): void |
| 13 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_groups' ] ); | 15 | { |
| 14 | add_filter( 'ac/export/value', [ $this, 'strip_tags_export_value' ], 10, 2 ); | 16 | add_action('ac/list_screen_groups', [$this, 'register_list_screen_groups']); |
| 17 | add_filter('ac/export/value', [$this, 'strip_tags_export_value'], 10, 4); | ||
| 15 | } | 18 | } |
| 16 | 19 | ||
| 17 | public function strip_tags_export_value( string $value, Column $column ) { | 20 | public function strip_tags_export_value(string $value, Column $column, $id, AC\ListScreen $list_screen) |
| 18 | if ( $column->get_list_screen() instanceof ListScreen\FieldGroup && $column->is_original() ) { | 21 | { |
| 19 | $value = strip_tags( $value ); | 22 | if ($list_screen instanceof ListScreen\FieldGroup && $column->is_original()) { |
| 23 | $value = strip_tags($value); | ||
| 20 | } | 24 | } |
| 21 | 25 | ||
| 22 | return $value; | 26 | return $value; |
| 23 | } | 27 | } |
| 24 | 28 | ||
| 25 | public function register_list_screen_groups( Groups $groups ): void { | 29 | public function register_list_screen_groups(Groups $groups): void |
| 26 | $groups->add( 'acf', __( 'Advanced Custom Fields', 'codepress-admin-columns' ), 7 ); | 30 | { |
| 31 | $groups->add('acf', __('Advanced Custom Fields', 'codepress-admin-columns'), 7); | ||
| 27 | } | 32 | } |
| 28 | 33 | ||
| 29 | } | 34 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -7,7 +7,8 @@ use AC\Registerable; | ... | @@ -7,7 +7,8 @@ use AC\Registerable; |
| 7 | 7 | ||
| 8 | class RemoveDeprecatedColumnFromTypeSelector implements Registerable { | 8 | class RemoveDeprecatedColumnFromTypeSelector implements Registerable { |
| 9 | 9 | ||
| 10 | public function register() { | 10 | public function register(): void |
| 11 | { | ||
| 11 | add_filter( 'ac/column/settings/column_types', [ $this, 'remove_from_type_selector' ], 10, 2 ); | 12 | add_filter( 'ac/column/settings/column_types', [ $this, 'remove_from_type_selector' ], 10, 2 ); |
| 12 | } | 13 | } |
| 13 | 14 | ... | ... |
| ... | @@ -19,7 +19,8 @@ class Scripts implements Registerable { | ... | @@ -19,7 +19,8 @@ class Scripts implements Registerable { |
| 19 | $this->location = $location; | 19 | $this->location = $location; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public function register() { | 22 | public function register(): void |
| 23 | { | ||
| 23 | add_action( 'ac/table_scripts/editing', [ $this, 'table_scripts_editing' ] ); | 24 | add_action( 'ac/table_scripts/editing', [ $this, 'table_scripts_editing' ] ); |
| 24 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | 25 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); |
| 25 | } | 26 | } | ... | ... |
| ... | @@ -8,15 +8,21 @@ use ACA\ACF\FieldType; | ... | @@ -8,15 +8,21 @@ use ACA\ACF\FieldType; |
| 8 | use ACA\ACF\Sorting; | 8 | use ACA\ACF\Sorting; |
| 9 | use ACP; | 9 | use ACP; |
| 10 | 10 | ||
| 11 | class ModelFactory implements SortingModelFactory { | 11 | class ModelFactory implements SortingModelFactory |
| 12 | { | ||
| 12 | 13 | ||
| 13 | public function create( Field $field, $meta_key, Column $column ) { | 14 | public function create(Field $field, $meta_key, Column $column) |
| 15 | { | ||
| 14 | $meta_type = $column->get_meta_type(); | 16 | $meta_type = $column->get_meta_type(); |
| 15 | 17 | ||
| 16 | switch ( $field->get_type() ) { | 18 | switch ($field->get_type()) { |
| 17 | case FieldType::TYPE_NUMBER: | 19 | case FieldType::TYPE_NUMBER: |
| 18 | case FieldType::TYPE_RANGE: | 20 | case FieldType::TYPE_RANGE: |
| 19 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::DECIMAL ) ); | 21 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 22 | $meta_type, | ||
| 23 | $meta_key, | ||
| 24 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::DECIMAL) | ||
| 25 | ); | ||
| 20 | 26 | ||
| 21 | case FieldType::TYPE_TEXT: | 27 | case FieldType::TYPE_TEXT: |
| 22 | case FieldType::TYPE_TEXTAREA: | 28 | case FieldType::TYPE_TEXTAREA: |
| ... | @@ -29,46 +35,85 @@ class ModelFactory implements SortingModelFactory { | ... | @@ -29,46 +35,85 @@ class ModelFactory implements SortingModelFactory { |
| 29 | case FieldType::TYPE_TIME_PICKER: | 35 | case FieldType::TYPE_TIME_PICKER: |
| 30 | case FieldType::TYPE_IMAGE: | 36 | case FieldType::TYPE_IMAGE: |
| 31 | case FieldType::TYPE_BOOLEAN: | 37 | case FieldType::TYPE_BOOLEAN: |
| 32 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key ); | 38 | return (new ACP\Sorting\Model\MetaFactory())->create($meta_type, $meta_key); |
| 33 | 39 | ||
| 34 | case FieldType::TYPE_DATE_PICKER: | 40 | case FieldType::TYPE_DATE_PICKER: |
| 35 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::NUMERIC ) ); | 41 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 42 | $meta_type, | ||
| 43 | $meta_key, | ||
| 44 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::NUMERIC) | ||
| 45 | ); | ||
| 36 | 46 | ||
| 37 | case FieldType::TYPE_DATE_TIME_PICKER: | 47 | case FieldType::TYPE_DATE_TIME_PICKER: |
| 38 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::DATETIME ) ); | 48 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 49 | $meta_type, | ||
| 50 | $meta_key, | ||
| 51 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::DATETIME) | ||
| 52 | ); | ||
| 39 | 53 | ||
| 40 | case FieldType::TYPE_CHECKBOX: | 54 | case FieldType::TYPE_CHECKBOX: |
| 41 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 55 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; |
| 42 | 56 | ||
| 43 | return ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\Select( $choices ) ); | 57 | return (new ACP\Sorting\Model\MetaFormatFactory())->create( |
| 58 | $meta_type, | ||
| 59 | $meta_key, | ||
| 60 | new Sorting\FormatValue\Select($choices), | ||
| 61 | null, | ||
| 62 | [ | ||
| 63 | 'post_type' => $column->get_post_type(), | ||
| 64 | 'taxonomy' => $column->get_taxonomy(), | ||
| 65 | ] | ||
| 66 | ); | ||
| 44 | case FieldType::TYPE_FILE: | 67 | case FieldType::TYPE_FILE: |
| 45 | return ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\File() ); | 68 | return (new ACP\Sorting\Model\MetaFormatFactory())->create( |
| 69 | $meta_type, | ||
| 70 | $meta_key, | ||
| 71 | new Sorting\FormatValue\File(), | ||
| 72 | null, | ||
| 73 | [ | ||
| 74 | 'post_type' => $column->get_post_type(), | ||
| 75 | 'taxonomy' => $column->get_taxonomy(), | ||
| 76 | ] | ||
| 77 | ); | ||
| 46 | 78 | ||
| 47 | case FieldType::TYPE_RADIO: | 79 | case FieldType::TYPE_RADIO: |
| 48 | case FieldType::TYPE_BUTTON_GROUP: | 80 | case FieldType::TYPE_BUTTON_GROUP: |
| 49 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 81 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; |
| 50 | natcasesort( $choices ); | 82 | natcasesort($choices); |
| 51 | 83 | ||
| 52 | return ( new ACP\Sorting\Model\MetaMappingFactory )->create( $meta_type, $meta_key, array_keys( $choices ) ); | 84 | return (new ACP\Sorting\Model\MetaMappingFactory())->create( |
| 85 | $meta_type, | ||
| 86 | $meta_key, | ||
| 87 | array_keys($choices) | ||
| 88 | ); | ||
| 53 | 89 | ||
| 54 | case FieldType::TYPE_SELECT: | 90 | case FieldType::TYPE_SELECT: |
| 55 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 91 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; |
| 56 | natcasesort( $choices ); | 92 | natcasesort($choices); |
| 57 | 93 | ||
| 58 | return $field instanceof Field\Multiple && $field->is_multiple() | 94 | return $field instanceof Field\Multiple && $field->is_multiple() |
| 59 | ? ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\Select( $choices ) ) | 95 | ? (new ACP\Sorting\Model\MetaFormatFactory())->create( |
| 60 | : ( new ACP\Sorting\Model\MetaMappingFactory )->create( $meta_type, $meta_key, array_keys( $choices ) ); | 96 | $meta_type, |
| 97 | $meta_key, | ||
| 98 | new Sorting\FormatValue\Select($choices), | ||
| 99 | null, | ||
| 100 | [ | ||
| 101 | 'post_type' => $column->get_post_type(), | ||
| 102 | 'taxonomy' => $column->get_taxonomy(), | ||
| 103 | ] | ||
| 104 | ) | ||
| 105 | : (new ACP\Sorting\Model\MetaMappingFactory())->create($meta_type, $meta_key, array_keys($choices)); | ||
| 61 | 106 | ||
| 62 | case FieldType::TYPE_RELATIONSHIP: | 107 | case FieldType::TYPE_RELATIONSHIP: |
| 63 | case FieldType::TYPE_POST: | 108 | case FieldType::TYPE_POST: |
| 64 | case FieldType::TYPE_PAGE_LINK: | 109 | case FieldType::TYPE_PAGE_LINK: |
| 65 | return ( new Sorting\ModelFactory\Relation() )->create( $field, $meta_key, $column ); | 110 | return (new Sorting\ModelFactory\Relation())->create($field, $meta_key, $column); |
| 66 | 111 | ||
| 67 | case FieldType::TYPE_USER: | 112 | case FieldType::TYPE_USER: |
| 68 | return ( new Sorting\ModelFactory\User() )->create( $field, $meta_key, $column ); | 113 | return (new Sorting\ModelFactory\User())->create($field, $meta_key, $column); |
| 69 | 114 | ||
| 70 | case FieldType::TYPE_TAXONOMY: | 115 | case FieldType::TYPE_TAXONOMY: |
| 71 | return ( new Sorting\ModelFactory\Taxonomy() )->create( $field, $meta_key, $column ); | 116 | return (new Sorting\ModelFactory\Taxonomy())->create($field, $meta_key, $column); |
| 72 | 117 | ||
| 73 | default: | 118 | default: |
| 74 | return new ACP\Sorting\Model\Disabled(); | 119 | return new ACP\Sorting\Model\Disabled(); | ... | ... |
| ... | @@ -12,31 +12,35 @@ use ACP\Sorting\Model\Disabled; | ... | @@ -12,31 +12,35 @@ use ACP\Sorting\Model\Disabled; |
| 12 | use ACP\Sorting\Model\MetaFormatFactory; | 12 | use ACP\Sorting\Model\MetaFormatFactory; |
| 13 | use ACP\Sorting\Model\MetaRelatedPostFactory; | 13 | use ACP\Sorting\Model\MetaRelatedPostFactory; |
| 14 | 14 | ||
| 15 | class Relation implements SortingModelFactory { | 15 | class Relation implements SortingModelFactory |
| 16 | { | ||
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| 18 | * @var MetaFormatFactory | 19 | * @var MetaFormatFactory |
| 19 | */ | 20 | */ |
| 20 | private $meta_format_factory; | 21 | private $meta_format_factory; |
| 21 | 22 | ||
| 22 | public function __construct() { | 23 | public function __construct() |
| 24 | { | ||
| 23 | $this->meta_format_factory = new MetaFormatFactory(); | 25 | $this->meta_format_factory = new MetaFormatFactory(); |
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | public function create( Field $field, $meta_key, Column $column ) { | 28 | public function create(Field $field, $meta_key, Column $column) |
| 29 | { | ||
| 27 | return $field instanceof Field\Multiple && $field->is_multiple() | 30 | return $field instanceof Field\Multiple && $field->is_multiple() |
| 28 | ? $this->create_multiple_relation_model( $column, $meta_key ) | 31 | ? $this->create_multiple_relation_model($column, $meta_key) |
| 29 | : $this->create_single_relation_model( $column, $meta_key ); | 32 | : $this->create_single_relation_model($column, $meta_key); |
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | private function create_single_relation_model( Column $column, $meta_key ) { | 35 | private function create_single_relation_model(Column $column, $meta_key) |
| 33 | $setting = $column->get_setting( AC\Settings\Column\Post::NAME ); | 36 | { |
| 37 | $setting = $column->get_setting(AC\Settings\Column\Post::NAME); | ||
| 34 | 38 | ||
| 35 | if ( ! $setting ) { | 39 | if ( ! $setting) { |
| 36 | return new Disabled(); | 40 | return new Disabled(); |
| 37 | } | 41 | } |
| 38 | 42 | ||
| 39 | $model = ( new MetaRelatedPostFactory() )->create( | 43 | $model = (new MetaRelatedPostFactory())->create( |
| 40 | $column->get_meta_type(), | 44 | $column->get_meta_type(), |
| 41 | $setting->get_value(), | 45 | $setting->get_value(), |
| 42 | $meta_key | 46 | $meta_key |
| ... | @@ -46,17 +50,28 @@ class Relation implements SortingModelFactory { | ... | @@ -46,17 +50,28 @@ class Relation implements SortingModelFactory { |
| 46 | ?: $this->meta_format_factory->create( | 50 | ?: $this->meta_format_factory->create( |
| 47 | $column->get_meta_type(), | 51 | $column->get_meta_type(), |
| 48 | $meta_key, | 52 | $meta_key, |
| 49 | new SettingFormatter( $setting ) | 53 | new SettingFormatter($setting), |
| 54 | null, | ||
| 55 | [ | ||
| 56 | 'taxonomy' => $column->get_taxonomy(), | ||
| 57 | 'post_type' => $column->get_post_type(), | ||
| 58 | ] | ||
| 50 | ); | 59 | ); |
| 51 | } | 60 | } |
| 52 | 61 | ||
| 53 | private function create_multiple_relation_model( Column $column, $meta_key ) { | 62 | private function create_multiple_relation_model(Column $column, $meta_key) |
| 54 | $setting = $column->get_setting( AC\Settings\Column\Post::NAME ); | 63 | { |
| 64 | $setting = $column->get_setting(AC\Settings\Column\Post::NAME); | ||
| 55 | 65 | ||
| 56 | return $this->meta_format_factory->create( | 66 | return $this->meta_format_factory->create( |
| 57 | $column->get_meta_type(), | 67 | $column->get_meta_type(), |
| 58 | $meta_key, | 68 | $meta_key, |
| 59 | new SerializedSettingFormatter( new SettingFormatter( $setting ) ) | 69 | new SerializedSettingFormatter(new SettingFormatter($setting)), |
| 70 | null, | ||
| 71 | [ | ||
| 72 | 'taxonomy' => $column->get_taxonomy(), | ||
| 73 | 'post_type' => $column->get_post_type(), | ||
| 74 | ] | ||
| 60 | ); | 75 | ); |
| 61 | } | 76 | } |
| 62 | 77 | ... | ... |
| ... | @@ -7,18 +7,29 @@ use ACA\ACF\Field; | ... | @@ -7,18 +7,29 @@ use ACA\ACF\Field; |
| 7 | use ACA\ACF\Sorting; | 7 | use ACA\ACF\Sorting; |
| 8 | use ACP; | 8 | use ACP; |
| 9 | 9 | ||
| 10 | class Taxonomy implements Sorting\SortingModelFactory { | 10 | class Taxonomy implements Sorting\SortingModelFactory |
| 11 | { | ||
| 11 | 12 | ||
| 12 | public function create( Field $field, $meta_key, Column $column ) { | 13 | public function create(Field $field, $meta_key, Column $column) |
| 13 | if ( ! $field instanceof Field\Type\Taxonomy ) { | 14 | { |
| 15 | if ( ! $field instanceof Field\Type\Taxonomy) { | ||
| 14 | return new ACP\Sorting\Model\Disabled(); | 16 | return new ACP\Sorting\Model\Disabled(); |
| 15 | } | 17 | } |
| 16 | 18 | ||
| 17 | if ( $field->uses_native_term_relation() ) { | 19 | if ($field->uses_native_term_relation()) { |
| 18 | return new ACP\Sorting\Model\Disabled(); | 20 | return new ACP\Sorting\Model\Disabled(); |
| 19 | } | 21 | } |
| 20 | 22 | ||
| 21 | return ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $column->get_meta_type(), $meta_key, new Sorting\FormatValue\Taxonomy() ); | 23 | return (new ACP\Sorting\Model\MetaFormatFactory())->create( |
| 24 | $column->get_meta_type(), | ||
| 25 | $meta_key, | ||
| 26 | new Sorting\FormatValue\Taxonomy(), | ||
| 27 | null, | ||
| 28 | [ | ||
| 29 | 'taxonomy' => $column->get_taxonomy(), | ||
| 30 | 'post_type' => $column->get_post_type(), | ||
| 31 | ] | ||
| 32 | ); | ||
| 22 | } | 33 | } |
| 23 | 34 | ||
| 24 | } | 35 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -9,29 +9,33 @@ use ACA\ACF\Sorting\SortingModelFactory; | ... | @@ -9,29 +9,33 @@ use ACA\ACF\Sorting\SortingModelFactory; |
| 9 | use ACP; | 9 | use ACP; |
| 10 | use ACP\Sorting\Model\MetaRelatedUserFactory; | 10 | use ACP\Sorting\Model\MetaRelatedUserFactory; |
| 11 | 11 | ||
| 12 | class User implements SortingModelFactory { | 12 | class User implements SortingModelFactory |
| 13 | { | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * @var ACP\Sorting\Model\MetaFormatFactory | 16 | * @var ACP\Sorting\Model\MetaFormatFactory |
| 16 | */ | 17 | */ |
| 17 | private $meta_format_factory; | 18 | private $meta_format_factory; |
| 18 | 19 | ||
| 19 | public function __construct() { | 20 | public function __construct() |
| 21 | { | ||
| 20 | $this->meta_format_factory = new ACP\Sorting\Model\MetaFormatFactory(); | 22 | $this->meta_format_factory = new ACP\Sorting\Model\MetaFormatFactory(); |
| 21 | } | 23 | } |
| 22 | 24 | ||
| 23 | public function create( Field $field, $meta_key, Column $column ) { | 25 | public function create(Field $field, $meta_key, Column $column) |
| 26 | { | ||
| 24 | return $field instanceof Field\Multiple && $field->is_multiple() | 27 | return $field instanceof Field\Multiple && $field->is_multiple() |
| 25 | ? $this->create_multiple_relation_model( $column, $meta_key ) | 28 | ? $this->create_multiple_relation_model($column, $meta_key) |
| 26 | : $this->create_single_relation_model( $column, $meta_key ); | 29 | : $this->create_single_relation_model($column, $meta_key); |
| 27 | } | 30 | } |
| 28 | 31 | ||
| 29 | private function create_single_relation_model( Column $column, $meta_key ) { | 32 | private function create_single_relation_model(Column $column, $meta_key) |
| 30 | $setting = $column->get_setting( AC\Settings\Column\User::NAME ); | 33 | { |
| 34 | $setting = $column->get_setting(AC\Settings\Column\User::NAME); | ||
| 31 | 35 | ||
| 32 | $model = ( new MetaRelatedUserFactory() )->create( | 36 | $model = (new MetaRelatedUserFactory())->create( |
| 33 | $column->get_meta_type(), | 37 | $column->get_meta_type(), |
| 34 | $setting->get_value(), | 38 | (string)$setting->get_value(), |
| 35 | $meta_key | 39 | $meta_key |
| 36 | ); | 40 | ); |
| 37 | 41 | ||
| ... | @@ -39,19 +43,30 @@ class User implements SortingModelFactory { | ... | @@ -39,19 +43,30 @@ class User implements SortingModelFactory { |
| 39 | ?: $this->meta_format_factory->create( | 43 | ?: $this->meta_format_factory->create( |
| 40 | $column->get_meta_type(), | 44 | $column->get_meta_type(), |
| 41 | $meta_key, | 45 | $meta_key, |
| 42 | new ACP\Sorting\FormatValue\SettingFormatter( $setting ) | 46 | new ACP\Sorting\FormatValue\SettingFormatter($setting), |
| 47 | null, | ||
| 48 | [ | ||
| 49 | 'taxonomy' => $column->get_taxonomy(), | ||
| 50 | 'post_type' => $column->get_post_type(), | ||
| 51 | ] | ||
| 43 | ); | 52 | ); |
| 44 | } | 53 | } |
| 45 | 54 | ||
| 46 | private function create_multiple_relation_model( Column $column, $meta_key ) { | 55 | private function create_multiple_relation_model(Column $column, $meta_key) |
| 47 | $setting = $column->get_setting( AC\Settings\Column\User::NAME ); | 56 | { |
| 57 | $setting = $column->get_setting(AC\Settings\Column\User::NAME); | ||
| 48 | 58 | ||
| 49 | return $this->meta_format_factory->create( | 59 | return $this->meta_format_factory->create( |
| 50 | $column->get_meta_type(), | 60 | $column->get_meta_type(), |
| 51 | $meta_key, | 61 | $meta_key, |
| 52 | new ACP\Sorting\FormatValue\SerializedSettingFormatter( | 62 | new ACP\Sorting\FormatValue\SerializedSettingFormatter( |
| 53 | new ACP\Sorting\FormatValue\SettingFormatter( $setting ) | 63 | new ACP\Sorting\FormatValue\SettingFormatter($setting) |
| 54 | ) | 64 | ), |
| 65 | null, | ||
| 66 | [ | ||
| 67 | 'taxonomy' => $column->get_taxonomy(), | ||
| 68 | 'post_type' => $column->get_post_type(), | ||
| 69 | ] | ||
| 55 | ); | 70 | ); |
| 56 | } | 71 | } |
| 57 | 72 | ... | ... |
| ... | @@ -3,26 +3,27 @@ | ... | @@ -3,26 +3,27 @@ |
| 3 | namespace ACA\BbPress; | 3 | namespace ACA\BbPress; |
| 4 | 4 | ||
| 5 | use AC\Registerable; | 5 | use AC\Registerable; |
| 6 | use ACA\BbPress\Service; | 6 | use AC\Services; |
| 7 | 7 | ||
| 8 | class BbPress implements Registerable { | 8 | class BbPress implements Registerable |
| 9 | { | ||
| 9 | 10 | ||
| 10 | public function register() { | 11 | public function register(): void |
| 11 | if ( ! class_exists( 'bbPress' ) ) { | 12 | { |
| 13 | if ( ! class_exists('bbPress')) { | ||
| 12 | return; | 14 | return; |
| 13 | } | 15 | } |
| 14 | 16 | ||
| 15 | $services = [ | 17 | $this->create_services()->register(); |
| 18 | } | ||
| 19 | |||
| 20 | private function create_services(): Services | ||
| 21 | { | ||
| 22 | return new Services([ | ||
| 16 | new Service\Columns(), | 23 | new Service\Columns(), |
| 17 | new Service\Editing(), | 24 | new Service\Editing(), |
| 18 | new Service\ListScreens(), | 25 | new Service\ListScreens(), |
| 19 | ]; | 26 | ]); |
| 20 | |||
| 21 | foreach ( $services as $service ) { | ||
| 22 | if ( $service instanceof Registerable ) { | ||
| 23 | $service->register(); | ||
| 24 | } | ||
| 25 | } | ||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | } | 29 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -13,7 +13,8 @@ class Topic extends ACP\ListScreen\Post { | ... | @@ -13,7 +13,8 @@ class Topic extends ACP\ListScreen\Post { |
| 13 | $this->set_group( 'bbpress' ); | 13 | $this->set_group( 'bbpress' ); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | protected function register_column_types() { | 16 | protected function register_column_types(): void |
| 17 | { | ||
| 17 | parent::register_column_types(); | 18 | parent::register_column_types(); |
| 18 | 19 | ||
| 19 | $this->register_column_type( new Column\Topic\Forum() ); | 20 | $this->register_column_type( new Column\Topic\Forum() ); | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\BbPress\ListScreenFactory; | 3 | namespace ACA\BbPress\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\BbPress\ListScreen\Topic; | 7 | use ACA\BbPress\ListScreen\Topic; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class TopicFactory implements ListScreenFactoryInterface { | 10 | class TopicFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'topic' === $key; | 15 | return 'topic' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new Topic(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new Topic(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'topic'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'topic'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return new Topic(); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Topic(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -8,7 +8,8 @@ use ACA\BbPress\Column; | ... | @@ -8,7 +8,8 @@ use ACA\BbPress\Column; |
| 8 | 8 | ||
| 9 | class Columns implements Registerable { | 9 | class Columns implements Registerable { |
| 10 | 10 | ||
| 11 | public function register() { | 11 | public function register(): void |
| 12 | { | ||
| 12 | add_action( 'ac/column_groups', [ $this, 'register_column_group' ] ); | 13 | add_action( 'ac/column_groups', [ $this, 'register_column_group' ] ); |
| 13 | } | 14 | } |
| 14 | 15 | ... | ... |
| ... | @@ -6,7 +6,8 @@ use AC\Registerable; | ... | @@ -6,7 +6,8 @@ use AC\Registerable; |
| 6 | 6 | ||
| 7 | class Editing implements Registerable { | 7 | class Editing implements Registerable { |
| 8 | 8 | ||
| 9 | public function register() { | 9 | public function register(): void |
| 10 | { | ||
| 10 | add_filter( 'ac/editing/role_group', [ $this, 'editing_role_group' ], 10, 2 ); | 11 | add_filter( 'ac/editing/role_group', [ $this, 'editing_role_group' ], 10, 2 ); |
| 11 | } | 12 | } |
| 12 | 13 | ... | ... |
| ... | @@ -9,11 +9,12 @@ use ACA\BbPress\ListScreenFactory\TopicFactory; | ... | @@ -9,11 +9,12 @@ use ACA\BbPress\ListScreenFactory\TopicFactory; |
| 9 | 9 | ||
| 10 | class ListScreens implements Registerable { | 10 | class ListScreens implements Registerable { |
| 11 | 11 | ||
| 12 | public function register() { | 12 | public function register(): void |
| 13 | { | ||
| 13 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); | 14 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); |
| 14 | add_action( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); | 15 | add_action( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); |
| 15 | 16 | ||
| 16 | AC\ListScreenFactory::add( new TopicFactory() ); | 17 | AC\ListScreenFactory\Aggregate::add( new TopicFactory() ); |
| 17 | } | 18 | } |
| 18 | 19 | ||
| 19 | public function register_list_screen_group( AC\Groups $groups ): void { | 20 | public function register_list_screen_group( AC\Groups $groups ): void { | ... | ... |
| ... | @@ -4,30 +4,32 @@ namespace ACA\BeaverBuilder; | ... | @@ -4,30 +4,32 @@ namespace ACA\BeaverBuilder; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC; |
| 6 | use AC\Registerable; | 6 | use AC\Registerable; |
| 7 | use AC\Services; | ||
| 7 | use ACA\BeaverBuilder\Service; | 8 | use ACA\BeaverBuilder\Service; |
| 8 | 9 | ||
| 9 | class BeaverBuilder implements Registerable { | 10 | class BeaverBuilder implements Registerable |
| 11 | { | ||
| 10 | 12 | ||
| 11 | public function register() { | 13 | public function register(): void |
| 12 | if ( ! class_exists( 'FLBuilderLoader' ) ) { | 14 | { |
| 15 | if ( ! class_exists('FLBuilderLoader')) { | ||
| 13 | return; | 16 | return; |
| 14 | } | 17 | } |
| 15 | 18 | ||
| 16 | AC\ListScreenFactory::add( new ListScreenFactory\Templates() ); | 19 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\Templates()); |
| 17 | AC\ListScreenFactory::add( new ListScreenFactory\SavedColumns() ); | 20 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedColumns()); |
| 18 | AC\ListScreenFactory::add( new ListScreenFactory\SavedModules() ); | 21 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedModules()); |
| 19 | AC\ListScreenFactory::add( new ListScreenFactory\SavedRows() ); | 22 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedRows()); |
| 20 | 23 | ||
| 21 | $services = [ | 24 | $this->create_services()->register(); |
| 25 | } | ||
| 26 | |||
| 27 | private function create_services(): Services | ||
| 28 | { | ||
| 29 | return new Services([ | ||
| 22 | new Service\ListScreens(), | 30 | new Service\ListScreens(), |
| 23 | new Service\PostTypes(), | 31 | new Service\PostTypes(), |
| 24 | ]; | 32 | ]); |
| 25 | |||
| 26 | foreach ( $services as $service ) { | ||
| 27 | if ( $service instanceof Registerable ) { | ||
| 28 | $service->register(); | ||
| 29 | } | ||
| 30 | } | ||
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | } | 35 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,9 +2,11 @@ | ... | @@ -2,9 +2,11 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\BeaverBuilder\ListScreen; | 3 | namespace ACA\BeaverBuilder\ListScreen; |
| 4 | 4 | ||
| 5 | use AC\Type\Uri; | ||
| 5 | use ACP; | 6 | use ACP; |
| 6 | 7 | ||
| 7 | class Template extends ACP\ListScreen\Post { | 8 | class Template extends ACP\ListScreen\Post |
| 9 | { | ||
| 8 | 10 | ||
| 9 | public const POST_TYPE = 'fl-builder-template'; | 11 | public const POST_TYPE = 'fl-builder-template'; |
| 10 | 12 | ||
| ... | @@ -12,24 +14,25 @@ class Template extends ACP\ListScreen\Post { | ... | @@ -12,24 +14,25 @@ class Template extends ACP\ListScreen\Post { |
| 12 | 14 | ||
| 13 | private $custom_label; | 15 | private $custom_label; |
| 14 | 16 | ||
| 15 | public function __construct( string $template_page, string $label ) { | 17 | public function __construct(string $template_page, string $label) |
| 16 | parent::__construct( 'fl-builder-template' ); | 18 | { |
| 19 | parent::__construct('fl-builder-template', self::POST_TYPE . $template_page); | ||
| 17 | 20 | ||
| 18 | $this->template_page = $template_page; | 21 | $this->template_page = $template_page; |
| 19 | $this->custom_label = $label; | 22 | $this->custom_label = $label; |
| 20 | 23 | ||
| 21 | $this->set_key( self::POST_TYPE . $template_page ) | 24 | $this->set_group('beaver_builder') |
| 22 | ->set_group( 'beaver_builder' ) | 25 | ->set_label($label); |
| 23 | ->set_label( $label ) | ||
| 24 | ->set_screen_id( $this->get_screen_base() . '-fl-builder-template' ); | ||
| 25 | } | 26 | } |
| 26 | 27 | ||
| 27 | public function get_label() { | 28 | public function get_label(): ?string |
| 29 | { | ||
| 28 | return $this->custom_label; | 30 | return $this->custom_label; |
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | public function get_screen_link() { | 33 | public function get_table_url(): Uri |
| 32 | return add_query_arg( [ 'fl-builder-template-type' => $this->template_page ], parent::get_screen_link() ); | 34 | { |
| 35 | return parent::get_table_url()->with_arg('fl-builder-template-type', $this->template_page); | ||
| 33 | } | 36 | } |
| 34 | 37 | ||
| 35 | } | 38 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | declare( strict_types=1 ); | 2 | |
| 3 | declare(strict_types=1); | ||
| 3 | 4 | ||
| 4 | namespace ACA\BeaverBuilder; | 5 | namespace ACA\BeaverBuilder; |
| 5 | 6 | ||
| 7 | use AC; | ||
| 6 | use AC\ListScreen; | 8 | use AC\ListScreen; |
| 7 | use AC\ListScreenFactory\ListSettingsTrait; | ||
| 8 | use AC\ListScreenFactoryInterface; | ||
| 9 | use ACA\BeaverBuilder\ListScreen\Template; | 9 | use ACA\BeaverBuilder\ListScreen\Template; |
| 10 | use LogicException; | ||
| 11 | use WP_Screen; | 10 | use WP_Screen; |
| 12 | 11 | ||
| 13 | abstract class ListScreenFactory implements ListScreenFactoryInterface { | 12 | abstract class ListScreenFactory extends AC\ListScreenFactory\BaseFactory |
| 14 | 13 | { | |
| 15 | use ListSettingsTrait; | ||
| 16 | 14 | ||
| 17 | private function create_list_screen(): Template { | 15 | protected function create_list_screen(string $key): ListScreen |
| 18 | return new Template( $this->get_page(), $this->get_label() ); | 16 | { |
| 17 | return new Template($this->get_page(), $this->get_label()); | ||
| 19 | } | 18 | } |
| 20 | 19 | ||
| 21 | abstract protected function get_label(): string; | 20 | abstract protected function get_label(): string; |
| 22 | 21 | ||
| 23 | abstract protected function get_page(): string; | 22 | abstract protected function get_page(): string; |
| 24 | 23 | ||
| 25 | public function can_create( string $key ): bool { | 24 | public function can_create(string $key): bool |
| 26 | return $key === Template::POST_TYPE . $this->get_page() && post_type_exists( Template::POST_TYPE ); | 25 | { |
| 27 | } | 26 | return $key === Template::POST_TYPE . $this->get_page() && post_type_exists(Template::POST_TYPE); |
| 28 | |||
| 29 | public function create( string $key, array $settings = [] ): ListScreen { | ||
| 30 | if ( ! $this->can_create( $key ) ) { | ||
| 31 | throw new LogicException( 'Invalid key' ); | ||
| 32 | } | 27 | } |
| 33 | 28 | ||
| 34 | return $this->add_settings( $this->create_list_screen(), $settings ); | 29 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 35 | } | 30 | { |
| 36 | |||
| 37 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | ||
| 38 | return 'edit' === $screen->base | 31 | return 'edit' === $screen->base |
| 39 | && $screen->post_type | 32 | && $screen->post_type |
| 40 | && 'edit-' . $screen->post_type === $screen->id | 33 | && 'edit-' . $screen->post_type === $screen->id |
| 41 | && $this->get_page() === filter_input( INPUT_GET, 'fl-builder-template-type' ); | 34 | && $this->get_page() === filter_input(INPUT_GET, 'fl-builder-template-type'); |
| 42 | } | ||
| 43 | |||
| 44 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 45 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 46 | throw new LogicException( 'Invalid screen' ); | ||
| 47 | } | 35 | } |
| 48 | 36 | ||
| 49 | return $this->add_settings( $this->create_list_screen(), $settings ); | 37 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 38 | { | ||
| 39 | return $this->create_list_screen($screen->post_type); | ||
| 50 | } | 40 | } |
| 51 | 41 | ||
| 52 | } | 42 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -12,7 +12,8 @@ use ACP\ListScreen\Taxonomy; | ... | @@ -12,7 +12,8 @@ use ACP\ListScreen\Taxonomy; |
| 12 | 12 | ||
| 13 | class ListScreens implements Registerable { | 13 | class ListScreens implements Registerable { |
| 14 | 14 | ||
| 15 | public function register(): void { | 15 | public function register(): void |
| 16 | { | ||
| 16 | add_action( 'ac/list_screen_groups', [ $this, 'register_beaver_builder_group' ] ); | 17 | add_action( 'ac/list_screen_groups', [ $this, 'register_beaver_builder_group' ] ); |
| 17 | add_filter( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); | 18 | add_filter( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); |
| 18 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); | 19 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); | ... | ... |
| ... | @@ -8,7 +8,8 @@ class PostTypes implements Registerable { | ... | @@ -8,7 +8,8 @@ class PostTypes implements Registerable { |
| 8 | 8 | ||
| 9 | public const POST_TYPE_TEMPLATE = 'fl-builder-template'; | 9 | public const POST_TYPE_TEMPLATE = 'fl-builder-template'; |
| 10 | 10 | ||
| 11 | public function register() { | 11 | public function register(): void |
| 12 | { | ||
| 12 | add_filter( 'ac/post_types', [ $this, 'deregister_global_post_type' ] ); | 13 | add_filter( 'ac/post_types', [ $this, 'deregister_global_post_type' ] ); |
| 13 | } | 14 | } |
| 14 | 15 | ... | ... |
| ... | @@ -3,42 +3,42 @@ | ... | @@ -3,42 +3,42 @@ |
| 3 | namespace ACA\BP; | 3 | namespace ACA\BP; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC; |
| 6 | use AC\ListScreenFactory\Aggregate; | ||
| 6 | use AC\Registerable; | 7 | use AC\Registerable; |
| 7 | use ACA\BP\ListScreenFactory; | 8 | use AC\Services; |
| 8 | use ACA\BP\Service; | ||
| 9 | use ACP\Service\IntegrationStatus; | 9 | use ACP\Service\IntegrationStatus; |
| 10 | 10 | ||
| 11 | final class BuddyPress implements Registerable { | 11 | final class BuddyPress implements Registerable |
| 12 | { | ||
| 12 | 13 | ||
| 13 | private $location; | 14 | private $location; |
| 14 | 15 | ||
| 15 | public function __construct( AC\Asset\Location\Absolute $location ) { | 16 | public function __construct(AC\Asset\Location\Absolute $location) |
| 17 | { | ||
| 16 | $this->location = $location; | 18 | $this->location = $location; |
| 17 | } | 19 | } |
| 18 | 20 | ||
| 19 | public function register() { | 21 | public function register(): void |
| 20 | if ( ! class_exists( 'BuddyPress', false ) ) { | 22 | { |
| 23 | if ( ! class_exists('BuddyPress', false)) { | ||
| 21 | return; | 24 | return; |
| 22 | } | 25 | } |
| 23 | 26 | ||
| 24 | $services = [ | 27 | Aggregate::add(new ListScreenFactory\Email()); |
| 25 | new Service\Admin( $this->location ), | 28 | Aggregate::add(new ListScreenFactory\Group()); |
| 26 | new Service\Columns(), | ||
| 27 | new Service\ListScreens(), | ||
| 28 | new Service\Table( $this->location ), | ||
| 29 | new IntegrationStatus( 'ac-addon-buddypress') | ||
| 30 | ]; | ||
| 31 | |||
| 32 | array_map( [ $this, 'register_service' ], $services ); | ||
| 33 | 29 | ||
| 34 | AC\ListScreenFactory::add( new ListScreenFactory\Email() ); | 30 | $this->create_services()->register(); |
| 35 | AC\ListScreenFactory::add( new ListScreenFactory\Group() ); | ||
| 36 | } | 31 | } |
| 37 | 32 | ||
| 38 | private function register_service( $service ) { | 33 | private function create_services(): Services |
| 39 | if ( $service instanceof Registerable ) { | 34 | { |
| 40 | $service->register(); | 35 | return new Services([ |
| 41 | } | 36 | new Service\Admin($this->location), |
| 37 | new Service\Columns(), | ||
| 38 | new Service\ListScreens(), | ||
| 39 | new Service\Table($this->location), | ||
| 40 | new IntegrationStatus('ac-addon-buddypress'), | ||
| 41 | ]); | ||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | } | 44 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -6,7 +6,8 @@ use ACP; | ... | @@ -6,7 +6,8 @@ use ACP; |
| 6 | 6 | ||
| 7 | class Groups extends ACP\Editing\Ajax\TableRows { | 7 | class Groups extends ACP\Editing\Ajax\TableRows { |
| 8 | 8 | ||
| 9 | public function register() { | 9 | public function register(): void |
| 10 | { | ||
| 10 | add_action( 'bp_groups_admin_load', [ $this, 'handle_request' ] ); | 11 | add_action( 'bp_groups_admin_load', [ $this, 'handle_request' ] ); |
| 11 | } | 12 | } |
| 12 | 13 | ... | ... |
| ... | @@ -4,7 +4,6 @@ namespace ACA\BP\Editing\Service\User; | ... | @@ -4,7 +4,6 @@ namespace ACA\BP\Editing\Service\User; |
| 4 | 4 | ||
| 5 | use ACP; | 5 | use ACP; |
| 6 | use ACP\Editing\Service; | 6 | use ACP\Editing\Service; |
| 7 | use ACP\Editing\Value\Data; | ||
| 8 | use ACP\Editing\View; | 7 | use ACP\Editing\View; |
| 9 | 8 | ||
| 10 | class Membertype implements Service { | 9 | class Membertype implements Service { | ... | ... |
| ... | @@ -2,12 +2,12 @@ | ... | @@ -2,12 +2,12 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\BP\Field\Profile; | 3 | namespace ACA\BP\Field\Profile; |
| 4 | 4 | ||
| 5 | use ACP; | ||
| 6 | use ACA\BP\Editing; | 5 | use ACA\BP\Editing; |
| 7 | use ACA\BP\Field\Profile; | 6 | use ACA\BP\Field\Profile; |
| 8 | use ACA\BP\Filtering; | 7 | use ACA\BP\Filtering; |
| 9 | use ACA\BP\Search; | 8 | use ACA\BP\Search; |
| 10 | use ACA\BP\Sorting; | 9 | use ACA\BP\Sorting; |
| 10 | use ACP; | ||
| 11 | use ACP\Sorting\Type\DataType; | 11 | use ACP\Sorting\Type\DataType; |
| 12 | 12 | ||
| 13 | class Datebox extends Profile { | 13 | class Datebox extends Profile { | ... | ... |
| ... | @@ -3,10 +3,10 @@ | ... | @@ -3,10 +3,10 @@ |
| 3 | namespace ACA\BP\Field\Profile; | 3 | namespace ACA\BP\Field\Profile; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC; |
| 6 | use ACP; | ||
| 7 | use ACA\BP\Editing; | 6 | use ACA\BP\Editing; |
| 8 | use ACA\BP\Field\Profile; | 7 | use ACA\BP\Field\Profile; |
| 9 | use ACA\BP\Search; | 8 | use ACA\BP\Search; |
| 9 | use ACP; | ||
| 10 | use ACP\Editing\Service\Basic; | 10 | use ACP\Editing\Service\Basic; |
| 11 | 11 | ||
| 12 | class Textarea extends Profile { | 12 | class Textarea extends Profile { | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\BP\ListScreen; | 5 | namespace ACA\BP\ListScreen; |
| 4 | 6 | ||
| 5 | use ACP; | 7 | use ACP; |
| 6 | 8 | ||
| 7 | class Email extends ACP\ListScreen\Post { | 9 | class Email extends ACP\ListScreen\Post |
| 10 | { | ||
| 8 | 11 | ||
| 9 | public function __construct() { | 12 | public function __construct() |
| 10 | parent::__construct( 'bp-email' ); | 13 | { |
| 14 | parent::__construct('bp-email'); | ||
| 11 | 15 | ||
| 12 | $this->set_group( 'buddypress' ); | 16 | $this->group = 'buddypress'; |
| 13 | } | 17 | } |
| 14 | 18 | ||
| 15 | } | 19 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\BP\ListScreen; | 5 | namespace ACA\BP\ListScreen; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 8 | use AC\ColumnRepository; | ||
| 9 | use AC\Type\Uri; | ||
| 6 | use ACA\BP\Column; | 10 | use ACA\BP\Column; |
| 7 | use ACA\BP\Editing; | 11 | use ACA\BP\Editing; |
| 12 | use ACA\BP\ListTable; | ||
| 13 | use ACA\BP\Table; | ||
| 8 | use ACP; | 14 | use ACP; |
| 9 | use BP_Groups_List_Table; | 15 | use BP_Groups_List_Table; |
| 10 | use ReflectionException; | ||
| 11 | |||
| 12 | class Group extends AC\ListScreenWP | ||
| 13 | implements ACP\Editing\ListScreen { | ||
| 14 | |||
| 15 | public function __construct() { | ||
| 16 | $this->set_key( 'bp-groups' ) | ||
| 17 | ->set_screen_id( 'toplevel_page_bp-groups' ) | ||
| 18 | ->set_screen_base( 'admin' ) | ||
| 19 | ->set_page( 'bp-groups' ) | ||
| 20 | ->set_label( __( 'Groups', 'codepress-admin-columns' ) ) | ||
| 21 | ->set_group( 'buddypress' ); | ||
| 22 | } | ||
| 23 | 16 | ||
| 24 | public function get_heading_hookname() { | 17 | class Group extends AC\ListScreen |
| 25 | return 'bp_groups_list_table_get_columns'; | 18 | implements ACP\Editing\ListScreen, AC\ListScreen\ManageValue, AC\ListScreen\ListTable |
| 26 | } | 19 | { |
| 20 | |||
| 21 | public function __construct() | ||
| 22 | { | ||
| 23 | parent::__construct('bp-groups', 'toplevel_page_bp-groups'); | ||
| 27 | 24 | ||
| 28 | /** | 25 | $this->label = __('Groups', 'codepress-admin-columns'); |
| 29 | * @param string $value | 26 | $this->group = 'buddypress'; |
| 30 | * @param string $column_name | ||
| 31 | * @param array $group | ||
| 32 | * | ||
| 33 | * @return string | ||
| 34 | */ | ||
| 35 | public function manage_value( $value, $column_name, $group ) { | ||
| 36 | return $this->get_display_value_by_column_name( $column_name, $group['id'], $value ); | ||
| 37 | } | 27 | } |
| 38 | 28 | ||
| 39 | /** | 29 | public function get_heading_hookname(): string |
| 40 | * @param int $id | 30 | { |
| 41 | * | 31 | return 'bp_groups_list_table_get_columns'; |
| 42 | * @return array | ||
| 43 | */ | ||
| 44 | protected function get_object( $id ) { | ||
| 45 | return (array) groups_get_group( $id ); | ||
| 46 | } | 32 | } |
| 47 | 33 | ||
| 48 | public function set_manage_value_callback() { | 34 | public function list_table(): AC\ListTable |
| 49 | add_action( 'bp_groups_admin_get_group_custom_column', [ $this, 'manage_value' ], 100, 3 ); | 35 | { |
| 36 | // Hook suffix is required when using the list screen, mainly in Ajax | ||
| 37 | if ( ! isset($GLOBALS['hook_suffix'])) { | ||
| 38 | $GLOBALS['hook_suffix'] = $this->get_screen_id(); | ||
| 50 | } | 39 | } |
| 51 | 40 | ||
| 52 | public function get_screen_link() { | 41 | return new ListTable\Group(new BP_Groups_List_Table()); |
| 53 | return add_query_arg( [ 'page' => $this->get_page(), 'layout' => $this->get_layout_id() ], $this->get_admin_url() ); | ||
| 54 | } | 42 | } |
| 55 | 43 | ||
| 56 | /** | 44 | public function manage_value(): AC\Table\ManageValue |
| 57 | * @return BP_Groups_List_Table | 45 | { |
| 58 | */ | 46 | return new Table\ManageValue\Group(new ColumnRepository($this)); |
| 59 | public function get_list_table() { | ||
| 60 | // Hook suffix is required when using the list screen, mainly in Ajax | ||
| 61 | if ( ! isset( $GLOBALS['hook_suffix'] ) ) { | ||
| 62 | $GLOBALS['hook_suffix'] = $this->get_screen_id(); | ||
| 63 | } | 47 | } |
| 64 | 48 | ||
| 65 | return new BP_Groups_List_Table(); | 49 | public function get_table_url(): Uri |
| 50 | { | ||
| 51 | $url = new AC\Type\Url\ListTable( | ||
| 52 | 'admin.php', | ||
| 53 | $this->has_id() ? $this->get_id() : null | ||
| 54 | ); | ||
| 55 | |||
| 56 | return $url->with_arg('page', 'bp-groups'); | ||
| 66 | } | 57 | } |
| 67 | 58 | ||
| 68 | /** | 59 | protected function register_column_types(): void |
| 69 | * @throws ReflectionException | 60 | { |
| 70 | */ | 61 | $this->register_column_types_from_list([ |
| 71 | protected function register_column_types() { | ||
| 72 | $this->register_column_types_from_list( [ | ||
| 73 | Column\Group\Avatar::class, | 62 | Column\Group\Avatar::class, |
| 74 | Column\Group\Creator::class, | 63 | Column\Group\Creator::class, |
| 75 | Column\Group\Description::class, | 64 | Column\Group\Description::class, |
| ... | @@ -77,14 +66,16 @@ class Group extends AC\ListScreenWP | ... | @@ -77,14 +66,16 @@ class Group extends AC\ListScreenWP |
| 77 | Column\Group\Name::class, | 66 | Column\Group\Name::class, |
| 78 | Column\Group\NameOnly::class, | 67 | Column\Group\NameOnly::class, |
| 79 | Column\Group\Status::class, | 68 | Column\Group\Status::class, |
| 80 | ] ); | 69 | ]); |
| 81 | } | 70 | } |
| 82 | 71 | ||
| 83 | public function get_table_attr_id() { | 72 | public function get_table_attr_id(): string |
| 73 | { | ||
| 84 | return '#bp-groups-form'; | 74 | return '#bp-groups-form'; |
| 85 | } | 75 | } |
| 86 | 76 | ||
| 87 | public function editing() { | 77 | public function editing() |
| 78 | { | ||
| 88 | return new Editing\Strategy\Group(); | 79 | return new Editing\Strategy\Group(); |
| 89 | } | 80 | } |
| 90 | 81 | ... | ... |
| ... | @@ -2,39 +2,31 @@ | ... | @@ -2,39 +2,31 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\BP\ListScreenFactory; | 3 | namespace ACA\BP\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC\ListScreenFactory; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | ||
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\BP\ListScreen; | 6 | use ACA\BP\ListScreen; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 7 | use WP_Screen; |
| 11 | 8 | ||
| 12 | class Email implements ListScreenFactoryInterface { | 9 | class Email extends ListScreenFactory\BaseFactory |
| 10 | { | ||
| 13 | 11 | ||
| 14 | use ListSettingsTrait; | 12 | public function can_create(string $key): bool |
| 15 | 13 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'bp-email' === $key; | 14 | return 'bp-email' === $key; |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 20 | public function create( string $key, array $settings = [] ): AC\ListScreen { | 17 | protected function create_list_screen(string $key): \AC\ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 18 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 19 | return new ListScreen\Email(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new ListScreen\Email(), $settings ); | ||
| 26 | } | 20 | } |
| 27 | 21 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 22 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 23 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'bp-email'; | 24 | return $screen->base === 'edit' && $screen->post_type === 'bp-email'; |
| 30 | } | 25 | } |
| 31 | 26 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): AC\ListScreen { | 27 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): \AC\ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 28 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 29 | return $this->create_list_screen('bp-email'); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new ListScreen\Email(), $settings ); | ||
| 38 | } | 30 | } |
| 39 | 31 | ||
| 40 | } | 32 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,39 +2,31 @@ | ... | @@ -2,39 +2,31 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\BP\ListScreenFactory; | 3 | namespace ACA\BP\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC\ListScreenFactory; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | ||
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\BP\ListScreen; | 6 | use ACA\BP\ListScreen; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 7 | use WP_Screen; |
| 11 | 8 | ||
| 12 | class Group implements ListScreenFactoryInterface { | 9 | class Group extends ListScreenFactory\BaseFactory |
| 10 | { | ||
| 13 | 11 | ||
| 14 | use ListSettingsTrait; | 12 | public function can_create(string $key): bool |
| 15 | 13 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'bp-groups' === $key; | 14 | return 'bp-groups' === $key; |
| 18 | } | 15 | } |
| 19 | 16 | ||
| 20 | public function create( string $key, array $settings = [] ): AC\ListScreen { | 17 | protected function create_list_screen(string $key): \AC\ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 18 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 19 | return new ListScreen\Group(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new ListScreen\Group(), $settings ); | ||
| 26 | } | ||
| 27 | |||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | ||
| 29 | return $screen->id === 'toplevel_page_bp-groups' && 'edit' !== filter_input( INPUT_GET, 'action' ); | ||
| 30 | } | 20 | } |
| 31 | 21 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): AC\ListScreen { | 22 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 23 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 24 | return $screen->id === 'toplevel_page_bp-groups' && 'edit' !== filter_input(INPUT_GET, 'action'); |
| 35 | } | 25 | } |
| 36 | 26 | ||
| 37 | return $this->add_settings( new ListScreen\Group(), $settings ); | 27 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): \AC\ListScreen |
| 28 | { | ||
| 29 | return $this->create_list_screen('bp-groups'); | ||
| 38 | } | 30 | } |
| 39 | 31 | ||
| 40 | } | 32 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace ACA\BP\ListTable; | ||
| 6 | |||
| 7 | use AC\ListTable; | ||
| 8 | use BP_Groups_List_Table; | ||
| 9 | |||
| 10 | class Group implements ListTable | ||
| 11 | { | ||
| 12 | |||
| 13 | use ListTable\WpListTableTrait; | ||
| 14 | |||
| 15 | public function __construct(BP_Groups_List_Table $table) | ||
| 16 | { | ||
| 17 | $this->table = $table; | ||
| 18 | } | ||
| 19 | |||
| 20 | public function get_column_value(string $column, int $id): string | ||
| 21 | { | ||
| 22 | return (string)apply_filters('bp_groups_admin_get_group_custom_column', '', $column, $this->get_group($id)); | ||
| 23 | } | ||
| 24 | |||
| 25 | public function render_row(int $id): string | ||
| 26 | { | ||
| 27 | ob_start(); | ||
| 28 | |||
| 29 | $this->table->single_row($this->get_group($id)); | ||
| 30 | |||
| 31 | return ob_get_clean(); | ||
| 32 | } | ||
| 33 | |||
| 34 | private function get_group(int $id): array | ||
| 35 | { | ||
| 36 | return (array)groups_get_group($id); | ||
| 37 | } | ||
| 38 | |||
| 39 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -20,7 +20,8 @@ class Admin implements Registerable { | ... | @@ -20,7 +20,8 @@ class Admin implements Registerable { |
| 20 | $this->location = $location; | 20 | $this->location = $location; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | public function register() { | 23 | public function register(): void |
| 24 | { | ||
| 24 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | 25 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); |
| 25 | } | 26 | } |
| 26 | 27 | ... | ... |
| ... | @@ -9,7 +9,8 @@ use ReflectionException; | ... | @@ -9,7 +9,8 @@ use ReflectionException; |
| 9 | 9 | ||
| 10 | class Columns implements Registerable { | 10 | class Columns implements Registerable { |
| 11 | 11 | ||
| 12 | public function register() { | 12 | public function register(): void |
| 13 | { | ||
| 13 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); | 14 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); |
| 14 | add_action( 'acp/column_types', [ $this, 'register_columns' ] ); | 15 | add_action( 'acp/column_types', [ $this, 'register_columns' ] ); |
| 15 | } | 16 | } | ... | ... |
| ... | @@ -9,7 +9,8 @@ use AC\Type\ListKey; | ... | @@ -9,7 +9,8 @@ use AC\Type\ListKey; |
| 9 | 9 | ||
| 10 | final class ListScreens implements Registerable { | 10 | final class ListScreens implements Registerable { |
| 11 | 11 | ||
| 12 | public function register() { | 12 | public function register(): void |
| 13 | { | ||
| 13 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); | 14 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); |
| 14 | add_filter( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); | 15 | add_filter( 'ac/admin/menu_group', [ $this, 'update_menu_list_groups' ], 10, 2 ); |
| 15 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); | 16 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); | ... | ... |
| ... | @@ -22,7 +22,8 @@ class Table implements Registerable { | ... | @@ -22,7 +22,8 @@ class Table implements Registerable { |
| 22 | $this->location = $location; | 22 | $this->location = $location; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | public function register() { | 25 | public function register(): void |
| 26 | { | ||
| 26 | add_action( 'ac/table/list_screen', [ $this, 'init_editable_table' ] ); | 27 | add_action( 'ac/table/list_screen', [ $this, 'init_editable_table' ] ); |
| 27 | add_action( 'ac/table_scripts', [ $this, 'table_scripts' ], 1 ); | 28 | add_action( 'ac/table_scripts', [ $this, 'table_scripts' ], 1 ); |
| 28 | } | 29 | } | ... | ... |
| ... | @@ -3,47 +3,56 @@ | ... | @@ -3,47 +3,56 @@ |
| 3 | namespace ACA\BP\Sorting; | 3 | namespace ACA\BP\Sorting; |
| 4 | 4 | ||
| 5 | use ACA\BP\Column; | 5 | use ACA\BP\Column; |
| 6 | use ACP\Search\Query\Bindings; | ||
| 6 | use ACP\Sorting\AbstractModel; | 7 | use ACP\Sorting\AbstractModel; |
| 8 | use ACP\Sorting\Model\QueryBindings; | ||
| 7 | use ACP\Sorting\Model\SqlOrderByFactory; | 9 | use ACP\Sorting\Model\SqlOrderByFactory; |
| 8 | use ACP\Sorting\Type\CastType; | 10 | use ACP\Sorting\Type\CastType; |
| 9 | use ACP\Sorting\Type\DataType; | 11 | use ACP\Sorting\Type\DataType; |
| 10 | use WP_User_Query; | 12 | use ACP\Sorting\Type\Order; |
| 11 | 13 | ||
| 12 | class Profile extends AbstractModel { | 14 | class Profile extends AbstractModel implements QueryBindings |
| 15 | { | ||
| 13 | 16 | ||
| 14 | /** | ||
| 15 | * @var Column\Profile | ||
| 16 | */ | ||
| 17 | protected $column; | 17 | protected $column; |
| 18 | 18 | ||
| 19 | protected $datatype; | 19 | protected $datatype; |
| 20 | 20 | ||
| 21 | public function __construct( Column\Profile $column, DataType $data_type = null ) { | 21 | public function __construct(Column\Profile $column, DataType $data_type = null) |
| 22 | parent::__construct( $data_type ); | 22 | { |
| 23 | parent::__construct(); | ||
| 23 | 24 | ||
| 24 | $this->column = $column; | 25 | $this->column = $column; |
| 26 | $this->data_type = $data_type ?: new DataType(DataType::STRING); | ||
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | public function get_sorting_vars() { | 29 | public function create_query_bindings(Order $order): Bindings |
| 28 | add_action( 'pre_user_query', [ $this, 'pre_user_query_callback' ] ); | 30 | { |
| 29 | |||
| 30 | return []; | ||
| 31 | } | ||
| 32 | |||
| 33 | public function pre_user_query_callback( WP_User_Query $query ) { | ||
| 34 | global $wpdb, $bp; | 31 | global $wpdb, $bp; |
| 35 | 32 | ||
| 36 | $from = $wpdb->prepare( " | 33 | $bindings = new Bindings(); |
| 34 | |||
| 35 | $bindings->join( | ||
| 36 | $wpdb->prepare( | ||
| 37 | " | ||
| 37 | LEFT JOIN {$bp->profile->table_name_data} as acsort_pd | 38 | LEFT JOIN {$bp->profile->table_name_data} as acsort_pd |
| 38 | ON $wpdb->users.ID = acsort_pd.user_id AND acsort_pd.field_id = %d | 39 | ON $wpdb->users.ID = acsort_pd.user_id AND acsort_pd.field_id = %d |
| 39 | ", $this->column->get_buddypress_field_id() ); | 40 | ", |
| 40 | 41 | $this->column->get_buddypress_field_id() | |
| 41 | $query->query_from .= $from; | 42 | ) |
| 42 | $query->query_orderby = sprintf( "GROUP BY $wpdb->users.ID ORDER BY %s", | 43 | ); |
| 43 | SqlOrderByFactory::create( 'acsort_pd.value', $this->get_order(), [ 'cast_type' => (string) CastType::create_from_data_type( $this->data_type ) ] ) | 44 | $bindings->group_by("$wpdb->users.ID"); |
| 45 | $bindings->order_by( | ||
| 46 | SqlOrderByFactory::create( | ||
| 47 | "acsort_pd.value", | ||
| 48 | (string)$order, | ||
| 49 | [ | ||
| 50 | 'cast_type' => (string)CastType::create_from_data_type($this->data_type), | ||
| 51 | ] | ||
| 52 | ) | ||
| 44 | ); | 53 | ); |
| 45 | 54 | ||
| 46 | remove_action( 'pre_user_query', [ $this, __FUNCTION__ ] ); | 55 | return $bindings; |
| 47 | } | 56 | } |
| 48 | 57 | ||
| 49 | } | 58 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,47 +2,57 @@ | ... | @@ -2,47 +2,57 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\BP\Sorting\User; | 3 | namespace ACA\BP\Sorting\User; |
| 4 | 4 | ||
| 5 | use ACP\Search\Query\Bindings; | ||
| 5 | use ACP\Sorting\AbstractModel; | 6 | use ACP\Sorting\AbstractModel; |
| 7 | use ACP\Sorting\Model\QueryBindings; | ||
| 6 | use ACP\Sorting\Model\SqlOrderByFactory; | 8 | use ACP\Sorting\Model\SqlOrderByFactory; |
| 7 | use ACP\Sorting\Type\ComputationType; | 9 | use ACP\Sorting\Type\ComputationType; |
| 8 | use WP_User_Query; | 10 | use ACP\Sorting\Type\Order; |
| 9 | 11 | ||
| 10 | class ActivityUpdates extends AbstractModel { | 12 | class ActivityUpdates extends AbstractModel implements QueryBindings |
| 13 | { | ||
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| 13 | * @var string | 16 | * @var string |
| 14 | */ | 17 | */ |
| 15 | private $activity_type; | 18 | private $activity_type; |
| 16 | 19 | ||
| 17 | public function __construct( $activity_type ) { | 20 | public function __construct($activity_type) |
| 21 | { | ||
| 18 | parent::__construct(); | 22 | parent::__construct(); |
| 19 | 23 | ||
| 20 | $this->activity_type = (string) $activity_type; | 24 | $this->activity_type = (string)$activity_type; |
| 21 | } | 25 | } |
| 22 | 26 | ||
| 23 | public function get_sorting_vars() { | 27 | public function create_query_bindings(Order $order): Bindings |
| 24 | add_action( 'pre_user_query', [ $this, 'pre_user_query_callback' ] ); | 28 | { |
| 25 | |||
| 26 | return []; | ||
| 27 | } | ||
| 28 | |||
| 29 | public function pre_user_query_callback( WP_User_Query $query ) { | ||
| 30 | global $wpdb, $bp; | 29 | global $wpdb, $bp; |
| 31 | 30 | ||
| 31 | $bindings = new Bindings(); | ||
| 32 | |||
| 33 | $alias = $bindings->get_unique_alias('activity'); | ||
| 32 | $where = ''; | 34 | $where = ''; |
| 33 | if ( $this->activity_type ) { | 35 | if ($this->activity_type) { |
| 34 | $where = $wpdb->prepare( 'AND acsort_activity.type = %s', $this->activity_type ); | 36 | $where = $wpdb->prepare("AND $alias.type = %s", $this->activity_type); |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 37 | $query->query_from .= " | 39 | $bindings->join( |
| 38 | LEFT JOIN {$bp->activity->table_name} as acsort_activity | 40 | " |
| 39 | ON {$wpdb->users}.ID = acsort_activity.user_id {$where} | 41 | LEFT JOIN {$bp->activity->table_name} as $alias |
| 40 | "; | 42 | ON {$wpdb->users}.ID = $alias.user_id {$where} |
| 41 | $query->query_orderby = sprintf( "GROUP BY {$wpdb->users}.ID ORDER BY %s", | 43 | " |
| 42 | SqlOrderByFactory::create_with_computation( new ComputationType( ComputationType::COUNT ), "acsort_activity.user_id", $this->get_order() ) | 44 | ); |
| 45 | |||
| 46 | $bindings->group_by("$wpdb->users.ID"); | ||
| 47 | $bindings->order_by( | ||
| 48 | SqlOrderByFactory::create_with_computation( | ||
| 49 | new ComputationType(ComputationType::COUNT), | ||
| 50 | "$alias.user_id", | ||
| 51 | (string)$order | ||
| 52 | ) | ||
| 43 | ); | 53 | ); |
| 44 | 54 | ||
| 45 | remove_action( 'pre_user_query', [ $this, __FUNCTION__ ] ); | 55 | return $bindings; |
| 46 | } | 56 | } |
| 47 | 57 | ||
| 48 | } | 58 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
wp-content/plugins/admin-columns-pro/addons/buddypress/classes/Table/ManageValue/Group.php
0 → 100644
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace ACA\BP\Table\ManageValue; | ||
| 6 | |||
| 7 | use AC\Table\ManageValue; | ||
| 8 | |||
| 9 | class Group extends ManageValue | ||
| 10 | { | ||
| 11 | |||
| 12 | public function register(): void | ||
| 13 | { | ||
| 14 | add_filter('bp_groups_admin_get_group_custom_column', [$this, 'render_value'], 100, 3); | ||
| 15 | } | ||
| 16 | |||
| 17 | public function render_value($value, $column_name, $group): ?string | ||
| 18 | { | ||
| 19 | return $this->render_cell((string)$column_name, (int)$group['id'], (string)$value); | ||
| 20 | } | ||
| 21 | |||
| 22 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -13,77 +13,98 @@ use ACP\ConditionalFormat; | ... | @@ -13,77 +13,98 @@ use ACP\ConditionalFormat; |
| 13 | use ACP\Sorting\Model\MetaFormatFactory; | 13 | use ACP\Sorting\Model\MetaFormatFactory; |
| 14 | 14 | ||
| 15 | class Organizer extends Meta | 15 | class Organizer extends Meta |
| 16 | implements AC\Column\Relation, ACP\Export\Exportable, ACP\Search\Searchable, ConditionalFormat\Formattable { | 16 | implements AC\Column\Relation, ACP\Export\Exportable, ACP\Search\Searchable, ConditionalFormat\Formattable |
| 17 | { | ||
| 17 | 18 | ||
| 18 | use ConditionalFormat\FilteredHtmlFormatTrait; | 19 | use ConditionalFormat\FilteredHtmlFormatTrait; |
| 19 | 20 | ||
| 20 | public function __construct() { | 21 | public function __construct() |
| 21 | $this->set_type( 'column-ec-event_organizer' ) | 22 | { |
| 22 | ->set_label( __( 'Organizer', 'codepress-admin-columns' ) ); | 23 | $this->set_type('column-ec-event_organizer') |
| 24 | ->set_label(__('Organizer', 'codepress-admin-columns')); | ||
| 23 | 25 | ||
| 24 | parent::__construct(); | 26 | parent::__construct(); |
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | public function get_relation_object() { | 29 | public function get_relation_object() |
| 28 | return new AC\Relation\Post( 'tribe_organizer' ); | 30 | { |
| 31 | return new AC\Relation\Post('tribe_organizer'); | ||
| 29 | } | 32 | } |
| 30 | 33 | ||
| 31 | public function get_meta_key() { | 34 | public function get_meta_key() |
| 35 | { | ||
| 32 | return '_EventOrganizerID'; | 36 | return '_EventOrganizerID'; |
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | public function get_value( $id ) { | 39 | public function get_value($id) |
| 36 | $post_ids = $this->get_raw_value( $id ); | 40 | { |
| 41 | $post_ids = $this->get_raw_value($id); | ||
| 37 | 42 | ||
| 38 | if ( ! $post_ids ) { | 43 | if ( ! $post_ids) { |
| 39 | return $this->get_empty_char(); | 44 | return $this->get_empty_char(); |
| 40 | } | 45 | } |
| 41 | 46 | ||
| 42 | $values = []; | 47 | $values = []; |
| 43 | foreach ( $post_ids as $_id ) { | 48 | foreach ($post_ids as $_id) { |
| 44 | $values[] = $this->get_formatted_value( $_id, $_id ); | 49 | $values[] = $this->get_formatted_value($_id, $_id); |
| 45 | } | 50 | } |
| 46 | 51 | ||
| 47 | $setting_limit = $this->get_setting( 'number_of_items' ); | 52 | $setting_limit = $this->get_setting('number_of_items'); |
| 48 | 53 | ||
| 49 | return ac_helper()->html->more( $values, $setting_limit ? $setting_limit->get_value() : false ); | 54 | return ac_helper()->html->more($values, $setting_limit ? $setting_limit->get_value() : false); |
| 50 | } | 55 | } |
| 51 | 56 | ||
| 52 | public function get_raw_value( $id ) { | 57 | public function get_raw_value($id) |
| 53 | $value = $this->get_meta_value( $id, $this->get_meta_key(), false ); | 58 | { |
| 59 | $value = $this->get_meta_value($id, $this->get_meta_key(), false); | ||
| 54 | 60 | ||
| 55 | $value = array_filter( $value ); | 61 | $value = array_filter($value); |
| 56 | 62 | ||
| 57 | if ( ! $value ) { | 63 | if ( ! $value) { |
| 58 | return false; | 64 | return false; |
| 59 | } | 65 | } |
| 60 | 66 | ||
| 61 | return $value; | 67 | return $value; |
| 62 | } | 68 | } |
| 63 | 69 | ||
| 64 | public function register_settings() { | 70 | public function register_settings() |
| 65 | $this->add_setting( new Settings\OrganizerDisplay( $this ) ); | 71 | { |
| 66 | $this->add_setting( new AC\Settings\Column\NumberOfItems( $this ) ); | 72 | $this->add_setting(new Settings\OrganizerDisplay($this)); |
| 73 | $this->add_setting(new AC\Settings\Column\NumberOfItems($this)); | ||
| 67 | } | 74 | } |
| 68 | 75 | ||
| 69 | public function editing() { | 76 | public function editing() |
| 77 | { | ||
| 70 | return new Editing\Service\Event\Organizer(); | 78 | return new Editing\Service\Event\Organizer(); |
| 71 | } | 79 | } |
| 72 | 80 | ||
| 73 | public function filtering() { | 81 | public function filtering() |
| 74 | return new Filtering\RelatedPost( $this ); | 82 | { |
| 83 | return new Filtering\RelatedPost($this); | ||
| 75 | } | 84 | } |
| 76 | 85 | ||
| 77 | public function sorting() { | 86 | public function sorting() |
| 78 | return ( new MetaFormatFactory() )->create( $this->get_meta_type(), $this->get_meta_key(), new ACP\Sorting\FormatValue\PostTitle() ); | 87 | { |
| 88 | return (new MetaFormatFactory())->create( | ||
| 89 | $this->get_meta_type(), | ||
| 90 | $this->get_meta_key(), | ||
| 91 | new ACP\Sorting\FormatValue\PostTitle(), | ||
| 92 | null, | ||
| 93 | [ | ||
| 94 | 'taxonomy' => $this->get_taxonomy(), | ||
| 95 | 'post_type' => $this->get_post_type(), | ||
| 96 | ] | ||
| 97 | ); | ||
| 79 | } | 98 | } |
| 80 | 99 | ||
| 81 | public function export() { | 100 | public function export() |
| 82 | return new ACP\Export\Model\StrippedValue( $this ); | 101 | { |
| 102 | return new ACP\Export\Model\StrippedValue($this); | ||
| 83 | } | 103 | } |
| 84 | 104 | ||
| 85 | public function search() { | 105 | public function search() |
| 86 | return new Search\Event\Relation( $this->get_meta_key(), $this->get_meta_type(), $this->get_relation_object() ); | 106 | { |
| 107 | return new Search\Event\Relation($this->get_meta_key(), $this->get_meta_type(), $this->get_relation_object()); | ||
| 87 | } | 108 | } |
| 88 | 109 | ||
| 89 | } | 110 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -8,8 +8,8 @@ use ACA\EC\Editing; | ... | @@ -8,8 +8,8 @@ use ACA\EC\Editing; |
| 8 | use ACA\EC\Filtering; | 8 | use ACA\EC\Filtering; |
| 9 | use ACA\EC\Search; | 9 | use ACA\EC\Search; |
| 10 | use ACA\EC\Settings; | 10 | use ACA\EC\Settings; |
| 11 | use ACP\ConditionalFormat; | ||
| 12 | use ACP; | 11 | use ACP; |
| 12 | use ACP\ConditionalFormat; | ||
| 13 | 13 | ||
| 14 | class Venue extends Meta | 14 | class Venue extends Meta |
| 15 | implements AC\Column\Relation, ACP\Export\Exportable, ACP\Search\Searchable, ACP\ConditionalFormat\Formattable { | 15 | implements AC\Column\Relation, ACP\Export\Exportable, ACP\Search\Searchable, ACP\ConditionalFormat\Formattable { | ... | ... |
| ... | @@ -2,8 +2,8 @@ | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\EC\Column\Venue; | 3 | namespace ACA\EC\Column\Venue; |
| 4 | 4 | ||
| 5 | use ACP\ConditionalFormat; | ||
| 6 | use ACA\EC\Column\Meta; | 5 | use ACA\EC\Column\Meta; |
| 6 | use ACP\ConditionalFormat; | ||
| 7 | use ACP\Search\Comparison\Meta\Text; | 7 | use ACP\Search\Comparison\Meta\Text; |
| 8 | use ACP\Search\Searchable; | 8 | use ACP\Search\Searchable; |
| 9 | 9 | ... | ... |
| ... | @@ -5,8 +5,8 @@ namespace ACA\EC\Column\Venue; | ... | @@ -5,8 +5,8 @@ namespace ACA\EC\Column\Venue; |
| 5 | use AC; | 5 | use AC; |
| 6 | use ACA\EC\Column; | 6 | use ACA\EC\Column; |
| 7 | use ACA\EC\Filtering; | 7 | use ACA\EC\Filtering; |
| 8 | use ACP\ConditionalFormat; | ||
| 9 | use ACP; | 8 | use ACP; |
| 9 | use ACP\ConditionalFormat; | ||
| 10 | 10 | ||
| 11 | class UpcomingEvent extends Column\UpcomingEvent | 11 | class UpcomingEvent extends Column\UpcomingEvent |
| 12 | implements AC\Column\Relation, ACP\Filtering\Filterable, ConditionalFormat\Formattable { | 12 | implements AC\Column\Relation, ACP\Filtering\Filterable, ConditionalFormat\Formattable { | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\EC; | 5 | namespace ACA\EC; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 6 | use AC\Registerable; | 8 | use AC\Registerable; |
| 7 | use ACA\EC\ImportListscreens; | 9 | use AC\Services; |
| 8 | use ACP\Service\IntegrationStatus; | 10 | use ACP\Service\IntegrationStatus; |
| 9 | use ACP\Storage\ListScreen\DecoderFactory; | ||
| 10 | 11 | ||
| 11 | final class EventsCalendar implements Registerable { | 12 | final class EventsCalendar implements Registerable |
| 13 | { | ||
| 12 | 14 | ||
| 13 | private $location; | 15 | private $location; |
| 14 | 16 | ||
| 15 | public function __construct( AC\Asset\Location\Absolute $location ) { | 17 | public function __construct(AC\Asset\Location\Absolute $location) |
| 18 | { | ||
| 16 | $this->location = $location; | 19 | $this->location = $location; |
| 17 | } | 20 | } |
| 18 | 21 | ||
| 19 | public function register() { | 22 | public function register(): void |
| 20 | if ( ! class_exists( 'Tribe__Events__Main', false ) ) { | 23 | { |
| 24 | if ( ! class_exists('Tribe__Events__Main', false)) { | ||
| 21 | return; | 25 | return; |
| 22 | } | 26 | } |
| 23 | 27 | ||
| 24 | $services = [ | 28 | $this->create_services()->register(); |
| 25 | new Service\ColumnGroups(), | ||
| 26 | new Service\ListScreens(), | ||
| 27 | new Service\Scripts( $this->location ), | ||
| 28 | new Service\TableScreen( $this->location ), | ||
| 29 | new ImportListscreens\Message( new ImportListscreens\ImportedSetting() ), | ||
| 30 | new ImportListscreens\Controller( new AC\Request(), AC()->get_storage(), new DecoderFactory( new AC\ListScreenFactory() ), $this->location ), | ||
| 31 | new IntegrationStatus( 'ac-addon-events-calendar' ), | ||
| 32 | ]; | ||
| 33 | |||
| 34 | array_map( [ $this, 'register_service' ], $services ); | ||
| 35 | } | 29 | } |
| 36 | 30 | ||
| 37 | private function register_service( Registerable $service ) { | 31 | private function create_services(): Services |
| 38 | $service->register(); | 32 | { |
| 33 | return new Services([ | ||
| 34 | new Service\ColumnGroups(), | ||
| 35 | new Service\ListScreens(), | ||
| 36 | new Service\Scripts($this->location), | ||
| 37 | new Service\TableScreen($this->location), | ||
| 38 | new IntegrationStatus('ac-addon-events-calendar'), | ||
| 39 | ]); | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | } | 42 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -5,31 +5,27 @@ namespace ACA\EC\Export\Strategy; | ... | @@ -5,31 +5,27 @@ namespace ACA\EC\Export\Strategy; |
| 5 | use ACA\EC\ListScreen; | 5 | use ACA\EC\ListScreen; |
| 6 | use ACP; | 6 | use ACP; |
| 7 | 7 | ||
| 8 | /** | 8 | class Event extends ACP\Export\Strategy\Post |
| 9 | * Exportability class for events list screen | 9 | { |
| 10 | * @since 1.0.2 | ||
| 11 | */ | ||
| 12 | class Event extends ACP\Export\Strategy\Post { | ||
| 13 | 10 | ||
| 14 | public function __construct( ListScreen\Event $list_screen ) { | 11 | public function __construct(ListScreen\Event $list_screen) |
| 15 | parent::__construct( $list_screen ); | 12 | { |
| 13 | parent::__construct($list_screen); | ||
| 16 | } | 14 | } |
| 17 | 15 | ||
| 18 | /** | 16 | protected function ajax_export(): void |
| 19 | * @since 1.0 | 17 | { |
| 20 | * @see ACP_Export_ExportableListScreen::ajax_export() | ||
| 21 | */ | ||
| 22 | protected function ajax_export(): void { | ||
| 23 | parent::ajax_export(); | 18 | parent::ajax_export(); |
| 24 | 19 | ||
| 25 | /** | 20 | /** |
| 26 | * The Events Calender runs 'post_limits' to alter the limit for the admin list. In order for Export to work, we have to make sure the default 'WordPress' limit is used based on our query arguments | 21 | * The Events Calander runs 'post_limits' to alter the limit for the admin list. In order for Export to work, we have to make sure the default 'WordPress' limit is used based on our query arguments |
| 27 | */ | 22 | */ |
| 28 | add_filter( 'post_limits', [ $this, 'modify_posts_limit' ], 1 ); | 23 | add_filter('post_limits', [$this, 'modify_posts_limit'], 1); |
| 29 | } | 24 | } |
| 30 | 25 | ||
| 31 | public function modify_posts_limit( $limit ): string { | 26 | public function modify_posts_limit($limit): string |
| 32 | remove_filter( 'post_limits', [ 'Tribe__Events__Admin_List', 'events_search_limits' ] ); | 27 | { |
| 28 | remove_filter('post_limits', ['Tribe__Events__Admin_List', 'events_search_limits']); | ||
| 33 | 29 | ||
| 34 | return $limit; | 30 | return $limit; |
| 35 | } | 31 | } | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | namespace ACA\EC\ImportListscreens; | ||
| 4 | |||
| 5 | use AC; | ||
| 6 | use ACP\Storage\ListScreen\DecoderFactory; | ||
| 7 | use ACP\Storage\ListScreen\EncodedCollection; | ||
| 8 | use ACP\Storage\ListScreen\Unserializer\JsonUnserializer; | ||
| 9 | |||
| 10 | class Controller implements AC\Registerable { | ||
| 11 | |||
| 12 | const ACTION_KEY = 'aca_ec_action'; | ||
| 13 | const IMPORT_METHOD_KEY = 'import-sets'; | ||
| 14 | const DISMISS_METHOD_KEY = 'dismiss-import'; | ||
| 15 | |||
| 16 | /** | ||
| 17 | * @var AC\Request | ||
| 18 | */ | ||
| 19 | private $request; | ||
| 20 | |||
| 21 | /** | ||
| 22 | * @var ImportedSetting | ||
| 23 | */ | ||
| 24 | private $setting; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * @var DecoderFactory | ||
| 28 | */ | ||
| 29 | private $decoder_factory; | ||
| 30 | |||
| 31 | /** | ||
| 32 | * @var AC\ListScreenRepository\Storage | ||
| 33 | */ | ||
| 34 | private $storage; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * @var AC\Asset\Location\Absolute | ||
| 38 | */ | ||
| 39 | private $location; | ||
| 40 | |||
| 41 | public function __construct( AC\Request $request, AC\ListScreenRepository\Storage $storage, DecoderFactory $decoder_factory, AC\Asset\Location\Absolute $location ) { | ||
| 42 | $this->request = $request; | ||
| 43 | $this->decoder_factory = $decoder_factory; | ||
| 44 | $this->storage = $storage; | ||
| 45 | $this->setting = new ImportedSetting(); | ||
| 46 | $this->location = $location; | ||
| 47 | } | ||
| 48 | |||
| 49 | public function register() { | ||
| 50 | add_action( 'admin_init', [ $this, 'handle_request' ] ); | ||
| 51 | } | ||
| 52 | |||
| 53 | public function handle_request() { | ||
| 54 | $action = $this->request->get( self::ACTION_KEY ); | ||
| 55 | |||
| 56 | if ( ! $action || ! in_array( $action, [ self::DISMISS_METHOD_KEY, self::IMPORT_METHOD_KEY ], true ) ) { | ||
| 57 | return; | ||
| 58 | } | ||
| 59 | |||
| 60 | switch ( $action ) { | ||
| 61 | case self::IMPORT_METHOD_KEY: | ||
| 62 | $this->import(); | ||
| 63 | $this->setting->mark_as_imported(); | ||
| 64 | break; | ||
| 65 | |||
| 66 | case self::DISMISS_METHOD_KEY: | ||
| 67 | $this->setting->mark_as_imported(); | ||
| 68 | break; | ||
| 69 | } | ||
| 70 | |||
| 71 | wp_redirect( remove_query_arg( self::ACTION_KEY ) ); | ||
| 72 | exit; | ||
| 73 | } | ||
| 74 | |||
| 75 | private function import() { | ||
| 76 | if ( $this->setting->is_imported() ) { | ||
| 77 | return; | ||
| 78 | } | ||
| 79 | |||
| 80 | $file_content = file_get_contents( $this->location->with_suffix( '/export/events.json' )->get_path() ); | ||
| 81 | $encoded_list_screens = ( new JsonUnserializer() )->unserialize( $file_content ); | ||
| 82 | |||
| 83 | if ( ! EncodedCollection::is_valid_collection( $encoded_list_screens ) ) { | ||
| 84 | return; | ||
| 85 | } | ||
| 86 | |||
| 87 | $encoded_collection = new EncodedCollection( $encoded_list_screens, $this->decoder_factory ); | ||
| 88 | |||
| 89 | foreach ( $encoded_collection as $encoded_list_screen ) { | ||
| 90 | if ( ! $encoded_collection->can_decode( $encoded_list_screen ) ) { | ||
| 91 | continue; | ||
| 92 | } | ||
| 93 | |||
| 94 | $list_screen = $encoded_collection->decode( $encoded_list_screen ); | ||
| 95 | $this->storage->save( $list_screen ); | ||
| 96 | } | ||
| 97 | } | ||
| 98 | |||
| 99 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | |||
| 3 | namespace ACA\EC\ImportListscreens; | ||
| 4 | |||
| 5 | final class ImportedSetting { | ||
| 6 | |||
| 7 | const IMPORTED_KEY = 'aca_ec_layouts_imported'; | ||
| 8 | |||
| 9 | public function is_imported() { | ||
| 10 | return (bool) get_option( self::IMPORTED_KEY ); | ||
| 11 | } | ||
| 12 | |||
| 13 | public function mark_as_imported() { | ||
| 14 | return update_option( self::IMPORTED_KEY, true ); | ||
| 15 | } | ||
| 16 | |||
| 17 | public function delete() { | ||
| 18 | delete_option( self::IMPORTED_KEY ); | ||
| 19 | } | ||
| 20 | |||
| 21 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | |||
| 3 | namespace ACA\EC\ImportListscreens; | ||
| 4 | |||
| 5 | use AC; | ||
| 6 | |||
| 7 | class Message implements AC\Registerable { | ||
| 8 | |||
| 9 | /** | ||
| 10 | * @var ImportedSetting | ||
| 11 | */ | ||
| 12 | private $setting; | ||
| 13 | |||
| 14 | public function __construct( ImportedSetting $setting ) { | ||
| 15 | $this->setting = $setting; | ||
| 16 | } | ||
| 17 | |||
| 18 | public function register() { | ||
| 19 | add_action( 'ac/settings/after_title', [ $this, 'display' ] ); | ||
| 20 | } | ||
| 21 | |||
| 22 | public function display( AC\ListScreen $list_screen ) { | ||
| 23 | if ( ! $list_screen instanceof AC\ListScreen\Post ) { | ||
| 24 | return; | ||
| 25 | } | ||
| 26 | |||
| 27 | if ( ! in_array( $list_screen->get_post_type(), [ 'tribe_events', 'tribe_venue', 'tribe_organizer' ] ) ) { | ||
| 28 | return; | ||
| 29 | } | ||
| 30 | |||
| 31 | if ( $this->setting->is_imported() ) { | ||
| 32 | return; | ||
| 33 | } | ||
| 34 | |||
| 35 | $this->display_import_layout_message(); | ||
| 36 | } | ||
| 37 | |||
| 38 | public function display_import_layout_message() { | ||
| 39 | ?> | ||
| 40 | |||
| 41 | <div class="notice notice-success"> | ||
| 42 | <p> | ||
| 43 | <?php printf( __( 'Enable our predefined column sets for %s?', 'codepress-admin-columns' ), __( 'The Events Calendar', 'the-events-calendar' ) ); ?> | ||
| 44 | <a href="<?= add_query_arg( Controller::ACTION_KEY, Controller::IMPORT_METHOD_KEY ) ?>" class="notice__actionlink">Yes</a> | ||
| 45 | <a href="<?= add_query_arg( Controller::ACTION_KEY, Controller::DISMISS_METHOD_KEY ) ?>" class="notice__actionlink">No thanks</a> | ||
| 46 | </p> | ||
| 47 | </div> | ||
| 48 | |||
| 49 | <?php | ||
| 50 | } | ||
| 51 | |||
| 52 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -15,7 +15,8 @@ class Event extends ACP\ListScreen\Post { | ... | @@ -15,7 +15,8 @@ class Event extends ACP\ListScreen\Post { |
| 15 | $this->set_group( 'events-calendar' ); | 15 | $this->set_group( 'events-calendar' ); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | protected function register_column_types() { | 18 | protected function register_column_types(): void |
| 19 | { | ||
| 19 | parent::register_column_types(); | 20 | parent::register_column_types(); |
| 20 | 21 | ||
| 21 | $this->register_column_types_from_list( [ | 22 | $this->register_column_types_from_list( [ | ... | ... |
| ... | @@ -2,8 +2,8 @@ | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\EC\ListScreen; | 3 | namespace ACA\EC\ListScreen; |
| 4 | 4 | ||
| 5 | use ACP; | ||
| 6 | use ACA\EC\Column; | 5 | use ACA\EC\Column; |
| 6 | use ACP; | ||
| 7 | 7 | ||
| 8 | class EventSeries extends ACP\ListScreen\Post { | 8 | class EventSeries extends ACP\ListScreen\Post { |
| 9 | 9 | ||
| ... | @@ -13,7 +13,8 @@ class EventSeries extends ACP\ListScreen\Post { | ... | @@ -13,7 +13,8 @@ class EventSeries extends ACP\ListScreen\Post { |
| 13 | $this->set_group( 'events-calendar' ); | 13 | $this->set_group( 'events-calendar' ); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | protected function register_column_types() { | 16 | protected function register_column_types(): void |
| 17 | { | ||
| 17 | parent::register_column_types(); | 18 | parent::register_column_types(); |
| 18 | 19 | ||
| 19 | $this->register_column_types_from_list( [ | 20 | $this->register_column_types_from_list( [ | ... | ... |
| ... | @@ -13,7 +13,8 @@ class Organizer extends ACP\ListScreen\Post { | ... | @@ -13,7 +13,8 @@ class Organizer extends ACP\ListScreen\Post { |
| 13 | $this->set_group( 'events-calendar' ); | 13 | $this->set_group( 'events-calendar' ); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | protected function register_column_types() { | 16 | protected function register_column_types(): void |
| 17 | { | ||
| 17 | parent::register_column_types(); | 18 | parent::register_column_types(); |
| 18 | 19 | ||
| 19 | $this->register_column_types_from_list( [ | 20 | $this->register_column_types_from_list( [ | ... | ... |
| ... | @@ -13,7 +13,8 @@ class Venue extends ACP\ListScreen\Post { | ... | @@ -13,7 +13,8 @@ class Venue extends ACP\ListScreen\Post { |
| 13 | $this->set_group( 'events-calendar' ); | 13 | $this->set_group( 'events-calendar' ); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | protected function register_column_types() { | 16 | protected function register_column_types(): void |
| 17 | { | ||
| 17 | parent::register_column_types(); | 18 | parent::register_column_types(); |
| 18 | 19 | ||
| 19 | $this->register_column_types_from_list( [ | 20 | $this->register_column_types_from_list( [ | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\EC\ListScreenFactory; | 3 | namespace ACA\EC\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\EC\ListScreen\Event; | 7 | use ACA\EC\ListScreen\Event; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class EventFactory implements ListScreenFactoryInterface { | 10 | class EventFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'tribe_events' === $key; | 15 | return 'tribe_events' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new Event(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new Event(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_events'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_events'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return $this->create_list_screen('tribe_events'); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Event(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\EC\ListScreenFactory; | 3 | namespace ACA\EC\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\EC\ListScreen\EventSeries; | 7 | use ACA\EC\ListScreen\EventSeries; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class EventSeriesFactory implements ListScreenFactoryInterface { | 10 | class EventSeriesFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'tribe_event_series' === $key; | 15 | return 'tribe_event_series' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new EventSeries(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new EventSeries(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_event_series'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_event_series'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return $this->create_list_screen('tribe_event_series'); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new EventSeries(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\EC\ListScreenFactory; | 3 | namespace ACA\EC\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\EC\ListScreen\Organizer; | 7 | use ACA\EC\ListScreen\Organizer; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class OrganizerFactory implements ListScreenFactoryInterface { | 10 | class OrganizerFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'tribe_organizer' === $key; | 15 | return 'tribe_organizer' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new Organizer(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new Organizer(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_organizer'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_organizer'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return $this->create_list_screen('tribe_organizer'); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Organizer(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,38 +3,31 @@ | ... | @@ -3,38 +3,31 @@ |
| 3 | namespace ACA\EC\ListScreenFactory; | 3 | namespace ACA\EC\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\EC\ListScreen\Venue; | 7 | use ACA\EC\ListScreen\Venue; |
| 9 | use LogicException; | ||
| 10 | use WP_Screen; | 8 | use WP_Screen; |
| 11 | 9 | ||
| 12 | class VenueFactory implements ListScreenFactoryInterface { | 10 | class VenueFactory extends ListScreenFactory\BaseFactory |
| 11 | { | ||
| 13 | 12 | ||
| 14 | use ListSettingsTrait; | 13 | public function can_create(string $key): bool |
| 15 | 14 | { | |
| 16 | public function can_create( string $key ): bool { | ||
| 17 | return 'tribe_venue' === $key; | 15 | return 'tribe_venue' === $key; |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 18 | protected function create_list_screen(string $key): ListScreen |
| 21 | if ( ! $this->can_create( $key ) ) { | 19 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 20 | return new Venue(); |
| 23 | } | ||
| 24 | |||
| 25 | return $this->add_settings( new Venue(), $settings ); | ||
| 26 | } | 21 | } |
| 27 | 22 | ||
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 24 | { | ||
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_venue'; | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_venue'; |
| 30 | } | 26 | } |
| 31 | 27 | ||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 29 | { |
| 34 | throw new LogicException( 'Invalid Screen' ); | 30 | return $this->create_list_screen('tribe_venue'); |
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Venue(), $settings ); | ||
| 38 | } | 31 | } |
| 39 | 32 | ||
| 40 | } | 33 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,7 +2,6 @@ | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\EC\Service; | 3 | namespace ACA\EC\Service; |
| 4 | 4 | ||
| 5 | use AC; | ||
| 6 | use AC\Groups; | 5 | use AC\Groups; |
| 7 | use AC\Registerable; | 6 | use AC\Registerable; |
| 8 | 7 | ||
| ... | @@ -11,7 +10,8 @@ final class ColumnGroups implements Registerable { | ... | @@ -11,7 +10,8 @@ final class ColumnGroups implements Registerable { |
| 11 | const EVENTS_CALENDAR = 'events_calendar'; | 10 | const EVENTS_CALENDAR = 'events_calendar'; |
| 12 | const EVENTS_CALENDAR_FIELDS = 'events_calendar_fields'; | 11 | const EVENTS_CALENDAR_FIELDS = 'events_calendar_fields'; |
| 13 | 12 | ||
| 14 | public function register() { | 13 | public function register(): void |
| 14 | { | ||
| 15 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); | 15 | add_action( 'ac/column_groups', [ $this, 'register_column_groups' ] ); |
| 16 | } | 16 | } |
| 17 | 17 | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\EC\Service; | 5 | namespace ACA\EC\Service; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| ... | @@ -8,13 +10,14 @@ use ACA\EC\ListScreenFactory; | ... | @@ -8,13 +10,14 @@ use ACA\EC\ListScreenFactory; |
| 8 | 10 | ||
| 9 | final class ListScreens implements Registerable { | 11 | final class ListScreens implements Registerable { |
| 10 | 12 | ||
| 11 | public function register() { | 13 | public function register(): void |
| 12 | AC\ListScreenFactory::add( new ListScreenFactory\EventFactory() ); | 14 | { |
| 13 | AC\ListScreenFactory::add( new ListScreenFactory\OrganizerFactory() ); | 15 | AC\ListScreenFactory\Aggregate::add( new ListScreenFactory\EventFactory() ); |
| 14 | AC\ListScreenFactory::add( new ListScreenFactory\VenueFactory() ); | 16 | AC\ListScreenFactory\Aggregate::add( new ListScreenFactory\OrganizerFactory() ); |
| 17 | AC\ListScreenFactory\Aggregate::add( new ListScreenFactory\VenueFactory() ); | ||
| 15 | 18 | ||
| 16 | if ( post_type_exists( 'tribe_event_series' ) ) { | 19 | if ( post_type_exists( 'tribe_event_series' ) ) { |
| 17 | AC\ListScreenFactory::add( new ListScreenFactory\EventSeriesFactory() ); | 20 | AC\ListScreenFactory\Aggregate::add( new ListScreenFactory\EventSeriesFactory() ); |
| 18 | } | 21 | } |
| 19 | 22 | ||
| 20 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_groups' ] ); | 23 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_groups' ] ); | ... | ... |
| ... | @@ -17,7 +17,8 @@ final class Scripts implements Registerable { | ... | @@ -17,7 +17,8 @@ final class Scripts implements Registerable { |
| 17 | $this->location = $location; | 17 | $this->location = $location; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | public function register() { | 20 | public function register(): void |
| 21 | { | ||
| 21 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | 22 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); |
| 22 | } | 23 | } |
| 23 | 24 | ... | ... |
| ... | @@ -11,7 +11,8 @@ use ACA\EC\ListScreen; | ... | @@ -11,7 +11,8 @@ use ACA\EC\ListScreen; |
| 11 | use ACA\EC\Sorting; | 11 | use ACA\EC\Sorting; |
| 12 | use WP_Query; | 12 | use WP_Query; |
| 13 | 13 | ||
| 14 | class TableScreen implements Registerable { | 14 | class TableScreen implements Registerable |
| 15 | { | ||
| 15 | 16 | ||
| 16 | /** | 17 | /** |
| 17 | * @var array | 18 | * @var array |
| ... | @@ -28,31 +29,39 @@ class TableScreen implements Registerable { | ... | @@ -28,31 +29,39 @@ class TableScreen implements Registerable { |
| 28 | */ | 29 | */ |
| 29 | private $location; | 30 | private $location; |
| 30 | 31 | ||
| 31 | public function __construct( Location\Absolute $location ) { | 32 | public function __construct(Location\Absolute $location) |
| 33 | { | ||
| 32 | $this->location = $location; | 34 | $this->location = $location; |
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | public function register() { | 37 | public function register(): void |
| 36 | add_action( 'ac/table_scripts', [ $this, 'table_scripts' ] ); | 38 | { |
| 37 | add_action( 'ac/table/list_screen', [ $this, 'add_events_filter_vars' ] ); | 39 | add_action('ac/table_scripts', [$this, 'table_scripts']); |
| 38 | add_action( 'ac/table/list_screen', [ $this, 'register_event_sorting_fix' ] ); | 40 | add_action('ac/table/list_screen', [$this, 'add_events_filter_vars']); |
| 39 | add_action( 'parse_query', [ $this, 'parse_query' ], 51 ); | 41 | add_action('ac/table/list_screen', [$this, 'register_event_sorting_fix']); |
| 42 | add_action('parse_query', [$this, 'parse_query'], 51); | ||
| 40 | } | 43 | } |
| 41 | 44 | ||
| 42 | public function table_scripts(): void { | 45 | public function table_scripts(AC\ListScreen $list_screen): void |
| 43 | $script = new Style( 'aca-ec-table', $this->location->with_suffix( 'assets/css/table.css' ) ); | 46 | { |
| 47 | if ($list_screen->get_group() !== 'events-calendar') { | ||
| 48 | return; | ||
| 49 | } | ||
| 50 | |||
| 51 | $script = new Style('aca-ec-table', $this->location->with_suffix('assets/css/table.css')); | ||
| 44 | $script->enqueue(); | 52 | $script->enqueue(); |
| 45 | } | 53 | } |
| 46 | 54 | ||
| 47 | /** | 55 | /** |
| 48 | * @param WP_Query $query | 56 | * @param WP_Query $query |
| 49 | */ | 57 | */ |
| 50 | public function parse_query( WP_Query $query ): void { | 58 | public function parse_query(WP_Query $query): void |
| 51 | if ( 'tribe_events' !== $query->get( 'post_type' ) ) { | 59 | { |
| 60 | if ('tribe_events' !== $query->get('post_type')) { | ||
| 52 | return; | 61 | return; |
| 53 | } | 62 | } |
| 54 | 63 | ||
| 55 | if ( ! filter_input( INPUT_GET, 'orderby' ) ) { | 64 | if ( ! filter_input(INPUT_GET, 'orderby')) { |
| 56 | return; | 65 | return; |
| 57 | } | 66 | } |
| 58 | 67 | ||
| ... | @@ -60,114 +69,124 @@ class TableScreen implements Registerable { | ... | @@ -60,114 +69,124 @@ class TableScreen implements Registerable { |
| 60 | $query->tribe_is_event = false; | 69 | $query->tribe_is_event = false; |
| 61 | } | 70 | } |
| 62 | 71 | ||
| 63 | public function add_events_filter_vars( $list_screen ): void { | 72 | public function add_events_filter_vars($list_screen): void |
| 64 | if ( ! $list_screen instanceof ListScreen\Event ) { | 73 | { |
| 74 | if ( ! $list_screen instanceof ListScreen\Event) { | ||
| 65 | return; | 75 | return; |
| 66 | } | 76 | } |
| 67 | 77 | ||
| 68 | $prefix = 'ac_related_filter_'; | 78 | $prefix = 'ac_related_filter_'; |
| 69 | 79 | ||
| 70 | $input = filter_input_array( INPUT_GET, [ | 80 | $input = filter_input_array(INPUT_GET, [ |
| 71 | $prefix . 'value' => FILTER_SANITIZE_NUMBER_INT, | 81 | $prefix . 'value' => FILTER_SANITIZE_NUMBER_INT, |
| 72 | ] ); | 82 | ]); |
| 73 | 83 | ||
| 74 | foreach ( $input as $k => $v ) { | 84 | foreach ($input as $k => $v) { |
| 75 | unset( $input[ $k ] ); | 85 | unset($input[$k]); |
| 76 | $input[ str_replace( $prefix, '', $k ) ] = $v; | 86 | $input[str_replace($prefix, '', $k)] = $v; |
| 77 | } | 87 | } |
| 78 | 88 | ||
| 79 | $input = (object) $input; | 89 | $input = (object)$input; |
| 80 | 90 | ||
| 81 | switch ( $input->post_type ?? '') { | 91 | switch ($input->post_type ?? '') { |
| 82 | case 'tribe_venue': | 92 | case 'tribe_venue': |
| 83 | $this->filter_on_venue( $input->value ); | 93 | $this->filter_on_venue($input->value); |
| 84 | 94 | ||
| 85 | break; | 95 | break; |
| 86 | case 'tribe_organizer': | 96 | case 'tribe_organizer': |
| 87 | $this->filter_on_organizer( $input->value ); | 97 | $this->filter_on_organizer($input->value); |
| 88 | 98 | ||
| 89 | break; | 99 | break; |
| 90 | default: | 100 | default: |
| 91 | return; // invalid post type | 101 | return; // invalid post type |
| 92 | } | 102 | } |
| 93 | 103 | ||
| 94 | $post_type_object = get_post_type_object( $input->post_type ); | 104 | $post_type_object = get_post_type_object($input->post_type); |
| 95 | 105 | ||
| 96 | if ( ! $post_type_object ) { | 106 | if ( ! $post_type_object) { |
| 97 | return; | 107 | return; |
| 98 | } | 108 | } |
| 99 | 109 | ||
| 100 | switch ( $input->date ) { | 110 | switch ($input->date) { |
| 101 | case 'future': | 111 | case 'future': |
| 102 | $this->filter_on_future_events(); | 112 | $this->filter_on_future_events(); |
| 103 | $date = __( 'upcoming', 'codepress-admin-columns' ); | 113 | $date = __('upcoming', 'codepress-admin-columns'); |
| 104 | 114 | ||
| 105 | break; | 115 | break; |
| 106 | case 'past': | 116 | case 'past': |
| 107 | $this->filter_on_past_events(); | 117 | $this->filter_on_past_events(); |
| 108 | $date = __( 'previous', 'codepress-admin-columns' ); | 118 | $date = __('previous', 'codepress-admin-columns'); |
| 109 | 119 | ||
| 110 | break; | 120 | break; |
| 111 | default: | 121 | default: |
| 112 | $date = __( 'all', 'codepress-admin-columns' ); | 122 | $date = __('all', 'codepress-admin-columns'); |
| 113 | } | 123 | } |
| 114 | 124 | ||
| 115 | // General notice | 125 | // General notice |
| 116 | $notice[] = sprintf( __( 'Filtering on %s: Showing %s events from %s.', 'codepress-admin-columns' ), | 126 | $notice[] = sprintf( |
| 127 | __('Filtering on %s: Showing %s events from %s.', 'codepress-admin-columns'), | ||
| 117 | $post_type_object->labels->singular_name, | 128 | $post_type_object->labels->singular_name, |
| 118 | $date, | 129 | $date, |
| 119 | get_the_title( $input->value ) | 130 | get_the_title($input->value) |
| 120 | ); | 131 | ); |
| 121 | 132 | ||
| 122 | // Return to related overview link | 133 | // Return to related overview link |
| 123 | $notice[] = sprintf( '<a href="%s" class="notice__actionlink">%s</a>', | 134 | $notice[] = sprintf( |
| 124 | esc_url( admin_url( 'edit.php?' . base64_decode( $input->return_url ) ) ), | 135 | '<a href="%s" class="notice__actionlink">%s</a>', |
| 125 | sprintf( __( 'Return to %s', 'codepress-admin-columns' ), $post_type_object->labels->name ) | 136 | esc_url(admin_url('edit.php?' . base64_decode($input->return_url))), |
| 137 | sprintf(__('Return to %s', 'codepress-admin-columns'), $post_type_object->labels->name) | ||
| 126 | ); | 138 | ); |
| 127 | 139 | ||
| 128 | // Remove filters and stay on this overview link | 140 | // Remove filters and stay on this overview link |
| 129 | $input_remove = []; | 141 | $input_remove = []; |
| 130 | 142 | ||
| 131 | foreach ( $input as $k => $v ) { | 143 | foreach ($input as $k => $v) { |
| 132 | $input_remove[ $prefix . $k ] = false; | 144 | $input_remove[$prefix . $k] = false; |
| 133 | } | 145 | } |
| 134 | 146 | ||
| 135 | $notice[] = sprintf( '<a href="%s" class="notice-aca-ec-filter__dismiss notice__actionlink">%s</a>', | 147 | $notice[] = sprintf( |
| 136 | add_query_arg( $input_remove ), | 148 | '<a href="%s" class="notice-aca-ec-filter__dismiss notice__actionlink">%s</a>', |
| 137 | __( 'Remove this filter', 'codepress-admin-columns' ) | 149 | add_query_arg($input_remove), |
| 150 | __('Remove this filter', 'codepress-admin-columns') | ||
| 138 | ); | 151 | ); |
| 139 | 152 | ||
| 140 | $this->notices[] = [ | 153 | $this->notices[] = [ |
| 141 | 'type' => 'success', | 154 | 'type' => 'success', |
| 142 | 'notice' => implode( ' ', $notice ), | 155 | 'notice' => implode(' ', $notice), |
| 143 | ]; | 156 | ]; |
| 144 | 157 | ||
| 145 | add_action( 'admin_notices', [ $this, 'display_notices' ] ); | 158 | add_action('admin_notices', [$this, 'display_notices']); |
| 146 | add_action( 'pre_get_posts', [ $this, 'events_query_callback' ] ); | 159 | add_action('pre_get_posts', [$this, 'events_query_callback']); |
| 147 | } | 160 | } |
| 148 | 161 | ||
| 149 | /** | 162 | /** |
| 150 | * @param WP_Query $wp_query | 163 | * @param WP_Query $wp_query |
| 151 | */ | 164 | */ |
| 152 | public function events_query_callback( WP_Query $wp_query ): void { | 165 | public function events_query_callback(WP_Query $wp_query): void |
| 153 | if ( ! $wp_query->is_main_query() ) { | 166 | { |
| 167 | if ( ! $wp_query->is_main_query()) { | ||
| 154 | return; | 168 | return; |
| 155 | } | 169 | } |
| 156 | 170 | ||
| 157 | $wp_query->query_vars = array_merge( $wp_query->query_vars, $this->filter_vars ); | 171 | $wp_query->query_vars = array_merge($wp_query->query_vars, $this->filter_vars); |
| 158 | } | 172 | } |
| 159 | 173 | ||
| 160 | public function display_notices(): void { | 174 | public function display_notices(): void |
| 161 | foreach ( $this->notices as $notice ) : ?> | 175 | { |
| 162 | <div class="notice notice-<?php echo $notice['type']; ?> notice-aca-ec-filter"> | 176 | foreach ($this->notices as $notice) : ?> |
| 177 | <div class="notice notice-<?php | ||
| 178 | echo $notice['type']; ?> notice-aca-ec-filter"> | ||
| 163 | <div class="info"> | 179 | <div class="info"> |
| 164 | <p><?php echo $notice['notice']; ?></p> | 180 | <p><?php |
| 181 | echo $notice['notice']; ?></p> | ||
| 165 | </div> | 182 | </div> |
| 166 | </div> | 183 | </div> |
| 167 | <?php endforeach; | 184 | <?php |
| 185 | endforeach; | ||
| 168 | } | 186 | } |
| 169 | 187 | ||
| 170 | private function filter_on_venue( $value ): void { | 188 | private function filter_on_venue($value): void |
| 189 | { | ||
| 171 | $column = new Column\Event\Venue(); | 190 | $column = new Column\Event\Venue(); |
| 172 | 191 | ||
| 173 | $this->filter_vars['meta_query'][] = [ | 192 | $this->filter_vars['meta_query'][] = [ |
| ... | @@ -176,7 +195,8 @@ class TableScreen implements Registerable { | ... | @@ -176,7 +195,8 @@ class TableScreen implements Registerable { |
| 176 | ]; | 195 | ]; |
| 177 | } | 196 | } |
| 178 | 197 | ||
| 179 | private function filter_on_organizer( $value ): void { | 198 | private function filter_on_organizer($value): void |
| 199 | { | ||
| 180 | $column = new Column\Event\Organizer(); | 200 | $column = new Column\Event\Organizer(); |
| 181 | 201 | ||
| 182 | $this->filter_vars['meta_query'][] = [ | 202 | $this->filter_vars['meta_query'][] = [ |
| ... | @@ -185,29 +205,32 @@ class TableScreen implements Registerable { | ... | @@ -185,29 +205,32 @@ class TableScreen implements Registerable { |
| 185 | ]; | 205 | ]; |
| 186 | } | 206 | } |
| 187 | 207 | ||
| 188 | private function filter_on_past_events(): void { | 208 | private function filter_on_past_events(): void |
| 209 | { | ||
| 189 | $column = new Column\Event\EndDate(); | 210 | $column = new Column\Event\EndDate(); |
| 190 | 211 | ||
| 191 | $this->filter_vars['meta_query'][] = [ | 212 | $this->filter_vars['meta_query'][] = [ |
| 192 | 'key' => $column->get_meta_key(), | 213 | 'key' => $column->get_meta_key(), |
| 193 | 'value' => date( 'Y-m-d H:i' ), | 214 | 'value' => date('Y-m-d H:i'), |
| 194 | 'compare' => '<', | 215 | 'compare' => '<', |
| 195 | ]; | 216 | ]; |
| 196 | } | 217 | } |
| 197 | 218 | ||
| 198 | private function filter_on_future_events(): void { | 219 | private function filter_on_future_events(): void |
| 220 | { | ||
| 199 | $column = new Column\Event\StartDate(); | 221 | $column = new Column\Event\StartDate(); |
| 200 | 222 | ||
| 201 | $this->filter_vars['meta_query'][] = [ | 223 | $this->filter_vars['meta_query'][] = [ |
| 202 | 'key' => $column->get_meta_key(), | 224 | 'key' => $column->get_meta_key(), |
| 203 | 'value' => date( 'Y-m-d H:i' ), | 225 | 'value' => date('Y-m-d H:i'), |
| 204 | 'compare' => '>', | 226 | 'compare' => '>', |
| 205 | ]; | 227 | ]; |
| 206 | } | 228 | } |
| 207 | 229 | ||
| 208 | public function register_event_sorting_fix( AC\ListScreen $list_screen ): void { | 230 | public function register_event_sorting_fix(AC\ListScreen $list_screen): void |
| 209 | if ( $list_screen instanceof ListScreen\Event ) { | 231 | { |
| 210 | $service = new Sorting\EventSortingFix( $list_screen ); | 232 | if ($list_screen instanceof ListScreen\Event) { |
| 233 | $service = new Sorting\EventSortingFix($list_screen); | ||
| 211 | $service->register(); | 234 | $service->register(); |
| 212 | } | 235 | } |
| 213 | } | 236 | } | ... | ... |
| 1 | body[class*=_page_gf_entries].acp-overflow-table .acp-hts-wrapper{max-width:100%;min-width:100%;margin-bottom:0}body[class*=_page_gf_entries].acp-overflow-table .gform-settings__wrapper{display:block !important;max-width:none}body[class*=_page_gf_entries].acp-overflow-table .acp-scrolling-indicator{display:none !important}body[class*=_page_gf_entries] .ac-table-actions{margin-top:5px}body[class*=_page_gf_entries] #ac-s{display:none}body[class*=_page_gf_entries] .layout-switcher{padding-left:0;align-self:center;height:26px;margin-right:10px}body[class*=_page_gf_entries] .layout-switcher select{font-size:14px;height:38px;max-width:150px}body[class*=_page_gf_entries] .gf-acs-button-container{display:flex;align-items:center}body[class*=_page_gf_entries] .tablenav{position:relative;z-index:1}body[class*=_page_gf_entries] #gf-acs-form{margin:10px 0;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;padding:8px 10px;display:flex;position:relative;z-index:1}body[class*=_page_gf_entries] #gf-acs-form #ac-s{display:block}body[class*=_page_gf_entries] #gf-acs-form button.ac-button__segments{vertical-align:bottom !important;transform:translateY(-5px)}body[class*=_page_gf_entries] #gf-acs-form .button{height:30px;padding:0 8px;line-height:12px}body[class*=_page_gf_entries] #gf-acs-form .rule-container{background:none;box-shadow:none !important}body[class*=_page_gf_entries] #gf-acs-form .rule-container.has-error{background-color:#ffe5e2}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header{max-width:90%}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-prev,body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next{top:calc(50% - 3px) !important}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before,body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next:before{font-family:revert}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next{top:50% !important}.wp-list-table td .gfield_list td,.wp-list-table td .gfield_list th{padding:3px;padding-right:10px}.wp-list-table th#is_starred span{font-size:15px;color:#aaa;vertical-align:middle;margin-bottom:-4px} | 1 | body[class*=_page_gf_entries].acp-overflow-table .acp-hts-wrapper{max-width:100%;min-width:100%;margin-bottom:0}body[class*=_page_gf_entries].acp-overflow-table .gform-settings__wrapper{display:block !important;max-width:none}body[class*=_page_gf_entries].acp-overflow-table .acp-scrolling-indicator{display:none !important}body[class*=_page_gf_entries] .ac-table-actions{margin-top:5px}body[class*=_page_gf_entries] #ac-s{display:none}body[class*=_page_gf_entries] .acp-layout-switcher{padding-left:0;align-self:center;height:26px;margin-right:10px}body[class*=_page_gf_entries] .acp-layout-switcher select{font-size:14px;height:38px;max-width:150px}body[class*=_page_gf_entries] .gf-acs-button-container{display:flex;align-items:center}body[class*=_page_gf_entries] .tablenav{position:relative;z-index:1}body[class*=_page_gf_entries] #gf-acs-form{margin:10px 0;background:#fff;box-shadow:0 1px 1px rgba(0,0,0,.04);border:1px solid #e5e5e5;padding:8px 10px;display:flex;position:relative;z-index:1}body[class*=_page_gf_entries] #gf-acs-form #ac-s{display:block}body[class*=_page_gf_entries] #gf-acs-form button.ac-button__segments{vertical-align:bottom !important;transform:translateY(-5px)}body[class*=_page_gf_entries] #gf-acs-form .button{height:30px;padding:0 8px;line-height:12px}body[class*=_page_gf_entries] #gf-acs-form .rule-container{background:none;box-shadow:none !important}body[class*=_page_gf_entries] #gf-acs-form .rule-container.has-error{background-color:#ffe5e2}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header{max-width:90%}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-prev,body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next{top:calc(50% - 3px) !important}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before,body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next:before{font-family:revert}body[class*=_page_gf_entries] .ui-datepicker .ui-datepicker-header .ui-datepicker-next{top:50% !important}.wp-list-table td .gfield_list td,.wp-list-table td .gfield_list th{padding:3px;padding-right:10px}.wp-list-table th#is_starred span{font-size:15px;color:#aaa;vertical-align:middle;margin-bottom:-4px} | ... | ... |
| 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=0)}([function(e,t,r){"use strict";r.r(t);class n{place(){let e=o(),t=document.querySelector(".gform-settings__content"),r=document.querySelector("#ac-s");t&&r&&(t.parentElement.insertBefore(e,t),e.append(r),e.insertAdjacentHTML("beforeend",'<div class="gf-acs-button-container"><button class="button">Filter</button></div>'))}}const o=()=>{let e=document.createElement("form");e.id="gf-acs-form",e.addEventListener("submit",()=>{let t=AC_SERVICES.getService("Search").getRules();if(AC_SERVICES.getService("Search").disableFields(),0===t.rules.length)return;let r=document.createElement("input");r.type="hidden",r.name="ac-rules",r.value=JSON.stringify(t),e.append(r)});const t=new URLSearchParams(window.location.search);return["page","id"].forEach(r=>{let n=t.get(r);n&&e.insertAdjacentHTML("afterbegin",`<input type="hidden" name="${r}" value="${n}">`)}),e};document.addEventListener("DOMContentLoaded",()=>{let e=document.querySelector("#gf_form_toolbar");e&&e.insertAdjacentHTML("afterend",'<div class="wp-header-end"></div>')}),AC_SERVICES.addListener("Table.Ready",()=>{var e,t;let r=document.querySelector(".layout-switcher"),n=document.querySelector(".gform-form-toolbar__container #gform-form-toolbar__menu");if(r&&n&&n.parentElement.insertBefore(r,n),AC.list_screen.indexOf("gf_entry")>-1){let r=document.querySelector(".tablenav-pages .displaying-num");if(r){let n=r.innerHTML.split(" ")[0],o=n.replace(",","").replace(".","");"undefined"!=typeof ACP_Export&&(ACP_Export.total_num_items=o),null===(t=null===(e=AC_SERVICES.getService("Editing"))||void 0===e?void 0:e.getService("BulkSelectionRow"))||void 0===t||t.setTotalItems(parseInt(o),n)}}}),AC_SERVICES.addListener("Service.Registered.Search",e=>{e.placementFactory.register("gravity_forms_entry",new n)})}]); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | (()=>{"use strict";class e{place(){let e=t(),n=document.querySelector(".gform-settings__content"),r=document.querySelector("#ac-s");n&&r&&(n.parentElement.insertBefore(e,n),e.append(r),e.insertAdjacentHTML("beforeend",'<div class="gf-acs-button-container"><button class="button">Filter</button></div>'))}}const t=()=>{let e=document.createElement("form");e.id="gf-acs-form",e.addEventListener("submit",(()=>{let t=AC_SERVICES.getService("Search").getRules();if(AC_SERVICES.getService("Search").disableFields(),0===t.rules.length)return;let n=document.createElement("input");n.type="hidden",n.name="ac-rules",n.value=JSON.stringify(t),e.append(n)}));const t=new URLSearchParams(window.location.search);return["page","id"].forEach((n=>{let r=t.get(n);r&&e.insertAdjacentHTML("afterbegin",`<input type="hidden" name="${n}" value="${r}">`)})),e};ACP_TABLE&&ACP_TABLE.hasOwnProperty("column_sets_style")&&(ACP_TABLE.column_sets_style="dropdown"),document.addEventListener("DOMContentLoaded",(()=>{let e=document.querySelector("#gf_form_toolbar");e&&e.insertAdjacentHTML("afterend",'<div class="wp-header-end"></div>')})),AC_SERVICES.addListener("Table.Ready",(()=>{var e,t;const n=document.querySelector(".acp-layout-switcher"),r=document.querySelector(".gform-form-toolbar__container #gform-form-toolbar__menu");if(n&&r&&r.parentElement.insertBefore(n,r),AC.list_screen.indexOf("gf_entry")>-1){let n=document.querySelector(".tablenav-pages .displaying-num");if(n){let r=n.innerHTML.split(" ")[0],o=r.replace(",","").replace(".","");"undefined"!=typeof ACP_Export&&(ACP_Export.total_num_items=o),null===(t=null===(e=AC_SERVICES.getService("Editing"))||void 0===e?void 0:e.getService("BulkSelectionRow"))||void 0===t||t.setTotalItems(parseInt(o),r)}}})),AC_SERVICES.addListener("Service.Registered.LayoutTabs",(e=>{if("tabs"===e.getStyle()){const t=e.getElement(),n=document.querySelector("#gf-admin-notices-wrapper");n&&t&&t.insertSelfBefore(n)}})),AC_SERVICES.addListener("Service.Registered.Search",(t=>{t.placementFactory.register("gravity_forms_entry",new e)}))})(); | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -11,7 +11,8 @@ use ACP\Type\HideOnScreen\Group; | ... | @@ -11,7 +11,8 @@ use ACP\Type\HideOnScreen\Group; |
| 11 | 11 | ||
| 12 | final class Admin implements AC\Registerable { | 12 | final class Admin implements AC\Registerable { |
| 13 | 13 | ||
| 14 | public function register() { | 14 | public function register(): void |
| 15 | { | ||
| 15 | add_action( 'acp/admin/settings/hide_on_screen', [ $this, 'add_hide_on_screen' ], 10, 2 ); | 16 | add_action( 'acp/admin/settings/hide_on_screen', [ $this, 'add_hide_on_screen' ], 10, 2 ); |
| 16 | } | 17 | } |
| 17 | 18 | ... | ... |
| ... | @@ -7,7 +7,8 @@ use ACA\GravityForms\Column; | ... | @@ -7,7 +7,8 @@ use ACA\GravityForms\Column; |
| 7 | use ACA\GravityForms\FieldFactory; | 7 | use ACA\GravityForms\FieldFactory; |
| 8 | use ACA\GravityForms\ListScreen; | 8 | use ACA\GravityForms\ListScreen; |
| 9 | 9 | ||
| 10 | final class EntryConfigurator implements AC\Registerable { | 10 | final class EntryConfigurator implements AC\Registerable |
| 11 | { | ||
| 11 | 12 | ||
| 12 | private $form_id; | 13 | private $form_id; |
| 13 | 14 | ||
| ... | @@ -15,55 +16,60 @@ final class EntryConfigurator implements AC\Registerable { | ... | @@ -15,55 +16,60 @@ final class EntryConfigurator implements AC\Registerable { |
| 15 | 16 | ||
| 16 | private $field_factory; | 17 | private $field_factory; |
| 17 | 18 | ||
| 18 | public function __construct( $form_id, EntryFactory $column_factory, FieldFactory $field_factory ) { | 19 | public function __construct($form_id, EntryFactory $column_factory, FieldFactory $field_factory) |
| 19 | $this->form_id = (int) $form_id; | 20 | { |
| 21 | $this->form_id = (int)$form_id; | ||
| 20 | $this->column_factory = $column_factory; | 22 | $this->column_factory = $column_factory; |
| 21 | $this->field_factory = $field_factory; | 23 | $this->field_factory = $field_factory; |
| 22 | } | 24 | } |
| 23 | 25 | ||
| 24 | public function register() { | 26 | public function register(): void |
| 25 | add_action( 'ac/list_screen/column_created', [ $this, 'configure_column' ] ); | 27 | { |
| 28 | add_action('ac/list_screen/column_created', [$this, 'configure_column'], 10, 2); | ||
| 26 | } | 29 | } |
| 27 | 30 | ||
| 28 | public function configure_column( AC\Column $column ): void { | 31 | public function configure_column(AC\Column $column, AC\ListScreen $list_screen): void |
| 29 | if ( ! $column instanceof Column\Entry ) { | 32 | { |
| 33 | if ( ! $column instanceof Column\Entry) { | ||
| 30 | return; | 34 | return; |
| 31 | } | 35 | } |
| 32 | 36 | ||
| 33 | $list_screen = $column->get_list_screen(); | 37 | if ( ! $list_screen instanceof ListScreen\Entry) { |
| 34 | |||
| 35 | if ( ! $list_screen instanceof ListScreen\Entry ) { | ||
| 36 | return; | 38 | return; |
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | if ( $list_screen->get_form_id() !== $this->form_id ) { | 41 | if ($list_screen->get_form_id() !== $this->form_id) { |
| 40 | return; | 42 | return; |
| 41 | } | 43 | } |
| 42 | 44 | ||
| 43 | $column->set_field( $this->field_factory->create( $this->get_field_id_by_type( $column->get_type() ), $this->form_id ) ); | 45 | $column->set_field( |
| 46 | $this->field_factory->create($this->get_field_id_by_type($column->get_type()), $this->form_id) | ||
| 47 | ); | ||
| 44 | } | 48 | } |
| 45 | 49 | ||
| 46 | private function get_field_id_by_type( $type ) { | 50 | private function get_field_id_by_type($type) |
| 47 | return str_replace( 'field_id-', '', $type ); | 51 | { |
| 52 | return str_replace('field_id-', '', $type); | ||
| 48 | } | 53 | } |
| 49 | 54 | ||
| 50 | public function register_entry_columns( ListScreen\Entry $list_screen ): void { | 55 | public function register_entry_columns(ListScreen\Entry $list_screen): void |
| 51 | foreach ( ( new AC\DefaultColumnsRepository() )->get( $list_screen->get_key() ) as $type => $label ) { | 56 | { |
| 52 | $field_id = $this->get_field_id_by_type( $type ); | 57 | foreach ((new AC\DefaultColumnsRepository())->get($list_screen->get_key()) as $type => $label) { |
| 58 | $field_id = $this->get_field_id_by_type($type); | ||
| 53 | $form_id = $list_screen->get_form_id(); | 59 | $form_id = $list_screen->get_form_id(); |
| 54 | 60 | ||
| 55 | if ( ! $this->column_factory->has_field( $field_id, $form_id ) ) { | 61 | if ( ! $this->column_factory->has_field($field_id, $form_id)) { |
| 56 | continue; | 62 | continue; |
| 57 | } | 63 | } |
| 58 | 64 | ||
| 59 | $column = $this->column_factory->create( $field_id, $form_id ); | 65 | $column = $this->column_factory->create($field_id, $form_id); |
| 60 | $column->set_type( $type ) | 66 | $column->set_type($type) |
| 61 | ->set_label( $label ) | 67 | ->set_label($label) |
| 62 | ->set_list_screen( $list_screen ); | 68 | ->set_list_screen($list_screen); |
| 63 | 69 | ||
| 64 | $this->configure_column( $column ); | 70 | $this->configure_column($column, $list_screen); |
| 65 | 71 | ||
| 66 | $list_screen->register_column_type( $column ); | 72 | $list_screen->register_column_type($column); |
| 67 | } | 73 | } |
| 68 | } | 74 | } |
| 69 | 75 | ... | ... |
| ... | @@ -7,7 +7,8 @@ use ACP; | ... | @@ -7,7 +7,8 @@ use ACP; |
| 7 | 7 | ||
| 8 | class Entry extends ACP\Editing\Ajax\TableRows { | 8 | class Entry extends ACP\Editing\Ajax\TableRows { |
| 9 | 9 | ||
| 10 | public function register() { | 10 | public function register(): void |
| 11 | { | ||
| 11 | add_action( Hooks::get_load_form_entries(), [ $this, 'handle_request' ] ); | 12 | add_action( Hooks::get_load_form_entries(), [ $this, 'handle_request' ] ); |
| 12 | } | 13 | } |
| 13 | 14 | ... | ... |
| ... | @@ -8,25 +8,30 @@ use ACA\GravityForms\ListTable; | ... | @@ -8,25 +8,30 @@ use ACA\GravityForms\ListTable; |
| 8 | use ACA\GravityForms\Utils\Hooks; | 8 | use ACA\GravityForms\Utils\Hooks; |
| 9 | use ACP\Export\Strategy; | 9 | use ACP\Export\Strategy; |
| 10 | 10 | ||
| 11 | class Entry extends Strategy { | 11 | class Entry extends Strategy |
| 12 | { | ||
| 12 | 13 | ||
| 13 | public function __construct( ListScreen\Entry $list_screen ) { | 14 | public function __construct(ListScreen\Entry $list_screen) |
| 14 | parent::__construct( $list_screen ); | 15 | { |
| 16 | parent::__construct($list_screen); | ||
| 15 | } | 17 | } |
| 16 | 18 | ||
| 17 | protected function ajax_export(): void { | 19 | protected function ajax_export(): void |
| 18 | add_filter( 'gform_get_entries_args_entry_list', [ $this, 'set_pagination_args' ], 11 ); | 20 | { |
| 19 | add_action( Hooks::get_load_form_entries(), [ $this, 'delayed_export' ] ); | 21 | add_filter('gform_get_entries_args_entry_list', [$this, 'set_pagination_args'], 11); |
| 22 | add_action(Hooks::get_load_form_entries(), [$this, 'delayed_export']); | ||
| 20 | } | 23 | } |
| 21 | 24 | ||
| 22 | public function delayed_export(): void { | 25 | public function delayed_export(): void |
| 26 | { | ||
| 23 | $table = $this->list_screen->get_list_table(); | 27 | $table = $this->list_screen->get_list_table(); |
| 24 | $table->prepare_items(); | 28 | $table->prepare_items(); |
| 25 | 29 | ||
| 26 | $this->export( wp_list_pluck( $table->items, 'id' ) ); | 30 | $this->export(wp_list_pluck($table->items, 'id')); |
| 27 | } | 31 | } |
| 28 | 32 | ||
| 29 | public function set_pagination_args( array $args ): array { | 33 | public function set_pagination_args(array $args): array |
| 34 | { | ||
| 30 | $per_page = $this->get_num_items_per_iteration(); | 35 | $per_page = $this->get_num_items_per_iteration(); |
| 31 | 36 | ||
| 32 | $args['paging']['page_size'] = $per_page; | 37 | $args['paging']['page_size'] = $per_page; |
| ... | @@ -34,7 +39,7 @@ class Entry extends Strategy { | ... | @@ -34,7 +39,7 @@ class Entry extends Strategy { |
| 34 | 39 | ||
| 35 | $ids = $this->get_requested_ids(); | 40 | $ids = $this->get_requested_ids(); |
| 36 | 41 | ||
| 37 | if ( $ids ) { | 42 | if ($ids) { |
| 38 | $args['search_criteria']['field_filters'] = [ | 43 | $args['search_criteria']['field_filters'] = [ |
| 39 | [ | 44 | [ |
| 40 | 'key' => 'id', | 45 | 'key' => 'id', |
| ... | @@ -47,8 +52,9 @@ class Entry extends Strategy { | ... | @@ -47,8 +52,9 @@ class Entry extends Strategy { |
| 47 | return $args; | 52 | return $args; |
| 48 | } | 53 | } |
| 49 | 54 | ||
| 50 | protected function get_list_table(): ?AC\ListTable { | 55 | protected function get_list_table(): AC\ListTable |
| 51 | return new ListTable( $this->list_screen->get_list_table() ); | 56 | { |
| 57 | return new ListTable($this->list_screen->get_list_table()); | ||
| 52 | } | 58 | } |
| 53 | 59 | ||
| 54 | } | 60 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\GravityForms; | 5 | namespace ACA\GravityForms; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 6 | use AC\Asset\Script; | ||
| 7 | use AC\Asset\Style; | ||
| 8 | use AC\DefaultColumnsRepository; | 8 | use AC\DefaultColumnsRepository; |
| 9 | use AC\Registerable; | 9 | use AC\Registerable; |
| 10 | use ACA\GravityForms\ListScreen; | 10 | use AC\Services; |
| 11 | use AC\Vendor\Psr\Container\ContainerInterface; | ||
| 11 | use ACA\GravityForms\Search\Query; | 12 | use ACA\GravityForms\Search\Query; |
| 12 | use ACA\GravityForms\TableScreen; | 13 | use ACA\GravityForms\Service\ColumnGroup; |
| 14 | use ACA\GravityForms\Service\Scripts; | ||
| 13 | use ACP\Search\QueryFactory; | 15 | use ACP\Search\QueryFactory; |
| 14 | use ACP\Search\TableScreenFactory; | 16 | use ACP\Search\TableScreenFactory; |
| 15 | use ACP\Service\IntegrationStatus; | 17 | use ACP\Service\IntegrationStatus; |
| 16 | use GFCommon; | 18 | use GFCommon; |
| 17 | 19 | ||
| 18 | final class GravityForms implements Registerable { | 20 | final class GravityForms implements Registerable |
| 21 | { | ||
| 19 | 22 | ||
| 20 | public const GROUP = 'gravity_forms'; | 23 | public const GROUP = 'gravity_forms'; |
| 21 | 24 | ||
| 22 | private $location; | 25 | private $location; |
| 23 | 26 | ||
| 24 | public function __construct( AC\Asset\Location\Absolute $location ) { | 27 | private $container; |
| 28 | |||
| 29 | public function __construct(AC\Asset\Location\Absolute $location, ContainerInterface $container) | ||
| 30 | { | ||
| 25 | $this->location = $location; | 31 | $this->location = $location; |
| 32 | $this->container = $container; | ||
| 26 | } | 33 | } |
| 27 | 34 | ||
| 28 | public function register() { | 35 | public function register(): void |
| 29 | if ( ! class_exists( 'GFCommon', false ) ) { | 36 | { |
| 37 | if ( ! class_exists('GFCommon', false)) { | ||
| 30 | return; | 38 | return; |
| 31 | } | 39 | } |
| 32 | 40 | ||
| 33 | $minimum_gf_version = '2.5'; | 41 | $minimum_gf_version = '2.5'; |
| 34 | 42 | ||
| 35 | if ( class_exists( 'GFCommon', false ) && version_compare( GFCommon::$version, $minimum_gf_version, '<' ) ) { | 43 | if (class_exists('GFCommon', false) && version_compare((string)GFCommon::$version, $minimum_gf_version, '<')) { |
| 36 | return; | 44 | return; |
| 37 | } | 45 | } |
| 38 | 46 | ||
| 39 | AC\ListScreenFactory::add( new ListScreenFactory\EntryFactory() ); | 47 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\EntryFactory()); |
| 40 | |||
| 41 | add_action( 'ac/column_groups', [ $this, 'register_column_group' ] ); | ||
| 42 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | ||
| 43 | add_action( 'ac/table_scripts', [ $this, 'table_scripts' ] ); | ||
| 44 | add_filter( "gform_noconflict_styles", [ $this, 'allowed_acp_styles' ] ); | ||
| 45 | add_filter( "gform_noconflict_scripts", [ $this, 'allowed_acp_scripts' ] ); | ||
| 46 | |||
| 47 | $services = [ | ||
| 48 | new Service\ListScreens(), | ||
| 49 | new TableScreen\Entry( new AC\ListScreenFactory(), AC()->get_storage(), new DefaultColumnsRepository() ), | ||
| 50 | new Admin(), | ||
| 51 | new IntegrationStatus( 'ac-addon-gravityforms' ), | ||
| 52 | ]; | ||
| 53 | 48 | ||
| 54 | array_map( static function ( Registerable $service ) { | 49 | $this->create_services()->register(); |
| 55 | $service->register(); | ||
| 56 | }, $services ); | ||
| 57 | 50 | ||
| 58 | // Enable Search | 51 | // Enable Search |
| 59 | QueryFactory::register( MetaTypes::GRAVITY_FORMS_ENTRY, Query::class ); | 52 | QueryFactory::register(MetaTypes::GRAVITY_FORMS_ENTRY, Query::class); |
| 60 | TableScreenFactory::register( ListScreen\Entry::class, Search\TableScreen\Entry::class ); | 53 | TableScreenFactory::register(ListScreen\Entry::class, Search\TableScreen\Entry::class); |
| 61 | } | ||
| 62 | |||
| 63 | public function register_column_group( AC\Groups $groups ): void { | ||
| 64 | $groups->add( 'gravity_forms', __( 'Gravity Forms', 'codepress-admin-columns' ), 14 ); | ||
| 65 | } | 54 | } |
| 66 | 55 | ||
| 67 | /** | 56 | private function create_services(): Services |
| 68 | * @param string $key | 57 | { |
| 69 | * | 58 | return new Services([ |
| 70 | * @return bool | 59 | new Service\ListScreens(), |
| 71 | */ | 60 | new TableScreen\Entry( |
| 72 | private function is_acp_asset( $key ) { | 61 | new AC\ListScreenFactory\Aggregate(), |
| 73 | $acp_prefixes = [ 'ac-', 'acp-', 'aca-', 'editor', 'mce-view', 'quicktags', 'common', 'tinymce' ]; | 62 | $this->container->get(AC\ListScreenRepository\Storage::class), |
| 74 | 63 | new DefaultColumnsRepository() | |
| 75 | foreach ( $acp_prefixes as $prefix ) { | 64 | ), |
| 76 | if ( strpos( $key, $prefix ) !== false ) { | 65 | new Admin(), |
| 77 | return true; | 66 | new IntegrationStatus('ac-addon-gravityforms'), |
| 78 | } | 67 | new Scripts($this->location), |
| 79 | } | 68 | new ColumnGroup(), |
| 80 | 69 | ]); | |
| 81 | return false; | ||
| 82 | } | ||
| 83 | |||
| 84 | /** | ||
| 85 | * @param array $objects | ||
| 86 | * | ||
| 87 | * @return array | ||
| 88 | */ | ||
| 89 | public function allowed_acp_styles( $objects ) { | ||
| 90 | global $wp_styles; | ||
| 91 | |||
| 92 | foreach ( $wp_styles->queue as $handle ) { | ||
| 93 | if ( ! $this->is_acp_asset( $handle ) ) { | ||
| 94 | continue; | ||
| 95 | } | ||
| 96 | |||
| 97 | $objects[] = $handle; | ||
| 98 | } | ||
| 99 | |||
| 100 | return $objects; | ||
| 101 | } | ||
| 102 | |||
| 103 | /** | ||
| 104 | * @param array $objects | ||
| 105 | * | ||
| 106 | * @return array | ||
| 107 | */ | ||
| 108 | public function allowed_acp_scripts( $objects ) { | ||
| 109 | global $wp_scripts; | ||
| 110 | |||
| 111 | foreach ( $wp_scripts->queue as $handle ) { | ||
| 112 | if ( ! $this->is_acp_asset( $handle ) ) { | ||
| 113 | continue; | ||
| 114 | } | ||
| 115 | |||
| 116 | $objects[] = $handle; | ||
| 117 | } | ||
| 118 | |||
| 119 | return $objects; | ||
| 120 | } | ||
| 121 | |||
| 122 | public function admin_scripts() { | ||
| 123 | wp_enqueue_style( 'gform_font_awesome' ); | ||
| 124 | } | ||
| 125 | |||
| 126 | public function table_scripts() { | ||
| 127 | $style = new Style( 'aca-gf-table', $this->location->with_suffix( 'assets/css/table.css' ) ); | ||
| 128 | $style->enqueue(); | ||
| 129 | |||
| 130 | $script = new Script( 'aca-gf-table', $this->location->with_suffix( 'assets/js/table.js' ) ); | ||
| 131 | $script->enqueue(); | ||
| 132 | |||
| 133 | wp_enqueue_script( 'wp-tinymce' ); | ||
| 134 | } | 70 | } |
| 135 | 71 | ||
| 136 | } | 72 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\GravityForms\ListScreen; | 5 | namespace ACA\GravityForms\ListScreen; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 8 | use AC\ColumnRepository; | ||
| 9 | use AC\Type\Uri; | ||
| 6 | use ACA\GravityForms; | 10 | use ACA\GravityForms; |
| 7 | use ACA\GravityForms\Column; | 11 | use ACA\GravityForms\Column; |
| 8 | use ACA\GravityForms\Column\EntryConfigurator; | 12 | use ACA\GravityForms\Column\EntryConfigurator; |
| 13 | use ACA\GravityForms\ListTable; | ||
| 14 | use ACA\GravityForms\MetaTypes; | ||
| 9 | use ACP\Editing; | 15 | use ACP\Editing; |
| 10 | use ACP\Export; | 16 | use ACP\Export; |
| 11 | use GF_Entry_List_Table; | 17 | use GF_Entry_List_Table; |
| 12 | use GFAPI; | 18 | use GFAPI; |
| 13 | 19 | ||
| 14 | class Entry extends AC\ListScreenWP implements Editing\ListScreen, Export\ListScreen { | 20 | class Entry extends AC\ListScreen implements Editing\ListScreen, Export\ListScreen, AC\ListScreen\ManageValue, |
| 21 | AC\ListScreen\ListTable | ||
| 22 | { | ||
| 15 | 23 | ||
| 16 | private $form_id; | 24 | private $form_id; |
| 17 | 25 | ||
| 18 | private $column_configurator; | 26 | private $column_configurator; |
| 19 | 27 | ||
| 20 | public function __construct( int $form_id, EntryConfigurator $column_configurator ) { | 28 | public function __construct(int $form_id, EntryConfigurator $column_configurator) |
| 29 | { | ||
| 30 | parent::__construct('gf_entry_' . $form_id, '_page_gf_entries'); | ||
| 31 | |||
| 21 | $this->form_id = $form_id; | 32 | $this->form_id = $form_id; |
| 22 | $this->column_configurator = $column_configurator; | 33 | $this->column_configurator = $column_configurator; |
| 23 | 34 | ||
| 24 | $this->set_group( 'gravity_forms' ) | 35 | $this->group = 'gravity_forms'; |
| 25 | ->set_page( 'gf_entries' ) | 36 | $this->set_meta_type(MetaTypes::GRAVITY_FORMS_ENTRY); |
| 26 | ->set_screen_id( '_page_gf_entries' ) | ||
| 27 | ->set_screen_base( '_page_gf_entries' ) | ||
| 28 | ->set_key( 'gf_entry_' . $form_id ) | ||
| 29 | ->set_meta_type( GravityForms\MetaTypes::GRAVITY_FORMS_ENTRY ); | ||
| 30 | } | ||
| 31 | |||
| 32 | public function editing() { | ||
| 33 | return new GravityForms\Editing\Strategy\Entry( $this->get_list_table() ); | ||
| 34 | } | ||
| 35 | |||
| 36 | public function export() { | ||
| 37 | return new GravityForms\Export\Strategy\Entry( $this ); | ||
| 38 | } | 37 | } |
| 39 | 38 | ||
| 40 | public function get_heading_hookname() { | 39 | public function list_table(): AC\ListTable |
| 41 | return 'gform_entry_list_columns'; | 40 | { |
| 41 | return new ListTable($this->get_list_table()); | ||
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | protected function get_object( $id ) { | 44 | public function manage_value(): AC\Table\ManageValue |
| 45 | return GFAPI::get_entry( $id ); | 45 | { |
| 46 | return new GravityForms\Table\ManageValue\Entry(new ColumnRepository($this)); | ||
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | public function set_manage_value_callback() { | 49 | public function editing() |
| 49 | add_filter( 'gform_entries_field_value', [ $this, 'manage_value_entry' ], 10, 4 ); | 50 | { |
| 51 | return new GravityForms\Editing\Strategy\Entry($this->get_list_table()); | ||
| 50 | } | 52 | } |
| 51 | 53 | ||
| 52 | /** | 54 | public function export() |
| 53 | * @param string $original_value | 55 | { |
| 54 | * @param int $form_id | 56 | return new GravityForms\Export\Strategy\Entry($this); |
| 55 | * @param string $field_id | ||
| 56 | * @param array $entry | ||
| 57 | * | ||
| 58 | * @return string | ||
| 59 | */ | ||
| 60 | public function manage_value_entry( $original_value, $form_id, $field_id, $entry ) { | ||
| 61 | $custom_column_value = $this->get_display_value_by_column_name( $field_id, $entry['id'], $original_value ); | ||
| 62 | |||
| 63 | if ( $custom_column_value ) { | ||
| 64 | return $custom_column_value; | ||
| 65 | } | 57 | } |
| 66 | 58 | ||
| 67 | $value = $this->get_display_value_by_column_name( 'field_id-' . $field_id, $entry['id'], $original_value ); | 59 | public function get_heading_hookname(): string |
| 68 | 60 | { | |
| 69 | return $value ?: $original_value; | 61 | return 'gform_entry_list_columns'; |
| 70 | } | 62 | } |
| 71 | 63 | ||
| 72 | /** | 64 | public function get_label(): ?string |
| 73 | * @return string | 65 | { |
| 74 | */ | 66 | return GFAPI::get_form($this->get_form_id())['title']; |
| 75 | public function get_label() { | ||
| 76 | return GFAPI::get_form( $this->get_form_id() )['title']; | ||
| 77 | } | 67 | } |
| 78 | 68 | ||
| 79 | /** | 69 | public function get_form_id(): int |
| 80 | * @return int | 70 | { |
| 81 | */ | ||
| 82 | public function get_form_id() { | ||
| 83 | return $this->form_id; | 71 | return $this->form_id; |
| 84 | } | 72 | } |
| 85 | 73 | ||
| 86 | protected function get_admin_url() { | 74 | public function get_table_url(): Uri |
| 87 | return admin_url( 'admin.php' ); | 75 | { |
| 88 | } | 76 | $url = new AC\Type\Url\ListTable('admin.php'); |
| 89 | 77 | ||
| 90 | public function get_screen_link() { | 78 | return $url->with_arg('id', (string)$this->form_id) |
| 91 | return add_query_arg( [ 'id' => $this->get_form_id() ], parent::get_screen_link() ); | 79 | ->with_arg('page', 'gf_entries'); |
| 92 | } | 80 | } |
| 93 | 81 | ||
| 94 | public function get_list_table(): GF_Entry_List_Table { | 82 | public function get_list_table(): GF_Entry_List_Table |
| 95 | return ( new GravityForms\TableFactory() )->create( $this->get_screen_id(), $this->form_id ); | 83 | { |
| 84 | return (new GravityForms\TableFactory())->create($this->get_screen_id(), $this->form_id); | ||
| 96 | } | 85 | } |
| 97 | 86 | ||
| 98 | public function register_column_types(): void { | 87 | public function register_column_types(): void |
| 99 | $this->column_configurator->register_entry_columns( $this ); | 88 | { |
| 89 | $this->column_configurator->register_entry_columns($this); | ||
| 100 | 90 | ||
| 101 | $this->register_column_types_from_list( [ | 91 | $this->register_column_types_from_list([ |
| 102 | Column\Entry\Custom\User::class, | 92 | Column\Entry\Custom\User::class, |
| 103 | Column\Entry\Original\DateCreated::class, | 93 | Column\Entry\Original\DateCreated::class, |
| 104 | Column\Entry\Original\DatePayment::class, | 94 | Column\Entry\Original\DatePayment::class, |
| ... | @@ -109,7 +99,7 @@ class Entry extends AC\ListScreenWP implements Editing\ListScreen, Export\ListSc | ... | @@ -109,7 +99,7 @@ class Entry extends AC\ListScreenWP implements Editing\ListScreen, Export\ListSc |
| 109 | Column\Entry\Original\TransactionId::class, | 99 | Column\Entry\Original\TransactionId::class, |
| 110 | Column\Entry\Original\User::class, | 100 | Column\Entry\Original\User::class, |
| 111 | Column\Entry\Original\UserIp::class, | 101 | Column\Entry\Original\UserIp::class, |
| 112 | ] ); | 102 | ]); |
| 113 | } | 103 | } |
| 114 | 104 | ||
| 115 | } | 105 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,96 +3,83 @@ | ... | @@ -3,96 +3,83 @@ |
| 3 | namespace ACA\GravityForms\ListScreenFactory; | 3 | namespace ACA\GravityForms\ListScreenFactory; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use AC\ListScreenFactory\ListSettingsTrait; | 6 | use AC\ListScreenFactory; |
| 7 | use AC\ListScreenFactoryInterface; | ||
| 8 | use ACA\GravityForms; | 7 | use ACA\GravityForms; |
| 9 | use ACA\GravityForms\Column\EntryConfigurator; | 8 | use ACA\GravityForms\Column\EntryConfigurator; |
| 10 | use ACA\GravityForms\FieldFactory; | 9 | use ACA\GravityForms\FieldFactory; |
| 11 | use ACA\GravityForms\ListScreen\Entry; | 10 | use ACA\GravityForms\ListScreen\Entry; |
| 12 | use GFForms; | 11 | use GFForms; |
| 13 | use GFFormsModel; | 12 | use GFFormsModel; |
| 14 | use LogicException; | ||
| 15 | use WP_Screen; | 13 | use WP_Screen; |
| 16 | 14 | ||
| 17 | class EntryFactory implements ListScreenFactoryInterface { | 15 | class EntryFactory extends ListScreenFactory\BaseFactory |
| 16 | { | ||
| 18 | 17 | ||
| 19 | use ListSettingsTrait; | 18 | public function can_create(string $key): bool |
| 20 | 19 | { | |
| 21 | public function can_create( string $key ): bool { | 20 | return null !== $this->get_form_id_from_list_key($key); |
| 22 | return null !== $this->get_form_id_from_list_key( $key ); | ||
| 23 | } | ||
| 24 | |||
| 25 | private function get_form_id_from_list_key( string $key ): ?int { | ||
| 26 | if ( ! ac_helper()->string->starts_with( $key, 'gf_entry_' ) ) { | ||
| 27 | return null; | ||
| 28 | } | 21 | } |
| 29 | 22 | ||
| 30 | $entry_id = ac_helper()->string->remove_prefix( $key, 'gf_entry_' ); | 23 | protected function create_list_screen(string $key): ListScreen |
| 24 | { | ||
| 25 | $form_id = $this->get_form_id_from_list_key($key); | ||
| 31 | 26 | ||
| 32 | return is_numeric( $entry_id ) | 27 | return new Entry($form_id, $this->create_entry_configurator($this->get_form_id_from_list_key($key))); |
| 33 | ? (int) $entry_id | ||
| 34 | : null; | ||
| 35 | } | 28 | } |
| 36 | 29 | ||
| 37 | public function create( string $key, array $settings = [] ): ListScreen { | 30 | private function get_form_id_from_list_key(string $key): ?int |
| 38 | if ( ! $this->can_create( $key ) ) { | 31 | { |
| 39 | throw new LogicException( 'Invalid key' ); | 32 | if ( ! ac_helper()->string->starts_with($key, 'gf_entry_')) { |
| 33 | return null; | ||
| 40 | } | 34 | } |
| 41 | 35 | ||
| 42 | $form_id = $this->get_form_id_from_list_key( $key ); | 36 | $entry_id = ac_helper()->string->remove_prefix($key, 'gf_entry_'); |
| 43 | 37 | ||
| 44 | if ( null === $form_id ) { | 38 | return is_numeric($entry_id) |
| 45 | throw new LogicException( 'Invalid form id' ); | 39 | ? (int)$entry_id |
| 46 | } | 40 | : null; |
| 47 | |||
| 48 | return $this->add_settings( | ||
| 49 | new Entry( $form_id, $this->create_entry_configurator( $form_id ) ), | ||
| 50 | $settings | ||
| 51 | ); | ||
| 52 | } | 41 | } |
| 53 | 42 | ||
| 54 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 43 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 55 | return strpos( $screen->id, '_page_gf_entries' ) !== false && | 44 | { |
| 56 | strpos( $screen->base, '_page_gf_entries' ) !== false && | 45 | return strpos($screen->id, '_page_gf_entries') !== false && |
| 46 | strpos($screen->base, '_page_gf_entries') !== false && | ||
| 57 | $this->has_form_id(); | 47 | $this->has_form_id(); |
| 58 | } | 48 | } |
| 59 | 49 | ||
| 60 | private function has_form_id(): bool { | 50 | private function has_form_id(): bool |
| 51 | { | ||
| 61 | return $this->get_current_form_id() > 0; | 52 | return $this->get_current_form_id() > 0; |
| 62 | } | 53 | } |
| 63 | 54 | ||
| 64 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 55 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 65 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 56 | { |
| 66 | throw new LogicException( 'Invalid screen' ); | ||
| 67 | } | ||
| 68 | |||
| 69 | $form_id = $this->get_current_form_id(); | 57 | $form_id = $this->get_current_form_id(); |
| 70 | 58 | ||
| 71 | return $this->add_settings( | 59 | return new Entry($form_id, $this->create_entry_configurator($form_id)); |
| 72 | new Entry( $form_id, $this->create_entry_configurator( $form_id ) ), | ||
| 73 | $settings | ||
| 74 | ); | ||
| 75 | } | 60 | } |
| 76 | 61 | ||
| 77 | private function get_current_form_id(): int { | 62 | private function get_current_form_id(): int |
| 78 | $form_id = GFForms::get( 'id' ); | 63 | { |
| 64 | $form_id = GFForms::get('id'); | ||
| 79 | 65 | ||
| 80 | if ( ! $form_id ) { | 66 | if ( ! $form_id) { |
| 81 | $forms = GFFormsModel::get_forms(); | 67 | $forms = GFFormsModel::get_forms(); |
| 82 | 68 | ||
| 83 | if ( $forms ) { | 69 | if ($forms) { |
| 84 | $form_id = $forms[0]->id; | 70 | $form_id = $forms[0]->id; |
| 85 | } | 71 | } |
| 86 | } | 72 | } |
| 87 | 73 | ||
| 88 | return (int) $form_id; | 74 | return (int)$form_id; |
| 89 | } | 75 | } |
| 90 | 76 | ||
| 91 | private function create_entry_configurator( int $form_id ): EntryConfigurator { | 77 | private function create_entry_configurator(int $form_id): EntryConfigurator |
| 78 | { | ||
| 92 | $fieldFactory = new FieldFactory(); | 79 | $fieldFactory = new FieldFactory(); |
| 93 | $columnFactory = new GravityForms\Column\EntryFactory( $fieldFactory ); | 80 | $columnFactory = new GravityForms\Column\EntryFactory($fieldFactory); |
| 94 | 81 | ||
| 95 | $entry_configurator = new EntryConfigurator( $form_id, $columnFactory, $fieldFactory ); | 82 | $entry_configurator = new EntryConfigurator($form_id, $columnFactory, $fieldFactory); |
| 96 | $entry_configurator->register(); | 83 | $entry_configurator->register(); |
| 97 | 84 | ||
| 98 | return $entry_configurator; | 85 | return $entry_configurator; | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 3 | namespace ACA\GravityForms; | 5 | namespace ACA\GravityForms; |
| 4 | 6 | ||
| 5 | use AC; | 7 | use AC; |
| 6 | use GF_Entry_List_Table; | 8 | use GF_Entry_List_Table; |
| 7 | use GFAPI; | 9 | use GFAPI; |
| 8 | 10 | ||
| 9 | class ListTable implements AC\ListTable { | 11 | class ListTable implements AC\ListTable |
| 12 | { | ||
| 10 | 13 | ||
| 11 | private $listTable; | 14 | private $table; |
| 12 | 15 | ||
| 13 | public function __construct( GF_Entry_List_Table $listTable ) { | 16 | public function __construct(GF_Entry_List_Table $table) |
| 14 | $this->listTable = $listTable; | 17 | { |
| 18 | $this->table = $table; | ||
| 15 | } | 19 | } |
| 16 | 20 | ||
| 17 | public function get_column_value( $column, $id ) { | 21 | public function get_column_value(string $column, int $id): string |
| 22 | { | ||
| 18 | ob_start(); | 23 | ob_start(); |
| 19 | 24 | $this->table->column_default(GFAPI::get_entry($id), $column); | |
| 20 | $entry = GFAPI::get_entry( $id ); | ||
| 21 | $this->listTable->column_default( $entry, $column ); | ||
| 22 | 25 | ||
| 23 | return ob_get_clean(); | 26 | return ob_get_clean(); |
| 24 | } | 27 | } |
| 25 | 28 | ||
| 26 | public function get_total_items() { | 29 | public function get_total_items(): int |
| 27 | return $this->listTable->get_pagination_arg( 'total_items' ); | 30 | { |
| 31 | return $this->table->get_pagination_arg('total_items'); | ||
| 32 | } | ||
| 33 | |||
| 34 | public function render_row(int $id): string | ||
| 35 | { | ||
| 36 | ob_start(); | ||
| 37 | $this->table->single_row(GFAPI::get_entry($id)); | ||
| 38 | |||
| 39 | return ob_get_clean(); | ||
| 28 | } | 40 | } |
| 29 | 41 | ||
| 30 | } | 42 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,6 +4,6 @@ namespace ACA\GravityForms; | ... | @@ -4,6 +4,6 @@ namespace ACA\GravityForms; |
| 4 | 4 | ||
| 5 | interface MetaTypes { | 5 | interface MetaTypes { |
| 6 | 6 | ||
| 7 | const GRAVITY_FORMS_ENTRY = 'gravity_forms_entry'; | 7 | public const GRAVITY_FORMS_ENTRY = 'gravity_forms_entry'; |
| 8 | 8 | ||
| 9 | } | 9 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -5,7 +5,8 @@ namespace ACA\GravityForms\Search; | ... | @@ -5,7 +5,8 @@ namespace ACA\GravityForms\Search; |
| 5 | use ACP\Search; | 5 | use ACP\Search; |
| 6 | use GFFormsModel; | 6 | use GFFormsModel; |
| 7 | 7 | ||
| 8 | final class Query extends Search\Query { | 8 | final class Query extends Search\Query |
| 9 | { | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * @var int | 12 | * @var int |
| ... | @@ -17,19 +18,22 @@ final class Query extends Search\Query { | ... | @@ -17,19 +18,22 @@ final class Query extends Search\Query { |
| 17 | */ | 18 | */ |
| 18 | private $status; | 19 | private $status; |
| 19 | 20 | ||
| 20 | public function register() { | 21 | public function register(): void |
| 21 | add_filter( 'gform_get_entries_args_entry_list', [ $this, 'catch_list_details' ], 10, 3 ); | 22 | { |
| 22 | add_filter( 'gform_gf_query_sql', [ $this, 'parse_search_query' ] ); | 23 | add_filter('gform_get_entries_args_entry_list', [$this, 'catch_list_details'], 10, 3); |
| 24 | add_filter('gform_gf_query_sql', [$this, 'parse_search_query']); | ||
| 23 | } | 25 | } |
| 24 | 26 | ||
| 25 | public function catch_list_details( array $args ) { | 27 | public function catch_list_details(array $args): array |
| 26 | $this->form_id = (int) $args['form_id']; | 28 | { |
| 27 | $this->status = (string) $args['search_criteria']['status']; | 29 | $this->form_id = (int)$args['form_id']; |
| 30 | $this->status = (string)$args['search_criteria']['status']; | ||
| 28 | 31 | ||
| 29 | return $args; | 32 | return $args; |
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | public function parse_search_query( array $query ) { | 35 | public function parse_search_query(array $query): array |
| 36 | { | ||
| 33 | global $wpdb; | 37 | global $wpdb; |
| 34 | 38 | ||
| 35 | $entry_table = GFFormsModel::get_entry_table_name(); | 39 | $entry_table = GFFormsModel::get_entry_table_name(); |
| ... | @@ -37,22 +41,22 @@ final class Query extends Search\Query { | ... | @@ -37,22 +41,22 @@ final class Query extends Search\Query { |
| 37 | $where = sprintf( | 41 | $where = sprintf( |
| 38 | 'WHERE %s.form_id = %s AND %s.status = %s', | 42 | 'WHERE %s.form_id = %s AND %s.status = %s', |
| 39 | $entry_table, | 43 | $entry_table, |
| 40 | $wpdb->prepare( '%d', $this->form_id ), | 44 | $wpdb->prepare('%d', $this->form_id), |
| 41 | $entry_table, | 45 | $entry_table, |
| 42 | $wpdb->prepare( '%s', $this->status ) | 46 | $wpdb->prepare('%s', $this->status) |
| 43 | ); | 47 | ); |
| 44 | 48 | ||
| 45 | $query['select'] = sprintf( 'SELECT SQL_CALC_FOUND_ROWS DISTINCT %s.id', $entry_table ); | 49 | $query['select'] = sprintf('SELECT SQL_CALC_FOUND_ROWS DISTINCT %s.id', $entry_table); |
| 46 | $query['from'] = sprintf( 'FROM %s', $entry_table ); | 50 | $query['from'] = sprintf('FROM %s', $entry_table); |
| 47 | $query['where'] = $where; | 51 | $query['where'] = $where; |
| 48 | $query['order'] = sprintf( 'ORDER BY %s.id DESC', $entry_table ); | 52 | $query['order'] = sprintf('ORDER BY %s.id DESC', $entry_table); |
| 49 | 53 | ||
| 50 | foreach ( $this->bindings as $binding ) { | 54 | foreach ($this->bindings as $binding) { |
| 51 | if ( $binding->get_where() ) { | 55 | if ($binding->get_where()) { |
| 52 | $query['where'] .= "\nAND " . $binding->get_where(); | 56 | $query['where'] .= "\nAND " . $binding->get_where(); |
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | if ( $binding->get_join() ) { | 59 | if ($binding->get_join()) { |
| 56 | $query['join'] .= "\n" . $binding->get_join(); | 60 | $query['join'] .= "\n" . $binding->get_join(); |
| 57 | } | 61 | } |
| 58 | } | 62 | } | ... | ... |
| ... | @@ -6,7 +6,8 @@ use ACP\Search; | ... | @@ -6,7 +6,8 @@ use ACP\Search; |
| 6 | 6 | ||
| 7 | class Entry extends Search\TableScreen { | 7 | class Entry extends Search\TableScreen { |
| 8 | 8 | ||
| 9 | public function register() { | 9 | public function register(): void |
| 10 | { | ||
| 10 | parent::register(); | 11 | parent::register(); |
| 11 | 12 | ||
| 12 | add_action( 'gform_pre_entry_list', [ $this, 'filters_markup' ] ); | 13 | add_action( 'gform_pre_entry_list', [ $this, 'filters_markup' ] ); | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace ACA\GravityForms\Service; | ||
| 6 | |||
| 7 | use AC; | ||
| 8 | use AC\Registerable; | ||
| 9 | |||
| 10 | class ColumnGroup implements Registerable | ||
| 11 | { | ||
| 12 | |||
| 13 | public function register(): void | ||
| 14 | { | ||
| 15 | add_action('ac/column_groups', [$this, 'register_column_group']); | ||
| 16 | } | ||
| 17 | |||
| 18 | public function register_column_group(AC\Groups $groups): void | ||
| 19 | { | ||
| 20 | $groups->add('gravity_forms', __('Gravity Forms', 'codepress-admin-columns'), 14); | ||
| 21 | } | ||
| 22 | |||
| 23 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -10,7 +10,8 @@ use GFAPI; | ... | @@ -10,7 +10,8 @@ use GFAPI; |
| 10 | 10 | ||
| 11 | class ListScreens implements Registerable { | 11 | class ListScreens implements Registerable { |
| 12 | 12 | ||
| 13 | public function register() { | 13 | public function register(): void |
| 14 | { | ||
| 14 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); | 15 | add_action( 'ac/list_screen_groups', [ $this, 'register_list_screen_group' ] ); |
| 15 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); | 16 | add_action( 'ac/list_keys', [ $this, 'add_list_keys' ] ); |
| 16 | } | 17 | } | ... | ... |
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace ACA\GravityForms\Service; | ||
| 6 | |||
| 7 | use AC\Asset\Location\Absolute; | ||
| 8 | use AC\Asset\Script; | ||
| 9 | use AC\Asset\Style; | ||
| 10 | use AC\ListScreen; | ||
| 11 | use AC\Registerable; | ||
| 12 | use ACA\GravityForms\ListScreen\Entry; | ||
| 13 | |||
| 14 | class Scripts implements Registerable | ||
| 15 | { | ||
| 16 | |||
| 17 | private $location; | ||
| 18 | |||
| 19 | public function __construct(Absolute $location) | ||
| 20 | { | ||
| 21 | $this->location = $location; | ||
| 22 | } | ||
| 23 | |||
| 24 | public function register(): void | ||
| 25 | { | ||
| 26 | add_action('ac/admin_scripts', [$this, 'admin_scripts']); | ||
| 27 | add_action('ac/table_scripts', [$this, 'table_scripts']); | ||
| 28 | add_filter("gform_noconflict_styles", [$this, 'allowed_acp_styles']); | ||
| 29 | add_filter("gform_noconflict_scripts", [$this, 'allowed_acp_scripts']); | ||
| 30 | } | ||
| 31 | |||
| 32 | public function admin_scripts(): void | ||
| 33 | { | ||
| 34 | wp_enqueue_style('gform_font_awesome'); | ||
| 35 | } | ||
| 36 | |||
| 37 | public function table_scripts(ListScreen $list_screen): void | ||
| 38 | { | ||
| 39 | if ( ! $list_screen instanceof Entry) { | ||
| 40 | return; | ||
| 41 | } | ||
| 42 | |||
| 43 | $style = new Style('aca-gf-table', $this->location->with_suffix('assets/css/table.css')); | ||
| 44 | $style->enqueue(); | ||
| 45 | |||
| 46 | $script = new Script('aca-gf-table', $this->location->with_suffix('assets/js/table.js')); | ||
| 47 | $script->enqueue(); | ||
| 48 | |||
| 49 | wp_enqueue_script('wp-tinymce'); | ||
| 50 | } | ||
| 51 | |||
| 52 | public function allowed_acp_styles($objects) | ||
| 53 | { | ||
| 54 | global $wp_styles; | ||
| 55 | |||
| 56 | foreach ($wp_styles->queue as $handle) { | ||
| 57 | if ( ! $this->is_acp_asset($handle)) { | ||
| 58 | continue; | ||
| 59 | } | ||
| 60 | |||
| 61 | $objects[] = $handle; | ||
| 62 | } | ||
| 63 | |||
| 64 | return $objects; | ||
| 65 | } | ||
| 66 | |||
| 67 | public function allowed_acp_scripts($objects) | ||
| 68 | { | ||
| 69 | global $wp_scripts; | ||
| 70 | |||
| 71 | foreach ($wp_scripts->queue as $handle) { | ||
| 72 | if ( ! $this->is_acp_asset($handle)) { | ||
| 73 | continue; | ||
| 74 | } | ||
| 75 | |||
| 76 | $objects[] = $handle; | ||
| 77 | } | ||
| 78 | |||
| 79 | return $objects; | ||
| 80 | } | ||
| 81 | |||
| 82 | private function is_acp_asset(string $key): bool | ||
| 83 | { | ||
| 84 | $acp_prefixes = ['ac-', 'acp-', 'aca-', 'editor', 'mce-view', 'quicktags', 'common', 'tinymce']; | ||
| 85 | |||
| 86 | foreach ($acp_prefixes as $prefix) { | ||
| 87 | if (strpos($key, $prefix) !== false) { | ||
| 88 | return true; | ||
| 89 | } | ||
| 90 | } | ||
| 91 | |||
| 92 | return false; | ||
| 93 | } | ||
| 94 | |||
| 95 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
wp-content/plugins/admin-columns-pro/addons/gravityforms/classes/Table/ManageValue/Entry.php
0 → 100644
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace ACA\GravityForms\Table\ManageValue; | ||
| 6 | |||
| 7 | use AC\Table\ManageValue; | ||
| 8 | |||
| 9 | class Entry extends ManageValue | ||
| 10 | { | ||
| 11 | |||
| 12 | public function register(): void | ||
| 13 | { | ||
| 14 | add_filter('gform_entries_field_value', [$this, 'render_value'], 10, 4); | ||
| 15 | } | ||
| 16 | |||
| 17 | public function render_value($original_value, $form_id, $field_id, $entry) | ||
| 18 | { | ||
| 19 | $value = $this->render_cell((string)$field_id, (int)$entry['id'], (string)$original_value); | ||
| 20 | |||
| 21 | if ( ! $value) { | ||
| 22 | $value = $this->render_cell('field_id-' . $field_id, (int)$entry['id'], (string)$original_value); | ||
| 23 | } | ||
| 24 | |||
| 25 | return $value ?: $original_value; | ||
| 26 | } | ||
| 27 | |||
| 28 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -5,21 +5,17 @@ namespace ACA\GravityForms; | ... | @@ -5,21 +5,17 @@ namespace ACA\GravityForms; |
| 5 | use GF_Entry_List_Table; | 5 | use GF_Entry_List_Table; |
| 6 | use GFCommon; | 6 | use GFCommon; |
| 7 | 7 | ||
| 8 | class TableFactory { | 8 | class TableFactory |
| 9 | { | ||
| 9 | 10 | ||
| 10 | /** | 11 | public function create(string $screen_id, int $form_id): GF_Entry_List_Table |
| 11 | * @param string $screen_id | 12 | { |
| 12 | * @param int $form_id | 13 | require_once(GFCommon::get_base_path() . '/entry_list.php'); |
| 13 | * | ||
| 14 | * @return GF_Entry_List_Table | ||
| 15 | */ | ||
| 16 | public function create( $screen_id, $form_id ) { | ||
| 17 | require_once( GFCommon::get_base_path() . '/entry_list.php' ); | ||
| 18 | 14 | ||
| 19 | return new GF_Entry_List_Table( [ | 15 | return new GF_Entry_List_Table([ |
| 20 | 'screen' => $screen_id, | 16 | 'screen' => $screen_id, |
| 21 | 'form_id' => $form_id, | 17 | 'form_id' => $form_id, |
| 22 | ] ); | 18 | ]); |
| 23 | } | 19 | } |
| 24 | 20 | ||
| 25 | } | 21 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,7 +4,7 @@ namespace ACA\GravityForms\TableScreen; | ... | @@ -4,7 +4,7 @@ namespace ACA\GravityForms\TableScreen; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC; |
| 6 | use AC\DefaultColumnsRepository; | 6 | use AC\DefaultColumnsRepository; |
| 7 | use AC\ListScreenFactoryInterface; | 7 | use AC\ListScreenFactory; |
| 8 | use AC\ListScreenRepository\Storage; | 8 | use AC\ListScreenRepository\Storage; |
| 9 | use AC\Type\ListScreenId; | 9 | use AC\Type\ListScreenId; |
| 10 | use ACA\GravityForms\Column; | 10 | use ACA\GravityForms\Column; |
| ... | @@ -25,7 +25,7 @@ class Entry implements AC\Registerable { | ... | @@ -25,7 +25,7 @@ class Entry implements AC\Registerable { |
| 25 | private $default_columns_repository; | 25 | private $default_columns_repository; |
| 26 | 26 | ||
| 27 | public function __construct( | 27 | public function __construct( |
| 28 | ListScreenFactoryInterface $list_screen_factory, | 28 | ListScreenFactory $list_screen_factory, |
| 29 | Storage $storage, | 29 | Storage $storage, |
| 30 | DefaultColumnsRepository $default_columns_repository | 30 | DefaultColumnsRepository $default_columns_repository |
| 31 | ) { | 31 | ) { |
| ... | @@ -34,7 +34,8 @@ class Entry implements AC\Registerable { | ... | @@ -34,7 +34,8 @@ class Entry implements AC\Registerable { |
| 34 | $this->default_columns_repository = $default_columns_repository; | 34 | $this->default_columns_repository = $default_columns_repository; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | public function register() { | 37 | public function register(): void |
| 38 | { | ||
| 38 | add_filter( 'gform_entry_list_columns', [ $this, 'remove_selector_column' ], 11, 2 ); | 39 | add_filter( 'gform_entry_list_columns', [ $this, 'remove_selector_column' ], 11, 2 ); |
| 39 | add_filter( 'acp/editing/result', [ $this, 'get_editing_ajax_value' ], 10, 3 ); | 40 | add_filter( 'acp/editing/result', [ $this, 'get_editing_ajax_value' ], 10, 3 ); |
| 40 | add_action( 'ac/table/list_screen', [ $this, 'create_default_list_screen' ], 9 ); | 41 | add_action( 'ac/table/list_screen', [ $this, 'create_default_list_screen' ], 9 ); | ... | ... |
| ... | @@ -8,37 +8,39 @@ use ACA\JetEngine\Field\Field; | ... | @@ -8,37 +8,39 @@ use ACA\JetEngine\Field\Field; |
| 8 | use ACA\JetEngine\Service\ColumnGroups; | 8 | use ACA\JetEngine\Service\ColumnGroups; |
| 9 | use ACP; | 9 | use ACP; |
| 10 | 10 | ||
| 11 | class Meta extends AC\Column implements ACP\Export\Exportable { | 11 | class Meta extends AC\Column implements ACP\Export\Exportable |
| 12 | { | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * @var Field | 15 | * @var Field |
| 15 | */ | 16 | */ |
| 16 | protected $field; | 17 | protected $field; |
| 17 | 18 | ||
| 18 | public function __construct() { | 19 | public function __construct() |
| 19 | $this->set_group( ColumnGroups::JET_ENGINE ) | 20 | { |
| 20 | ->set_label( 'JetEngine Meta' ); | 21 | $this->set_group(ColumnGroups::JET_ENGINE) |
| 22 | ->set_label('JetEngine Meta'); | ||
| 21 | } | 23 | } |
| 22 | 24 | ||
| 23 | public function get_raw_value( $id ) { | 25 | public function get_raw_value($id) |
| 24 | return get_metadata( $this->list_screen->get_meta_type(), $id, $this->get_type(), true ); | 26 | { |
| 25 | } | 27 | return get_metadata($this->list_screen->get_meta_type(), $id, $this->get_type(), true); |
| 26 | |||
| 27 | protected function get_meta_type() { | ||
| 28 | return $this->list_screen->get_meta_type(); | ||
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | // Delayed constructor | 30 | // Delayed constructor |
| 32 | public function set_field( Field $field ) { | 31 | public function set_field(Field $field) |
| 32 | { | ||
| 33 | $this->field = $field; | 33 | $this->field = $field; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | protected function get_meta_key() { | 36 | protected function get_meta_key() |
| 37 | { | ||
| 37 | return $this->get_type(); | 38 | return $this->get_type(); |
| 38 | } | 39 | } |
| 39 | 40 | ||
| 40 | public function export() { | 41 | public function export() |
| 41 | return ( new Export\ModelFactory() )->create( $this, $this->field ) ?: false; | 42 | { |
| 43 | return (new Export\ModelFactory())->create($this, $this->field) ?: false; | ||
| 42 | } | 44 | } |
| 43 | 45 | ||
| 44 | } | 46 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -15,30 +15,43 @@ use ACP; | ... | @@ -15,30 +15,43 @@ use ACP; |
| 15 | * @property Field\Type\Posts $field | 15 | * @property Field\Type\Posts $field |
| 16 | */ | 16 | */ |
| 17 | class Post extends Column\Meta | 17 | class Post extends Column\Meta |
| 18 | implements ACP\Search\Searchable, ACP\Editing\Editable, ACP\Sorting\Sortable, ACP\ConditionalFormat\Formattable { | 18 | implements ACP\Search\Searchable, ACP\Editing\Editable, ACP\Sorting\Sortable, ACP\ConditionalFormat\Formattable |
| 19 | { | ||
| 19 | 20 | ||
| 20 | use SearchableTrait, | 21 | use SearchableTrait; |
| 21 | EditableTrait, | 22 | use EditableTrait; |
| 22 | DefaultValueFormatterTrait, | 23 | use DefaultValueFormatterTrait; |
| 23 | ACP\ConditionalFormat\FilteredHtmlFormatTrait; | 24 | use ACP\ConditionalFormat\FilteredHtmlFormatTrait; |
| 24 | 25 | ||
| 25 | protected function register_settings() { | 26 | protected function register_settings() |
| 26 | $this->add_setting( new Settings\Column\Post( $this ) ); | 27 | { |
| 28 | $this->add_setting(new Settings\Column\Post($this)); | ||
| 27 | } | 29 | } |
| 28 | 30 | ||
| 29 | /** | 31 | /** |
| 30 | * @return Settings\Column\Post | 32 | * @return Settings\Column\Post |
| 31 | */ | 33 | */ |
| 32 | private function get_post_setting() { | 34 | private function get_post_setting() |
| 33 | $setting = $this->get_setting( Settings\Column\Post::NAME ); | 35 | { |
| 36 | $setting = $this->get_setting(Settings\Column\Post::NAME); | ||
| 34 | 37 | ||
| 35 | return $setting instanceof Settings\Column\Post | 38 | return $setting instanceof Settings\Column\Post |
| 36 | ? $setting | 39 | ? $setting |
| 37 | : null; | 40 | : null; |
| 38 | } | 41 | } |
| 39 | 42 | ||
| 40 | public function sorting() { | 43 | public function sorting() |
| 41 | return ( new Sorting\ModelFactory\Post )->create( $this->get_meta_type(), $this->get_meta_key(), $this->field->is_multiple(), $this->get_post_setting() ); | 44 | { |
| 45 | return (new Sorting\ModelFactory\Post())->create( | ||
| 46 | $this->get_meta_type(), | ||
| 47 | $this->get_meta_key(), | ||
| 48 | $this->field->is_multiple(), | ||
| 49 | $this->get_post_setting(), | ||
| 50 | [ | ||
| 51 | 'taxonomy' => $this->get_taxonomy(), | ||
| 52 | 'post_type' => $this->get_post_type(), | ||
| 53 | ] | ||
| 54 | ); | ||
| 42 | } | 55 | } |
| 43 | 56 | ||
| 44 | } | 57 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -6,7 +6,6 @@ use ACA\JetEngine\Column; | ... | @@ -6,7 +6,6 @@ use ACA\JetEngine\Column; |
| 6 | use ACA\JetEngine\Editing; | 6 | use ACA\JetEngine\Editing; |
| 7 | use ACA\JetEngine\Search; | 7 | use ACA\JetEngine\Search; |
| 8 | use ACA\JetEngine\Sorting; | 8 | use ACA\JetEngine\Sorting; |
| 9 | use ACA\JetEngine\Value\DefaultValueFormatterTrait; | ||
| 10 | use ACP; | 9 | use ACP; |
| 11 | 10 | ||
| 12 | class Switcher extends Column\Meta implements ACP\Search\Searchable, ACP\Editing\Editable, ACP\Sorting\Sortable { | 11 | class Switcher extends Column\Meta implements ACP\Search\Searchable, ACP\Editing\Editable, ACP\Sorting\Sortable { | ... | ... |
| ... | @@ -2,8 +2,6 @@ | ... | @@ -2,8 +2,6 @@ |
| 2 | 2 | ||
| 3 | namespace ACA\JetEngine; | 3 | namespace ACA\JetEngine; |
| 4 | 4 | ||
| 5 | use ACA\JetEngine\Field; | ||
| 6 | |||
| 7 | final class FieldFactory { | 5 | final class FieldFactory { |
| 8 | 6 | ||
| 9 | public function create( array $settings ): ?Field\Field { | 7 | public function create( array $settings ): ?Field\Field { | ... | ... |
| ... | @@ -3,49 +3,62 @@ | ... | @@ -3,49 +3,62 @@ |
| 3 | namespace ACA\JetEngine; | 3 | namespace ACA\JetEngine; |
| 4 | 4 | ||
| 5 | use AC\ListScreen; | 5 | use AC\ListScreen; |
| 6 | use ACA\JetEngine\Column; | ||
| 7 | use ACA\JetEngine\Field\Field; | 6 | use ACA\JetEngine\Field\Field; |
| 8 | use ACA\JetEngine\Utils\Api; | 7 | use ACA\JetEngine\Utils\Api; |
| 9 | use ACP; | 8 | use ACP; |
| 10 | 9 | ||
| 11 | final class FieldRepository { | 10 | final class FieldRepository |
| 11 | { | ||
| 12 | 12 | ||
| 13 | /** | 13 | /** |
| 14 | * @var FieldFactory | 14 | * @var FieldFactory |
| 15 | */ | 15 | */ |
| 16 | private $field_factory; | 16 | private $field_factory; |
| 17 | 17 | ||
| 18 | public function __construct() { | 18 | /** |
| 19 | * @var ListScreen | ||
| 20 | */ | ||
| 21 | private $list_screen; | ||
| 22 | |||
| 23 | public function __construct(ListScreen $list_screen) | ||
| 24 | { | ||
| 25 | $this->list_screen = $list_screen; | ||
| 19 | $this->field_factory = new FieldFactory(); | 26 | $this->field_factory = new FieldFactory(); |
| 20 | } | 27 | } |
| 21 | 28 | ||
| 22 | public function find_by_column( Column\Meta $column ): ?Field { | 29 | public function find_by_column(Column\Meta $column): ?Field |
| 23 | $fields = $this->find_by_list_screen( $column->get_list_screen() ); | 30 | { |
| 31 | $fields = $this->find_all(); | ||
| 24 | 32 | ||
| 25 | if ( empty( $fields ) ) { | 33 | if (empty($fields)) { |
| 26 | return null; | 34 | return null; |
| 27 | } | 35 | } |
| 28 | 36 | ||
| 29 | $field = array_filter( $fields, static function ( $field ) use ( $column ) { | 37 | $field = array_filter($fields, static function ($field) use ($column) { |
| 30 | return $field->get_name() === $column->get_type(); | 38 | return $field->get_name() === $column->get_type(); |
| 31 | } ); | 39 | }); |
| 32 | 40 | ||
| 33 | return empty( $field ) ? null : current( $field ); | 41 | return empty($field) ? null : current($field); |
| 34 | } | 42 | } |
| 35 | 43 | ||
| 36 | /** | 44 | /** |
| 37 | * @return Field[] | 45 | * @return Field[] |
| 38 | */ | 46 | */ |
| 39 | public function find_by_list_screen( ListScreen $list_screen ): array { | 47 | public function find_all(): array |
| 40 | switch ( true ) { | 48 | { |
| 41 | case $list_screen instanceof ListScreen\Post: | 49 | switch (true) { |
| 42 | return $this->map_meta_types( Api::MetaBox()->get_fields_for_context( 'post_type', $list_screen->get_post_type() ) ); | 50 | case $this->list_screen instanceof ListScreen\Post: |
| 43 | case $list_screen instanceof ACP\ListScreen\Taxonomy: | 51 | return $this->map_meta_types( |
| 44 | return $this->map_meta_types( Api::MetaBox()->get_fields_for_context( 'taxonomy', $list_screen->get_taxonomy() ) ); | 52 | Api::MetaBox()->get_fields_for_context('post_type', $this->list_screen->get_post_type()) |
| 45 | case $list_screen instanceof ACP\ListScreen\User: | 53 | ); |
| 46 | $fields = array_merge( ...array_values( Api::MetaBox()->get_fields_for_context( 'user' ) ) ); | 54 | case $this->list_screen instanceof ACP\ListScreen\Taxonomy: |
| 47 | 55 | return $this->map_meta_types( | |
| 48 | return $this->map_meta_types( $fields ); | 56 | Api::MetaBox()->get_fields_for_context('taxonomy', $this->list_screen->get_taxonomy()) |
| 57 | ); | ||
| 58 | case $this->list_screen instanceof ACP\ListScreen\User: | ||
| 59 | $fields = array_merge(...array_values(Api::MetaBox()->get_fields_for_context('user'))); | ||
| 60 | |||
| 61 | return $this->map_meta_types($fields); | ||
| 49 | } | 62 | } |
| 50 | 63 | ||
| 51 | return []; | 64 | return []; |
| ... | @@ -54,16 +67,17 @@ final class FieldRepository { | ... | @@ -54,16 +67,17 @@ final class FieldRepository { |
| 54 | /** | 67 | /** |
| 55 | * @return Field[] | 68 | * @return Field[] |
| 56 | */ | 69 | */ |
| 57 | private function map_meta_types( array $meta_types ): array { | 70 | private function map_meta_types(array $meta_types): array |
| 71 | { | ||
| 58 | $fields = []; | 72 | $fields = []; |
| 59 | 73 | ||
| 60 | foreach ( $meta_types as $field ) { | 74 | foreach ($meta_types as $field) { |
| 61 | if ( isset( $field['object_type'] ) && $field['object_type'] === 'field' ) { | 75 | if (isset($field['object_type']) && $field['object_type'] === 'field') { |
| 62 | $fields[] = $this->field_factory->create( $field ); | 76 | $fields[] = $this->field_factory->create($field); |
| 63 | } | 77 | } |
| 64 | } | 78 | } |
| 65 | 79 | ||
| 66 | return array_filter( $fields ); | 80 | return array_filter($fields); |
| 67 | } | 81 | } |
| 68 | 82 | ||
| 69 | } | 83 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -4,43 +4,45 @@ namespace ACA\JetEngine; | ... | @@ -4,43 +4,45 @@ namespace ACA\JetEngine; |
| 4 | 4 | ||
| 5 | use AC; | 5 | use AC; |
| 6 | use AC\Registerable; | 6 | use AC\Registerable; |
| 7 | use AC\Services; | ||
| 7 | use ACP\Service\IntegrationStatus; | 8 | use ACP\Service\IntegrationStatus; |
| 8 | 9 | ||
| 9 | class JetEngine implements Registerable { | 10 | class JetEngine implements Registerable |
| 11 | { | ||
| 10 | 12 | ||
| 11 | private $location; | 13 | private $location; |
| 12 | 14 | ||
| 13 | public function __construct( AC\Asset\Location\Absolute $location ) { | 15 | public function __construct(AC\Asset\Location\Absolute $location) |
| 16 | { | ||
| 14 | $this->location = $location; | 17 | $this->location = $location; |
| 15 | } | 18 | } |
| 16 | 19 | ||
| 17 | public function register() { | 20 | public function register(): void |
| 18 | if ( ! class_exists( 'Jet_Engine', false ) || ! $this->check_minimum_jet_engine_version() ) { | 21 | { |
| 22 | if ( ! class_exists('Jet_Engine', false) || ! $this->check_minimum_jet_engine_version()) { | ||
| 19 | return; | 23 | return; |
| 20 | } | 24 | } |
| 21 | 25 | ||
| 22 | $services = [ | 26 | $this->create_services()->register(); |
| 23 | new Service\Admin( $this->location ), | 27 | } |
| 24 | new Service\ColumnInstantiate, | 28 | |
| 25 | new Service\ColumnGroups, | 29 | private function create_services(): Services |
| 30 | { | ||
| 31 | return new Services([ | ||
| 32 | new Service\Admin($this->location), | ||
| 33 | new Service\ColumnInstantiate(), | ||
| 34 | new Service\ColumnGroups(), | ||
| 26 | new Service\RelationalColumns(), | 35 | new Service\RelationalColumns(), |
| 27 | new Service\MetaColumns(), | 36 | new Service\MetaColumns(), |
| 28 | new IntegrationStatus( 'ac-addon-jetengine' ), | 37 | new IntegrationStatus('ac-addon-jetengine'), |
| 29 | ]; | 38 | ]); |
| 30 | |||
| 31 | foreach ( $services as $service ) { | ||
| 32 | if ( $service instanceof Registerable ) { | ||
| 33 | $service->register(); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | private function check_minimum_jet_engine_version(): bool { | 41 | private function check_minimum_jet_engine_version(): bool |
| 42 | { | ||
| 39 | $jet_engine = jet_engine(); | 43 | $jet_engine = jet_engine(); |
| 40 | 44 | ||
| 41 | return $jet_engine | 45 | return $jet_engine && version_compare($jet_engine->get_version(), '2.11.0', '>='); |
| 42 | ? version_compare( $jet_engine->get_version(), '2.11.0', '>=' ) | ||
| 43 | : false; | ||
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | } | 48 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -19,7 +19,8 @@ final class Admin implements AC\Registerable { | ... | @@ -19,7 +19,8 @@ final class Admin implements AC\Registerable { |
| 19 | $this->location = $location; | 19 | $this->location = $location; |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | public function register() { | 22 | public function register(): void |
| 23 | { | ||
| 23 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | 24 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); |
| 24 | } | 25 | } |
| 25 | 26 | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Column/MetaBox/CustomTable.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Column/MetaBox/NumberOfFields.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Column/PostType/Description.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Column/PostType/PluralName.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Column/PostType/Taxonomies.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Export/Model/StrippedValue.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Setting/SubFieldSettingFactory.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Value/Formatter/FormattedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Value/Formatter/SettingFormatter.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/metabox/classes/Value/ValueFormatterFactory.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/CouponsUsed.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/CreatedVersion.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/CreatedVia.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Currency.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Customer.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/CustomerNote.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Date/CompletedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Date/CreatedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Date/ModifiedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Date/PaidDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Discount.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Downloads.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/IsCustomer.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/OrderNumber.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/Billing.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/Date.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/ShipTo.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/Status.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Original/Total.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/PaidAmount.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/PaymentMethod.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/ProductTaxonomy.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Purchased.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Shipping.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/ShippingMethod.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/Subtotal.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/TotalWeight.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Order/TransactionId.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Product/BackordersAllowed.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Product/DefaultFormValues.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/Product/ShopOrder/Sales.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/ProductVariation/Taxonomy.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/ShopOrder/ProductTaxonomy.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/CouponsUsed.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/FirstOrder.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/LastOrder.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/OrderCount.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/Orders.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/Products.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Column/User/ShopOrder/TotalSales.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Editing/OrderSubscription/Date.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Editing/Product/Featured.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Editing/Storage/Order/Status.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Editing/Strategy/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Editing/TableRows/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Export/Order/OrderTitle.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Export/OrderSubscription/Total.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Export/Strategy/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Export/StrippedTableValue.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/ListScreen/OrderSubscription.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/ListScreenFactory/OrderFactory.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/ListScreenFactory/ProductFactory.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/ListTable/ManageValue/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Address/FullAddress.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Address/FullName.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Addresses.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/CreatedVersion.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/CreatedVia.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Currency.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Customer.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/CustomerIp.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Date/CompletedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Date/CreatedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Date/ModifiedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Date/PaidDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/Discount.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/IsCustomer.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/PaymentMethod.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/ProductTaxonomy.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/ShippingTotal.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Order/TransactionId.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/Product/Order/OrderCount.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/TableScreen/Order.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/User/ShopOrder/OrderCount.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/User/ShopOrder/Products.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Search/User/ShopOrder/TotalSales.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Service/Compatibility.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Service/Subscriptions.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Service/SubscriptionsPostType.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Settings/ShopOrder/CustomerLink.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/AddressField.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/CustomerField.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/CustomerFullname.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/Date/CompletedDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/Date/PaidDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/FullNameAddress.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/ItemsSold.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/OperationalData.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/OrderBy.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/OrderData.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Order/OrderMeta.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/Product/Order/Customers.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/ShopOrder/ShippingMethod.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/OrderDate.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/OrderExtrema.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/Products.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/ProductsUnique.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/ShopOrder/LastOrder.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Sorting/User/ShopOrder/OrderDate.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Subscriptions.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/classes/Type/OrderSubscriptionTableUrl.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/orders_subscriptions.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/product_variation.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/shoporder/products.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/shoporder/users.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/subscription/products.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/config/columns/subscription/users.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/woocommerce/templates/modal-value/products-by-user.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/yoast-seo/classes/Column/Post/SchemaArticleType.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/addons/yoast-seo/classes/Column/Post/SchemaPageType.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/assets/css/admin-page-settings.css.map
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Admin/Notice/DatabaseMissing.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ApplyFilter/ValidAudioMimetypes.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ApplyFilter/ValidVideoMimetypes.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Controller/AjaxRequestCustomFieldKeys.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Controller/Middleware/ListScreenAdmin.php
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Controller/Middleware/ListScreenTable.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/EncodedListScreenData.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/EncodedListScreenDataFactory.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Exception/InvalidListScreenException.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Exception/SourceNotAvailableException.php
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactory/Aggregate.php
0 → 100644
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactory/BaseFactory.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenFactoryInterface.php
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Filter/Site.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/ListScreenRepository/Sort/UserOrder.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Table/ManageValue/Taxonomy.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Table/PrimaryColumnFactory.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Type/Url/EditorNetworkColumns.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
wp-content/plugins/admin-columns-pro/admin-columns/classes/Type/Url/ListTable/Taxonomy.php
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
No preview for this file type
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment