[svn r22067] FS#2867 - The forums tool: Eliminating the global variable $fck_attribute.

skala
Ivan Tcholakov 16 years ago
parent bce5e7a0fa
commit 3a3da756a6
  1. 16
      main/forum/editpost.php
  2. 18
      main/forum/forumfunction.inc.php
  3. 14
      main/forum/iframe_thread.php
  4. 19
      main/forum/index.php
  5. 12
      main/forum/newthread.php
  6. 12
      main/forum/reply.php
  7. 13
      main/forum/viewforumcategory.php
  8. 2
      main/inc/lib/fckeditor/toolbars/forum.php
  9. 2
      main/inc/lib/fckeditor/toolbars/forum_student.php

@ -78,25 +78,9 @@ $this_section=SECTION_COURSES;
// notice for unauthorized people.
api_protect_course_script(true);
// FCKeditor configuration
$fck_attribute['Width'] = '100%';
$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()) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
$nameTools=get_lang('Forum');

@ -159,7 +159,7 @@ function show_add_forumcategory_form($inputvalues=array()) {
$form->addElement('header', '', get_lang('AddForumCategory'));
$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
//$form->applyFilter('forum_category_title', 'html_filter');
$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200'));
//$form->applyFilter('forum_category_comment', 'html_filter');
$form->addElement('style_submit_button', 'SubmitForumCategory', get_lang('CreateCategory'), 'class="add"');
@ -214,7 +214,7 @@ function show_add_forum_form($inputvalues=array()) {
$form->addElement('text', 'forum_title', get_lang('Title'),'class="input_titles"');
//$form->applyFilter('forum_title', 'html_filter');
// The comment of the forum
$form->addElement('html_editor', 'forum_comment', get_lang('Comment'));
$form->addElement('html_editor', 'forum_comment', get_lang('Comment'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200'));
//$form->applyFilter('forum_comment', 'html_filter');
// dropdown list: Forum Categories
$forum_categories=get_forum_categories();
@ -449,7 +449,7 @@ function show_edit_forumcategory_form($inputvalues=array()) {
$form->addElement('hidden', 'forum_category_id');
$form->addElement('text', 'forum_category_title', get_lang('Title'),'class="input_titles"');
//$form->applyFilter('forum_category_title', 'html_filter');
$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'));
$form->addElement('html_editor', 'forum_category_comment', get_lang('Comment'), null, array('ToolbarSet' => 'Forum', 'Width' => '98%', 'Height' => '200'));
//$form->applyFilter('forum_category_comment', 'html_filter');
$form->addElement('style_submit_button', 'SubmitEditForumCategory',get_lang('ModifyCategory'), 'class="save"');
global $charset;
@ -1916,7 +1916,11 @@ function show_add_post_form($action='', $id='', $form_values='') {
$form->addElement('text', 'post_title', get_lang('Title'),'class="input_titles"');
//$form->applyFilter('post_title', 'html_filter');
$form->addElement('html_editor', 'post_text', get_lang('Text'));
$form->addElement('html_editor', 'post_text', get_lang('Text'), null,
api_is_allowed_to_edit()
? array('ToolbarSet' => 'Forum', 'Width' => '100%', 'Height' => '400')
: array('ToolbarSet' => 'Forum_Student', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student')
);
//$form->applyFilter('post_text', 'html_filter');
$form->addElement('html', '<div class="row"><div class="label">');
@ -2345,7 +2349,11 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
}
$form->addElement('text', 'post_title', get_lang('Title'),'class="input_titles"');
$form->applyFilter('post_title', 'html_filter');
$form->addElement('html_editor', 'post_text', get_lang('Text'));
$form->addElement('html_editor', 'post_text', get_lang('Text'), null,
api_is_allowed_to_edit()
? array('ToolbarSet' => 'Forum', 'Width' => '100%', 'Height' => '400')
: array('ToolbarSet' => 'Forum_Student', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student')
);
//$form->applyFilter('post_text', 'html_filter');
$form->addElement('html', '<div class="row"><div class="label">');

@ -74,20 +74,6 @@ api_protect_course_script(true);
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
if (!api_is_allowed_to_edit(false,true)) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
$nameTools=get_lang('Forum');
?>
<!DOCTYPE html

@ -87,22 +87,6 @@ $nameTools=get_lang('Forums');
require 'forumconfig.inc.php';
require_once 'forumfunction.inc.php';
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['InDocument'] = false;
$fck_attribute['Config']['CreateDocumentDir'] = '../../courses/'.api_get_course_path().'/document/';
if(!api_is_allowed_to_edit(false,true)) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
/*
==============================================================================
@ -160,9 +144,6 @@ $form_count=0;
*/
$get_actions=isset($_GET['action']) ? $_GET['action'] : '';
if (api_is_allowed_to_edit(false,true)) {
$fck_attribute['Width'] = '98%';
$fck_attribute['Height'] = '200';
$fck_attribute['ToolbarSet'] = 'Forum';
handle_forum_and_forumcategories();
}

@ -62,18 +62,6 @@ require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'
include_once (api_get_path(LIBRARY_PATH).'groupmanager.lib.php');
$nameTools=get_lang('Forum');
// configuration for FCKeditor
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
if(!api_is_allowed_to_edit(false,true)) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
/*
-----------------------------------------------------------

@ -54,18 +54,6 @@ $this_section=SECTION_COURSES;
// notice for unauthorized people.
api_protect_course_script(true);
// configuration for FCKeditor
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
if(!api_is_allowed_to_edit(false,true)) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
// including additional library scripts
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');

@ -97,19 +97,6 @@ require_once 'forumfunction.inc.php';
==============================================================================
*/
$fck_attribute['Width'] = '100%';
$fck_attribute['Height'] = '400';
$fck_attribute['Config']['IMUploadPath'] = 'upload/forum/';
$fck_attribute['Config']['FlashUploadPath'] = 'upload/forum/';
if(!api_is_allowed_to_edit(false,true)) {
$fck_attribute['Config']['UserStatus'] = 'student';
$fck_attribute['ToolbarSet'] = 'Forum_Student';
}
else
{
$fck_attribute['ToolbarSet'] = 'Forum';
}
/*
-----------------------------------------------------------

@ -45,4 +45,4 @@ $config['ToolbarSets']['Maximized'] = array(
// Here new width and height of the editor may be set.
// Possible values, examples: 300 , '250' , '100%' , ...
//$config['Width'] = '100%';
//$config['Height'] = '300';
//$config['Height'] = '400';

@ -46,4 +46,4 @@ $config['BlockCopyPaste'] = true;
// Here new width and height of the editor may be set.
// Possible values, examples: 300 , '250' , '100%' , ...
//$config['Width'] = '100%';
//$config['Height'] = '300';
//$config['Height'] = '400';

Loading…
Cancel
Save