[feature/module_services] Move search module to module services

This commit is contained in:
Marc Alexander
2013-11-16 17:16:28 +01:00
parent 19c2d437a4
commit a816a703f2
3 changed files with 43 additions and 26 deletions

View File

@@ -179,6 +179,15 @@ services:
tags: tags:
- { name: board3.module } - { 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: board3.module.stylechanger:
class: \board3\portal\modules\stylechanger class: \board3\portal\modules\stylechanger
arguments: arguments:

View File

@@ -347,7 +347,7 @@ class v210_beta1 extends \phpbb\db\migration\migration
'module_status' => 1, 'module_status' => 1,
), ),
array( array(
'module_classname' => 'search', 'module_classname' => '\board3\portal\modules\search',
'module_column' => 1, 'module_column' => 1,
'module_order' => 5, 'module_order' => 5,
'module_name' => 'PORTAL_SEARCH', 'module_name' => 'PORTAL_SEARCH',

View File

@@ -1,24 +1,18 @@
<?php <?php
/** /**
* *
* @package Board3 Portal v2 - Search * @package Board3 Portal v2.1
* @copyright (c) Board3 Group ( www.board3.de ) * @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License * @license http://opensource.org/licenses/gpl-license.php GNU Public License
* *
*/ */
/** namespace board3\portal\modules;
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/** /**
* @package Search * @package Search
*/ */
class portal_search_module extends \board3\portal\modules\module_base class search extends module_base
{ {
/** /**
* Allowed columns: Just sum up your options (Exp: left + right = 10) * Allowed columns: Just sum up your options (Exp: left + right = 10)
@@ -53,15 +47,42 @@ class portal_search_module extends \board3\portal\modules\module_base
*/ */
public $custom_acp_tpl = ''; public $custom_acp_tpl = '';
/** @var \phpbb\template */
protected $template;
/** @var phpbb root path */
protected $phpbb_root_path;
/** @var php file extension */
protected $php_ext;
/**
* Construct a search object
*
* @param \phpbb\template $template phpBB template
* @param string $phpbb_root_path phpbb root path
* @param string $php_ext php file extension
*/
public function __construct($template, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
/**
* @inheritdoc
*/
public function get_template_side($module_id) public function get_template_side($module_id)
{ {
global $template, $phpbb_root_path, $phpEx; $this->template->assign_var('S_SEARCH_ACTION', append_sid("{$this->phpbb_root_path}search.{$this->php_ext}"));
$template->assign_var('S_SEARCH_ACTION', append_sid("{$phpbb_root_path}search.$phpEx"));
return 'search_side.html'; return 'search_side.html';
} }
/**
* @inheritdoc
*/
public function get_template_acp($module_id) public function get_template_acp($module_id)
{ {
return array( return array(
@@ -69,17 +90,4 @@ class portal_search_module extends \board3\portal\modules\module_base
'vars' => array(), 'vars' => array(),
); );
} }
/**
* API functions
*/
public function install($module_id)
{
return true;
}
public function uninstall($module_id, $db)
{
return true;
}
} }