diff --git a/AdminSearch/TemplateModification.php b/AdminSearch/TemplateModification.php new file mode 100644 index 0000000..e1935d2 --- /dev/null +++ b/AdminSearch/TemplateModification.php @@ -0,0 +1,53 @@ +app->finder('XF:TemplateModification'); + + $conditions = [ + [$finder->caseInsensitive('description'), 'like', $finder->escapeLike($text, '%?%')], + [$finder->caseInsensitive('modification_key'), 'like', $finder->escapeLike($text, '%?%')], + ]; + if ($previousMatchIds) + { + $conditions[] = ['modification_id', $previousMatchIds]; + } + + $finder + ->whereOr($conditions) + ->order($finder->caseInsensitive('modification_key')) + ->limit($limit); + + return $finder->fetch(); + } + + public function getTemplateData(Entity $record) + { + /** @var Router $router */ + $router = $this->app->container('router.admin'); + + return [ + 'link' => $router->buildLink('template-modification/edit', $record), + 'title' => $record->modification_key, + ]; + } + + public function isSearchable() + { + return \XF::$developmentMode; + } +} diff --git a/_output/content_type_fields/tck_template_modification-admin_search_class.json b/_output/content_type_fields/tck_template_modification-admin_search_class.json new file mode 100644 index 0000000..4efef2e --- /dev/null +++ b/_output/content_type_fields/tck_template_modification-admin_search_class.json @@ -0,0 +1,5 @@ +{ + "content_type": "tck_template_modification", + "field_name": "admin_search_class", + "field_value": "TickTackk\\DeveloperTools\\AdminSearch\\TemplateModification" +} \ No newline at end of file diff --git a/_output/phrases/tck_template_modifications.txt b/_output/phrases/tck_template_modifications.txt new file mode 100644 index 0000000..a9b5b3d --- /dev/null +++ b/_output/phrases/tck_template_modifications.txt @@ -0,0 +1 @@ +Template Modifications \ No newline at end of file