|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
<?php |
|
|
|
|
<?php |
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
Dokeos - elearning and course management software |
|
|
|
|
@ -61,9 +61,9 @@ |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
// name of the language file that needs to be included |
|
|
|
|
$language_file = array ( |
|
|
|
|
'forum', |
|
|
|
|
'group' |
|
|
|
|
$language_file = array ( |
|
|
|
|
'forum', |
|
|
|
|
'group' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// including the global dokeos file |
|
|
|
|
@ -81,16 +81,21 @@ api_protect_course_script(true); |
|
|
|
|
|
|
|
|
|
// FCKeditor configuration |
|
|
|
|
$fck_attribute['Width'] = '100%'; |
|
|
|
|
$fck_attribute['Height'] = '300'; |
|
|
|
|
$fck_attribute['ToolbarSet'] = 'Middle'; |
|
|
|
|
$fck_attribute['Height'] = '400'; |
|
|
|
|
|
|
|
|
|
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/'; |
|
|
|
|
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/'; |
|
|
|
|
|
|
|
|
|
// including additional library scripts |
|
|
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); |
|
|
|
|
include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php'); |
|
|
|
|
if(!api_is_allowed_to_edit()) { |
|
|
|
|
include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php'); |
|
|
|
|
if(!api_is_allowed_to_edit()) { |
|
|
|
|
$fck_attribute['Config']['UserStatus'] = 'student'; |
|
|
|
|
$fck_attribute['ToolbarSet'] = 'Forum_Student'; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
$fck_attribute['ToolbarSet'] = 'Forum'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$nameTools=get_lang('Forum'); |
|
|
|
|
@ -102,26 +107,26 @@ $nameTools=get_lang('Forum'); |
|
|
|
|
*/ |
|
|
|
|
include('forumconfig.inc.php'); |
|
|
|
|
include('forumfunction.inc.php'); |
|
|
|
|
|
|
|
|
|
// javascript |
|
|
|
|
$htmlHeadXtra[] = '<script> |
|
|
|
|
|
|
|
|
|
function advanced_parameters() { |
|
|
|
|
if(document.getElementById(\'id_qualify\').style.display == \'none\') { |
|
|
|
|
document.getElementById(\'id_qualify\').style.display = \'block\'; |
|
|
|
|
document.getElementById(\'img_plus_and_minus\').innerHTML=\' <img src="../img/nolines_minus.gif" alt="" /> '.get_lang('AdvancedParameters').'\'; |
|
|
|
|
} else { |
|
|
|
|
document.getElementById(\'id_qualify\').style.display = \'none\'; |
|
|
|
|
document.getElementById(\'img_plus_and_minus\').innerHTML=\' <img src="../img/nolines_plus.gif" alt="" /> '.get_lang('AdvancedParameters').'\'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
// javascript |
|
|
|
|
$htmlHeadXtra[] = '<script> |
|
|
|
|
|
|
|
|
|
function advanced_parameters() { |
|
|
|
|
if(document.getElementById(\'id_qualify\').style.display == \'none\') { |
|
|
|
|
document.getElementById(\'id_qualify\').style.display = \'block\'; |
|
|
|
|
document.getElementById(\'img_plus_and_minus\').innerHTML=\' <img src="../img/nolines_minus.gif" alt="" /> '.get_lang('AdvancedParameters').'\'; |
|
|
|
|
} else { |
|
|
|
|
document.getElementById(\'id_qualify\').style.display = \'none\'; |
|
|
|
|
document.getElementById(\'img_plus_and_minus\').innerHTML=\' <img src="../img/nolines_plus.gif" alt="" /> '.get_lang('AdvancedParameters').'\'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
MAIN DISPLAY SECTION |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
*/ |
|
|
|
|
/* |
|
|
|
|
----------------------------------------------------------- |
|
|
|
|
Retrieving forum and forum categorie information |
|
|
|
|
@ -138,18 +143,18 @@ $current_post=get_post_information($_GET['post']); |
|
|
|
|
----------------------------------------------------------- |
|
|
|
|
Header and Breadcrumbs |
|
|
|
|
----------------------------------------------------------- |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($_SESSION['toolgroup'])) { |
|
|
|
|
|
|
|
|
|
$_clean['toolgroup']=(int)$_SESSION['toolgroup']; |
|
|
|
|
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']); |
|
|
|
|
$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups')); |
|
|
|
|
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')'); |
|
|
|
|
$interbreadcrumb[] = array("url" => "viewforum.php?origin=".$origin."&gidReq=".$_SESSION['toolgroup']."&forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title'])); |
|
|
|
|
$interbreadcrumb[] = array("url" => "#","name" => get_lang('EditPost')); |
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($_SESSION['toolgroup'])) { |
|
|
|
|
|
|
|
|
|
$_clean['toolgroup']=(int)$_SESSION['toolgroup']; |
|
|
|
|
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']); |
|
|
|
|
$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups')); |
|
|
|
|
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['toolgroup'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')'); |
|
|
|
|
$interbreadcrumb[] = array("url" => "viewforum.php?origin=".$origin."&gidReq=".$_SESSION['toolgroup']."&forum=".Security::remove_XSS($_GET['forum']),"name" => prepare4display($current_forum['forum_title'])); |
|
|
|
|
$interbreadcrumb[] = array("url" => "#","name" => get_lang('EditPost')); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
$interbreadcrumb[]=array("url" => "index.php","name" => $nameTools); |
|
|
|
|
$interbreadcrumb[]=array("url" => "viewforumcategory.php?forumcategory=".$current_forum_category['cat_id'],"name" => prepare4display($current_forum_category['cat_title'])); |
|
|
|
|
@ -173,18 +178,18 @@ $table_link = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); |
|
|
|
|
----------------------------------------------------------- |
|
|
|
|
Header |
|
|
|
|
----------------------------------------------------------- |
|
|
|
|
*/ |
|
|
|
|
//are we in a lp ? |
|
|
|
|
$origin = ''; |
|
|
|
|
if (isset($_GET['origin'])) { |
|
|
|
|
$origin = Security::remove_XSS($_GET['origin']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($origin=='learnpath') { |
|
|
|
|
include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php'); |
|
|
|
|
} else { |
|
|
|
|
*/ |
|
|
|
|
//are we in a lp ? |
|
|
|
|
$origin = ''; |
|
|
|
|
if (isset($_GET['origin'])) { |
|
|
|
|
$origin = Security::remove_XSS($_GET['origin']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($origin=='learnpath') { |
|
|
|
|
include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php'); |
|
|
|
|
} else { |
|
|
|
|
Display :: display_header(null); |
|
|
|
|
api_display_tool_title($nameTools); |
|
|
|
|
api_display_tool_title($nameTools); |
|
|
|
|
} |
|
|
|
|
//echo '<link href="forumstyles.css" rel="stylesheet" type="text/css" />'; |
|
|
|
|
/* |
|
|
|
|
@ -205,11 +210,11 @@ if (!api_is_allowed_to_edit() AND (($current_forum_category['visibility']==0 OR |
|
|
|
|
} |
|
|
|
|
if (!api_is_allowed_to_edit() AND ($current_forum_category['locked']<>0 OR $current_forum['locked']<>0 OR $current_thread['locked']<>0)) { |
|
|
|
|
forum_not_allowed_here(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!$_user['user_id'] AND $current_forum['allow_anonymous']==0) { |
|
|
|
|
forum_not_allowed_here(); |
|
|
|
|
forum_not_allowed_here(); |
|
|
|
|
} |
|
|
|
|
if (!api_is_allowed_to_edit() AND $current_forum['allow_edit']==0) { |
|
|
|
|
if (!api_is_allowed_to_edit() AND $current_forum['allow_edit']==0) { |
|
|
|
|
forum_not_allowed_here(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -229,28 +234,28 @@ echo '</table>'; |
|
|
|
|
|
|
|
|
|
// the form for the reply |
|
|
|
|
$values=show_edit_post_form($current_post, $current_thread, $current_forum, isset($_SESSION['formelements'])?$_SESSION['formelements']:''); |
|
|
|
|
if (!empty($values) and $_POST['SubmitPost']) { |
|
|
|
|
store_edit_post($values); |
|
|
|
|
|
|
|
|
|
$option_chek=isset($values['thread_qualify_gradebook'])?$values['thread_qualify_gradebook']:null;// values 1 or 0 |
|
|
|
|
if ( 1== $option_chek ) { |
|
|
|
|
$id=$values['thread_id']; |
|
|
|
|
$title_gradebook=$values['calification_notebook_title']; |
|
|
|
|
$value_calification=$values['numeric_calification']; |
|
|
|
|
$weight_calification=$values['weight_calification']; |
|
|
|
|
$description=""; |
|
|
|
|
$session_id=api_get_session_id(); |
|
|
|
|
$link_id=is_resource_in_course_gradebook(api_get_course_id(),5,$id,$session_id); |
|
|
|
|
if ( $link_id==false ) { |
|
|
|
|
add_resource_to_course_gradebook(api_get_course_id(), 5, $id, $title_gradebook,$weight_calification,$value_calification,$description,time(),1,api_get_session_id()); |
|
|
|
|
} else { |
|
|
|
|
api_sql_query('UPDATE '.$table_link.' SET weight='.$weight_calification.' WHERE id='.$link_id.''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($values) and $_POST['SubmitPost']) { |
|
|
|
|
store_edit_post($values); |
|
|
|
|
|
|
|
|
|
$option_chek=isset($values['thread_qualify_gradebook'])?$values['thread_qualify_gradebook']:null;// values 1 or 0 |
|
|
|
|
if ( 1== $option_chek ) { |
|
|
|
|
$id=$values['thread_id']; |
|
|
|
|
$title_gradebook=$values['calification_notebook_title']; |
|
|
|
|
$value_calification=$values['numeric_calification']; |
|
|
|
|
$weight_calification=$values['weight_calification']; |
|
|
|
|
$description=""; |
|
|
|
|
$session_id=api_get_session_id(); |
|
|
|
|
$link_id=is_resource_in_course_gradebook(api_get_course_id(),5,$id,$session_id); |
|
|
|
|
if ( $link_id==false ) { |
|
|
|
|
add_resource_to_course_gradebook(api_get_course_id(), 5, $id, $title_gradebook,$weight_calification,$value_calification,$description,time(),1,api_get_session_id()); |
|
|
|
|
} else { |
|
|
|
|
api_sql_query('UPDATE '.$table_link.' SET weight='.$weight_calification.' WHERE id='.$link_id.''); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// footer |
|
|
|
|
if ($origin!='learnpath') { |
|
|
|
|
Display :: display_footer(); |
|
|
|
|
if ($origin!='learnpath') { |
|
|
|
|
Display :: display_footer(); |
|
|
|
|
} |