[ticket/289] Move store_selected_forums to modules_helper

This commit is contained in:
Marc Alexander
2014-07-24 19:18:25 +02:00
parent 2c279b71df
commit d41bd0eab9
12 changed files with 64 additions and 106 deletions

View File

@@ -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);
}
}