[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

@@ -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
*