From 53a58f8a7c9c56833981135a8da443004ea12044 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 09:12:18 +0200 Subject: [PATCH 1/8] [ticket/289] Removed duplicated code from attachments.php --- modules/attachments.php | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/modules/attachments.php b/modules/attachments.php index a315d9ee..caa62a48 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -167,6 +167,8 @@ class attachments extends module_base */ public function select_filetype($value, $key, $module_id) { + $extensions = array(); + // Get extensions $sql = 'SELECT * FROM ' . EXTENSIONS_TABLE . ' @@ -178,11 +180,7 @@ class attachments extends module_base $extensions[] = $row; } - $selected = array(); - if(isset($this->config['board3_attachments_filetype_' . $module_id]) && strlen($this->config['board3_attachments_filetype_' . $module_id]) > 0) - { - $selected = explode(',', $this->config['board3_attachments_filetype_' . $module_id]); - } + $selected = $this->get_selected_filetypes($module_id); // Build options $ext_options = ''; + foreach ($select_ary as $id => $option) + { + $options .= ''; + } + $options .= ''; + + return $options; + } } diff --git a/modules/attachments.php b/modules/attachments.php index caa62a48..d86b52ae 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -47,6 +47,9 @@ class attachments extends module_base /** @var \phpbb\config\config */ protected $config; + /** @var \board3\portal\includes\modules_helper */ + protected $helper; + /** @var \phpbb\request\request */ protected $request; @@ -70,6 +73,7 @@ class attachments extends module_base * * @param \phpbb\auth\auth $auth phpBB auth service * @param \phpbb\config\config $config phpBB config + * @param \board3\portal\includes\modules_helper $helper Modules helper * @param \phpbb\template $template phpBB template * @param \phpbb\db\driver $db Database driver * @param \phpbb\request\request $request phpBB request @@ -77,10 +81,11 @@ class attachments extends module_base * @param string $phpbb_root_path phpBB root path * @param \phpbb\user $user phpBB user object */ - public function __construct($auth, $config, $template, $db, $request, $phpEx, $phpbb_root_path, $user) + public function __construct($auth, $config, $helper, $template, $db, $request, $phpEx, $phpbb_root_path, $user) { $this->auth = $auth; $this->config = $config; + $this->helper = $helper; $this->template = $template; $this->db = $db; $this->request = $request; @@ -177,20 +182,15 @@ class attachments extends module_base while ($row = $this->db->sql_fetchrow($result)) { - $extensions[] = $row; + $extensions[] = array( + 'value' => $row['extension'], + 'title' => $row['extension'], + ); } $selected = $this->get_selected_filetypes($module_id); - // Build options - $ext_options = ''; - - return $ext_options; + return $this->helper->generate_select_box($key, $extensions, $selected); } /** diff --git a/tests/unit/includes/modules_helper_test.php b/tests/unit/includes/modules_helper_test.php index 307f0f06..9f373dcb 100644 --- a/tests/unit/includes/modules_helper_test.php +++ b/tests/unit/includes/modules_helper_test.php @@ -43,4 +43,44 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe { $this->assertEquals($expected, $this->modules_helper->get_disallowed_forums($input)); } + + public function data_generate_select_box() + { + return array( + array('', + 'foobar', + array( + '1' => array( + 'value' => 'one', + 'title' => 'one', + ), + '2' => array( + 'value' => 'two', + 'title' => 'two', + ), + ), + array('two')), + array('', + 'foobar', + array( + '1' => array( + 'value' => 'one', + 'title' => 'two', + ), + '2' => array( + 'value' => 'two', + 'title' => 'three', + ), + ), + array('one')), + ); + } + + /** + * @dataProvider data_generate_select_box + */ + public function test_generate_select_box($expected, $key, $select_ary, $selected_options) + { + $this->assertEquals($expected, $this->modules_helper->generate_select_box($key, $select_ary, $selected_options)); + } } From 7f887b872cb5f3a10ac8fa7d42b317b501fa55f4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 17:42:51 +0200 Subject: [PATCH 3/8] [ticket/289] Add method for generating forum select boxes --- acp/portal_module.php | 12 ++++++-- includes/modules_helper.php | 34 ++++++++++++++++++++- modules/attachments.php | 2 +- tests/unit/acp/move_module_test.php | 1 + tests/unit/includes/fixtures/auth.xml | 3 ++ tests/unit/includes/modules_helper_test.php | 8 +++++ 6 files changed, 56 insertions(+), 4 deletions(-) diff --git a/acp/portal_module.php b/acp/portal_module.php index 474ad0cf..85ec7ce4 100644 --- a/acp/portal_module.php +++ b/acp/portal_module.php @@ -15,7 +15,7 @@ class portal_module public $new_config = array(); protected $c_class; protected $db, $user, $cache, $template, $display_vars, $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; - protected $root_path, $version_check, $request, $php_ext, $portal_helper; + protected $root_path, $version_check, $request, $php_ext, $portal_helper, $modules_helper; public $module_column = array(); public function __construct() @@ -41,6 +41,7 @@ class portal_module $this->phpbb_container = $phpbb_container; $this->version_check = $this->phpbb_container->get('board3.version.check'); $this->portal_helper = $this->phpbb_container->get('board3.portal.helper'); + $this->modules_helper = $this->phpbb_container->get('board3.portal.modules_helper'); define('PORTAL_MODULES_TABLE', $this->phpbb_container->getParameter('board3.modules.table')); define('PORTAL_CONFIG_TABLE', $this->phpbb_container->getParameter('board3.config.table')); @@ -331,7 +332,14 @@ class portal_module } else { - $func = $vars['method']; + if ($vars['method'][0] == 'board3.portal.modules_helper') + { + $func = array($this->modules_helper, $vars['method'][1]); + } + else + { + $func = $vars['method']; + } } $content = call_user_func_array($func, $args); } diff --git a/includes/modules_helper.php b/includes/modules_helper.php index ff18fa9d..e366aeac 100644 --- a/includes/modules_helper.php +++ b/includes/modules_helper.php @@ -65,10 +65,42 @@ class modules_helper $options = ''; return $options; } + + /** + * Generate forum select box + * + * @param string $value Value of select box + * @param string $key Key of select box + * + * @return string HTML code of select box + * @access public + */ + public function generate_forum_select($value, $key) + { + $forum_list = make_forum_select(false, false, true, true, true, false, true); + + $selected_options = $select_ary = array(); + if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) + { + $selected_options = explode(',', $this->config[$key]); + } + + // Build forum options + foreach ($forum_list as $f_id => $f_row) + { + $select_ary[] = array( + 'value' => $f_id, + 'title' => $f_row['padding'] . $f_row['forum_name'], + 'disabled' => $f_row['disabled'], + ); + } + + return $this->generate_select_box($key, $select_ary, $selected_options); + } } diff --git a/modules/attachments.php b/modules/attachments.php index d86b52ae..8780d471 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -121,7 +121,7 @@ class attachments extends module_base 'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS', 'board3_attachments_number_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_attach_max_length_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), + 'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), 'board3_attachments_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_attachments_filetype_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'), 'board3_attachments_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/tests/unit/acp/move_module_test.php b/tests/unit/acp/move_module_test.php index 5d1aaea1..a76d389b 100644 --- a/tests/unit/acp/move_module_test.php +++ b/tests/unit/acp/move_module_test.php @@ -39,6 +39,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data new \board3\portal\modules\donation($config, $template, $user), )); $phpbb_container->set('board3.portal.helper', new \board3\portal\includes\helper($phpbb_container->get('board3.module_collection'))); + $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth())); $phpbb_container->setParameter('board3.modules.table', $table_prefix . 'portal_modules'); $phpbb_container->setParameter('board3.config.table', $table_prefix . 'portal_config'); $cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put')); diff --git a/tests/unit/includes/fixtures/auth.xml b/tests/unit/includes/fixtures/auth.xml index 03bcb3f5..84a5d919 100644 --- a/tests/unit/includes/fixtures/auth.xml +++ b/tests/unit/includes/fixtures/auth.xml @@ -17,12 +17,14 @@ forum_idparent_id + forum_nameforum_parentsforum_descforum_rules 1 0 + forum_one @@ -30,6 +32,7 @@ 2 1 + forum_two diff --git a/tests/unit/includes/modules_helper_test.php b/tests/unit/includes/modules_helper_test.php index 9f373dcb..1d1633ae 100644 --- a/tests/unit/includes/modules_helper_test.php +++ b/tests/unit/includes/modules_helper_test.php @@ -83,4 +83,12 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe { $this->assertEquals($expected, $this->modules_helper->generate_select_box($key, $select_ary, $selected_options)); } + + public function test_generate_forum_select() + { + $this->assertEquals( + '', + $this->modules_helper->generate_forum_select('foo', 'bar') + ); + } } From d55448069723b0d593c0bff1f0f26cdd184e7bd4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 17:51:16 +0200 Subject: [PATCH 4/8] [ticket/289] Add missing class variable to modules_helper --- config/services.yml | 1 + includes/modules_helper.php | 10 +++++++++- tests/unit/acp/move_module_test.php | 2 +- tests/unit/functions/fetch_news_test.php | 2 +- tests/unit/includes/modules_helper_test.php | 3 ++- tests/unit/portal/fetch_posts_test.php | 2 +- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config/services.yml b/config/services.yml index c4dc603b..a84e42e4 100644 --- a/config/services.yml +++ b/config/services.yml @@ -55,6 +55,7 @@ services: class: board3\portal\includes\modules_helper arguments: - @auth + - @config board3.portal.fetch_posts: class: board3\portal\portal\fetch_posts diff --git a/includes/modules_helper.php b/includes/modules_helper.php index e366aeac..fcc9d6fa 100644 --- a/includes/modules_helper.php +++ b/includes/modules_helper.php @@ -17,15 +17,23 @@ class modules_helper */ protected $auth; + /** + * phpBB config + * @var \phpbb\config\config + */ + protected $config; + /** * Constructor * NOTE: The parameters of this method must match in order and type with * the dependencies defined in the services.yml file for this service. * @param \phpbb\auth\auth $auth Auth object + * @param \phpbb\config\config $config phpBB config */ - public function __construct($auth) + public function __construct($auth, $config) { $this->auth = $auth; + $this->config = $config; } /** diff --git a/tests/unit/acp/move_module_test.php b/tests/unit/acp/move_module_test.php index a76d389b..5a1e49b8 100644 --- a/tests/unit/acp/move_module_test.php +++ b/tests/unit/acp/move_module_test.php @@ -39,7 +39,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data new \board3\portal\modules\donation($config, $template, $user), )); $phpbb_container->set('board3.portal.helper', new \board3\portal\includes\helper($phpbb_container->get('board3.module_collection'))); - $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth())); + $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config)); $phpbb_container->setParameter('board3.modules.table', $table_prefix . 'portal_modules'); $phpbb_container->setParameter('board3.config.table', $table_prefix . 'portal_config'); $cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put')); diff --git a/tests/unit/functions/fetch_news_test.php b/tests/unit/functions/fetch_news_test.php index 07b834a9..1c5a592f 100644 --- a/tests/unit/functions/fetch_news_test.php +++ b/tests/unit/functions/fetch_news_test.php @@ -51,7 +51,7 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework $this->auth = $auth; $this->user = $user; $phpbb_container = new \phpbb_mock_container_builder(); - $this->modules_helper = new \board3\portal\includes\modules_helper($auth); + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config); $phpbb_container->set('board3.portal.modules_helper', $this->modules_helper); $phpbb_container->set('board3.portal.fetch_posts', new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user)); $template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display')); diff --git a/tests/unit/includes/modules_helper_test.php b/tests/unit/includes/modules_helper_test.php index 1d1633ae..d7ed2e94 100644 --- a/tests/unit/includes/modules_helper_test.php +++ b/tests/unit/includes/modules_helper_test.php @@ -24,8 +24,9 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe parent::setUp(); $auth = new \phpbb\auth\auth(); + $config = new \phpbb\config\config(array()); - $this->modules_helper = new \board3\portal\includes\modules_helper($auth); + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $config); } public function data_get_disallowed_forums() diff --git a/tests/unit/portal/fetch_posts_test.php b/tests/unit/portal/fetch_posts_test.php index da42eaf5..4e2ff7c0 100644 --- a/tests/unit/portal/fetch_posts_test.php +++ b/tests/unit/portal/fetch_posts_test.php @@ -50,7 +50,7 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d // Pretend to allow downloads in forum 1 $auth->acl[1][0] = true; $this->auth = $auth; - $this->modules_helper = new \board3\portal\includes\modules_helper($auth); + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config); $this->user = $user; $template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display')); $this->fetch_posts = new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user); From 483c621fac6cf65b1fa8b96b73ff800e4734ad56 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 17:52:34 +0200 Subject: [PATCH 5/8] [ticket/289] Remove unneeded assignment --- modules/attachments.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/attachments.php b/modules/attachments.php index 8780d471..95b0f23d 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -271,7 +271,6 @@ class attachments extends module_base { $attach_forums = false; $where = ''; - $filetypes = array(); // Get filetypes and put them into an array $filetypes = $this->get_selected_filetypes($module_id); From 2c279b71df3acedf6049bd9ae64cba475d8ec5e2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 18:04:05 +0200 Subject: [PATCH 6/8] [ticket/289] Use generate_forum_select() in all modules --- modules/announcements.php | 32 +------------------------------- modules/attachments.php | 30 ------------------------------ modules/news.php | 32 +------------------------------- modules/poll.php | 31 +------------------------------ modules/recent.php | 32 +------------------------------- 5 files changed, 4 insertions(+), 153 deletions(-) diff --git a/modules/announcements.php b/modules/announcements.php index 556c301b..09ad54df 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -457,7 +457,7 @@ class announcements extends module_base 'board3_number_of_announcements_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_day_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_length_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), + 'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), 'board3_announcements_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_archive_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_permissions_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -505,36 +505,6 @@ class announcements extends module_base return $db->sql_query($sql); } - /** - * Create forum select box - * - * @param mixed $value Value of input - * @param string $key Key name - * @param int $module_id Module ID - * - * @return string Forum select box HTML - */ - public function select_forums($value, $key, $module_id) - { - $forum_list = make_forum_select(false, false, true, true, true, false, true); - - $selected = array(); - if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) - { - $selected = explode(',', $this->config[$key]); - } - // Build forum options - $s_forum_options = ''; - - return $s_forum_options; - - } - /** * Store selected forums * diff --git a/modules/attachments.php b/modules/attachments.php index 95b0f23d..1c0d2057 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -212,36 +212,6 @@ class attachments extends module_base } - /** - * Create forum select box - * - * @param mixed $value Value of input - * @param string $key Key name - * @param int $module_id Module ID - * - * @return string Forum select box HTML - */ - public function select_forums($value, $key) - { - $forum_list = make_forum_select(false, false, true, true, true, false, true); - - $selected = array(); - if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) - { - $selected = explode(',', $this->config[$key]); - } - // Build forum options - $s_forum_options = ''; - - return $s_forum_options; - - } - /** * Store selected forums * diff --git a/modules/news.php b/modules/news.php index 47a81fc2..13d9c95a 100644 --- a/modules/news.php +++ b/modules/news.php @@ -436,7 +436,7 @@ class news extends module_base 'board3_show_all_news_' . $module_id => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_number_of_news_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_news_length_' . $module_id => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), + 'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), 'board3_news_exclude_' . $module_id => array('lang' => 'PORTAL_NEWS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_news_show_last_' . $module_id => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_news_archive_' . $module_id => array('lang' => 'PORTAL_NEWS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -486,36 +486,6 @@ class news extends module_base return $db->sql_query($sql); } - /** - * Create forum select box - * - * @param mixed $value Value of input - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function select_forums($value, $key, $module_id) - { - $forum_list = make_forum_select(false, false, true, true, true, false, true); - - $selected = array(); - if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) - { - $selected = explode(',', $this->config[$key]); - } - // Build forum options - $s_forum_options = ''; - - return $s_forum_options; - - } - /** * Store selected forums * diff --git a/modules/poll.php b/modules/poll.php index e6534a8a..2e09f126 100644 --- a/modules/poll.php +++ b/modules/poll.php @@ -120,7 +120,7 @@ class poll extends module_base 'title' => 'ACP_PORTAL_POLLS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_POLLS_SETTINGS', - 'board3_poll_topic_id_' . $module_id => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), + 'board3_poll_topic_id_' . $module_id => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), 'board3_poll_exclude_id_' . $module_id => array('lang' => 'PORTAL_POLL_EXCLUDE_ID' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_poll_limit_' . $module_id => array('lang' => 'PORTAL_POLL_LIMIT' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_poll_allow_vote_' . $module_id => array('lang' => 'PORTAL_POLL_ALLOW_VOTE' , 'validate' => 'ibool', 'type' => 'radio:yes_no', 'explain' => true), @@ -159,35 +159,6 @@ class poll extends module_base return $db->sql_query($sql); } - /** - * Create forum select box - * - * @param mixed $value Value of input - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function select_forums($value, $key, $module_id) - { - $forum_list = make_forum_select(false, false, true, true, true, false, true); - - $selected = array(); - if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) - { - $selected = explode(',', $this->config[$key]); - } - // Build forum options - $s_forum_options = ''; - - return $s_forum_options; - } - /** * Store selected forums * diff --git a/modules/recent.php b/modules/recent.php index 81d7f379..ebad0736 100644 --- a/modules/recent.php +++ b/modules/recent.php @@ -219,7 +219,7 @@ class recent extends module_base 'legend1' => 'ACP_PORTAL_RECENT_SETTINGS', 'board3_max_topics_' . $module_id => array('lang' => 'PORTAL_MAX_TOPIC', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_recent_title_limit_' . $module_id => array('lang' => 'PORTAL_RECENT_TITLE_LIMIT', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_recent_forum_' . $module_id => array('lang' => 'PORTAL_RECENT_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_forums', 'submit' => 'store_selected_forums'), + 'board3_recent_forum_' . $module_id => array('lang' => 'PORTAL_RECENT_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), 'board3_recent_exclude_forums_' . $module_id => array('lang' => 'PORTAL_EXCLUDE_FORUM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) ); @@ -253,36 +253,6 @@ class recent extends module_base return $db->sql_query($sql); } - /** - * Create forum select box - * - * @param mixed $value Value of input - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function select_forums($value, $key, $module_id) - { - $forum_list = make_forum_select(false, false, true, true, true, false, true); - - $selected = array(); - if(isset($this->config[$key]) && strlen($this->config[$key]) > 0) - { - $selected = explode(',', $this->config[$key]); - } - // Build forum options - $s_forum_options = ''; - - return $s_forum_options; - - } - /** * Store selected forums * From d41bd0eab9713e0312fe1a02b7966a265993677a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 19:18:25 +0200 Subject: [PATCH 7/8] [ticket/289] Move store_selected_forums to modules_helper --- acp/portal_module.php | 20 ++++++++++----- config/services.yml | 1 + includes/modules_helper.php | 27 ++++++++++++++++++++- modules/announcements.php | 18 +------------- modules/attachments.php | 18 +------------- modules/news.php | 21 +--------------- modules/poll.php | 21 +--------------- modules/recent.php | 20 +-------------- tests/unit/acp/move_module_test.php | 4 +-- tests/unit/functions/fetch_news_test.php | 3 ++- tests/unit/includes/modules_helper_test.php | 14 +++++++++-- tests/unit/portal/fetch_posts_test.php | 3 ++- 12 files changed, 64 insertions(+), 106 deletions(-) diff --git a/acp/portal_module.php b/acp/portal_module.php index 85ec7ce4..8309bb9c 100644 --- a/acp/portal_module.php +++ b/acp/portal_module.php @@ -182,18 +182,26 @@ class portal_module { if ($submit && ((isset($null['type']) && $null['type'] == 'custom') || (isset($null['submit_type']) && $null['submit_type'] == 'custom'))) { - $func = array($this->c_class, $null['submit']); - - if(method_exists($this->c_class, $null['submit'])) + if (!is_array($null['submit'])) { + $func = array($this->c_class, $null['submit']); $args = ($module_id != 0) ? array($config_name, $module_id) : $config_name; - call_user_func_array($func, $args); } else { - $args = ($module_id != 0) ? array($cfg_array[$config_name], $config_name, $module_id) : $config_name; - call_user_func_array($null['submit'], $args); + if ($null['submit'][0] == 'board3.portal.modules_helper') + { + $func = array($this->modules_helper, $null['submit'][1]); + $args = ($module_id != 0) ? array($config_name, $module_id) : $config_name; + } + else + { + $args = ($module_id != 0) ? array($cfg_array[$config_name], $config_name, $module_id) : $config_name; + $func = $null['submit']; + } } + + call_user_func_array($func, $args); } if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) diff --git a/config/services.yml b/config/services.yml index a84e42e4..597aefe6 100644 --- a/config/services.yml +++ b/config/services.yml @@ -56,6 +56,7 @@ services: arguments: - @auth - @config + - @request board3.portal.fetch_posts: class: board3\portal\portal\fetch_posts diff --git a/includes/modules_helper.php b/includes/modules_helper.php index fcc9d6fa..0a5d7673 100644 --- a/includes/modules_helper.php +++ b/includes/modules_helper.php @@ -23,17 +23,25 @@ class modules_helper */ protected $config; + /** + * phpBB request + * @var \phpbb\request\request + */ + protected $request; + /** * Constructor * NOTE: The parameters of this method must match in order and type with * the dependencies defined in the services.yml file for this service. * @param \phpbb\auth\auth $auth Auth object * @param \phpbb\config\config $config phpBB config + * @param \phpbb\request\request $request phpBB request */ - public function __construct($auth, $config) + public function __construct($auth, $config, $request) { $this->auth = $auth; $this->config = $config; + $this->request = $request; } /** @@ -111,4 +119,21 @@ class modules_helper return $this->generate_select_box($key, $select_ary, $selected_options); } + + /** + * Store selected forums + * + * @param string $key Key name + * @param int $module_id Module ID + * + * @return null + * @access public + */ + public function store_selected_forums($key) + { + // Get selected extensions + $values = $this->request->variable($key, array(0 => '')); + $news = implode(',', $values); + $this->config->set($key, $news); + } } diff --git a/modules/announcements.php b/modules/announcements.php index 09ad54df..3edb1169 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -457,7 +457,7 @@ class announcements extends module_base 'board3_number_of_announcements_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_day_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_announcements_length_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), + 'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_announcements_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_archive_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_permissions_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_PERMISSIONS' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -504,20 +504,4 @@ class announcements extends module_base WHERE ' . $db->sql_in_set('config_name', $del_config); return $db->sql_query($sql); } - - /** - * Store selected forums - * - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function store_selected_forums($key, $module_id) - { - // Get selected forums - $values = $this->request->variable($key, array(0 => '')); - $news = implode(',', $values); - set_config($key, $news); - } } diff --git a/modules/attachments.php b/modules/attachments.php index 1c0d2057..e7a0acf1 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -121,7 +121,7 @@ class attachments extends module_base 'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS', 'board3_attachments_number_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_attach_max_length_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), + 'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_attachments_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_attachments_filetype_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'), 'board3_attachments_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -212,22 +212,6 @@ class attachments extends module_base } - /** - * Store selected forums - * - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function store_selected_forums($key) - { - // Get selected extensions - $values = $this->request->variable($key, array(0 => '')); - $news = implode(',', $values); - set_config($key, $news); - } - /** * Parse template variables for module * diff --git a/modules/news.php b/modules/news.php index 13d9c95a..8e12e536 100644 --- a/modules/news.php +++ b/modules/news.php @@ -436,7 +436,7 @@ class news extends module_base 'board3_show_all_news_' . $module_id => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_number_of_news_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_news_length_' . $module_id => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), + 'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_news_exclude_' . $module_id => array('lang' => 'PORTAL_NEWS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_news_show_last_' . $module_id => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_news_archive_' . $module_id => array('lang' => 'PORTAL_NEWS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -485,23 +485,4 @@ class news extends module_base WHERE ' . $db->sql_in_set('config_name', $del_config); return $db->sql_query($sql); } - - /** - * Store selected forums - * - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function store_selected_forums($key, $module_id) - { - // Get selected extensions - $values = $this->request->variable($key, array(0 => '')); - - $news = implode(',', $values); - - set_config($key, $news); - - } } diff --git a/modules/poll.php b/modules/poll.php index 2e09f126..c4fe9d0b 100644 --- a/modules/poll.php +++ b/modules/poll.php @@ -120,7 +120,7 @@ class poll extends module_base 'title' => 'ACP_PORTAL_POLLS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_POLLS_SETTINGS', - 'board3_poll_topic_id_' . $module_id => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), + 'board3_poll_topic_id_' . $module_id => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_poll_exclude_id_' . $module_id => array('lang' => 'PORTAL_POLL_EXCLUDE_ID' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_poll_limit_' . $module_id => array('lang' => 'PORTAL_POLL_LIMIT' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_poll_allow_vote_' . $module_id => array('lang' => 'PORTAL_POLL_ALLOW_VOTE' , 'validate' => 'ibool', 'type' => 'radio:yes_no', 'explain' => true), @@ -159,25 +159,6 @@ class poll extends module_base return $db->sql_query($sql); } - /** - * Store selected forums - * - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function store_selected_forums($key, $module_id) - { - // Get selected forums - $values = $this->request->variable($key, array(0 => '')); - - $news = implode(',', $values); - - set_config($key, $news); - - } - /** * Parse template variables for module * diff --git a/modules/recent.php b/modules/recent.php index ebad0736..2ff0f7d4 100644 --- a/modules/recent.php +++ b/modules/recent.php @@ -219,7 +219,7 @@ class recent extends module_base 'legend1' => 'ACP_PORTAL_RECENT_SETTINGS', 'board3_max_topics_' . $module_id => array('lang' => 'PORTAL_MAX_TOPIC', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'board3_recent_title_limit_' . $module_id => array('lang' => 'PORTAL_RECENT_TITLE_LIMIT', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_recent_forum_' . $module_id => array('lang' => 'PORTAL_RECENT_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => 'store_selected_forums'), + 'board3_recent_forum_' . $module_id => array('lang' => 'PORTAL_RECENT_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_recent_exclude_forums_' . $module_id => array('lang' => 'PORTAL_EXCLUDE_FORUM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) ); @@ -252,22 +252,4 @@ class recent extends module_base WHERE ' . $db->sql_in_set('config_name', $del_config); return $db->sql_query($sql); } - - /** - * Store selected forums - * - * @param string $key Key name - * @param int $module_id Module ID - * - * @return null - */ - public function store_selected_forums($key, $module_id) - { - // Get selected extensions - $values = $this->request->variable($key, array(0 => '')); - - $news = implode(',', $values); - - set_config($key, $news); - } } diff --git a/tests/unit/acp/move_module_test.php b/tests/unit/acp/move_module_test.php index 5a1e49b8..060b40bf 100644 --- a/tests/unit/acp/move_module_test.php +++ b/tests/unit/acp/move_module_test.php @@ -23,6 +23,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data parent::setUp(); global $db, $cache, $phpbb_root_path, $phpEx, $user, $phpbb_container, $request, $template, $table_prefix; $user = new \board3\portal\tests\mock\user(); + $request = new \phpbb_mock_request; $phpbb_container = new \phpbb_mock_container_builder(); // Mock version check $phpbb_container->set('board3.version.check', @@ -39,7 +40,7 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data new \board3\portal\modules\donation($config, $template, $user), )); $phpbb_container->set('board3.portal.helper', new \board3\portal\includes\helper($phpbb_container->get('board3.module_collection'))); - $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config)); + $phpbb_container->set('board3.portal.modules_helper', new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), $config, $request)); $phpbb_container->setParameter('board3.modules.table', $table_prefix . 'portal_modules'); $phpbb_container->setParameter('board3.config.table', $table_prefix . 'portal_config'); $cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put')); @@ -61,7 +62,6 @@ class phpbb_acp_move_module_test extends \board3\portal\tests\testframework\data 'UNABLE_TO_MOVE' => 'UNABLE_TO_MOVE', 'UNABLE_TO_MOVE_ROW' => 'UNABLE_TO_MOVE_ROW', )); - $request = new \phpbb_mock_request; $this->portal_module = new \board3\portal\acp\portal_module(); $this->update_portal_modules(); } diff --git a/tests/unit/functions/fetch_news_test.php b/tests/unit/functions/fetch_news_test.php index 1c5a592f..6ce4f81f 100644 --- a/tests/unit/functions/fetch_news_test.php +++ b/tests/unit/functions/fetch_news_test.php @@ -27,6 +27,7 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework $user->timezone = new \DateTimeZone('UTC'); $user->add_lang('common'); $user->add_lang('../../ext/board3/portal/language/en/portal'); + $request = new \phpbb_mock_request; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions')); $cache->expects($this->any()) @@ -51,7 +52,7 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework $this->auth = $auth; $this->user = $user; $phpbb_container = new \phpbb_mock_container_builder(); - $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config); + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $request); $phpbb_container->set('board3.portal.modules_helper', $this->modules_helper); $phpbb_container->set('board3.portal.fetch_posts', new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user)); $template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display')); diff --git a/tests/unit/includes/modules_helper_test.php b/tests/unit/includes/modules_helper_test.php index d7ed2e94..03b05134 100644 --- a/tests/unit/includes/modules_helper_test.php +++ b/tests/unit/includes/modules_helper_test.php @@ -14,6 +14,8 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe protected $modules; + protected $config; + public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/auth.xml'); @@ -24,9 +26,10 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe parent::setUp(); $auth = new \phpbb\auth\auth(); - $config = new \phpbb\config\config(array()); + $this->config = new \phpbb\config\config(array()); + $request = new \phpbb_mock_request(array('foo' => array('bar'))); - $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $config); + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $request); } public function data_get_disallowed_forums() @@ -92,4 +95,11 @@ class board3_includes_modules_helper_test extends \board3\portal\tests\testframe $this->modules_helper->generate_forum_select('foo', 'bar') ); } + + public function test_store_selected_forums() + { + $this->assertEmpty($this->config['foo']); + $this->modules_helper->store_selected_forums('foo'); + $this->assertEquals('bar', $this->config['foo']); + } } diff --git a/tests/unit/portal/fetch_posts_test.php b/tests/unit/portal/fetch_posts_test.php index 4e2ff7c0..45c988ca 100644 --- a/tests/unit/portal/fetch_posts_test.php +++ b/tests/unit/portal/fetch_posts_test.php @@ -50,7 +50,8 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d // Pretend to allow downloads in forum 1 $auth->acl[1][0] = true; $this->auth = $auth; - $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config); + $request = new \phpbb_mock_request; + $this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $request); $this->user = $user; $template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display')); $this->fetch_posts = new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user); From e3e60b306858af588b647a828792e36a2f2d2ff7 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 24 Jul 2014 19:22:46 +0200 Subject: [PATCH 8/8] [ticket/289] Fix incorrect method docs --- includes/modules_helper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/modules_helper.php b/includes/modules_helper.php index 0a5d7673..71094100 100644 --- a/includes/modules_helper.php +++ b/includes/modules_helper.php @@ -70,8 +70,7 @@ class modules_helper * @param string $key Key of select box * @param array $select_ary Array of select box options * @param array $selected_options Array of selected options - * @param string $select_key Key inside select box options - * that holds the option value + * * @return string HTML code of select box * @access public */