$fieldName, ]; }, $filters); $filteringForm = $this->Bootstrap->table( [ 'small' => true, 'striped' => false, 'hover' => false, 'tableClass' => ['indexFilteringTable'], ], [ 'fields' => [ [ 'key' => 'fieldname', 'label' => __('Field'), 'formatter' => function ($field, $row) { return sprintf('%s', h($field), h($field)); } ], [ 'key' => 'operator', 'label' => __('Operator'), 'formatter' => function ($field, $row) { $options = [ sprintf('', '=', '='), sprintf('', '!=', '!='), ]; return sprintf('', implode('', $options)); } ], [ 'key' => 'value', 'labelHtml' => sprintf( '%s %s', __('Value'), sprintf('', __('Supports strict matches and LIKE matches with the `%` character. Example: `%.com`')) ), 'formatter' => function ($field, $row) { return sprintf(''); } ], ], 'items' => $tableItems ] ); $filteringMetafields = ''; if ($metaFieldsEnabled) { $helpText = $this->Bootstrap->genNode('sup', [ 'class' => ['ms-1 fa fa-info'], 'title' => __('Include help'), 'data-bs-toggle' => 'tooltip', ]); $filteringMetafields = $this->Bootstrap->genNode('h5', [], __('Meta Fields') . $helpText); $filteringMetafields .= $this->element('genericElements/IndexTable/metafield_filtering', $metaTemplates); } $filteringTags = ''; if ($taggingEnabled) { $helpText = $this->Bootstrap->genNode('sup', [ 'class' => ['ms-1 fa fa-info'], 'title' => __('Supports negation matches (with the `!` character) and LIKE matches (with the `%` character). Example: `!exportable`, `%able`'), 'data-bs-toggle' => 'tooltip', ]); $filteringTags = $this->Bootstrap->genNode('h5', [ 'class' => 'mt-2' ], __('Tags') . $helpText); $filteringTags .= $this->Tag->tags([], [ 'allTags' => $allTags, 'picker' => true, 'editable' => false, ]); } $modalBody = implode('', [$filteringForm, $filteringMetafields, $filteringTags]); echo $this->Bootstrap->modal([ 'title' => __('Filtering options for {0}', Inflector::singularize($this->request->getParam('controller'))), 'size' => !empty($metaFieldsEnabled) ? 'xl' : 'lg', 'type' => 'confirm', 'bodyHtml' => $modalBody, 'confirmText' => __('Filter'), 'confirmFunction' => 'filterIndex' ]); ?>