plugin updates
Showing
1000 changed files
with
1928 additions
and
1818 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; | ||
| 19 | |||
| 20 | final class AdvancedCustomFields implements Registerable | ||
| 21 | { | ||
| 18 | 22 | ||
| 19 | final class AdvancedCustomFields implements Registerable { | 23 | private $location; |
| 20 | 24 | ||
| 21 | private $location; | 25 | private $container; |
| 22 | 26 | ||
| 23 | public function __construct( AC\Asset\Location\Absolute $location ) { | 27 | public function __construct(AC\Asset\Location\Absolute $location, ContainerInterface $container) |
| 24 | $this->location = $location; | 28 | { |
| 25 | } | 29 | $this->location = $location; |
| 30 | $this->container = $container; | ||
| 31 | } | ||
| 26 | 32 | ||
| 27 | public function register() { | 33 | public function register(): void |
| 28 | if ( ! class_exists( 'acf', false ) ) { | 34 | { |
| 29 | return; | 35 | if ( ! class_exists('acf', false)) { |
| 30 | } | 36 | return; |
| 37 | } | ||
| 31 | 38 | ||
| 32 | AC\ListScreenFactory::add( new FieldGroupFactory() ); | 39 | AC\ListScreenFactory\Aggregate::add(new FieldGroupFactory()); |
| 33 | 40 | ||
| 34 | $column_initiator = new ColumnInstantiator( | 41 | $this->create_services()->register(); |
| 35 | new ConfigFactory( new FieldFactory() ), | 42 | } |
| 36 | new Search\ComparisonFactory(), | ||
| 37 | new Sorting\ModelFactory(), | ||
| 38 | new Editing\ModelFactory(), | ||
| 39 | new Filtering\ModelFactory(), | ||
| 40 | new FieldFormattableFactory() | ||
| 41 | ); | ||
| 42 | 43 | ||
| 43 | $request_handler_factory = new RequestHandlerFactory( new Request() ); | 44 | private function create_services(): Services |
| 44 | $request_handler_factory->add( 'aca-acf-map-legacy-list-screen', new MapLegacyListScreen( AC()->get_storage() ) ); | 45 | { |
| 46 | $column_initiator = new ColumnInstantiator( | ||
| 47 | new ConfigFactory(new FieldFactory()), | ||
| 48 | new Search\ComparisonFactory(), | ||
| 49 | new Sorting\ModelFactory(), | ||
| 50 | new Editing\ModelFactory(), | ||
| 51 | new Filtering\ModelFactory(), | ||
| 52 | new FieldFormattableFactory() | ||
| 53 | ); | ||
| 45 | 54 | ||
| 46 | $services = [ | 55 | $request_handler_factory = new RequestHandlerFactory(new Request()); |
| 47 | new ACP\Service\IntegrationStatus( 'ac-addon-acf' ), | 56 | $request_handler_factory->add( |
| 48 | new ColumnGroup(), | 57 | 'aca-acf-map-legacy-list-screen', |
| 49 | new Service\ColumnSettings(), | 58 | new MapLegacyListScreen($this->container->get(Storage::class)) |
| 50 | new Service\EditingFix(), | 59 | ); |
| 51 | new Service\LegacyColumnMapper(), | ||
| 52 | new Service\ListScreens(), | ||
| 53 | new Service\RemoveDeprecatedColumnFromTypeSelector(), | ||
| 54 | new Service\AddColumns( | ||
| 55 | new FieldRepository( new FieldGroup\QueryFactory() ), | ||
| 56 | new FieldsFactory(), | ||
| 57 | new ColumnFactory( $column_initiator ) | ||
| 58 | ), | ||
| 59 | new Service\Scripts( $this->location ), | ||
| 60 | new Service\InitColumn( $column_initiator ), | ||
| 61 | new RequestParser( $request_handler_factory ), | ||
| 62 | ]; | ||
| 63 | 60 | ||
| 64 | array_map( static function ( Registerable $service ) { | 61 | return new Services([ |
| 65 | $service->register(); | 62 | new IntegrationStatus('ac-addon-acf'), |
| 66 | }, $services ); | 63 | new ColumnGroup(), |
| 67 | } | 64 | new Service\ColumnSettings(), |
| 65 | new Service\EditingFix(), | ||
| 66 | new Service\LegacyColumnMapper(), | ||
| 67 | new Service\ListScreens(), | ||
| 68 | new Service\RemoveDeprecatedColumnFromTypeSelector(), | ||
| 69 | new Service\AddColumns( | ||
| 70 | new FieldRepository(new FieldGroup\QueryFactory()), | ||
| 71 | new FieldsFactory(), | ||
| 72 | new ColumnFactory($column_initiator) | ||
| 73 | ), | ||
| 74 | new Service\Scripts($this->location), | ||
| 75 | new Service\InitColumn($column_initiator), | ||
| 76 | new RequestParser($request_handler_factory), | ||
| 77 | ]); | ||
| 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,83 +4,94 @@ namespace ACA\ACF; | ... | @@ -4,83 +4,94 @@ 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 |
| 9 | 10 | { | |
| 10 | /** | 11 | |
| 11 | * @var ColumnInstantiator | 12 | /** |
| 12 | */ | 13 | * @var ColumnInstantiator |
| 13 | private $column_initiator; | 14 | */ |
| 14 | 15 | private $column_initiator; | |
| 15 | /** | 16 | |
| 16 | * @var CloneColumnFactory | 17 | /** |
| 17 | */ | 18 | * @var CloneColumnFactory |
| 18 | private $clone_column_factory; | 19 | */ |
| 19 | 20 | private $clone_column_factory; | |
| 20 | public function __construct( ColumnInstantiator $column_initiator ) { | 21 | |
| 21 | $this->column_initiator = $column_initiator; | 22 | public function __construct(ColumnInstantiator $column_initiator) |
| 22 | $this->clone_column_factory = new CloneColumnFactory( $this ); | 23 | { |
| 23 | } | 24 | $this->column_initiator = $column_initiator; |
| 24 | 25 | $this->clone_column_factory = new CloneColumnFactory($this); | |
| 25 | /** | 26 | } |
| 26 | * @param array $settings | 27 | |
| 27 | * | 28 | /** |
| 28 | * @return Column|null | 29 | * @param array $settings |
| 29 | */ | 30 | * |
| 30 | public function create( array $settings ) { | 31 | * @return Column|null |
| 31 | if ( isset( $settings['_clone'] ) ) { | 32 | */ |
| 32 | return $this->clone_column_factory->create( $settings ); | 33 | public function create(array $settings) |
| 33 | } | 34 | { |
| 34 | 35 | if (isset($settings['_clone'])) { | |
| 35 | switch ( $settings['type'] ) { | 36 | return $this->clone_column_factory->create($settings); |
| 36 | case FieldType::TYPE_GROUP: | 37 | } |
| 37 | return ( new GroupColumnFactory( $this ) )->create( $settings ); | 38 | |
| 38 | 39 | switch ($settings['type']) { | |
| 39 | case FieldType::TYPE_REPEATER: | 40 | case FieldType::TYPE_GROUP: |
| 40 | return $this->create_column( new Repeater(), $settings ); | 41 | return (new GroupColumnFactory($this))->create($settings); |
| 41 | 42 | ||
| 42 | case FieldType::TYPE_BOOLEAN: | 43 | case FieldType::TYPE_REPEATER: |
| 43 | case FieldType::TYPE_BUTTON_GROUP: | 44 | return $this->create_column(new Repeater(), $settings); |
| 44 | case FieldType::TYPE_CHECKBOX: | 45 | |
| 45 | case FieldType::TYPE_COLOR_PICKER: | 46 | case FieldType::TYPE_BOOLEAN: |
| 46 | case FieldType::TYPE_DATE_PICKER: | 47 | case FieldType::TYPE_BUTTON_GROUP: |
| 47 | case FieldType::TYPE_DATE_TIME_PICKER: | 48 | case FieldType::TYPE_CHECKBOX: |
| 48 | case FieldType::TYPE_EMAIL: | 49 | case FieldType::TYPE_COLOR_PICKER: |
| 49 | case FieldType::TYPE_FILE: | 50 | case FieldType::TYPE_DATE_PICKER: |
| 50 | case FieldType::TYPE_FLEXIBLE_CONTENT: | 51 | case FieldType::TYPE_DATE_TIME_PICKER: |
| 51 | case FieldType::TYPE_GALLERY: | 52 | case FieldType::TYPE_EMAIL: |
| 52 | case FieldType::TYPE_GOOGLE_MAP: | 53 | case FieldType::TYPE_FILE: |
| 53 | case FieldType::TYPE_IMAGE: | 54 | case FieldType::TYPE_FLEXIBLE_CONTENT: |
| 54 | case FieldType::TYPE_LINK: | 55 | case FieldType::TYPE_GALLERY: |
| 55 | case FieldType::TYPE_NUMBER: | 56 | case FieldType::TYPE_GOOGLE_MAP: |
| 56 | case FieldType::TYPE_OEMBED: | 57 | case FieldType::TYPE_IMAGE: |
| 57 | case FieldType::TYPE_PAGE_LINK: | 58 | case FieldType::TYPE_LINK: |
| 58 | case FieldType::TYPE_PASSWORD: | 59 | case FieldType::TYPE_NUMBER: |
| 59 | case FieldType::TYPE_POST: | 60 | case FieldType::TYPE_OEMBED: |
| 60 | case FieldType::TYPE_RADIO: | 61 | case FieldType::TYPE_PAGE_LINK: |
| 61 | case FieldType::TYPE_RANGE: | 62 | case FieldType::TYPE_PASSWORD: |
| 62 | case FieldType::TYPE_RELATIONSHIP: | 63 | case FieldType::TYPE_POST: |
| 63 | case FieldType::TYPE_SELECT: | 64 | case FieldType::TYPE_RADIO: |
| 64 | case FieldType::TYPE_TAXONOMY: | 65 | case FieldType::TYPE_RANGE: |
| 65 | case FieldType::TYPE_TEXT: | 66 | case FieldType::TYPE_RELATIONSHIP: |
| 66 | case FieldType::TYPE_TEXTAREA: | 67 | case FieldType::TYPE_SELECT: |
| 67 | case FieldType::TYPE_TIME_PICKER: | 68 | case FieldType::TYPE_TAXONOMY: |
| 68 | case FieldType::TYPE_URL: | 69 | case FieldType::TYPE_TEXT: |
| 69 | case FieldType::TYPE_USER: | 70 | case FieldType::TYPE_TEXTAREA: |
| 70 | case FieldType::TYPE_WYSIWYG: | 71 | case FieldType::TYPE_TIME_PICKER: |
| 71 | return $this->create_column( new Column(), $settings ); | 72 | case FieldType::TYPE_URL: |
| 72 | default: | 73 | case FieldType::TYPE_USER: |
| 73 | return $this->create_column( new Unsupported(), $settings ); | 74 | case FieldType::TYPE_WYSIWYG: |
| 74 | } | 75 | return $this->create_column(new Column(), $settings); |
| 75 | } | 76 | default: |
| 76 | 77 | return $this->create_column(new Unsupported(), $settings); | |
| 77 | private function create_column( Column $column, array $settings ) { | 78 | } |
| 78 | $column->set_label( $settings['label'] ) | 79 | } |
| 79 | ->set_type( $settings['key'] ); | 80 | |
| 80 | 81 | private function create_column(Column $column, array $settings) | |
| 81 | $this->column_initiator->initiate( $column ); | 82 | { |
| 82 | 83 | $column = apply_filters('acp/acf/column', $column, $settings['type'], $settings); | |
| 83 | return $column; | 84 | |
| 84 | } | 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); | ||
| 93 | |||
| 94 | return $column; | ||
| 95 | } | ||
| 85 | 96 | ||
| 86 | } | 97 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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,28 +6,31 @@ use ACA\ACF; | ... | @@ -6,28 +6,31 @@ 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 | { |
| 19 | Column\CustomField::class, | 21 | $this->register_column_types_from_list([ |
| 20 | Column\Actions::class, | 22 | Column\CustomField::class, |
| 21 | Column\Post\Author::class, | 23 | Column\Actions::class, |
| 22 | Column\Post\Content::class, | 24 | Column\Post\Author::class, |
| 23 | Column\Post\DatePublished::class, | 25 | Column\Post\Content::class, |
| 24 | Column\Post\ID::class, | 26 | Column\Post\DatePublished::class, |
| 25 | Column\Post\Modified::class, | 27 | Column\Post\ID::class, |
| 26 | Column\Post\Status::class, | 28 | Column\Post\Modified::class, |
| 27 | Column\Post\Title::class, | 29 | Column\Post\Status::class, |
| 28 | Column\Post\TitleRaw::class, | 30 | Column\Post\Title::class, |
| 29 | ACF\Column\FieldGroup\Location::class, | 31 | Column\Post\TitleRaw::class, |
| 30 | ] ); | 32 | ACF\Column\FieldGroup\Location::class, |
| 31 | } | 33 | ]); |
| 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 |
| 14 | { | ||
| 15 | return 'acf-field-group' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'acf-field-group' === $key; | 19 | { |
| 18 | } | 20 | return new FieldGroup(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'acf-field-group'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new FieldGroup(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return new FieldGroup(); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'acf-field-group'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new FieldGroup(), $settings ); | ||
| 38 | } | ||
| 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']); |
| 15 | } | 17 | add_filter('ac/export/value', [$this, 'strip_tags_export_value'], 10, 4); |
| 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()) { |
| 20 | } | 23 | $value = strip_tags($value); |
| 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 | { |
| 27 | } | 31 | $groups->add('acf', __('Advanced Custom Fields', 'codepress-admin-columns'), 7); |
| 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,71 +8,116 @@ use ACA\ACF\FieldType; | ... | @@ -8,71 +8,116 @@ 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 | public function create( Field $field, $meta_key, Column $column ) { | 13 | |
| 14 | $meta_type = $column->get_meta_type(); | 14 | public function create(Field $field, $meta_key, Column $column) |
| 15 | 15 | { | |
| 16 | switch ( $field->get_type() ) { | 16 | $meta_type = $column->get_meta_type(); |
| 17 | case FieldType::TYPE_NUMBER: | 17 | |
| 18 | case FieldType::TYPE_RANGE: | 18 | switch ($field->get_type()) { |
| 19 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::DECIMAL ) ); | 19 | case FieldType::TYPE_NUMBER: |
| 20 | 20 | case FieldType::TYPE_RANGE: | |
| 21 | case FieldType::TYPE_TEXT: | 21 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 22 | case FieldType::TYPE_TEXTAREA: | 22 | $meta_type, |
| 23 | case FieldType::TYPE_WYSIWYG: | 23 | $meta_key, |
| 24 | case FieldType::TYPE_EMAIL: | 24 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::DECIMAL) |
| 25 | case FieldType::TYPE_COLOR_PICKER: | 25 | ); |
| 26 | case FieldType::TYPE_OEMBED: | 26 | |
| 27 | case FieldType::TYPE_URL: | 27 | case FieldType::TYPE_TEXT: |
| 28 | case FieldType::TYPE_PASSWORD: | 28 | case FieldType::TYPE_TEXTAREA: |
| 29 | case FieldType::TYPE_TIME_PICKER: | 29 | case FieldType::TYPE_WYSIWYG: |
| 30 | case FieldType::TYPE_IMAGE: | 30 | case FieldType::TYPE_EMAIL: |
| 31 | case FieldType::TYPE_BOOLEAN: | 31 | case FieldType::TYPE_COLOR_PICKER: |
| 32 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key ); | 32 | case FieldType::TYPE_OEMBED: |
| 33 | 33 | case FieldType::TYPE_URL: | |
| 34 | case FieldType::TYPE_DATE_PICKER: | 34 | case FieldType::TYPE_PASSWORD: |
| 35 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::NUMERIC ) ); | 35 | case FieldType::TYPE_TIME_PICKER: |
| 36 | 36 | case FieldType::TYPE_IMAGE: | |
| 37 | case FieldType::TYPE_DATE_TIME_PICKER: | 37 | case FieldType::TYPE_BOOLEAN: |
| 38 | return ( new ACP\Sorting\Model\MetaFactory() )->create( $meta_type, $meta_key, new ACP\Sorting\Type\DataType( ACP\Sorting\Type\DataType::DATETIME ) ); | 38 | return (new ACP\Sorting\Model\MetaFactory())->create($meta_type, $meta_key); |
| 39 | 39 | ||
| 40 | case FieldType::TYPE_CHECKBOX: | 40 | case FieldType::TYPE_DATE_PICKER: |
| 41 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 41 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 42 | 42 | $meta_type, | |
| 43 | return ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\Select( $choices ) ); | 43 | $meta_key, |
| 44 | case FieldType::TYPE_FILE: | 44 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::NUMERIC) |
| 45 | return ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\File() ); | 45 | ); |
| 46 | 46 | ||
| 47 | case FieldType::TYPE_RADIO: | 47 | case FieldType::TYPE_DATE_TIME_PICKER: |
| 48 | case FieldType::TYPE_BUTTON_GROUP: | 48 | return (new ACP\Sorting\Model\MetaFactory())->create( |
| 49 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 49 | $meta_type, |
| 50 | natcasesort( $choices ); | 50 | $meta_key, |
| 51 | 51 | new ACP\Sorting\Type\DataType(ACP\Sorting\Type\DataType::DATETIME) | |
| 52 | return ( new ACP\Sorting\Model\MetaMappingFactory )->create( $meta_type, $meta_key, array_keys( $choices ) ); | 52 | ); |
| 53 | 53 | ||
| 54 | case FieldType::TYPE_SELECT: | 54 | case FieldType::TYPE_CHECKBOX: |
| 55 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | 55 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; |
| 56 | natcasesort( $choices ); | 56 | |
| 57 | 57 | return (new ACP\Sorting\Model\MetaFormatFactory())->create( | |
| 58 | return $field instanceof Field\Multiple && $field->is_multiple() | 58 | $meta_type, |
| 59 | ? ( new ACP\Sorting\Model\MetaFormatFactory() )->create( $meta_type, $meta_key, new Sorting\FormatValue\Select( $choices ) ) | 59 | $meta_key, |
| 60 | : ( new ACP\Sorting\Model\MetaMappingFactory )->create( $meta_type, $meta_key, array_keys( $choices ) ); | 60 | new Sorting\FormatValue\Select($choices), |
| 61 | 61 | null, | |
| 62 | case FieldType::TYPE_RELATIONSHIP: | 62 | [ |
| 63 | case FieldType::TYPE_POST: | 63 | 'post_type' => $column->get_post_type(), |
| 64 | case FieldType::TYPE_PAGE_LINK: | 64 | 'taxonomy' => $column->get_taxonomy(), |
| 65 | return ( new Sorting\ModelFactory\Relation() )->create( $field, $meta_key, $column ); | 65 | ] |
| 66 | 66 | ); | |
| 67 | case FieldType::TYPE_USER: | 67 | case FieldType::TYPE_FILE: |
| 68 | return ( new Sorting\ModelFactory\User() )->create( $field, $meta_key, $column ); | 68 | return (new ACP\Sorting\Model\MetaFormatFactory())->create( |
| 69 | 69 | $meta_type, | |
| 70 | case FieldType::TYPE_TAXONOMY: | 70 | $meta_key, |
| 71 | return ( new Sorting\ModelFactory\Taxonomy() )->create( $field, $meta_key, $column ); | 71 | new Sorting\FormatValue\File(), |
| 72 | 72 | null, | |
| 73 | default: | 73 | [ |
| 74 | return new ACP\Sorting\Model\Disabled(); | 74 | 'post_type' => $column->get_post_type(), |
| 75 | } | 75 | 'taxonomy' => $column->get_taxonomy(), |
| 76 | } | 76 | ] |
| 77 | ); | ||
| 78 | |||
| 79 | case FieldType::TYPE_RADIO: | ||
| 80 | case FieldType::TYPE_BUTTON_GROUP: | ||
| 81 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | ||
| 82 | natcasesort($choices); | ||
| 83 | |||
| 84 | return (new ACP\Sorting\Model\MetaMappingFactory())->create( | ||
| 85 | $meta_type, | ||
| 86 | $meta_key, | ||
| 87 | array_keys($choices) | ||
| 88 | ); | ||
| 89 | |||
| 90 | case FieldType::TYPE_SELECT: | ||
| 91 | $choices = $field instanceof Field\Choices ? $field->get_choices() : []; | ||
| 92 | natcasesort($choices); | ||
| 93 | |||
| 94 | return $field instanceof Field\Multiple && $field->is_multiple() | ||
| 95 | ? (new ACP\Sorting\Model\MetaFormatFactory())->create( | ||
| 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)); | ||
| 106 | |||
| 107 | case FieldType::TYPE_RELATIONSHIP: | ||
| 108 | case FieldType::TYPE_POST: | ||
| 109 | case FieldType::TYPE_PAGE_LINK: | ||
| 110 | return (new Sorting\ModelFactory\Relation())->create($field, $meta_key, $column); | ||
| 111 | |||
| 112 | case FieldType::TYPE_USER: | ||
| 113 | return (new Sorting\ModelFactory\User())->create($field, $meta_key, $column); | ||
| 114 | |||
| 115 | case FieldType::TYPE_TAXONOMY: | ||
| 116 | return (new Sorting\ModelFactory\Taxonomy())->create($field, $meta_key, $column); | ||
| 117 | |||
| 118 | default: | ||
| 119 | return new ACP\Sorting\Model\Disabled(); | ||
| 120 | } | ||
| 121 | } | ||
| 77 | 122 | ||
| 78 | } | 123 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -12,52 +12,67 @@ use ACP\Sorting\Model\Disabled; | ... | @@ -12,52 +12,67 @@ 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 | * @var MetaFormatFactory | 18 | /** |
| 19 | */ | 19 | * @var MetaFormatFactory |
| 20 | private $meta_format_factory; | 20 | */ |
| 21 | 21 | private $meta_format_factory; | |
| 22 | public function __construct() { | 22 | |
| 23 | $this->meta_format_factory = new MetaFormatFactory(); | 23 | public function __construct() |
| 24 | } | 24 | { |
| 25 | 25 | $this->meta_format_factory = new MetaFormatFactory(); | |
| 26 | public function create( Field $field, $meta_key, Column $column ) { | 26 | } |
| 27 | return $field instanceof Field\Multiple && $field->is_multiple() | 27 | |
| 28 | ? $this->create_multiple_relation_model( $column, $meta_key ) | 28 | public function create(Field $field, $meta_key, Column $column) |
| 29 | : $this->create_single_relation_model( $column, $meta_key ); | 29 | { |
| 30 | } | 30 | return $field instanceof Field\Multiple && $field->is_multiple() |
| 31 | 31 | ? $this->create_multiple_relation_model($column, $meta_key) | |
| 32 | private function create_single_relation_model( Column $column, $meta_key ) { | 32 | : $this->create_single_relation_model($column, $meta_key); |
| 33 | $setting = $column->get_setting( AC\Settings\Column\Post::NAME ); | 33 | } |
| 34 | 34 | ||
| 35 | if ( ! $setting ) { | 35 | private function create_single_relation_model(Column $column, $meta_key) |
| 36 | return new Disabled(); | 36 | { |
| 37 | } | 37 | $setting = $column->get_setting(AC\Settings\Column\Post::NAME); |
| 38 | 38 | ||
| 39 | $model = ( new MetaRelatedPostFactory() )->create( | 39 | if ( ! $setting) { |
| 40 | $column->get_meta_type(), | 40 | return new Disabled(); |
| 41 | $setting->get_value(), | 41 | } |
| 42 | $meta_key | 42 | |
| 43 | ); | 43 | $model = (new MetaRelatedPostFactory())->create( |
| 44 | 44 | $column->get_meta_type(), | |
| 45 | return $model | 45 | $setting->get_value(), |
| 46 | ?: $this->meta_format_factory->create( | 46 | $meta_key |
| 47 | $column->get_meta_type(), | 47 | ); |
| 48 | $meta_key, | 48 | |
| 49 | new SettingFormatter( $setting ) | 49 | return $model |
| 50 | ); | 50 | ?: $this->meta_format_factory->create( |
| 51 | } | 51 | $column->get_meta_type(), |
| 52 | 52 | $meta_key, | |
| 53 | private function create_multiple_relation_model( Column $column, $meta_key ) { | 53 | new SettingFormatter($setting), |
| 54 | $setting = $column->get_setting( AC\Settings\Column\Post::NAME ); | 54 | null, |
| 55 | 55 | [ | |
| 56 | return $this->meta_format_factory->create( | 56 | 'taxonomy' => $column->get_taxonomy(), |
| 57 | $column->get_meta_type(), | 57 | 'post_type' => $column->get_post_type(), |
| 58 | $meta_key, | 58 | ] |
| 59 | new SerializedSettingFormatter( new SettingFormatter( $setting ) ) | 59 | ); |
| 60 | ); | 60 | } |
| 61 | } | 61 | |
| 62 | private function create_multiple_relation_model(Column $column, $meta_key) | ||
| 63 | { | ||
| 64 | $setting = $column->get_setting(AC\Settings\Column\Post::NAME); | ||
| 65 | |||
| 66 | return $this->meta_format_factory->create( | ||
| 67 | $column->get_meta_type(), | ||
| 68 | $meta_key, | ||
| 69 | new SerializedSettingFormatter(new SettingFormatter($setting)), | ||
| 70 | null, | ||
| 71 | [ | ||
| 72 | 'taxonomy' => $column->get_taxonomy(), | ||
| 73 | 'post_type' => $column->get_post_type(), | ||
| 74 | ] | ||
| 75 | ); | ||
| 76 | } | ||
| 62 | 77 | ||
| 63 | } | 78 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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 | { |
| 14 | return new ACP\Sorting\Model\Disabled(); | 15 | if ( ! $field instanceof Field\Type\Taxonomy) { |
| 15 | } | 16 | return new ACP\Sorting\Model\Disabled(); |
| 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( |
| 22 | } | 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 | ); | ||
| 33 | } | ||
| 23 | 34 | ||
| 24 | } | 35 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -9,50 +9,65 @@ use ACA\ACF\Sorting\SortingModelFactory; | ... | @@ -9,50 +9,65 @@ 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 | * @var ACP\Sorting\Model\MetaFormatFactory | 15 | /** |
| 16 | */ | 16 | * @var ACP\Sorting\Model\MetaFormatFactory |
| 17 | private $meta_format_factory; | 17 | */ |
| 18 | 18 | private $meta_format_factory; | |
| 19 | public function __construct() { | 19 | |
| 20 | $this->meta_format_factory = new ACP\Sorting\Model\MetaFormatFactory(); | 20 | public function __construct() |
| 21 | } | 21 | { |
| 22 | 22 | $this->meta_format_factory = new ACP\Sorting\Model\MetaFormatFactory(); | |
| 23 | public function create( Field $field, $meta_key, Column $column ) { | 23 | } |
| 24 | return $field instanceof Field\Multiple && $field->is_multiple() | 24 | |
| 25 | ? $this->create_multiple_relation_model( $column, $meta_key ) | 25 | public function create(Field $field, $meta_key, Column $column) |
| 26 | : $this->create_single_relation_model( $column, $meta_key ); | 26 | { |
| 27 | } | 27 | return $field instanceof Field\Multiple && $field->is_multiple() |
| 28 | 28 | ? $this->create_multiple_relation_model($column, $meta_key) | |
| 29 | private function create_single_relation_model( Column $column, $meta_key ) { | 29 | : $this->create_single_relation_model($column, $meta_key); |
| 30 | $setting = $column->get_setting( AC\Settings\Column\User::NAME ); | 30 | } |
| 31 | 31 | ||
| 32 | $model = ( new MetaRelatedUserFactory() )->create( | 32 | private function create_single_relation_model(Column $column, $meta_key) |
| 33 | $column->get_meta_type(), | 33 | { |
| 34 | $setting->get_value(), | 34 | $setting = $column->get_setting(AC\Settings\Column\User::NAME); |
| 35 | $meta_key | 35 | |
| 36 | ); | 36 | $model = (new MetaRelatedUserFactory())->create( |
| 37 | 37 | $column->get_meta_type(), | |
| 38 | return $model | 38 | (string)$setting->get_value(), |
| 39 | ?: $this->meta_format_factory->create( | 39 | $meta_key |
| 40 | $column->get_meta_type(), | 40 | ); |
| 41 | $meta_key, | 41 | |
| 42 | new ACP\Sorting\FormatValue\SettingFormatter( $setting ) | 42 | return $model |
| 43 | ); | 43 | ?: $this->meta_format_factory->create( |
| 44 | } | 44 | $column->get_meta_type(), |
| 45 | 45 | $meta_key, | |
| 46 | private function create_multiple_relation_model( Column $column, $meta_key ) { | 46 | new ACP\Sorting\FormatValue\SettingFormatter($setting), |
| 47 | $setting = $column->get_setting( AC\Settings\Column\User::NAME ); | 47 | null, |
| 48 | 48 | [ | |
| 49 | return $this->meta_format_factory->create( | 49 | 'taxonomy' => $column->get_taxonomy(), |
| 50 | $column->get_meta_type(), | 50 | 'post_type' => $column->get_post_type(), |
| 51 | $meta_key, | 51 | ] |
| 52 | new ACP\Sorting\FormatValue\SerializedSettingFormatter( | 52 | ); |
| 53 | new ACP\Sorting\FormatValue\SettingFormatter( $setting ) | 53 | } |
| 54 | ) | 54 | |
| 55 | ); | 55 | private function create_multiple_relation_model(Column $column, $meta_key) |
| 56 | } | 56 | { |
| 57 | $setting = $column->get_setting(AC\Settings\Column\User::NAME); | ||
| 58 | |||
| 59 | return $this->meta_format_factory->create( | ||
| 60 | $column->get_meta_type(), | ||
| 61 | $meta_key, | ||
| 62 | new ACP\Sorting\FormatValue\SerializedSettingFormatter( | ||
| 63 | new ACP\Sorting\FormatValue\SettingFormatter($setting) | ||
| 64 | ), | ||
| 65 | null, | ||
| 66 | [ | ||
| 67 | 'taxonomy' => $column->get_taxonomy(), | ||
| 68 | 'post_type' => $column->get_post_type(), | ||
| 69 | ] | ||
| 70 | ); | ||
| 71 | } | ||
| 57 | 72 | ||
| 58 | } | 73 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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 | { |
| 12 | return; | 13 | if ( ! class_exists('bbPress')) { |
| 13 | } | 14 | return; |
| 15 | } | ||
| 14 | 16 | ||
| 15 | $services = [ | 17 | $this->create_services()->register(); |
| 16 | new Service\Columns(), | 18 | } |
| 17 | new Service\Editing(), | ||
| 18 | new Service\ListScreens(), | ||
| 19 | ]; | ||
| 20 | 19 | ||
| 21 | foreach ( $services as $service ) { | 20 | private function create_services(): Services |
| 22 | if ( $service instanceof Registerable ) { | 21 | { |
| 23 | $service->register(); | 22 | return new Services([ |
| 24 | } | 23 | new Service\Columns(), |
| 25 | } | 24 | new Service\Editing(), |
| 26 | } | 25 | new Service\ListScreens(), |
| 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 |
| 14 | { | ||
| 15 | return 'topic' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'topic' === $key; | 19 | { |
| 18 | } | 20 | return new Topic(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'topic'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new Topic(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return new Topic(); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'topic'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Topic(), $settings ); | ||
| 38 | } | ||
| 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 |
| 10 | 11 | { | |
| 11 | public function register() { | 12 | |
| 12 | if ( ! class_exists( 'FLBuilderLoader' ) ) { | 13 | public function register(): void |
| 13 | return; | 14 | { |
| 14 | } | 15 | if ( ! class_exists('FLBuilderLoader')) { |
| 15 | 16 | return; | |
| 16 | AC\ListScreenFactory::add( new ListScreenFactory\Templates() ); | 17 | } |
| 17 | AC\ListScreenFactory::add( new ListScreenFactory\SavedColumns() ); | 18 | |
| 18 | AC\ListScreenFactory::add( new ListScreenFactory\SavedModules() ); | 19 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\Templates()); |
| 19 | AC\ListScreenFactory::add( new ListScreenFactory\SavedRows() ); | 20 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedColumns()); |
| 20 | 21 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedModules()); | |
| 21 | $services = [ | 22 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\SavedRows()); |
| 22 | new Service\ListScreens(), | 23 | |
| 23 | new Service\PostTypes(), | 24 | $this->create_services()->register(); |
| 24 | ]; | 25 | } |
| 25 | 26 | ||
| 26 | foreach ( $services as $service ) { | 27 | private function create_services(): Services |
| 27 | if ( $service instanceof Registerable ) { | 28 | { |
| 28 | $service->register(); | 29 | return new Services([ |
| 29 | } | 30 | new Service\ListScreens(), |
| 30 | } | 31 | new Service\PostTypes(), |
| 31 | } | 32 | ]); |
| 33 | } | ||
| 32 | 34 | ||
| 33 | } | 35 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,34 +2,37 @@ | ... | @@ -2,34 +2,37 @@ |
| 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 | ||
| 11 | private $template_page; | 13 | private $template_page; |
| 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 ) | 26 | } |
| 24 | ->set_screen_id( $this->get_screen_base() . '-fl-builder-template' ); | ||
| 25 | } | ||
| 26 | 27 | ||
| 27 | public function get_label() { | 28 | public function get_label(): ?string |
| 28 | return $this->custom_label; | 29 | { |
| 29 | } | 30 | return $this->custom_label; |
| 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 | { |
| 33 | } | 35 | return parent::get_table_url()->with_arg('fl-builder-template-type', $this->template_page); |
| 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 | |||
| 17 | private function create_list_screen(): Template { | ||
| 18 | return new Template( $this->get_page(), $this->get_label() ); | ||
| 19 | } | ||
| 20 | |||
| 21 | abstract protected function get_label(): string; | ||
| 22 | |||
| 23 | abstract protected function get_page(): string; | ||
| 24 | 14 | ||
| 25 | public function can_create( string $key ): bool { | 15 | protected function create_list_screen(string $key): ListScreen |
| 26 | return $key === Template::POST_TYPE . $this->get_page() && post_type_exists( Template::POST_TYPE ); | 16 | { |
| 27 | } | 17 | return new Template($this->get_page(), $this->get_label()); |
| 18 | } | ||
| 28 | 19 | ||
| 29 | public function create( string $key, array $settings = [] ): ListScreen { | 20 | abstract protected function get_label(): string; |
| 30 | if ( ! $this->can_create( $key ) ) { | ||
| 31 | throw new LogicException( 'Invalid key' ); | ||
| 32 | } | ||
| 33 | 21 | ||
| 34 | return $this->add_settings( $this->create_list_screen(), $settings ); | 22 | abstract protected function get_page(): string; |
| 35 | } | ||
| 36 | 23 | ||
| 37 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 24 | public function can_create(string $key): bool |
| 38 | return 'edit' === $screen->base | 25 | { |
| 39 | && $screen->post_type | 26 | return $key === Template::POST_TYPE . $this->get_page() && post_type_exists(Template::POST_TYPE); |
| 40 | && 'edit-' . $screen->post_type === $screen->id | 27 | } |
| 41 | && $this->get_page() === filter_input( INPUT_GET, 'fl-builder-template-type' ); | ||
| 42 | } | ||
| 43 | 28 | ||
| 44 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 29 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 45 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 30 | { |
| 46 | throw new LogicException( 'Invalid screen' ); | 31 | return 'edit' === $screen->base |
| 47 | } | 32 | && $screen->post_type |
| 33 | && 'edit-' . $screen->post_type === $screen->id | ||
| 34 | && $this->get_page() === filter_input(INPUT_GET, 'fl-builder-template-type'); | ||
| 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 |
| 50 | } | 38 | { |
| 39 | return $this->create_list_screen($screen->post_type); | ||
| 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 | private $location; | 13 | |
| 14 | 14 | private $location; | |
| 15 | public function __construct( AC\Asset\Location\Absolute $location ) { | 15 | |
| 16 | $this->location = $location; | 16 | public function __construct(AC\Asset\Location\Absolute $location) |
| 17 | } | 17 | { |
| 18 | 18 | $this->location = $location; | |
| 19 | public function register() { | 19 | } |
| 20 | if ( ! class_exists( 'BuddyPress', false ) ) { | 20 | |
| 21 | return; | 21 | public function register(): void |
| 22 | } | 22 | { |
| 23 | 23 | if ( ! class_exists('BuddyPress', false)) { | |
| 24 | $services = [ | 24 | return; |
| 25 | new Service\Admin( $this->location ), | 25 | } |
| 26 | new Service\Columns(), | 26 | |
| 27 | new Service\ListScreens(), | 27 | Aggregate::add(new ListScreenFactory\Email()); |
| 28 | new Service\Table( $this->location ), | 28 | Aggregate::add(new ListScreenFactory\Group()); |
| 29 | new IntegrationStatus( 'ac-addon-buddypress') | 29 | |
| 30 | ]; | 30 | $this->create_services()->register(); |
| 31 | 31 | } | |
| 32 | array_map( [ $this, 'register_service' ], $services ); | 32 | |
| 33 | 33 | private function create_services(): Services | |
| 34 | AC\ListScreenFactory::add( new ListScreenFactory\Email() ); | 34 | { |
| 35 | AC\ListScreenFactory::add( new ListScreenFactory\Group() ); | 35 | return new Services([ |
| 36 | } | 36 | new Service\Admin($this->location), |
| 37 | 37 | new Service\Columns(), | |
| 38 | private function register_service( $service ) { | 38 | new Service\ListScreens(), |
| 39 | if ( $service instanceof Registerable ) { | 39 | new Service\Table($this->location), |
| 40 | $service->register(); | 40 | new IntegrationStatus('ac-addon-buddypress'), |
| 41 | } | 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; | 16 | |
| 11 | 17 | class Group extends AC\ListScreen | |
| 12 | class Group extends AC\ListScreenWP | 18 | implements ACP\Editing\ListScreen, AC\ListScreen\ManageValue, AC\ListScreen\ListTable |
| 13 | implements ACP\Editing\ListScreen { | 19 | { |
| 14 | 20 | ||
| 15 | public function __construct() { | 21 | public function __construct() |
| 16 | $this->set_key( 'bp-groups' ) | 22 | { |
| 17 | ->set_screen_id( 'toplevel_page_bp-groups' ) | 23 | parent::__construct('bp-groups', 'toplevel_page_bp-groups'); |
| 18 | ->set_screen_base( 'admin' ) | 24 | |
| 19 | ->set_page( 'bp-groups' ) | 25 | $this->label = __('Groups', 'codepress-admin-columns'); |
| 20 | ->set_label( __( 'Groups', 'codepress-admin-columns' ) ) | 26 | $this->group = 'buddypress'; |
| 21 | ->set_group( 'buddypress' ); | 27 | } |
| 22 | } | 28 | |
| 23 | 29 | public function get_heading_hookname(): string | |
| 24 | public function get_heading_hookname() { | 30 | { |
| 25 | return 'bp_groups_list_table_get_columns'; | 31 | return 'bp_groups_list_table_get_columns'; |
| 26 | } | 32 | } |
| 27 | 33 | ||
| 28 | /** | 34 | public function list_table(): AC\ListTable |
| 29 | * @param string $value | 35 | { |
| 30 | * @param string $column_name | 36 | // Hook suffix is required when using the list screen, mainly in Ajax |
| 31 | * @param array $group | 37 | if ( ! isset($GLOBALS['hook_suffix'])) { |
| 32 | * | 38 | $GLOBALS['hook_suffix'] = $this->get_screen_id(); |
| 33 | * @return string | 39 | } |
| 34 | */ | 40 | |
| 35 | public function manage_value( $value, $column_name, $group ) { | 41 | return new ListTable\Group(new BP_Groups_List_Table()); |
| 36 | return $this->get_display_value_by_column_name( $column_name, $group['id'], $value ); | 42 | } |
| 37 | } | 43 | |
| 38 | 44 | public function manage_value(): AC\Table\ManageValue | |
| 39 | /** | 45 | { |
| 40 | * @param int $id | 46 | return new Table\ManageValue\Group(new ColumnRepository($this)); |
| 41 | * | 47 | } |
| 42 | * @return array | 48 | |
| 43 | */ | 49 | public function get_table_url(): Uri |
| 44 | protected function get_object( $id ) { | 50 | { |
| 45 | return (array) groups_get_group( $id ); | 51 | $url = new AC\Type\Url\ListTable( |
| 46 | } | 52 | 'admin.php', |
| 47 | 53 | $this->has_id() ? $this->get_id() : null | |
| 48 | public function set_manage_value_callback() { | 54 | ); |
| 49 | add_action( 'bp_groups_admin_get_group_custom_column', [ $this, 'manage_value' ], 100, 3 ); | 55 | |
| 50 | } | 56 | return $url->with_arg('page', 'bp-groups'); |
| 51 | 57 | } | |
| 52 | public function get_screen_link() { | 58 | |
| 53 | return add_query_arg( [ 'page' => $this->get_page(), 'layout' => $this->get_layout_id() ], $this->get_admin_url() ); | 59 | protected function register_column_types(): void |
| 54 | } | 60 | { |
| 55 | 61 | $this->register_column_types_from_list([ | |
| 56 | /** | 62 | Column\Group\Avatar::class, |
| 57 | * @return BP_Groups_List_Table | 63 | Column\Group\Creator::class, |
| 58 | */ | 64 | Column\Group\Description::class, |
| 59 | public function get_list_table() { | 65 | Column\Group\Id::class, |
| 60 | // Hook suffix is required when using the list screen, mainly in Ajax | 66 | Column\Group\Name::class, |
| 61 | if ( ! isset( $GLOBALS['hook_suffix'] ) ) { | 67 | Column\Group\NameOnly::class, |
| 62 | $GLOBALS['hook_suffix'] = $this->get_screen_id(); | 68 | Column\Group\Status::class, |
| 63 | } | 69 | ]); |
| 64 | 70 | } | |
| 65 | return new BP_Groups_List_Table(); | 71 | |
| 66 | } | 72 | public function get_table_attr_id(): string |
| 67 | 73 | { | |
| 68 | /** | 74 | return '#bp-groups-form'; |
| 69 | * @throws ReflectionException | 75 | } |
| 70 | */ | 76 | |
| 71 | protected function register_column_types() { | 77 | public function editing() |
| 72 | $this->register_column_types_from_list( [ | 78 | { |
| 73 | Column\Group\Avatar::class, | 79 | return new Editing\Strategy\Group(); |
| 74 | Column\Group\Creator::class, | 80 | } |
| 75 | Column\Group\Description::class, | ||
| 76 | Column\Group\Id::class, | ||
| 77 | Column\Group\Name::class, | ||
| 78 | Column\Group\NameOnly::class, | ||
| 79 | Column\Group\Status::class, | ||
| 80 | ] ); | ||
| 81 | } | ||
| 82 | |||
| 83 | public function get_table_attr_id() { | ||
| 84 | return '#bp-groups-form'; | ||
| 85 | } | ||
| 86 | |||
| 87 | public function editing() { | ||
| 88 | return new Editing\Strategy\Group(); | ||
| 89 | } | ||
| 90 | 81 | ||
| 91 | } | 82 | } |
| ... | \ 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 Email implements ListScreenFactoryInterface { | 9 | class Email extends ListScreenFactory\BaseFactory |
| 10 | { | ||
| 13 | 11 | ||
| 14 | use ListSettingsTrait; | 12 | public function can_create(string $key): bool |
| 13 | { | ||
| 14 | return 'bp-email' === $key; | ||
| 15 | } | ||
| 15 | 16 | ||
| 16 | public function can_create( string $key ): bool { | 17 | protected function create_list_screen(string $key): \AC\ListScreen |
| 17 | return 'bp-email' === $key; | 18 | { |
| 18 | } | 19 | return new ListScreen\Email(); |
| 20 | } | ||
| 19 | 21 | ||
| 20 | public function create( string $key, array $settings = [] ): AC\ListScreen { | 22 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 23 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 24 | return $screen->base === 'edit' && $screen->post_type === 'bp-email'; |
| 23 | } | 25 | } |
| 24 | 26 | ||
| 25 | return $this->add_settings( new ListScreen\Email(), $settings ); | 27 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): \AC\ListScreen |
| 26 | } | 28 | { |
| 27 | 29 | return $this->create_list_screen('bp-email'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 30 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'bp-email'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): AC\ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new ListScreen\Email(), $settings ); | ||
| 38 | } | ||
| 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 |
| 13 | { | ||
| 14 | return 'bp-groups' === $key; | ||
| 15 | } | ||
| 15 | 16 | ||
| 16 | public function can_create( string $key ): bool { | 17 | protected function create_list_screen(string $key): \AC\ListScreen |
| 17 | return 'bp-groups' === $key; | 18 | { |
| 18 | } | 19 | return new ListScreen\Group(); |
| 20 | } | ||
| 19 | 21 | ||
| 20 | public function create( string $key, array $settings = [] ): AC\ListScreen { | 22 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 23 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 24 | return $screen->id === 'toplevel_page_bp-groups' && 'edit' !== filter_input(INPUT_GET, 'action'); |
| 23 | } | 25 | } |
| 24 | 26 | ||
| 25 | return $this->add_settings( new ListScreen\Group(), $settings ); | 27 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): \AC\ListScreen |
| 26 | } | 28 | { |
| 27 | 29 | return $this->create_list_screen('bp-groups'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 30 | } |
| 29 | return $screen->id === 'toplevel_page_bp-groups' && 'edit' !== filter_input( INPUT_GET, 'action' ); | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): AC\ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new ListScreen\Group(), $settings ); | ||
| 38 | } | ||
| 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 |
| 13 | 15 | { | |
| 14 | /** | 16 | |
| 15 | * @var Column\Profile | 17 | protected $column; |
| 16 | */ | 18 | |
| 17 | protected $column; | 19 | protected $datatype; |
| 18 | 20 | ||
| 19 | protected $datatype; | 21 | public function __construct(Column\Profile $column, DataType $data_type = null) |
| 20 | 22 | { | |
| 21 | public function __construct( Column\Profile $column, DataType $data_type = null ) { | 23 | parent::__construct(); |
| 22 | parent::__construct( $data_type ); | 24 | |
| 23 | 25 | $this->column = $column; | |
| 24 | $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 | 31 | global $wpdb, $bp; | |
| 30 | return []; | 32 | |
| 31 | } | 33 | $bindings = new Bindings(); |
| 32 | 34 | ||
| 33 | public function pre_user_query_callback( WP_User_Query $query ) { | 35 | $bindings->join( |
| 34 | global $wpdb, $bp; | 36 | $wpdb->prepare( |
| 35 | 37 | " | |
| 36 | $from = $wpdb->prepare( " | 38 | LEFT JOIN {$bp->profile->table_name_data} as acsort_pd |
| 37 | LEFT JOIN {$bp->profile->table_name_data} as acsort_pd | 39 | ON $wpdb->users.ID = acsort_pd.user_id AND acsort_pd.field_id = %d |
| 38 | ON $wpdb->users.ID = acsort_pd.user_id AND acsort_pd.field_id = %d | 40 | ", |
| 39 | ", $this->column->get_buddypress_field_id() ); | 41 | $this->column->get_buddypress_field_id() |
| 40 | 42 | ) | |
| 41 | $query->query_from .= $from; | 43 | ); |
| 42 | $query->query_orderby = sprintf( "GROUP BY $wpdb->users.ID ORDER BY %s", | 44 | $bindings->group_by("$wpdb->users.ID"); |
| 43 | SqlOrderByFactory::create( 'acsort_pd.value', $this->get_order(), [ 'cast_type' => (string) CastType::create_from_data_type( $this->data_type ) ] ) | 45 | $bindings->order_by( |
| 44 | ); | 46 | SqlOrderByFactory::create( |
| 45 | 47 | "acsort_pd.value", | |
| 46 | remove_action( 'pre_user_query', [ $this, __FUNCTION__ ] ); | 48 | (string)$order, |
| 47 | } | 49 | [ |
| 50 | 'cast_type' => (string)CastType::create_from_data_type($this->data_type), | ||
| 51 | ] | ||
| 52 | ) | ||
| 53 | ); | ||
| 54 | |||
| 55 | return $bindings; | ||
| 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 |
| 11 | 13 | { | |
| 12 | /** | 14 | |
| 13 | * @var string | 15 | /** |
| 14 | */ | 16 | * @var string |
| 15 | private $activity_type; | 17 | */ |
| 16 | 18 | private $activity_type; | |
| 17 | public function __construct( $activity_type ) { | 19 | |
| 18 | parent::__construct(); | 20 | public function __construct($activity_type) |
| 19 | 21 | { | |
| 20 | $this->activity_type = (string) $activity_type; | 22 | parent::__construct(); |
| 21 | } | 23 | |
| 22 | 24 | $this->activity_type = (string)$activity_type; | |
| 23 | public function get_sorting_vars() { | 25 | } |
| 24 | add_action( 'pre_user_query', [ $this, 'pre_user_query_callback' ] ); | 26 | |
| 25 | 27 | public function create_query_bindings(Order $order): Bindings | |
| 26 | return []; | 28 | { |
| 27 | } | 29 | global $wpdb, $bp; |
| 28 | 30 | ||
| 29 | public function pre_user_query_callback( WP_User_Query $query ) { | 31 | $bindings = new Bindings(); |
| 30 | global $wpdb, $bp; | 32 | |
| 31 | 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 | ); |
| 43 | ); | 45 | |
| 44 | 46 | $bindings->group_by("$wpdb->users.ID"); | |
| 45 | remove_action( 'pre_user_query', [ $this, __FUNCTION__ ] ); | 47 | $bindings->order_by( |
| 46 | } | 48 | SqlOrderByFactory::create_with_computation( |
| 49 | new ComputationType(ComputationType::COUNT), | ||
| 50 | "$alias.user_id", | ||
| 51 | (string)$order | ||
| 52 | ) | ||
| 53 | ); | ||
| 54 | |||
| 55 | return $bindings; | ||
| 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 | use ConditionalFormat\FilteredHtmlFormatTrait; | 18 | |
| 19 | 19 | use ConditionalFormat\FilteredHtmlFormatTrait; | |
| 20 | public function __construct() { | 20 | |
| 21 | $this->set_type( 'column-ec-event_organizer' ) | 21 | public function __construct() |
| 22 | ->set_label( __( 'Organizer', 'codepress-admin-columns' ) ); | 22 | { |
| 23 | 23 | $this->set_type('column-ec-event_organizer') | |
| 24 | parent::__construct(); | 24 | ->set_label(__('Organizer', 'codepress-admin-columns')); |
| 25 | } | 25 | |
| 26 | 26 | parent::__construct(); | |
| 27 | public function get_relation_object() { | 27 | } |
| 28 | return new AC\Relation\Post( 'tribe_organizer' ); | 28 | |
| 29 | } | 29 | public function get_relation_object() |
| 30 | 30 | { | |
| 31 | public function get_meta_key() { | 31 | return new AC\Relation\Post('tribe_organizer'); |
| 32 | return '_EventOrganizerID'; | 32 | } |
| 33 | } | 33 | |
| 34 | 34 | public function get_meta_key() | |
| 35 | public function get_value( $id ) { | 35 | { |
| 36 | $post_ids = $this->get_raw_value( $id ); | 36 | return '_EventOrganizerID'; |
| 37 | 37 | } | |
| 38 | if ( ! $post_ids ) { | 38 | |
| 39 | return $this->get_empty_char(); | 39 | public function get_value($id) |
| 40 | } | 40 | { |
| 41 | 41 | $post_ids = $this->get_raw_value($id); | |
| 42 | $values = []; | 42 | |
| 43 | foreach ( $post_ids as $_id ) { | 43 | if ( ! $post_ids) { |
| 44 | $values[] = $this->get_formatted_value( $_id, $_id ); | 44 | return $this->get_empty_char(); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | $setting_limit = $this->get_setting( 'number_of_items' ); | 47 | $values = []; |
| 48 | 48 | foreach ($post_ids as $_id) { | |
| 49 | return ac_helper()->html->more( $values, $setting_limit ? $setting_limit->get_value() : false ); | 49 | $values[] = $this->get_formatted_value($_id, $_id); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | public function get_raw_value( $id ) { | 52 | $setting_limit = $this->get_setting('number_of_items'); |
| 53 | $value = $this->get_meta_value( $id, $this->get_meta_key(), false ); | 53 | |
| 54 | 54 | return ac_helper()->html->more($values, $setting_limit ? $setting_limit->get_value() : false); | |
| 55 | $value = array_filter( $value ); | 55 | } |
| 56 | 56 | ||
| 57 | if ( ! $value ) { | 57 | public function get_raw_value($id) |
| 58 | return false; | 58 | { |
| 59 | } | 59 | $value = $this->get_meta_value($id, $this->get_meta_key(), false); |
| 60 | 60 | ||
| 61 | return $value; | 61 | $value = array_filter($value); |
| 62 | } | 62 | |
| 63 | 63 | if ( ! $value) { | |
| 64 | public function register_settings() { | 64 | return false; |
| 65 | $this->add_setting( new Settings\OrganizerDisplay( $this ) ); | 65 | } |
| 66 | $this->add_setting( new AC\Settings\Column\NumberOfItems( $this ) ); | 66 | |
| 67 | } | 67 | return $value; |
| 68 | 68 | } | |
| 69 | public function editing() { | 69 | |
| 70 | return new Editing\Service\Event\Organizer(); | 70 | public function register_settings() |
| 71 | } | 71 | { |
| 72 | 72 | $this->add_setting(new Settings\OrganizerDisplay($this)); | |
| 73 | public function filtering() { | 73 | $this->add_setting(new AC\Settings\Column\NumberOfItems($this)); |
| 74 | return new Filtering\RelatedPost( $this ); | 74 | } |
| 75 | } | 75 | |
| 76 | 76 | public function editing() | |
| 77 | public function sorting() { | 77 | { |
| 78 | return ( new MetaFormatFactory() )->create( $this->get_meta_type(), $this->get_meta_key(), new ACP\Sorting\FormatValue\PostTitle() ); | 78 | return new Editing\Service\Event\Organizer(); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | public function export() { | 81 | public function filtering() |
| 82 | return new ACP\Export\Model\StrippedValue( $this ); | 82 | { |
| 83 | } | 83 | return new Filtering\RelatedPost($this); |
| 84 | 84 | } | |
| 85 | public function search() { | 85 | |
| 86 | return new Search\Event\Relation( $this->get_meta_key(), $this->get_meta_type(), $this->get_relation_object() ); | 86 | public function sorting() |
| 87 | } | 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 | ); | ||
| 98 | } | ||
| 99 | |||
| 100 | public function export() | ||
| 101 | { | ||
| 102 | return new ACP\Export\Model\StrippedValue($this); | ||
| 103 | } | ||
| 104 | |||
| 105 | public function search() | ||
| 106 | { | ||
| 107 | return new Search\Event\Relation($this->get_meta_key(), $this->get_meta_type(), $this->get_relation_object()); | ||
| 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 | final class EventsCalendar implements Registerable { | ||
| 12 | |||
| 13 | private $location; | ||
| 14 | |||
| 15 | public function __construct( AC\Asset\Location\Absolute $location ) { | ||
| 16 | $this->location = $location; | ||
| 17 | } | ||
| 18 | |||
| 19 | public function register() { | ||
| 20 | if ( ! class_exists( 'Tribe__Events__Main', false ) ) { | ||
| 21 | return; | ||
| 22 | } | ||
| 23 | |||
| 24 | $services = [ | ||
| 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 | } | ||
| 36 | 11 | ||
| 37 | private function register_service( Registerable $service ) { | 12 | final class EventsCalendar implements Registerable |
| 38 | $service->register(); | 13 | { |
| 39 | } | 14 | |
| 15 | private $location; | ||
| 16 | |||
| 17 | public function __construct(AC\Asset\Location\Absolute $location) | ||
| 18 | { | ||
| 19 | $this->location = $location; | ||
| 20 | } | ||
| 21 | |||
| 22 | public function register(): void | ||
| 23 | { | ||
| 24 | if ( ! class_exists('Tribe__Events__Main', false)) { | ||
| 25 | return; | ||
| 26 | } | ||
| 27 | |||
| 28 | $this->create_services()->register(); | ||
| 29 | } | ||
| 30 | |||
| 31 | private function create_services(): Services | ||
| 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 | ]); | ||
| 40 | } | ||
| 40 | 41 | ||
| 41 | } | 42 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -5,33 +5,29 @@ namespace ACA\EC\Export\Strategy; | ... | @@ -5,33 +5,29 @@ 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 | 10 | |
| 11 | */ | 11 | public function __construct(ListScreen\Event $list_screen) |
| 12 | class Event extends ACP\Export\Strategy\Post { | 12 | { |
| 13 | 13 | parent::__construct($list_screen); | |
| 14 | public function __construct( ListScreen\Event $list_screen ) { | 14 | } |
| 15 | parent::__construct( $list_screen ); | 15 | |
| 16 | } | 16 | protected function ajax_export(): void |
| 17 | 17 | { | |
| 18 | /** | 18 | parent::ajax_export(); |
| 19 | * @since 1.0 | 19 | |
| 20 | * @see ACP_Export_ExportableListScreen::ajax_export() | 20 | /** |
| 21 | */ | 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 |
| 22 | protected function ajax_export(): void { | 22 | */ |
| 23 | parent::ajax_export(); | 23 | add_filter('post_limits', [$this, 'modify_posts_limit'], 1); |
| 24 | 24 | } | |
| 25 | /** | 25 | |
| 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 | 26 | public function modify_posts_limit($limit): string |
| 27 | */ | 27 | { |
| 28 | add_filter( 'post_limits', [ $this, 'modify_posts_limit' ], 1 ); | 28 | remove_filter('post_limits', ['Tribe__Events__Admin_List', 'events_search_limits']); |
| 29 | } | 29 | |
| 30 | 30 | return $limit; | |
| 31 | public function modify_posts_limit( $limit ): string { | 31 | } |
| 32 | remove_filter( 'post_limits', [ 'Tribe__Events__Admin_List', 'events_search_limits' ] ); | ||
| 33 | |||
| 34 | return $limit; | ||
| 35 | } | ||
| 36 | 32 | ||
| 37 | } | 33 | } |
| ... | \ 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 | 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 |
| 14 | { | ||
| 15 | return 'tribe_events' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'tribe_events' === $key; | 19 | { |
| 18 | } | 20 | return new Event(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_events'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new Event(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return $this->create_list_screen('tribe_events'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_events'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Event(), $settings ); | ||
| 38 | } | ||
| 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 |
| 14 | { | ||
| 15 | return 'tribe_event_series' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'tribe_event_series' === $key; | 19 | { |
| 18 | } | 20 | return new EventSeries(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_event_series'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new EventSeries(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return $this->create_list_screen('tribe_event_series'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_event_series'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new EventSeries(), $settings ); | ||
| 38 | } | ||
| 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 |
| 14 | { | ||
| 15 | return 'tribe_organizer' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'tribe_organizer' === $key; | 19 | { |
| 18 | } | 20 | return new Organizer(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_organizer'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new Organizer(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return $this->create_list_screen('tribe_organizer'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_organizer'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Organizer(), $settings ); | ||
| 38 | } | ||
| 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 |
| 14 | { | ||
| 15 | return 'tribe_venue' === $key; | ||
| 16 | } | ||
| 15 | 17 | ||
| 16 | public function can_create( string $key ): bool { | 18 | protected function create_list_screen(string $key): ListScreen |
| 17 | return 'tribe_venue' === $key; | 19 | { |
| 18 | } | 20 | return new Venue(); |
| 21 | } | ||
| 19 | 22 | ||
| 20 | public function create( string $key, array $settings = [] ): ListScreen { | 23 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 21 | if ( ! $this->can_create( $key ) ) { | 24 | { |
| 22 | throw new LogicException( 'Invalid Listscreen key' ); | 25 | return $screen->base === 'edit' && $screen->post_type === 'tribe_venue'; |
| 23 | } | 26 | } |
| 24 | 27 | ||
| 25 | return $this->add_settings( new Venue(), $settings ); | 28 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 26 | } | 29 | { |
| 27 | 30 | return $this->create_list_screen('tribe_venue'); | |
| 28 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 31 | } |
| 29 | return $screen->base === 'edit' && $screen->post_type === 'tribe_venue'; | ||
| 30 | } | ||
| 31 | |||
| 32 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | ||
| 33 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | ||
| 34 | throw new LogicException( 'Invalid Screen' ); | ||
| 35 | } | ||
| 36 | |||
| 37 | return $this->add_settings( new Venue(), $settings ); | ||
| 38 | } | ||
| 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 | ... | ... |
This diff is collapsed.
Click to expand it.
| 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,64 +7,70 @@ use ACA\GravityForms\Column; | ... | @@ -7,64 +7,70 @@ 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 | private $form_id; | 12 | |
| 13 | 13 | private $form_id; | |
| 14 | private $column_factory; | 14 | |
| 15 | 15 | private $column_factory; | |
| 16 | private $field_factory; | 16 | |
| 17 | 17 | private $field_factory; | |
| 18 | public function __construct( $form_id, EntryFactory $column_factory, FieldFactory $field_factory ) { | 18 | |
| 19 | $this->form_id = (int) $form_id; | 19 | public function __construct($form_id, EntryFactory $column_factory, FieldFactory $field_factory) |
| 20 | $this->column_factory = $column_factory; | 20 | { |
| 21 | $this->field_factory = $field_factory; | 21 | $this->form_id = (int)$form_id; |
| 22 | } | 22 | $this->column_factory = $column_factory; |
| 23 | 23 | $this->field_factory = $field_factory; | |
| 24 | public function register() { | 24 | } |
| 25 | add_action( 'ac/list_screen/column_created', [ $this, 'configure_column' ] ); | 25 | |
| 26 | } | 26 | public function register(): void |
| 27 | 27 | { | |
| 28 | public function configure_column( AC\Column $column ): void { | 28 | add_action('ac/list_screen/column_created', [$this, 'configure_column'], 10, 2); |
| 29 | if ( ! $column instanceof Column\Entry ) { | 29 | } |
| 30 | return; | 30 | |
| 31 | } | 31 | public function configure_column(AC\Column $column, AC\ListScreen $list_screen): void |
| 32 | 32 | { | |
| 33 | $list_screen = $column->get_list_screen(); | 33 | if ( ! $column instanceof Column\Entry) { |
| 34 | 34 | return; | |
| 35 | if ( ! $list_screen instanceof ListScreen\Entry ) { | 35 | } |
| 36 | return; | 36 | |
| 37 | } | 37 | if ( ! $list_screen instanceof ListScreen\Entry) { |
| 38 | 38 | return; | |
| 39 | if ( $list_screen->get_form_id() !== $this->form_id ) { | 39 | } |
| 40 | return; | 40 | |
| 41 | } | 41 | if ($list_screen->get_form_id() !== $this->form_id) { |
| 42 | 42 | return; | |
| 43 | $column->set_field( $this->field_factory->create( $this->get_field_id_by_type( $column->get_type() ), $this->form_id ) ); | 43 | } |
| 44 | } | 44 | |
| 45 | 45 | $column->set_field( | |
| 46 | private function get_field_id_by_type( $type ) { | 46 | $this->field_factory->create($this->get_field_id_by_type($column->get_type()), $this->form_id) |
| 47 | return str_replace( 'field_id-', '', $type ); | 47 | ); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | public function register_entry_columns( ListScreen\Entry $list_screen ): void { | 50 | private function get_field_id_by_type($type) |
| 51 | foreach ( ( new AC\DefaultColumnsRepository() )->get( $list_screen->get_key() ) as $type => $label ) { | 51 | { |
| 52 | $field_id = $this->get_field_id_by_type( $type ); | 52 | return str_replace('field_id-', '', $type); |
| 53 | $form_id = $list_screen->get_form_id(); | 53 | } |
| 54 | 54 | ||
| 55 | if ( ! $this->column_factory->has_field( $field_id, $form_id ) ) { | 55 | public function register_entry_columns(ListScreen\Entry $list_screen): void |
| 56 | continue; | 56 | { |
| 57 | } | 57 | foreach ((new AC\DefaultColumnsRepository())->get($list_screen->get_key()) as $type => $label) { |
| 58 | 58 | $field_id = $this->get_field_id_by_type($type); | |
| 59 | $column = $this->column_factory->create( $field_id, $form_id ); | 59 | $form_id = $list_screen->get_form_id(); |
| 60 | $column->set_type( $type ) | 60 | |
| 61 | ->set_label( $label ) | 61 | if ( ! $this->column_factory->has_field($field_id, $form_id)) { |
| 62 | ->set_list_screen( $list_screen ); | 62 | continue; |
| 63 | 63 | } | |
| 64 | $this->configure_column( $column ); | 64 | |
| 65 | 65 | $column = $this->column_factory->create($field_id, $form_id); | |
| 66 | $list_screen->register_column_type( $column ); | 66 | $column->set_type($type) |
| 67 | } | 67 | ->set_label($label) |
| 68 | } | 68 | ->set_list_screen($list_screen); |
| 69 | |||
| 70 | $this->configure_column($column, $list_screen); | ||
| 71 | |||
| 72 | $list_screen->register_column_type($column); | ||
| 73 | } | ||
| 74 | } | ||
| 69 | 75 | ||
| 70 | } | 76 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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,47 +8,53 @@ use ACA\GravityForms\ListTable; | ... | @@ -8,47 +8,53 @@ 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 | public function __construct( ListScreen\Entry $list_screen ) { | 13 | |
| 14 | parent::__construct( $list_screen ); | 14 | public function __construct(ListScreen\Entry $list_screen) |
| 15 | } | 15 | { |
| 16 | 16 | parent::__construct($list_screen); | |
| 17 | protected function ajax_export(): void { | 17 | } |
| 18 | add_filter( 'gform_get_entries_args_entry_list', [ $this, 'set_pagination_args' ], 11 ); | 18 | |
| 19 | add_action( Hooks::get_load_form_entries(), [ $this, 'delayed_export' ] ); | 19 | protected function ajax_export(): void |
| 20 | } | 20 | { |
| 21 | 21 | add_filter('gform_get_entries_args_entry_list', [$this, 'set_pagination_args'], 11); | |
| 22 | public function delayed_export(): void { | 22 | add_action(Hooks::get_load_form_entries(), [$this, 'delayed_export']); |
| 23 | $table = $this->list_screen->get_list_table(); | 23 | } |
| 24 | $table->prepare_items(); | 24 | |
| 25 | 25 | public function delayed_export(): void | |
| 26 | $this->export( wp_list_pluck( $table->items, 'id' ) ); | 26 | { |
| 27 | } | 27 | $table = $this->list_screen->get_list_table(); |
| 28 | 28 | $table->prepare_items(); | |
| 29 | public function set_pagination_args( array $args ): array { | 29 | |
| 30 | $per_page = $this->get_num_items_per_iteration(); | 30 | $this->export(wp_list_pluck($table->items, 'id')); |
| 31 | 31 | } | |
| 32 | $args['paging']['page_size'] = $per_page; | 32 | |
| 33 | $args['paging']['offset'] = $this->get_export_counter() * $per_page; | 33 | public function set_pagination_args(array $args): array |
| 34 | 34 | { | |
| 35 | $ids = $this->get_requested_ids(); | 35 | $per_page = $this->get_num_items_per_iteration(); |
| 36 | 36 | ||
| 37 | if ( $ids ) { | 37 | $args['paging']['page_size'] = $per_page; |
| 38 | $args['search_criteria']['field_filters'] = [ | 38 | $args['paging']['offset'] = $this->get_export_counter() * $per_page; |
| 39 | [ | 39 | |
| 40 | 'key' => 'id', | 40 | $ids = $this->get_requested_ids(); |
| 41 | 'operator' => 'IN', | 41 | |
| 42 | 'value' => $ids, | 42 | if ($ids) { |
| 43 | ], | 43 | $args['search_criteria']['field_filters'] = [ |
| 44 | ]; | 44 | [ |
| 45 | } | 45 | 'key' => 'id', |
| 46 | 46 | 'operator' => 'IN', | |
| 47 | return $args; | 47 | 'value' => $ids, |
| 48 | } | 48 | ], |
| 49 | 49 | ]; | |
| 50 | protected function get_list_table(): ?AC\ListTable { | 50 | } |
| 51 | return new ListTable( $this->list_screen->get_list_table() ); | 51 | |
| 52 | } | 52 | return $args; |
| 53 | } | ||
| 54 | |||
| 55 | protected function get_list_table(): AC\ListTable | ||
| 56 | { | ||
| 57 | return new ListTable($this->list_screen->get_list_table()); | ||
| 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 |
| 19 | 21 | { | |
| 20 | public const GROUP = 'gravity_forms'; | 22 | |
| 21 | 23 | public const GROUP = 'gravity_forms'; | |
| 22 | private $location; | 24 | |
| 23 | 25 | private $location; | |
| 24 | public function __construct( AC\Asset\Location\Absolute $location ) { | 26 | |
| 25 | $this->location = $location; | 27 | private $container; |
| 26 | } | 28 | |
| 27 | 29 | public function __construct(AC\Asset\Location\Absolute $location, ContainerInterface $container) | |
| 28 | public function register() { | 30 | { |
| 29 | if ( ! class_exists( 'GFCommon', false ) ) { | 31 | $this->location = $location; |
| 30 | return; | 32 | $this->container = $container; |
| 31 | } | 33 | } |
| 32 | 34 | ||
| 33 | $minimum_gf_version = '2.5'; | 35 | public function register(): void |
| 34 | 36 | { | |
| 35 | if ( class_exists( 'GFCommon', false ) && version_compare( GFCommon::$version, $minimum_gf_version, '<' ) ) { | 37 | if ( ! class_exists('GFCommon', false)) { |
| 36 | return; | 38 | return; |
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | AC\ListScreenFactory::add( new ListScreenFactory\EntryFactory() ); | 41 | $minimum_gf_version = '2.5'; |
| 40 | 42 | ||
| 41 | add_action( 'ac/column_groups', [ $this, 'register_column_group' ] ); | 43 | if (class_exists('GFCommon', false) && version_compare((string)GFCommon::$version, $minimum_gf_version, '<')) { |
| 42 | add_action( 'ac/admin_scripts', [ $this, 'admin_scripts' ] ); | 44 | return; |
| 43 | add_action( 'ac/table_scripts', [ $this, 'table_scripts' ] ); | 45 | } |
| 44 | add_filter( "gform_noconflict_styles", [ $this, 'allowed_acp_styles' ] ); | 46 | |
| 45 | add_filter( "gform_noconflict_scripts", [ $this, 'allowed_acp_scripts' ] ); | 47 | AC\ListScreenFactory\Aggregate::add(new ListScreenFactory\EntryFactory()); |
| 46 | 48 | ||
| 47 | $services = [ | 49 | $this->create_services()->register(); |
| 48 | new Service\ListScreens(), | 50 | |
| 49 | new TableScreen\Entry( new AC\ListScreenFactory(), AC()->get_storage(), new DefaultColumnsRepository() ), | 51 | // Enable Search |
| 50 | new Admin(), | 52 | QueryFactory::register(MetaTypes::GRAVITY_FORMS_ENTRY, Query::class); |
| 51 | new IntegrationStatus( 'ac-addon-gravityforms' ), | 53 | TableScreenFactory::register(ListScreen\Entry::class, Search\TableScreen\Entry::class); |
| 52 | ]; | 54 | } |
| 53 | 55 | ||
| 54 | array_map( static function ( Registerable $service ) { | 56 | private function create_services(): Services |
| 55 | $service->register(); | 57 | { |
| 56 | }, $services ); | 58 | return new Services([ |
| 57 | 59 | new Service\ListScreens(), | |
| 58 | // Enable Search | 60 | new TableScreen\Entry( |
| 59 | QueryFactory::register( MetaTypes::GRAVITY_FORMS_ENTRY, Query::class ); | 61 | new AC\ListScreenFactory\Aggregate(), |
| 60 | TableScreenFactory::register( ListScreen\Entry::class, Search\TableScreen\Entry::class ); | 62 | $this->container->get(AC\ListScreenRepository\Storage::class), |
| 61 | } | 63 | new DefaultColumnsRepository() |
| 62 | 64 | ), | |
| 63 | public function register_column_group( AC\Groups $groups ): void { | 65 | new Admin(), |
| 64 | $groups->add( 'gravity_forms', __( 'Gravity Forms', 'codepress-admin-columns' ), 14 ); | 66 | new IntegrationStatus('ac-addon-gravityforms'), |
| 65 | } | 67 | new Scripts($this->location), |
| 66 | 68 | new ColumnGroup(), | |
| 67 | /** | 69 | ]); |
| 68 | * @param string $key | 70 | } |
| 69 | * | ||
| 70 | * @return bool | ||
| 71 | */ | ||
| 72 | private function is_acp_asset( $key ) { | ||
| 73 | $acp_prefixes = [ 'ac-', 'acp-', 'aca-', 'editor', 'mce-view', 'quicktags', 'common', 'tinymce' ]; | ||
| 74 | |||
| 75 | foreach ( $acp_prefixes as $prefix ) { | ||
| 76 | if ( strpos( $key, $prefix ) !== false ) { | ||
| 77 | return true; | ||
| 78 | } | ||
| 79 | } | ||
| 80 | |||
| 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 | } | ||
| 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, |
| 15 | 21 | AC\ListScreen\ListTable | |
| 16 | private $form_id; | 22 | { |
| 17 | 23 | ||
| 18 | private $column_configurator; | 24 | private $form_id; |
| 19 | 25 | ||
| 20 | public function __construct( int $form_id, EntryConfigurator $column_configurator ) { | 26 | private $column_configurator; |
| 21 | $this->form_id = $form_id; | 27 | |
| 22 | $this->column_configurator = $column_configurator; | 28 | public function __construct(int $form_id, EntryConfigurator $column_configurator) |
| 23 | 29 | { | |
| 24 | $this->set_group( 'gravity_forms' ) | 30 | parent::__construct('gf_entry_' . $form_id, '_page_gf_entries'); |
| 25 | ->set_page( 'gf_entries' ) | 31 | |
| 26 | ->set_screen_id( '_page_gf_entries' ) | 32 | $this->form_id = $form_id; |
| 27 | ->set_screen_base( '_page_gf_entries' ) | 33 | $this->column_configurator = $column_configurator; |
| 28 | ->set_key( 'gf_entry_' . $form_id ) | 34 | |
| 29 | ->set_meta_type( GravityForms\MetaTypes::GRAVITY_FORMS_ENTRY ); | 35 | $this->group = 'gravity_forms'; |
| 30 | } | 36 | $this->set_meta_type(MetaTypes::GRAVITY_FORMS_ENTRY); |
| 31 | 37 | } | |
| 32 | public function editing() { | 38 | |
| 33 | return new GravityForms\Editing\Strategy\Entry( $this->get_list_table() ); | 39 | public function list_table(): AC\ListTable |
| 34 | } | 40 | { |
| 35 | 41 | return new ListTable($this->get_list_table()); | |
| 36 | public function export() { | 42 | } |
| 37 | return new GravityForms\Export\Strategy\Entry( $this ); | 43 | |
| 38 | } | 44 | public function manage_value(): AC\Table\ManageValue |
| 39 | 45 | { | |
| 40 | public function get_heading_hookname() { | 46 | return new GravityForms\Table\ManageValue\Entry(new ColumnRepository($this)); |
| 41 | return 'gform_entry_list_columns'; | 47 | } |
| 42 | } | 48 | |
| 43 | 49 | public function editing() | |
| 44 | protected function get_object( $id ) { | 50 | { |
| 45 | return GFAPI::get_entry( $id ); | 51 | return new GravityForms\Editing\Strategy\Entry($this->get_list_table()); |
| 46 | } | 52 | } |
| 47 | 53 | ||
| 48 | public function set_manage_value_callback() { | 54 | public function export() |
| 49 | add_filter( 'gform_entries_field_value', [ $this, 'manage_value_entry' ], 10, 4 ); | 55 | { |
| 50 | } | 56 | return new GravityForms\Export\Strategy\Entry($this); |
| 51 | 57 | } | |
| 52 | /** | 58 | |
| 53 | * @param string $original_value | 59 | public function get_heading_hookname(): string |
| 54 | * @param int $form_id | 60 | { |
| 55 | * @param string $field_id | 61 | return 'gform_entry_list_columns'; |
| 56 | * @param array $entry | 62 | } |
| 57 | * | 63 | |
| 58 | * @return string | 64 | public function get_label(): ?string |
| 59 | */ | 65 | { |
| 60 | public function manage_value_entry( $original_value, $form_id, $field_id, $entry ) { | 66 | return GFAPI::get_form($this->get_form_id())['title']; |
| 61 | $custom_column_value = $this->get_display_value_by_column_name( $field_id, $entry['id'], $original_value ); | 67 | } |
| 62 | 68 | ||
| 63 | if ( $custom_column_value ) { | 69 | public function get_form_id(): int |
| 64 | return $custom_column_value; | 70 | { |
| 65 | } | 71 | return $this->form_id; |
| 66 | 72 | } | |
| 67 | $value = $this->get_display_value_by_column_name( 'field_id-' . $field_id, $entry['id'], $original_value ); | 73 | |
| 68 | 74 | public function get_table_url(): Uri | |
| 69 | return $value ?: $original_value; | 75 | { |
| 70 | } | 76 | $url = new AC\Type\Url\ListTable('admin.php'); |
| 71 | 77 | ||
| 72 | /** | 78 | return $url->with_arg('id', (string)$this->form_id) |
| 73 | * @return string | 79 | ->with_arg('page', 'gf_entries'); |
| 74 | */ | 80 | } |
| 75 | public function get_label() { | 81 | |
| 76 | return GFAPI::get_form( $this->get_form_id() )['title']; | 82 | public function get_list_table(): GF_Entry_List_Table |
| 77 | } | 83 | { |
| 78 | 84 | return (new GravityForms\TableFactory())->create($this->get_screen_id(), $this->form_id); | |
| 79 | /** | 85 | } |
| 80 | * @return int | 86 | |
| 81 | */ | 87 | public function register_column_types(): void |
| 82 | public function get_form_id() { | 88 | { |
| 83 | return $this->form_id; | 89 | $this->column_configurator->register_entry_columns($this); |
| 84 | } | 90 | |
| 85 | 91 | $this->register_column_types_from_list([ | |
| 86 | protected function get_admin_url() { | 92 | Column\Entry\Custom\User::class, |
| 87 | return admin_url( 'admin.php' ); | 93 | Column\Entry\Original\DateCreated::class, |
| 88 | } | 94 | Column\Entry\Original\DatePayment::class, |
| 89 | 95 | Column\Entry\Original\EntryId::class, | |
| 90 | public function get_screen_link() { | 96 | Column\Entry\Original\PaymentAmount::class, |
| 91 | return add_query_arg( [ 'id' => $this->get_form_id() ], parent::get_screen_link() ); | 97 | Column\Entry\Original\SourceUrl::class, |
| 92 | } | 98 | Column\Entry\Original\Starred::class, |
| 93 | 99 | Column\Entry\Original\TransactionId::class, | |
| 94 | public function get_list_table(): GF_Entry_List_Table { | 100 | Column\Entry\Original\User::class, |
| 95 | return ( new GravityForms\TableFactory() )->create( $this->get_screen_id(), $this->form_id ); | 101 | Column\Entry\Original\UserIp::class, |
| 96 | } | 102 | ]); |
| 97 | 103 | } | |
| 98 | public function register_column_types(): void { | ||
| 99 | $this->column_configurator->register_entry_columns( $this ); | ||
| 100 | |||
| 101 | $this->register_column_types_from_list( [ | ||
| 102 | Column\Entry\Custom\User::class, | ||
| 103 | Column\Entry\Original\DateCreated::class, | ||
| 104 | Column\Entry\Original\DatePayment::class, | ||
| 105 | Column\Entry\Original\EntryId::class, | ||
| 106 | Column\Entry\Original\PaymentAmount::class, | ||
| 107 | Column\Entry\Original\SourceUrl::class, | ||
| 108 | Column\Entry\Original\Starred::class, | ||
| 109 | Column\Entry\Original\TransactionId::class, | ||
| 110 | Column\Entry\Original\User::class, | ||
| 111 | Column\Entry\Original\UserIp::class, | ||
| 112 | ] ); | ||
| 113 | } | ||
| 114 | 104 | ||
| 115 | } | 105 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -3,99 +3,86 @@ | ... | @@ -3,99 +3,86 @@ |
| 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 |
| 19 | { | ||
| 20 | return null !== $this->get_form_id_from_list_key($key); | ||
| 21 | } | ||
| 20 | 22 | ||
| 21 | public function can_create( string $key ): bool { | 23 | protected function create_list_screen(string $key): ListScreen |
| 22 | return null !== $this->get_form_id_from_list_key( $key ); | 24 | { |
| 23 | } | 25 | $form_id = $this->get_form_id_from_list_key($key); |
| 24 | 26 | ||
| 25 | private function get_form_id_from_list_key( string $key ): ?int { | 27 | return new Entry($form_id, $this->create_entry_configurator($this->get_form_id_from_list_key($key))); |
| 26 | if ( ! ac_helper()->string->starts_with( $key, 'gf_entry_' ) ) { | 28 | } |
| 27 | return null; | ||
| 28 | } | ||
| 29 | 29 | ||
| 30 | $entry_id = ac_helper()->string->remove_prefix( $key, 'gf_entry_' ); | 30 | private function get_form_id_from_list_key(string $key): ?int |
| 31 | { | ||
| 32 | if ( ! ac_helper()->string->starts_with($key, 'gf_entry_')) { | ||
| 33 | return null; | ||
| 34 | } | ||
| 31 | 35 | ||
| 32 | return is_numeric( $entry_id ) | 36 | $entry_id = ac_helper()->string->remove_prefix($key, 'gf_entry_'); |
| 33 | ? (int) $entry_id | ||
| 34 | : null; | ||
| 35 | } | ||
| 36 | 37 | ||
| 37 | public function create( string $key, array $settings = [] ): ListScreen { | 38 | return is_numeric($entry_id) |
| 38 | if ( ! $this->can_create( $key ) ) { | 39 | ? (int)$entry_id |
| 39 | throw new LogicException( 'Invalid key' ); | 40 | : null; |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | $form_id = $this->get_form_id_from_list_key( $key ); | 43 | public function can_create_from_wp_screen(WP_Screen $screen): bool |
| 44 | { | ||
| 45 | return strpos($screen->id, '_page_gf_entries') !== false && | ||
| 46 | strpos($screen->base, '_page_gf_entries') !== false && | ||
| 47 | $this->has_form_id(); | ||
| 48 | } | ||
| 43 | 49 | ||
| 44 | if ( null === $form_id ) { | 50 | private function has_form_id(): bool |
| 45 | throw new LogicException( 'Invalid form id' ); | 51 | { |
| 46 | } | 52 | return $this->get_current_form_id() > 0; |
| 53 | } | ||
| 47 | 54 | ||
| 48 | return $this->add_settings( | 55 | protected function create_list_screen_from_wp_screen(WP_Screen $screen): ListScreen |
| 49 | new Entry( $form_id, $this->create_entry_configurator( $form_id ) ), | 56 | { |
| 50 | $settings | 57 | $form_id = $this->get_current_form_id(); |
| 51 | ); | ||
| 52 | } | ||
| 53 | 58 | ||
| 54 | public function can_create_by_wp_screen( WP_Screen $screen ): bool { | 59 | return new Entry($form_id, $this->create_entry_configurator($form_id)); |
| 55 | return strpos( $screen->id, '_page_gf_entries' ) !== false && | 60 | } |
| 56 | strpos( $screen->base, '_page_gf_entries' ) !== false && | ||
| 57 | $this->has_form_id(); | ||
| 58 | } | ||
| 59 | 61 | ||
| 60 | private function has_form_id(): bool { | 62 | private function get_current_form_id(): int |
| 61 | return $this->get_current_form_id() > 0; | 63 | { |
| 62 | } | 64 | $form_id = GFForms::get('id'); |
| 63 | 65 | ||
| 64 | public function create_by_wp_screen( WP_Screen $screen, array $settings = [] ): ListScreen { | 66 | if ( ! $form_id) { |
| 65 | if ( ! $this->can_create_by_wp_screen( $screen ) ) { | 67 | $forms = GFFormsModel::get_forms(); |
| 66 | throw new LogicException( 'Invalid screen' ); | ||
| 67 | } | ||
| 68 | 68 | ||
| 69 | $form_id = $this->get_current_form_id(); | 69 | if ($forms) { |
| 70 | $form_id = $forms[0]->id; | ||
| 71 | } | ||
| 72 | } | ||
| 70 | 73 | ||
| 71 | return $this->add_settings( | 74 | return (int)$form_id; |
| 72 | new Entry( $form_id, $this->create_entry_configurator( $form_id ) ), | 75 | } |
| 73 | $settings | ||
| 74 | ); | ||
| 75 | } | ||
| 76 | 76 | ||
| 77 | private function get_current_form_id(): int { | 77 | private function create_entry_configurator(int $form_id): EntryConfigurator |
| 78 | $form_id = GFForms::get( 'id' ); | 78 | { |
| 79 | $fieldFactory = new FieldFactory(); | ||
| 80 | $columnFactory = new GravityForms\Column\EntryFactory($fieldFactory); | ||
| 79 | 81 | ||
| 80 | if ( ! $form_id ) { | 82 | $entry_configurator = new EntryConfigurator($form_id, $columnFactory, $fieldFactory); |
| 81 | $forms = GFFormsModel::get_forms(); | 83 | $entry_configurator->register(); |
| 82 | 84 | ||
| 83 | if ( $forms ) { | 85 | return $entry_configurator; |
| 84 | $form_id = $forms[0]->id; | 86 | } |
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | return (int) $form_id; | ||
| 89 | } | ||
| 90 | |||
| 91 | private function create_entry_configurator( int $form_id ): EntryConfigurator { | ||
| 92 | $fieldFactory = new FieldFactory(); | ||
| 93 | $columnFactory = new GravityForms\Column\EntryFactory( $fieldFactory ); | ||
| 94 | |||
| 95 | $entry_configurator = new EntryConfigurator( $form_id, $columnFactory, $fieldFactory ); | ||
| 96 | $entry_configurator->register(); | ||
| 97 | |||
| 98 | return $entry_configurator; | ||
| 99 | } | ||
| 100 | 87 | ||
| 101 | } | 88 | } |
| ... | \ 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 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 | { | ||
| 13 | |||
| 14 | private $table; | ||
| 10 | 15 | ||
| 11 | private $listTable; | 16 | public function __construct(GF_Entry_List_Table $table) |
| 17 | { | ||
| 18 | $this->table = $table; | ||
| 19 | } | ||
| 12 | 20 | ||
| 13 | public function __construct( GF_Entry_List_Table $listTable ) { | 21 | public function get_column_value(string $column, int $id): string |
| 14 | $this->listTable = $listTable; | 22 | { |
| 15 | } | 23 | ob_start(); |
| 24 | $this->table->column_default(GFAPI::get_entry($id), $column); | ||
| 16 | 25 | ||
| 17 | public function get_column_value( $column, $id ) { | 26 | return ob_get_clean(); |
| 18 | ob_start(); | 27 | } |
| 19 | 28 | ||
| 20 | $entry = GFAPI::get_entry( $id ); | 29 | public function get_total_items(): int |
| 21 | $this->listTable->column_default( $entry, $column ); | 30 | { |
| 31 | return $this->table->get_pagination_arg('total_items'); | ||
| 32 | } | ||
| 22 | 33 | ||
| 23 | return ob_get_clean(); | 34 | public function render_row(int $id): string |
| 24 | } | 35 | { |
| 36 | ob_start(); | ||
| 37 | $this->table->single_row(GFAPI::get_entry($id)); | ||
| 25 | 38 | ||
| 26 | public function get_total_items() { | 39 | return ob_get_clean(); |
| 27 | return $this->listTable->get_pagination_arg( 'total_items' ); | 40 | } |
| 28 | } | ||
| 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,59 +5,63 @@ namespace ACA\GravityForms\Search; | ... | @@ -5,59 +5,63 @@ 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 | * @var int | 11 | /** |
| 12 | */ | 12 | * @var int |
| 13 | private $form_id; | 13 | */ |
| 14 | 14 | private $form_id; | |
| 15 | /** | 15 | |
| 16 | * @var string | 16 | /** |
| 17 | */ | 17 | * @var string |
| 18 | private $status; | 18 | */ |
| 19 | 19 | private $status; | |
| 20 | public function register() { | 20 | |
| 21 | add_filter( 'gform_get_entries_args_entry_list', [ $this, 'catch_list_details' ], 10, 3 ); | 21 | public function register(): void |
| 22 | add_filter( 'gform_gf_query_sql', [ $this, 'parse_search_query' ] ); | 22 | { |
| 23 | } | 23 | add_filter('gform_get_entries_args_entry_list', [$this, 'catch_list_details'], 10, 3); |
| 24 | 24 | add_filter('gform_gf_query_sql', [$this, 'parse_search_query']); | |
| 25 | public function catch_list_details( array $args ) { | 25 | } |
| 26 | $this->form_id = (int) $args['form_id']; | 26 | |
| 27 | $this->status = (string) $args['search_criteria']['status']; | 27 | public function catch_list_details(array $args): array |
| 28 | 28 | { | |
| 29 | return $args; | 29 | $this->form_id = (int)$args['form_id']; |
| 30 | } | 30 | $this->status = (string)$args['search_criteria']['status']; |
| 31 | 31 | ||
| 32 | public function parse_search_query( array $query ) { | 32 | return $args; |
| 33 | global $wpdb; | 33 | } |
| 34 | 34 | ||
| 35 | $entry_table = GFFormsModel::get_entry_table_name(); | 35 | public function parse_search_query(array $query): array |
| 36 | 36 | { | |
| 37 | $where = sprintf( | 37 | global $wpdb; |
| 38 | 'WHERE %s.form_id = %s AND %s.status = %s', | 38 | |
| 39 | $entry_table, | 39 | $entry_table = GFFormsModel::get_entry_table_name(); |
| 40 | $wpdb->prepare( '%d', $this->form_id ), | 40 | |
| 41 | $entry_table, | 41 | $where = sprintf( |
| 42 | $wpdb->prepare( '%s', $this->status ) | 42 | 'WHERE %s.form_id = %s AND %s.status = %s', |
| 43 | ); | 43 | $entry_table, |
| 44 | 44 | $wpdb->prepare('%d', $this->form_id), | |
| 45 | $query['select'] = sprintf( 'SELECT SQL_CALC_FOUND_ROWS DISTINCT %s.id', $entry_table ); | 45 | $entry_table, |
| 46 | $query['from'] = sprintf( 'FROM %s', $entry_table ); | 46 | $wpdb->prepare('%s', $this->status) |
| 47 | $query['where'] = $where; | 47 | ); |
| 48 | $query['order'] = sprintf( 'ORDER BY %s.id DESC', $entry_table ); | 48 | |
| 49 | 49 | $query['select'] = sprintf('SELECT SQL_CALC_FOUND_ROWS DISTINCT %s.id', $entry_table); | |
| 50 | foreach ( $this->bindings as $binding ) { | 50 | $query['from'] = sprintf('FROM %s', $entry_table); |
| 51 | if ( $binding->get_where() ) { | 51 | $query['where'] = $where; |
| 52 | $query['where'] .= "\nAND " . $binding->get_where(); | 52 | $query['order'] = sprintf('ORDER BY %s.id DESC', $entry_table); |
| 53 | } | 53 | |
| 54 | 54 | foreach ($this->bindings as $binding) { | |
| 55 | if ( $binding->get_join() ) { | 55 | if ($binding->get_where()) { |
| 56 | $query['join'] .= "\n" . $binding->get_join(); | 56 | $query['where'] .= "\nAND " . $binding->get_where(); |
| 57 | } | 57 | } |
| 58 | } | 58 | |
| 59 | 59 | if ($binding->get_join()) { | |
| 60 | return $query; | 60 | $query['join'] .= "\n" . $binding->get_join(); |
| 61 | } | 61 | } |
| 62 | } | ||
| 63 | |||
| 64 | return $query; | ||
| 65 | } | ||
| 62 | 66 | ||
| 63 | } | 67 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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 | * @var Field | 14 | /** |
| 15 | */ | 15 | * @var Field |
| 16 | protected $field; | 16 | */ |
| 17 | 17 | protected $field; | |
| 18 | public function __construct() { | 18 | |
| 19 | $this->set_group( ColumnGroups::JET_ENGINE ) | 19 | public function __construct() |
| 20 | ->set_label( 'JetEngine Meta' ); | 20 | { |
| 21 | } | 21 | $this->set_group(ColumnGroups::JET_ENGINE) |
| 22 | 22 | ->set_label('JetEngine Meta'); | |
| 23 | public function get_raw_value( $id ) { | 23 | } |
| 24 | return get_metadata( $this->list_screen->get_meta_type(), $id, $this->get_type(), true ); | 24 | |
| 25 | } | 25 | public function get_raw_value($id) |
| 26 | 26 | { | |
| 27 | protected function get_meta_type() { | 27 | return get_metadata($this->list_screen->get_meta_type(), $id, $this->get_type(), true); |
| 28 | return $this->list_screen->get_meta_type(); | 28 | } |
| 29 | } | 29 | |
| 30 | 30 | // Delayed constructor | |
| 31 | // Delayed constructor | 31 | public function set_field(Field $field) |
| 32 | 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 | return $this->get_type(); | 37 | { |
| 38 | } | 38 | return $this->get_type(); |
| 39 | 39 | } | |
| 40 | public function export() { | 40 | |
| 41 | return ( new Export\ModelFactory() )->create( $this, $this->field ) ?: false; | 41 | public function export() |
| 42 | } | 42 | { |
| 43 | return (new Export\ModelFactory())->create($this, $this->field) ?: false; | ||
| 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 | use SearchableTrait, | 20 | |
| 21 | EditableTrait, | 21 | use SearchableTrait; |
| 22 | DefaultValueFormatterTrait, | 22 | use EditableTrait; |
| 23 | ACP\ConditionalFormat\FilteredHtmlFormatTrait; | 23 | use DefaultValueFormatterTrait; |
| 24 | 24 | use ACP\ConditionalFormat\FilteredHtmlFormatTrait; | |
| 25 | protected function register_settings() { | 25 | |
| 26 | $this->add_setting( new Settings\Column\Post( $this ) ); | 26 | protected function register_settings() |
| 27 | } | 27 | { |
| 28 | 28 | $this->add_setting(new Settings\Column\Post($this)); | |
| 29 | /** | 29 | } |
| 30 | * @return Settings\Column\Post | 30 | |
| 31 | */ | 31 | /** |
| 32 | private function get_post_setting() { | 32 | * @return Settings\Column\Post |
| 33 | $setting = $this->get_setting( Settings\Column\Post::NAME ); | 33 | */ |
| 34 | 34 | private function get_post_setting() | |
| 35 | return $setting instanceof Settings\Column\Post | 35 | { |
| 36 | ? $setting | 36 | $setting = $this->get_setting(Settings\Column\Post::NAME); |
| 37 | : null; | 37 | |
| 38 | } | 38 | return $setting instanceof Settings\Column\Post |
| 39 | 39 | ? $setting | |
| 40 | public function sorting() { | 40 | : null; |
| 41 | return ( new Sorting\ModelFactory\Post )->create( $this->get_meta_type(), $this->get_meta_key(), $this->field->is_multiple(), $this->get_post_setting() ); | 41 | } |
| 42 | } | 42 | |
| 43 | public function sorting() | ||
| 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 | ); | ||
| 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,67 +3,81 @@ | ... | @@ -3,67 +3,81 @@ |
| 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 |
| 12 | 11 | { | |
| 13 | /** | 12 | |
| 14 | * @var FieldFactory | 13 | /** |
| 15 | */ | 14 | * @var FieldFactory |
| 16 | private $field_factory; | 15 | */ |
| 17 | 16 | private $field_factory; | |
| 18 | public function __construct() { | 17 | |
| 19 | $this->field_factory = new FieldFactory(); | 18 | /** |
| 20 | } | 19 | * @var ListScreen |
| 21 | 20 | */ | |
| 22 | public function find_by_column( Column\Meta $column ): ?Field { | 21 | private $list_screen; |
| 23 | $fields = $this->find_by_list_screen( $column->get_list_screen() ); | 22 | |
| 24 | 23 | public function __construct(ListScreen $list_screen) | |
| 25 | if ( empty( $fields ) ) { | 24 | { |
| 26 | return null; | 25 | $this->list_screen = $list_screen; |
| 27 | } | 26 | $this->field_factory = new FieldFactory(); |
| 28 | 27 | } | |
| 29 | $field = array_filter( $fields, static function ( $field ) use ( $column ) { | 28 | |
| 30 | return $field->get_name() === $column->get_type(); | 29 | public function find_by_column(Column\Meta $column): ?Field |
| 31 | } ); | 30 | { |
| 32 | 31 | $fields = $this->find_all(); | |
| 33 | return empty( $field ) ? null : current( $field ); | 32 | |
| 34 | } | 33 | if (empty($fields)) { |
| 35 | 34 | return null; | |
| 36 | /** | 35 | } |
| 37 | * @return Field[] | 36 | |
| 38 | */ | 37 | $field = array_filter($fields, static function ($field) use ($column) { |
| 39 | public function find_by_list_screen( ListScreen $list_screen ): array { | 38 | return $field->get_name() === $column->get_type(); |
| 40 | switch ( true ) { | 39 | }); |
| 41 | case $list_screen instanceof ListScreen\Post: | 40 | |
| 42 | return $this->map_meta_types( Api::MetaBox()->get_fields_for_context( 'post_type', $list_screen->get_post_type() ) ); | 41 | return empty($field) ? null : current($field); |
| 43 | case $list_screen instanceof ACP\ListScreen\Taxonomy: | 42 | } |
| 44 | return $this->map_meta_types( Api::MetaBox()->get_fields_for_context( 'taxonomy', $list_screen->get_taxonomy() ) ); | 43 | |
| 45 | case $list_screen instanceof ACP\ListScreen\User: | 44 | /** |
| 46 | $fields = array_merge( ...array_values( Api::MetaBox()->get_fields_for_context( 'user' ) ) ); | 45 | * @return Field[] |
| 47 | 46 | */ | |
| 48 | return $this->map_meta_types( $fields ); | 47 | public function find_all(): array |
| 49 | } | 48 | { |
| 50 | 49 | switch (true) { | |
| 51 | return []; | 50 | case $this->list_screen instanceof ListScreen\Post: |
| 52 | } | 51 | return $this->map_meta_types( |
| 53 | 52 | Api::MetaBox()->get_fields_for_context('post_type', $this->list_screen->get_post_type()) | |
| 54 | /** | 53 | ); |
| 55 | * @return Field[] | 54 | case $this->list_screen instanceof ACP\ListScreen\Taxonomy: |
| 56 | */ | 55 | return $this->map_meta_types( |
| 57 | private function map_meta_types( array $meta_types ): array { | 56 | Api::MetaBox()->get_fields_for_context('taxonomy', $this->list_screen->get_taxonomy()) |
| 58 | $fields = []; | 57 | ); |
| 59 | 58 | case $this->list_screen instanceof ACP\ListScreen\User: | |
| 60 | foreach ( $meta_types as $field ) { | 59 | $fields = array_merge(...array_values(Api::MetaBox()->get_fields_for_context('user'))); |
| 61 | if ( isset( $field['object_type'] ) && $field['object_type'] === 'field' ) { | 60 | |
| 62 | $fields[] = $this->field_factory->create( $field ); | 61 | return $this->map_meta_types($fields); |
| 63 | } | 62 | } |
| 64 | } | 63 | |
| 65 | 64 | return []; | |
| 66 | return array_filter( $fields ); | 65 | } |
| 67 | } | 66 | |
| 67 | /** | ||
| 68 | * @return Field[] | ||
| 69 | */ | ||
| 70 | private function map_meta_types(array $meta_types): array | ||
| 71 | { | ||
| 72 | $fields = []; | ||
| 73 | |||
| 74 | foreach ($meta_types as $field) { | ||
| 75 | if (isset($field['object_type']) && $field['object_type'] === 'field') { | ||
| 76 | $fields[] = $this->field_factory->create($field); | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | return array_filter($fields); | ||
| 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 |
| 10 | 11 | { | |
| 11 | private $location; | 12 | |
| 12 | 13 | private $location; | |
| 13 | public function __construct( AC\Asset\Location\Absolute $location ) { | 14 | |
| 14 | $this->location = $location; | 15 | public function __construct(AC\Asset\Location\Absolute $location) |
| 15 | } | 16 | { |
| 16 | 17 | $this->location = $location; | |
| 17 | public function register() { | 18 | } |
| 18 | if ( ! class_exists( 'Jet_Engine', false ) || ! $this->check_minimum_jet_engine_version() ) { | 19 | |
| 19 | return; | 20 | public function register(): void |
| 20 | } | 21 | { |
| 21 | 22 | if ( ! class_exists('Jet_Engine', false) || ! $this->check_minimum_jet_engine_version()) { | |
| 22 | $services = [ | 23 | return; |
| 23 | new Service\Admin( $this->location ), | 24 | } |
| 24 | new Service\ColumnInstantiate, | 25 | |
| 25 | new Service\ColumnGroups, | 26 | $this->create_services()->register(); |
| 26 | new Service\RelationalColumns(), | 27 | } |
| 27 | new Service\MetaColumns(), | 28 | |
| 28 | new IntegrationStatus( 'ac-addon-jetengine' ), | 29 | private function create_services(): Services |
| 29 | ]; | 30 | { |
| 30 | 31 | return new Services([ | |
| 31 | foreach ( $services as $service ) { | 32 | new Service\Admin($this->location), |
| 32 | if ( $service instanceof Registerable ) { | 33 | new Service\ColumnInstantiate(), |
| 33 | $service->register(); | 34 | new Service\ColumnGroups(), |
| 34 | } | 35 | new Service\RelationalColumns(), |
| 35 | } | 36 | new Service\MetaColumns(), |
| 36 | } | 37 | new IntegrationStatus('ac-addon-jetengine'), |
| 37 | 38 | ]); | |
| 38 | private function check_minimum_jet_engine_version(): bool { | 39 | } |
| 39 | $jet_engine = jet_engine(); | 40 | |
| 40 | 41 | private function check_minimum_jet_engine_version(): bool | |
| 41 | return $jet_engine | 42 | { |
| 42 | ? version_compare( $jet_engine->get_version(), '2.11.0', '>=' ) | 43 | $jet_engine = jet_engine(); |
| 43 | : false; | 44 | |
| 44 | } | 45 | return $jet_engine && version_compare($jet_engine->get_version(), '2.11.0', '>='); |
| 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