From a816a703f227cdbe4f25de47d5dfb04ed4bf097a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 16 Nov 2013 17:16:28 +0100 Subject: [PATCH] [feature/module_services] Move search module to module services --- config/services.yml | 9 +++ migrations/v210_beta1.php | 2 +- .../portal_search.php => modules/search.php | 58 +++++++++++-------- 3 files changed, 43 insertions(+), 26 deletions(-) rename portal/modules/portal_search.php => modules/search.php (56%) diff --git a/config/services.yml b/config/services.yml index c0f9cf52..1bbaaf91 100644 --- a/config/services.yml +++ b/config/services.yml @@ -179,6 +179,15 @@ services: tags: - { name: board3.module } + board3.module.search: + class: \board3\portal\modules\search + arguments: + - @template + - %core.php_ext% + - %core.root_path% + tags: + - { name: board3.module } + board3.module.stylechanger: class: \board3\portal\modules\stylechanger arguments: diff --git a/migrations/v210_beta1.php b/migrations/v210_beta1.php index 1a7ffd78..c612ab2c 100644 --- a/migrations/v210_beta1.php +++ b/migrations/v210_beta1.php @@ -347,7 +347,7 @@ class v210_beta1 extends \phpbb\db\migration\migration 'module_status' => 1, ), array( - 'module_classname' => 'search', + 'module_classname' => '\board3\portal\modules\search', 'module_column' => 1, 'module_order' => 5, 'module_name' => 'PORTAL_SEARCH', diff --git a/portal/modules/portal_search.php b/modules/search.php similarity index 56% rename from portal/modules/portal_search.php rename to modules/search.php index f87bc876..e3a6413c 100644 --- a/portal/modules/portal_search.php +++ b/modules/search.php @@ -1,24 +1,18 @@ template = $template; + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + } + + /** + * @inheritdoc + */ public function get_template_side($module_id) { - global $template, $phpbb_root_path, $phpEx; - - $template->assign_var('S_SEARCH_ACTION', append_sid("{$phpbb_root_path}search.$phpEx")); + $this->template->assign_var('S_SEARCH_ACTION', append_sid("{$this->phpbb_root_path}search.{$this->php_ext}")); return 'search_side.html'; } + /** + * @inheritdoc + */ public function get_template_acp($module_id) { return array( @@ -69,17 +90,4 @@ class portal_search_module extends \board3\portal\modules\module_base 'vars' => array(), ); } - - /** - * API functions - */ - public function install($module_id) - { - return true; - } - - public function uninstall($module_id, $db) - { - return true; - } }