[svn r19819] action links consistency

form titles
icon consistency
form consistency
feedback messages
skala
Patrick Cool 16 years ago
parent 48adf9b0d7
commit d308ef4d42
  1. 11
      main/forum/editpost.php
  2. 76
      main/forum/forumfunction.inc.php
  3. 4
      main/forum/forumsearch.php
  4. 2
      main/forum/index.php
  5. 24
      main/forum/newthread.php
  6. 10
      main/forum/reply.php
  7. 3
      main/forum/viewforum.php
  8. 31
      main/forum/viewforumcategory.php
  9. 21
      main/forum/viewthread.php

@ -117,7 +117,6 @@ $htmlHeadXtra[] = '<script>
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
}
@ -191,7 +190,7 @@ 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" />';
/*
@ -220,6 +219,14 @@ if (!api_is_allowed_to_edit() AND $current_forum['allow_edit']==0) {
forum_not_allowed_here();
}
// action links
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif').' '.get_lang('BackToForum').'</a>';
echo '</div>';
/*
-----------------------------------------------------------
Display Forum Category and the Forum information

@ -194,8 +194,16 @@ function show_add_forum_form($inputvalues=array()) {
$form = new FormValidator('forumcategory', 'post', 'index.php');
// the header for the form
if (!empty($inputvalues))
{
$form_title = get_lang('EditForum');
}
else
{
$form_title = get_lang('AddForum');
}
$session_header = isset($_SESSION['session_name']) ? ' ('.$_SESSION['session_name'].') ' : '';
$form->addElement('header', '', get_lang('AddForum').$session_header);
$form->addElement('header', '', $form_title.$session_header);
// we have a hidden field if we are editing
if (is_array($inputvalues)) {
@ -231,13 +239,13 @@ function show_add_forum_form($inputvalues=array()) {
/* if (document.getElementById('id_qualify').style.display == 'none') {
document.getElementById('id_qualify').style.display = 'block';
document.getElementById('plus').innerHTML='&nbsp;<img src=\"../img/nolines_minus.gif\" alt=\"\" />&nbsp;".get_lang('AddAnAttachment')."';
document.getElementById('plus').innerHTML='&nbsp;<img src=\"../img/div_hide.gif\" alt=\"\" />&nbsp;".get_lang('AddAnAttachment')."';
} else {
document.getElementById('options').style.display = 'none';
document.getElementById('plus').innerHTML='&nbsp;<img src=\"../img/nolines_plus.gif\" alt=\"\" />&nbsp;".get_lang('AddAnAttachment')."';
document.getElementById('plus').innerHTML='&nbsp;<img src=\"../img/div_show.gif\" alt=\"\" />&nbsp;".get_lang('AddAnAttachment')."';
}*/
$form->addElement('static','Group','','<div id="plus"><a href="javascript://" onclick="advanced_parameters()" ><br /><span id="plus_minus">&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</span></a></div>');
$form->addElement('static','Group','<br /><div id="plus"><a href="javascript://" onclick="advanced_parameters()" ><span id="plus_minus">&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</span></a></div>','');
$form->addElement('html','<div id="options" style="display:none">');
$group='';
@ -373,7 +381,8 @@ function show_add_forum_form($inputvalues=array()) {
$check = Security::check_token('post');
if ($check) {
$values = $form->exportValues();
store_forum($values);
$return_message = store_forum($values);
Display :: display_confirmation_message($return_message);
}
Security::clear_token();
} else {
@ -1844,6 +1853,21 @@ function show_add_post_form($action='', $id='', $form_values='') {
global $origin;
global $charset;
// setting the class and text of the form title and submit button
if ($_GET['action']=='quote'){
$class='save';
$text=get_lang('QuoteMessage');
}elseif ($_GET['action'] == 'replythread'){
$class='save';
$text=get_lang('ReplyToThread');
}elseif ($_GET['action']=='replymessage'){
$class='save';
$text=get_lang('ReplyToMessage');
}else {
$class='add';
$text=get_lang('CreateThread');
}
// initiate the object
$my_thread = isset($_GET['thread']) ? $_GET['thread']:'';
$my_forum = isset($_GET['forum']) ? $_GET['forum']:'';
@ -1853,6 +1877,8 @@ function show_add_post_form($action='', $id='', $form_values='') {
$form = new FormValidator('thread', 'post', api_get_self().'?forum='.Security::remove_XSS($my_forum).'&thread='.Security::remove_XSS($my_thread).'&post='.Security::remove_XSS($my_post).'&action='.Security::remove_XSS($my_action).'&origin='.$origin);
$form->setConstants(array('forum' => '5'));
$form->addElement('header', '', $text);
// settting the form elements
$form->addElement('hidden', 'forum_id', strval(intval($my_forum)));
$form->addElement('hidden', 'thread_id', strval(intval($my_thread)));
@ -1865,7 +1891,7 @@ function show_add_post_form($action='', $id='', $form_values='') {
$form->addElement('text', 'post_title', get_lang('Title'),'class="input_titles"');
$form->addElement('html_editor', 'post_text', get_lang('Text'));
$form->addElement('static','Group','','<a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus">&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</span></a>');
$form->addElement('static','Group','<a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus"><img src="../img/div_show.gif" alt="" /> '.get_lang('AdvancedParameters').'</span></a>','');
$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
@ -1902,16 +1928,6 @@ function show_add_post_form($action='', $id='', $form_values='') {
$info =api_get_user_info($userid);
$courseid=api_get_course_id();
if ($_GET['action']=='quote'){
$class='save';
$text=get_lang('QuoteMessage');
}elseif ($_GET['action']=='replymessage'){
$class='save';
$text=get_lang('ReplyToThread');
}else {
$class='add';
$text=get_lang('CreateThread');
}
$form->addElement('style_submit_button', 'SubmitPost', $text, 'class="'.$class.'"');
$form->add_real_progress_bar('DocumentUpload','user_upload');
@ -1965,9 +1981,15 @@ function show_add_post_form($action='', $id='', $form_values='') {
$form->setConstants(array('sec_token' => $token));
$form->display();
echo '<br />';
if ($forum_setting['show_thread_iframe_on_reply'] and $action<>'newthread') {
echo "<iframe src=\"iframe_thread.php?forum=".Security::remove_XSS($my_forum)."&amp;thread=".Security::remove_XSS($my_thread)."#".Security::remove_XSS($my_post)."\" width=\"80%\"></iframe>";
if ($forum_setting['show_thread_iframe_on_reply'] and $action<>'newthread')
{
echo '<div class="row">
<div class="label">'.get_lang('Thread').'
</div>
<div class="formw">';
echo "<iframe style=\"border: 1px solid black\" src=\"iframe_thread.php?forum=".Security::remove_XSS($my_forum)."&amp;thread=".Security::remove_XSS($my_thread)."#".Security::remove_XSS($my_post)."\" width=\"100%\"></iframe>";
echo ' </div>
</div>';
}
@ -2276,7 +2298,7 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
// initiate the object
$form = new FormValidator('edit_post', 'post', api_get_self().'?forum='.Security::remove_XSS($_GET['forum']).'&origin='.$origin.'&thread='.Security::remove_XSS($_GET['thread']).'&post='.Security::remove_XSS($_GET['post']));
$form->addElement('header', '', get_lang('EditPost'));
// settting the form elements
$form->addElement('hidden', 'post_id', $current_post['post_id']);
$form->addElement('hidden', 'thread_id', $current_thread['thread_id']);
@ -2287,7 +2309,7 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
$form->addElement('text', 'post_title', get_lang('Title'),'class="input_titles"');
$form->addElement('html_editor', 'post_text', get_lang('Text'));
$form->addElement('static','Group','','<a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus">&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</span></a>');
$form->addElement('static','Group','<a href="javascript://" onclick="return advanced_parameters()"><span id="img_plus_and_minus"><img src="../img/div_show.gif" alt="" />'.get_lang('AdvancedParameters').'</span></a>','');
$form->addElement('html','<div id="id_qualify" style="display:none">');
if (!isset($_GET['edit'])) {
@ -2896,7 +2918,12 @@ function move_thread_form() {
$forum_categories=get_forum_categories();
$forums=get_forums();
$htmlcontent="\n<tr>\n<td></td>\n<td>\n<SELECT NAME='forum'>\n";
$htmlcontent .= ' <div class="row">
<div class="label">
<span class="form_required">*</span>'.get_lang('MoveTo').'
</div>
<div class="formw">';
$htmlcontent .= "<SELECT NAME='forum'>\n";
foreach ($forum_categories as $key=>$category) {
$htmlcontent.="\t<OPTGROUP LABEL=\"".$category['cat_title']."\">\n";
foreach ($forums as $key=>$forum) {
@ -2906,7 +2933,10 @@ function move_thread_form() {
}
$htmlcontent.="\t</OPTGROUP>\n";
}
$htmlcontent.="</SELECT>\n</td></tr>";
$htmlcontent.="</SELECT>\n";
$htmlcontent .= ' </div>
</div>';
$form->addElement('html',$htmlcontent);
// The OK button

@ -103,7 +103,9 @@ if ($origin=='learnpath') {
}
// Display the tool title
api_display_tool_title($nameTools);
// api_display_tool_title($nameTools);
// tool introduction
// Tool introduction
$fck_attribute['Width'] = '100%';

@ -128,7 +128,7 @@ if (isset($_GET['action']) && $_GET['action']=='add' ) {
Display :: display_header('');
api_display_tool_title($nameTools);
// api_display_tool_title($nameTools);
//echo '<link href="forumstyles.css" rel="stylesheet" type="text/css" />';
// Tool introduction

@ -88,21 +88,6 @@ $origin = '';
if(isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
}
/*
*
* if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
}
*
*
*
* */
// javascript
$htmlHeadXtra[] = '<script>
@ -113,7 +98,6 @@ $htmlHeadXtra[] = '<script>
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
}
@ -185,7 +169,7 @@ 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);
}
/*
-----------------------------------------------------------
@ -221,6 +205,12 @@ if (!$_user['user_id'] AND $current_forum['allow_anonymous']<>1) {
-----------------------------------------------------------
*/
handle_forum_and_forumcategories();
// action links
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif').' '.get_lang('BackToForum').'</a>';
echo '</div>';
/*
-----------------------------------------------------------

@ -96,7 +96,6 @@ $htmlHeadXtra[] = '<script>
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
}
@ -187,9 +186,16 @@ if (!$_user['user_id'] AND $current_forum['allow_anonymous']==0) {
}
/*
-----------------------------------------------------------
Display forms / Feedback Messages
Action links
-----------------------------------------------------------
*/
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif').' '.get_lang('BackToForum').'</a>';
echo '<a href="viewthread.php?forum='.Security::remove_XSS($_GET['forum']).'&amp;thread='.Security::remove_XSS($_GET['thread']).'">'.Display::return_icon('forumthread.gif').' '.get_lang('BackToThread').'</a>';
echo '</div>';
/*
-----------------------------------------------------------
Display Forum Category and the Forum information

@ -154,7 +154,7 @@ if ($origin=='learnpath') {
} else {
// the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string
Display :: display_header('');
api_display_tool_title($nameTools);
//api_display_tool_title($nameTools);
}
/*
@ -302,6 +302,7 @@ echo '<div class="actions">';
if (empty($_SESSION['toolgroup'])){
echo '<span style="float:right;">'.search_link().'</span>';
}
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
// The link should appear when
// 1. the course admin is here
// 2. the course member is here and new threads are allowed

@ -137,7 +137,7 @@ 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);
}
/*
@ -158,6 +158,21 @@ if (!api_is_allowed_to_edit(false,true) AND $current_forum_category['visibility'
forum_not_allowed_here();
}
/*
-----------------------------------------------------------
Action Links
-----------------------------------------------------------
*/
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
if (api_is_allowed_to_edit(false,true)) {
//echo '<a href="'.api_get_self().'?forumcategory='.$_GET['forumcategory'].'&amp;action=add&amp;content=forumcategory">'.get_lang('AddForumCategory').'</a> | ';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&amp;content=forum"> '.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
//echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='.Security::remove_XSS($_GET['forumcategory']).'&amp;action=add&amp;content=forum">'.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
}
echo '</div>';
/*
------------------------------------------------------------------------------------------------------
ACTIONS
@ -216,20 +231,6 @@ if ($action_forums!='add') {
unset($_SESSION['_gid']);
}
/*
-----------------------------------------------------------
Action Links
-----------------------------------------------------------
*/
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
if (api_is_allowed_to_edit(false,true)) {
//echo '<a href="'.api_get_self().'?forumcategory='.$_GET['forumcategory'].'&amp;action=add&amp;content=forumcategory">'.get_lang('AddForumCategory').'</a> | ';
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add&amp;content=forum"> '.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
//echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='.Security::remove_XSS($_GET['forumcategory']).'&amp;action=add&amp;content=forum">'.Display::return_icon('forum_new.gif', get_lang('AddForum')).' '.get_lang('AddForum').'</a>';
}
echo '</div>';
/*
-----------------------------------------------------------
Display Forum Categories and the Forums in it

@ -195,20 +195,17 @@ if ($my_message<>'PostDeletedSpecial') {
-----------------------------------------------------------
*/
echo '<div class="actions">';
echo '<div style="float:right;">';
$my_url = '<a href="viewthread.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($_GET['forum']).'&amp;origin='.$origin.'&amp;thread='.Security::remove_XSS($_GET['thread']).'&amp;search='.Security::remove_XSS(urlencode($my_search));
echo $my_url.'&amp;view=flat&origin='.$origin.'">'.get_lang('FlatView').'</a> | ';
echo $my_url.'&amp;view=threaded&origin='.$origin.'">'.get_lang('ThreadedView').'</a> | ';
echo $my_url.'&amp;view=nested&origin='.$origin.'">'.get_lang('NestedView').'</a>';
$my_url = null;
echo '</div>';
echo '<span style="float:right;">'.search_link().'</span>';
echo '<a href="index.php">'.Display::return_icon('back.png').' '.get_lang('BackToForumOverview').'</a>';
echo '<a href="viewforum.php?forum='.Security::remove_XSS($_GET['forum']).'">'.Display::return_icon('forum.gif').' '.get_lang('BackToForum').'</a>';
// the reply to thread link should only appear when the forum_category is not locked AND the forum is not locked AND the thread is not locked.
// if one of the three levels is locked then the link should not be displayed
if ($current_forum_category['locked']==0 AND $current_forum['locked']==0 AND $current_thread['locked']==0 OR api_is_allowed_to_edit(false,true)) {
// The link should only appear when the user is logged in or when anonymous posts are allowed.
if ($_user['user_id'] OR ($current_forum['allow_anonymous']==1 AND !$_user['user_id'])) {
//reply link
echo '<a href="reply.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;thread='.Security::remove_XSS($_GET['thread']).'&amp;action=replythread&origin='.$origin.'">'.get_lang('ReplyToThread').'</a>';
echo '<a href="reply.php?'.api_get_cidreq().'&forum='.Security::remove_XSS($_GET['forum']).'&amp;thread='.Security::remove_XSS($_GET['thread']).'&amp;action=replythread&origin='.$origin.'">'.Display::return_icon('forumthread_new.gif').get_lang('ReplyToThread').'</a>';
//new thread link
if ((api_is_allowed_to_edit(false,true) && !(api_is_course_coach() && $current_forum['session_id']!=$_SESSION['id_session'])) 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)) {
@ -226,6 +223,14 @@ if ($my_message<>'PostDeletedSpecial') {
}
}
}
// the different views of the thread
$my_url = '<a href="viewthread.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($_GET['forum']).'&amp;origin='.$origin.'&amp;thread='.Security::remove_XSS($_GET['thread']).'&amp;search='.Security::remove_XSS(urlencode($my_search));
echo $my_url.'&amp;view=flat&origin='.$origin.'">'.Display::return_icon('forum_listview.gif').get_lang('FlatView').'</a>';
echo $my_url.'&amp;view=threaded&origin='.$origin.'">'.Display::return_icon('forum_threadedview.gif').get_lang('ThreadedView').'</a>';
echo $my_url.'&amp;view=nested&origin='.$origin.'">'.Display::return_icon('forum_nestedview.gif').get_lang('NestedView').'</a>';
$my_url = null;
echo '</div>&nbsp;';

Loading…
Cancel
Save