|
|
|
@ -298,13 +298,15 @@ function show_add_forum_form($inputvalues = array(), $lp_id) |
|
|
|
|
$form->addRule('forum_title', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
$form->addRule('forum_category', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
|
|
$defaultSettingAllowNewThreads = api_get_default_tool_setting('forum', 'allow_new_threads', 0); |
|
|
|
|
|
|
|
|
|
// Settings the defaults |
|
|
|
|
if (empty($inputvalues) || !is_array($inputvalues)) { |
|
|
|
|
$defaults['allow_anonymous_group']['allow_anonymous'] = 0; |
|
|
|
|
$defaults['students_can_edit_group']['students_can_edit'] = 0; |
|
|
|
|
$defaults['approval_direct_group']['approval_direct'] = 0; |
|
|
|
|
$defaults['allow_attachments_group']['allow_attachments'] = 1; |
|
|
|
|
$defaults['allow_new_threads_group']['allow_new_threads'] = 0; |
|
|
|
|
$defaults['allow_new_threads_group']['allow_new_threads'] = $defaultSettingAllowNewThreads; |
|
|
|
|
$defaults['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view'); |
|
|
|
|
$defaults['public_private_group_forum_group']['public_private_group_forum'] = 'public'; |
|
|
|
|
if (isset($_GET['forumcategory'])) { |
|
|
|
@ -319,7 +321,7 @@ function show_add_forum_form($inputvalues = array(), $lp_id) |
|
|
|
|
$defaults['students_can_edit_group']['students_can_edit'] = isset($inputvalues['allow_edit']) ? $inputvalues['allow_edit'] : null; |
|
|
|
|
$defaults['approval_direct_group']['approval_direct'] = isset($inputvalues['approval_direct_post']) ? $inputvalues['approval_direct_post'] : null; |
|
|
|
|
$defaults['allow_attachments_group']['allow_attachments'] = isset($inputvalues['allow_attachments']) ? $inputvalues['allow_attachments'] : null; |
|
|
|
|
$defaults['allow_new_threads_group']['allow_new_threads'] = isset($inputvalues['allow_new_threads']) ? $inputvalues['allow_new_threads'] : null; |
|
|
|
|
$defaults['allow_new_threads_group']['allow_new_threads'] = isset($inputvalues['allow_new_threads']) ? $inputvalues['allow_new_threads'] : $defaultSettingAllowNewThreads; |
|
|
|
|
$defaults['default_view_type_group']['default_view_type'] = isset($inputvalues['default_view']) ? $inputvalues['default_view'] : null; |
|
|
|
|
$defaults['public_private_group_forum_group']['public_private_group_forum'] = isset($inputvalues['forum_group_public_private']) ? $inputvalues['forum_group_public_private'] : null; |
|
|
|
|
$defaults['group_forum'] = isset($inputvalues['forum_of_group']) ? $inputvalues['forum_of_group'] : null; |
|
|
|
|