diff --git a/src/Backend.php b/src/Backend.php index 1e80a62..45ccba2 100644 --- a/src/Backend.php +++ b/src/Backend.php @@ -62,6 +62,7 @@ class Backend extends dcNsProcess dcCore::app()->addBehaviors([ // user pref 'adminFiltersListsV2' => [BackendBehaviors::class, 'adminFiltersListsV2'], + 'adminColumnsListsV2' => [BackendBehaviors::class, 'adminColumnsListsV2'], 'adminBlogPreferencesFormV2' => [BackendBehaviors::class, 'adminBlogPreferencesFormV2'], 'adminBeforeBlogSettingsUpdate' => [BackendBehaviors::class, 'adminBeforeBlogSettingsUpdate'], // post diff --git a/src/BackendBehaviors.php b/src/BackendBehaviors.php index d9fa50f..d34a49a 100644 --- a/src/BackendBehaviors.php +++ b/src/BackendBehaviors.php @@ -42,6 +42,11 @@ class BackendBehaviors ]; } + /** + * User pref widget text filters options. + * + * @param ArrayObject $sorts Sort options + */ public static function adminFiltersListsV2(ArrayObject $sorts): void { $sorts['pwt'] = [ @@ -53,6 +58,25 @@ class BackendBehaviors ]; } + /** + * User pref for widget text columns lists. + * + * @param ArrayObject $cols Columns + */ + public static function adminColumnsListsV2(ArrayObject $cols): void + { + $cols[My::id()] = [ + My::name(), + [ + 'post_dt' => [true, __('Entry date')], + 'option_title' => [true, __('Widget title')], + 'option_creadt' => [true, __('Widget date')], + 'user_id' => [true, __('Author')], + 'post_type' => [true, __('Entry type')], + ], + ]; + } + public static function adminBlogPreferencesFormV2(dcSettings $blog_settings): void { echo ' diff --git a/src/Manage.php b/src/Manage.php index 6840b0c..4c7ac0b 100644 --- a/src/Manage.php +++ b/src/Manage.php @@ -87,6 +87,9 @@ class Manage extends dcNsProcess # filters $filter = new adminGenericFilterV2('pwt'); $filter->add(dcAdminFilters::getPageFilter()); + $filter->add(dcAdminFilters::getInputFilter('search_post_title', __('Entry:'))); + $filter->add(dcAdminFilters::getInputFilter('search_widget_title', __('Widget:'))); + $filter->add(dcAdminFilters::getInputFilter('user_id', __('User:'))); $params = $filter->params(); # Get posts with text widget @@ -118,14 +121,13 @@ class Manage extends dcNsProcess $filter->display('admin.plugin.' . My::id(), form::hidden('p', My::id())); $posts_list->display( - (int) $filter->value('page'), - (int) $filter->value('nb'), + $filter, '