Fixing forum page when adding to the LP

skala
Julio Montoya 14 years ago
parent 6c1be39a61
commit 1fd21eb7dd
  1. 11
      main/css/base_chamilo.css
  2. 25
      main/forum/forumfunction.inc.php
  3. 1
      main/forum/index.php
  4. 2
      main/forum/newthread.php
  5. 54
      main/forum/viewforum.php

@ -2522,17 +2522,6 @@ span.form_required {
padding:0px;
}
#contact_registration .label{
width:205px;
}
#contact_registration .formw{
width:344px;
float:left;
margin-left:20px;
}
#id_contact_form .normal-message{
padding:20px;
}

@ -233,9 +233,9 @@ function show_add_forum_form($inputvalues = array(), $lp_id) {
document.getElementById('plus').innerHTML=' '.Display::return_icon('div_show.gif').' ".get_lang('AddAnAttachment')."';
}*/
$form->addElement('html', '<div class="row"><div class="label">');
$form->addElement('html', '<br /><div id="plus"><a href="javascript://" onclick="advanced_parameters()" ><span id="plus_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'</span></a></div>','');
$form->addElement('html', '</div><div class="formw"></div></div>');
$form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">');
$form->addElement('html', '<a href="javascript://" onclick="advanced_parameters()" ><span id="plus_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'</span></a>','');
$form->addElement('html', '</div></div>');
$form->addElement('html', '<div id="options" style="display:none">');
$group = '';
@ -276,7 +276,7 @@ function show_add_forum_form($inputvalues = array(), $lp_id) {
$group[] =& HTML_QuickForm::createElement('radio', 'default_view_type', null, get_lang('Nested'), 'nested');
$form->addGroup($group, 'default_view_type_group', get_lang('DefaultViewType'), '&nbsp;');
$form->addElement('static','Group', '<br /><strong>'.get_lang('GroupSettings').'</strong>');
//$form->addElement('static','Group', '<br /><strong>'.get_lang('GroupSettings').'</strong>');
// Dropdown list: Groups.
$groups = GroupManager::get_group_list();
@ -2009,22 +2009,23 @@ function show_add_post_form($action = '', $id = '', $form_values = '') {
//$form->applyFilter('post_title', 'html_filter');
$form->addElement('html_editor', 'post_text', get_lang('Text'), null,
api_is_allowed_to_edit(null, true)
? array('ToolbarSet' => 'Forum', 'Width' => '100%', 'Height' => '400')
: array('ToolbarSet' => 'ForumStudent', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student')
? array('ToolbarSet' => 'Forum', 'Width' => '100%', 'Height' => '300')
: array('ToolbarSet' => 'ForumStudent', 'Width' => '100%', 'Height' => '300', 'UserStatus' => 'student')
);
//$form->applyFilter('post_text', 'html_filter');
$form->addElement('html', '<div class="row"><div class="label">');
$form->addElement('html', '</div><div class="formw"><a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a></div></div>');
$form->addElement('html', '<div class="row"><div class="label"></div><div class="formw">');
$form->addElement('html', '<a href="javascript://" onclick="return advanced_parameters()">
<span id="img_plus_and_minus">&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).' '.get_lang('AdvancedParameters').'</span></a></div></div>');
$form->addElement('html', '<div id="id_qualify" style="display:none">');
if( (api_is_course_admin() || api_is_course_coach() || api_is_course_tutor()) && !($my_thread) ) {
// Thread qualify
$form->addElement('static', 'Group', '<br /><strong>'.get_lang('AlterQualifyThread').'</strong>');
// Thread qualify
$form->applyFilter('numeric_calification', 'html_filter');
$form->addElement('checkbox', 'thread_qualify_gradebook', '', get_lang('QualifyThreadGradebook'), 'onclick="javascript:if(this.checked==true){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$form -> addElement('html', '<div id="options_field" style="display:none">');
$form->addElement('text', 'numeric_calification', get_lang('QualificationNumeric'),'Style="width:40px"');
$form->addElement('text', 'calification_notebook_title', get_lang('TitleColumnGradebook'));
@ -2048,7 +2049,7 @@ function show_add_post_form($action = '', $id = '', $form_values = '') {
}
// User upload
$form->addElement('html', '<br /><b><div class="row"><div class="label">'.get_lang('AddAnAttachment').'</div></div></b><br /><br />');
$form->addElement('html', '<b><div class="row"><div class="label">'.get_lang('AddAnAttachment').'</div></div></b><br /><br />');
$form->addElement('file', 'user_upload',get_lang('FileName'),'');
$form->addElement('textarea', 'file_comment', get_lang('FileComment'), array ('rows' => 4, 'cols' => 34));
$form->applyFilter('file_comment', 'html_filter');

@ -192,7 +192,6 @@ if (api_is_allowed_to_edit(false, true)) {
}
}
var_dump(api_is_coach());
echo '</div>';
/* Display Forum Categories and the Forums in it */

@ -174,7 +174,7 @@ if ($origin == 'group') {
} else {
echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview'),'','32').'</a>';
}*/
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'">'.Display::return_icon('back.png',get_lang('BackToForum'),'','32').'</a>';
echo '<a href="viewforum.php?origin='.$origin.'&forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'">'.Display::return_icon('back.png',get_lang('BackToForum'),'','32').'</a>';
echo '</div>';
/* Display Forum Category and the Forum information */

@ -259,34 +259,39 @@ if (!empty($message)) {
/* Action links */
echo '<div class="actions">';
if ($origin != 'learnpath') {
echo '<div class="actions">';
if ($origin=='group') {
echo '<a href="../group/group_space.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Groups'),'','32').'</a>';
} else {
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('BackToForumOverview'), '', '32').'</a>';
}
// The link should appear when
// 1. the course admin is here
// 2. the course member is here and new threads are allowed
// 3. a visitor is here and new threads AND allowed AND anonymous posts are allowed
if (api_is_allowed_to_edit(false, true) OR ($current_forum['allow_new_threads'] == 1 AND isset($_user['user_id'])) OR ($current_forum['allow_new_threads'] == 1 AND !isset($_user['user_id']) AND $current_forum['allow_anonymous'] == 1)) {
if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) {
if (!api_is_anonymous()) {
if ($my_forum == strval(intval($my_forum))) {
echo '<a href="newthread.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;forum='.Security::remove_XSS($my_forum).$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'','32').'</a>';
} else {
$my_forum = strval(intval($my_forum));
echo '<a href="newthread.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;forum='.$my_forum.$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'','32').'</a>';
}
}
} else {
echo get_lang('ForumLocked');
}
}
echo '</div>';
}
}
// The link should appear when
// 1. the course admin is here
// 2. the course member is here and new threads are allowed
// 3. a visitor is here and new threads AND allowed AND anonymous posts are allowed
if (api_is_allowed_to_edit(false, true) OR ($current_forum['allow_new_threads'] == 1 AND isset($_user['user_id'])) OR ($current_forum['allow_new_threads'] == 1 AND !isset($_user['user_id']) AND $current_forum['allow_anonymous'] == 1)) {
if ($current_forum['locked'] <> 1 AND $current_forum['locked'] <> 1) {
if (!api_is_anonymous()) {
if ($my_forum == strval(intval($my_forum))) {
echo '<a href="newthread.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;forum='.Security::remove_XSS($my_forum).$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'','32').'</a>';
} else {
$my_forum = strval(intval($my_forum));
echo '<a href="newthread.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;forum='.$my_forum.$origin_string.'">'.Display::return_icon('new_thread.png',get_lang('NewTopic'),'','32').'</a>';
}
}
} else {
echo get_lang('ForumLocked');
}
}
echo '</div>';
/* Display */
@ -294,19 +299,14 @@ echo '<table class="forum_table" >';
// The current forum
if ($origin != 'learnpath') {
echo '<thead><tr><th class="forum_head" colspan="7">';
if (!empty ($current_forum_category['cat_title'])) {
//echo '<span class="forum_low_description">'.prepare4display($current_forum_category['cat_title'])."</span><br />";
}
echo '<span class="forum_title">'.prepare4display($current_forum['forum_title']).'</span>';
if (!empty ($current_forum['forum_comment'])) {
echo '<br /><span class="forum_description">'.prepare4display($current_forum['forum_comment']).'</span>';
}
echo '</th></tr></thead>';
}
@ -432,4 +432,4 @@ echo isset($table_list) ? $table_list : '';
if ($origin != 'learnpath') {
Display :: display_footer();
}
}
Loading…
Cancel
Save