[svn r11334] coding guidelines

using correct return messages
removing resourcelinker (has been removed everywhere)
removing direct post/ approval (too complex)
skala
Patrick Cool 18 years ago
parent 50dcf173da
commit 1e7c44219a
  1. 5
      main/forum/editpost.php
  2. 20
      main/forum/forumfunction.inc.php
  3. 5
      main/forum/reply.php
  4. 9
      main/forum/viewforum.php
  5. 5
      main/forum/viewforumcategory.php
  6. 2
      main/forum/viewthread.php

@ -76,7 +76,10 @@ require ('../inc/global.inc.php');
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()) $fck_attribute['Config']['UserStatus'] = 'student';
if(!api_is_allowed_to_edit())
{
$fck_attribute['Config']['UserStatus'] = 'student';
}
$nameTools=get_lang('Forum');

@ -109,26 +109,26 @@ function handle_forum_and_forumcategories()
if ($_GET['action']=='delete' AND isset($_GET['content']) AND isset($_GET['id']))
{
$return_message=delete_forum_forumcategory_thread($_GET['content'],$_GET['id']);// note: this has to be cleaned first
Display :: display_normal_message($return_message,false);
Display :: display_confirmation_message($return_message,false);
}
// Change visibility of a forum or a forum category
if (($_GET['action']=='invisible' OR $_GET['action']=='visible') AND isset($_GET['content']) AND isset($_GET['id']))
{
$return_message=change_visibility($_GET['content'], $_GET['id'],$_GET['action']);// note: this has to be cleaned first
Display :: display_normal_message($return_message,false);
Display :: display_confirmation_message($return_message,false);
}
// Change lock status of a forum or a forum category
if (($_GET['action']=='lock' OR $_GET['action']=='unlock') AND isset($_GET['content']) AND isset($_GET['id']))
{
$return_message=change_lock_status($_GET['content'], $_GET['id'],$_GET['action']);// note: this has to be cleaned first
Display :: display_normal_message($return_message,false);
Display :: display_confirmation_message($return_message,false);
}
// Move a forum or a forum category
if ($_GET['action']=='move' AND isset($_GET['content']) AND isset($_GET['id']) AND isset($_GET['direction']))
{
$return_message=move_up_down($_GET['content'], $_GET['direction'], $_GET['id']);// note: this has to be cleaned first
Display :: display_normal_message($return_message,false);
Display :: display_confirmation_message($return_message,false);
}
}
@ -236,7 +236,7 @@ function show_add_forum_form($inputvalues=array())
$group='';
$group[] =& HTML_QuickForm::createElement('radio', 'approval_direct',null,get_lang('Approval'),1);
$group[] =& HTML_QuickForm::createElement('radio', 'approval_direct',null,get_lang('Direct'),0);
$form->addGroup($group, 'approval_direct_group', get_lang('ApprovalDirect'), ' ');
//$form->addGroup($group, 'approval_direct_group', get_lang('ApprovalDirect'), ' ');
// This is for vertical
@ -246,7 +246,7 @@ function show_add_forum_form($inputvalues=array())
$group='';
$group[] =& HTML_QuickForm::createElement('radio', 'allow_attachments',null,get_lang('Yes'),1);
$group[] =& HTML_QuickForm::createElement('radio', 'allow_attachments',null,get_lang('No'),0);
$form->addGroup($group, 'allow_attachments_group', get_lang('AllowAttachments'), ' ');
//$form->addGroup($group, 'allow_attachments_group', get_lang('AllowAttachments'), ' ');
// This is for vertical
//$form->addElement('radio', 'allow_new_threads', get_lang('AllowNewThreads'), 1, get_lang('Yes'));
@ -488,7 +488,7 @@ function store_forum($values)
}
Display :: display_normal_message($return_message);
Display :: display_confirmation_message($return_message);
}
/**
@ -1593,7 +1593,7 @@ function store_thread($values)
session_unregister('addedresource');
session_unregister('addedresourceid');
Display :: display_normal_message($message,false);
Display :: display_confirmation_message($message,false);
}
/**
* This function displays the form that is used to add a post. This can be a new thread or a reply.
@ -1765,7 +1765,7 @@ function store_reply($values)
session_unregister('addedresource');
session_unregister('addedresourceid');
Display :: display_normal_message($message,false);
Display :: display_confirmation_message($message,false);
}
@ -1897,7 +1897,7 @@ function store_edit_post($values)
session_unregister('addedresource');
session_unregister('addedresourceid');
Display :: display_normal_message($message,false);
Display :: display_confirmation_message($message,false);
}

@ -147,7 +147,8 @@ if (isset($_POST['add_resources']) AND $_POST['add_resources']==get_lang('Resour
if($origin=='learnpath')
{
include(api_get_path(INCLUDE_PATH).'reduced_header.inc.php');
} else
}
else
{
Display :: display_header();
api_display_tool_title($nameTools);
@ -224,7 +225,9 @@ if (!empty($values) AND $_POST['SubmitPost'])
==============================================================================
*/
if($origin!='learnpath')
{
Display :: display_footer();
}
?>

@ -171,7 +171,7 @@ if (!api_is_allowed_to_edit() AND ($current_forum_category['visibility']==0 OR $
*/
if (isset($message))
{
Display :: display_normal_message($message);
Display :: display_confirmation_message($message);
}
@ -238,7 +238,10 @@ foreach ($threads as $row)
// thread who have no replies yet and the only post is invisible should not be displayed to students.
if (api_is_allowed_to_edit() OR !($row['thread_replies']=='0' AND $row['visible']=='0'))
{
if($counter%2==0) $class="row_odd"; else $class="row_even";
if($counter%2==0)
{
$class="row_odd"; else $class="row_even";
}
echo "\t<tr class=\"$class\">\n";
echo "\t\t<td>";
if (is_array($whatsnew_post_info[$_GET['forum']][$row['thread_id']]) and !empty($whatsnew_post_info[$_GET['forum']][$row['thread_id']]))
@ -326,7 +329,9 @@ echo "</table>";
==============================================================================
*/
if($origin != 'learnpath')
{
Display :: display_footer();
}
?>

@ -91,7 +91,10 @@ $fck_attribute['Height'] = '300';
$fck_attribute['ToolbarSet'] = 'Middle';
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
if(!api_is_allowed_to_edit()) $fck_attribute['Config']['UserStatus'] = 'student';
if(!api_is_allowed_to_edit())
{
$fck_attribute['Config']['UserStatus'] = 'student';
}
/*
-----------------------------------------------------------

@ -168,7 +168,7 @@ if ($_GET['action']=='move' and isset($_GET['post']))
*/
if (isset($message))
{
Display :: display_normal_message(get_lang($message));
Display :: display_confirmation_message(get_lang($message));
}

Loading…
Cancel
Save