@ -63,7 +63,7 @@ $(function () {
var l = $(this);
var id = l.closest("tr").attr("id");
var filename = l.closest("tr").find(".attachFilename").html();
if (confirm("'.get_lang('AreYouSureToDeleteJS ').'", filename)) {
if (confirm("'.get_lang('Are you sure to delete ').'", filename)) {
$.ajax({
type: "POST",
url: "'.$ajaxUrl.'& a=delete_file& attachId=" + id +"& thread='.$threadId.'& forum='.$forumId.'",
@ -200,7 +200,7 @@ function show_add_forumcategory_form($inputvalues = [], $lp_id)
// hidden field if from learning path
$form->addElement('hidden', 'lp_id', $lp_id);
// Setting the form elements.
$form->addElement('header', get_lang('AddForumC ategory'));
$form->addElement('header', get_lang('Add forum c ategory'));
$form->addElement('text', 'forum_category_title', get_lang('Title'), ['autofocus']);
$form->addElement(
'html_editor',
@ -222,10 +222,10 @@ function show_add_forumcategory_form($inputvalues = [], $lp_id)
[] // extra data
);
$form->addButtonCreate(get_lang('CreateC ategory'), 'SubmitForumCategory');
$form->addButtonCreate(get_lang('Create c ategory'), 'SubmitForumCategory');
// Setting the rules.
$form->addRule('forum_category_title', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('forum_category_title', get_lang('Required fiel d'), 'required');
// The validation or display
if ($form->validate()) {
@ -261,9 +261,9 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$form = new FormValidator('forumcategory', 'post', 'index.php?'.api_get_cidreq());
// The header for the form
$form_title = get_lang('AddF orum');
$form_title = get_lang('Add a f orum');
if (!empty($inputvalues)) {
$form_title = get_lang('EditF orum');
$form_title = get_lang('Edit f orum');
}
$form->addHeader($form_title);
@ -298,7 +298,7 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$form->addElement(
'select',
'forum_category',
get_lang('InForumC ategory'),
get_lang('Create in c ategory'),
$forum_categories_titles
);
$form->applyFilter('forum_category', 'html_filter');
@ -308,7 +308,7 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$group = [];
$group[] = $form->createElement('radio', 'allow_anonymous', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'allow_anonymous', null, get_lang('No'), 0);
$form->addGroup($group, 'allow_anonymous_group', get_lang('AllowAnonymousPosts '));
$form->addGroup($group, 'allow_anonymous_group', get_lang('Allow anonymous posts? '));
}
$form->addButtonAdvancedSettings('advanced_params');
@ -316,19 +316,19 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$form->addDateTimePicker(
'start_time',
[get_lang('ForumStartDate'), get_lang('ForumStartD ateComment')],
[get_lang('Public access (access authorized to any member of the course)ation date'), get_lang('Public access (access authorized to any member of the course)ation d ateComment')],
['id' => 'start_time']
);
$form->addDateTimePicker(
'end_time',
[get_lang('ForumEndDate'), get_lang('ForumEndD ateComment')],
[get_lang('Closing date'), get_lang('Closing d ateComment')],
['id' => 'end_time']
);
$form->addRule(
['start_time', 'end_time'],
get_lang('StartDateMustBeBeforeTheEndD ate'),
get_lang('Start date must be before the end d ate'),
'compare_datetime_text',
'< allow_empty '
);
@ -336,12 +336,12 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$group = [];
$group[] = $form->createElement('radio', 'moderated', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'moderated', null, get_lang('No'), 0);
$form->addGroup($group, 'moderated', get_lang('ModeratedF orum'));
$form->addGroup($group, 'moderated', get_lang('Moderated f orum'));
$group = [];
$group[] = $form->createElement('radio', 'students_can_edit', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'students_can_edit', null, get_lang('No'), 0);
$form->addGroup($group, 'students_can_edit_group', get_lang('StudentsCanEdit '));
$form->addGroup($group, 'students_can_edit_group', get_lang('Can learners edit their own posts? '));
$group = [];
$group[] = $form->createElement('radio', 'approval_direct', null, get_lang('Approval'), 1);
@ -354,27 +354,27 @@ function show_add_forum_form($inputvalues = [], $lp_id)
$group = [];
$group[] = $form->createElement('radio', 'allow_new_threads', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'allow_new_threads', null, get_lang('No'), 0);
$form->addGroup($group, 'allow_new_threads_group', get_lang('AllowNewT hreads'));
$form->addGroup($group, 'allow_new_threads_group', get_lang('Allow users to start new t hreads'));
$group = [];
$group[] = $form->createElement('radio', 'default_view_type', null, get_lang('Flat'), 'flat');
$group[] = $form->createElement('radio', 'default_view_type', null, get_lang('Threaded'), 'threaded');
$group[] = $form->createElement('radio', 'default_view_type', null, get_lang('Nested'), 'nested');
$form->addGroup($group, 'default_view_type_group', get_lang('DefaultViewT ype'));
$form->addGroup($group, 'default_view_type_group', get_lang('Default view t ype'));
// Drop down list: Groups
$groups = GroupManager::get_group_list();
$groups_titles[0] = get_lang('NotAGroupF orum');
$groups_titles[0] = get_lang('Not a group f orum');
foreach ($groups as $key => $value) {
$groups_titles[$value['id']] = $value['name'];
}
$form->addElement('select', 'group_forum', get_lang('ForGroup'), $groups_titles);
$form->addElement('select', 'group_forum', get_lang('For Group'), $groups_titles);
// Public or private group forum
$group = [];
$group[] = $form->createElement('radio', 'public_private_group_forum', null, get_lang('Public'), 'public');
$group[] = $form->createElement('radio', 'public_private_group_forum', null, get_lang('Private'), 'private');
$form->addGroup($group, 'public_private_group_forum_group', get_lang('PublicPrivateGroupForum'));
$group[] = $form->createElement('radio', 'public_private_group_forum', null, get_lang('Public access (access authorized to any member of the course) '), 'public');
$group[] = $form->createElement('radio', 'public_private_group_forum', null, get_lang('Private access (access authorized to group members only) '), 'private');
$form->addGroup($group, 'public_private_group_forum_group', get_lang('Public access (access authorized to any member of the course) Private access (access authorized to group members only) GroupForum'));
// Forum image
$form->addProgress();
@ -389,15 +389,15 @@ function show_add_forum_form($inputvalues = [], $lp_id)
null,
['class' => 'img-responsive']
);
$form->addElement('label', get_lang('PreviewI mage'), $show_preview_image);
$form->addElement('checkbox', 'remove_picture', null, get_lang('DelImag e'));
$form->addElement('label', get_lang('Preview i mage'), $show_preview_image);
$form->addElement('checkbox', 'remove_picture', null, get_lang('Remove pictur e'));
}
}
$forum_image = isset($inputvalues['forum_image']) ? $inputvalues['forum_image'] : '';
$form->addElement('file', 'picture', ($forum_image != '' ? get_lang('UpdateImage') : get_lang('AddI mage')));
$form->addElement('file', 'picture', ($forum_image != '' ? get_lang('Update Image') : get_lang('Add i mage')));
$form->addRule(
'picture',
get_lang('OnlyImagesA llowed'),
get_lang('Only PNG, JPG or GIF images a llowed'),
'filetype',
['jpg', 'jpeg', 'png', 'gif']
);
@ -409,14 +409,14 @@ function show_add_forum_form($inputvalues = [], $lp_id)
// The OK button
if (isset($_GET['id']) & & $_GET['action'] == 'edit') {
$form->addButtonUpdate(get_lang('ModifyF orum'), 'SubmitForum');
$form->addButtonUpdate(get_lang('Edit f orum'), 'SubmitForum');
} else {
$form->addButtonCreate(get_lang('CreateF orum'), 'SubmitForum');
$form->addButtonCreate(get_lang('Create f orum'), 'SubmitForum');
}
// setting the rules
$form->addRule('forum_title', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('forum_category', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('forum_title', get_lang('Required fiel d'), 'required');
$form->addRule('forum_category', get_lang('Required fiel d'), 'required');
$defaultSettingAllowNewThreads = api_get_default_tool_setting('forum', 'allow_new_threads', 0);
@ -462,9 +462,9 @@ function show_add_forum_form($inputvalues = [], $lp_id)
if ($forumId) {
// Skill::saveSkills($form, ITEM_TYPE_FORUM, $forumId);
if (isset($values['forum_id'])) {
Display::addFlash(Display::return_message(get_lang('ForumEdit ed'), 'confirmation'));
Display::addFlash(Display::return_message(get_lang('The forum has been modifi ed'), 'confirmation'));
} else {
Display::addFlash(Display::return_message(get_lang('ForumA dded'), 'confirmation'));
Display::addFlash(Display::return_message(get_lang('The forum has been a dded'), 'confirmation'));
}
}
}
@ -528,7 +528,7 @@ function show_edit_forumcategory_form($inputvalues = [])
$form = new FormValidator('forumcategory', 'post', 'index.php?'.api_get_cidreq().'&id='.$categoryId);
// Setting the form elements.
$form->addElement('header', '', get_lang('EditF orumCategory'));
$form->addElement('header', '', get_lang('Edit f orumCategory'));
$form->addElement('hidden', 'forum_category_id');
$form->addElement('text', 'forum_category_title', get_lang('Title'));
@ -552,7 +552,7 @@ function show_edit_forumcategory_form($inputvalues = [])
[] // extra data
);
$form->addButtonUpdate(get_lang('ModifyCategory'), 'SubmitEditF orumCategory');
$form->addButtonUpdate(get_lang('Edit category'), 'SubmitEdit f orumCategory');
// Setting the default values.
$defaultvalues['forum_category_id'] = $inputvalues['cat_id'];
@ -561,7 +561,7 @@ function show_edit_forumcategory_form($inputvalues = [])
$form->setDefaults($defaultvalues);
// Setting the rules.
$form->addRule('forum_category_title', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('forum_category_title', get_lang('Required fiel d'), 'required');
// Validation or display
if ($form->validate()) {
@ -634,7 +634,7 @@ function store_forumcategory($values, $courseInfo = [], $showMessage = true)
'ForumCategoryUpdated',
api_get_user_id()
);
$return_message = get_lang('ForumCategoryEdit ed');
$return_message = get_lang('The forum category has been modifi ed');
$logInfo = [
'tool' => TOOL_FORUM,
@ -677,7 +677,7 @@ function store_forumcategory($values, $courseInfo = [], $showMessage = true)
$courseInfo
);
}
$return_message = get_lang('ForumCategoryA dded');
$return_message = get_lang('The forum category has been a dded');
$logInfo = [
'tool' => TOOL_FORUM,
@ -770,7 +770,7 @@ function store_forum($values, $courseInfo = [], $returnId = false)
$_FILES['picture']['type']
);
if (!filter_extension($new_file_name)) {
//Display::addFlash(Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension '), 'error'));
//Display::addFlash(Display::return_message(get_lang('File upload failed: this file extension or file type is prohibited '), 'error'));
$image_moved = false;
} else {
$file_extension = explode('.', $_FILES['picture']['name']);
@ -885,7 +885,7 @@ function store_forum($values, $courseInfo = [], $returnId = false)
$groupInfo
);
$return_message = get_lang('ForumEdit ed');
$return_message = get_lang('The forum has been modifi ed');
$forumId = $values['forum_id'];
$logInfo = [
@ -973,7 +973,7 @@ function store_forum($values, $courseInfo = [], $returnId = false)
];
Event::registerLog($logInfo);
}
$return_message = get_lang('ForumA dded');
$return_message = get_lang('The forum has been a dded');
}
if ($returnId) {
@ -1029,7 +1029,7 @@ function deleteForumCategoryThread($content, $id)
$return_message = '';
if ($content === 'forumcategory') {
$tool_constant = TOOL_FORUM_CATEGORY;
$return_message = get_lang('ForumCategoryD eleted');
$return_message = get_lang('Forum category d eleted');
if (!empty($forum_list)) {
$sql = "SELECT forum_id FROM $table_forums
@ -1051,7 +1051,7 @@ function deleteForumCategoryThread($content, $id)
if ($content === 'forum') {
$tool_constant = TOOL_FORUM;
$return_message = get_lang('ForumD eleted');
$return_message = get_lang('Forum d eleted');
if (!empty($number_threads)) {
$sql = "SELECT thread_id FROM $table_forum_thread
@ -1073,7 +1073,7 @@ function deleteForumCategoryThread($content, $id)
if ($content === 'thread') {
$tool_constant = TOOL_FORUM_THREAD;
$return_message = get_lang('ThreadD eleted');
$return_message = get_lang('Thread d eleted');
Skill::deleteSkillsFromItem($id, ITEM_TYPE_FORUM_THREAD);
}
@ -1230,7 +1230,7 @@ function return_visible_invisible_icon(
}
}
$html .= 'action=invisible& content='.$content.'& id='.$id.'">'.
Display::return_icon('visible.png', get_lang('MakeI nvisible'), [], ICON_SIZE_SMALL).'< / a > ';
Display::return_icon('visible.png', get_lang('Make i nvisible'), [], ICON_SIZE_SMALL).'< / a > ';
}
if ($current_visibility_status == 0) {
$html .= '< a href = "'.api_get_self().'?'.api_get_cidreq().'&';
@ -1240,7 +1240,7 @@ function return_visible_invisible_icon(
}
}
$html .= 'action=visible& content='.$content.'& id='.$id.'">'.
Display::return_icon('invisible.png', get_lang('MakeVisible'), [], ICON_SIZE_SMALL).'< / a > ';
Display::return_icon('invisible.png', get_lang('Make Visible'), [], ICON_SIZE_SMALL).'< / a > ';
}
return $html;
@ -1263,7 +1263,7 @@ function return_lock_unlock_icon($content, $id, $current_lock_status, $additiona
if (api_resource_is_locked_by_gradebook($id, LINK_FORUM_THREAD)) {
$html .= Display::return_icon(
'lock_na.png',
get_lang('ResourceLockedByGradebook '),
get_lang('This option is not available because this activity is contained by an assessment, which is currently locked. To unlock the assessment, ask your platform administrator. '),
[],
ICON_SIZE_SMALL
);
@ -1324,15 +1324,15 @@ function return_up_down_icon($content, $id, $list)
}
if ($position > 1) {
$return_value = '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=move&direction=up&content='.$content.'&forumcategory='.$forumCategory.'&id='.$id.'" title = "'.get_lang('MoveU p').'" > '.
Display::return_icon('up.png', get_lang('MoveU p'), [], ICON_SIZE_SMALL).'< / a > ';
$return_value = '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=move&direction=up&content='.$content.'&forumcategory='.$forumCategory.'&id='.$id.'" title = "'.get_lang('Move u p').'" > '.
Display::return_icon('up.png', get_lang('Move u p'), [], ICON_SIZE_SMALL).'< / a > ';
} else {
$return_value = Display::return_icon('up_na.png', '-', [], ICON_SIZE_SMALL);
}
if ($position < $total_items) {
$return_value .= '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=move&direction=down&content='.$content.'&forumcategory='.$forumCategory.'&id='.$id.'" title = "'.get_lang('MoveD own').'" > '.
Display::return_icon('down.png', get_lang('MoveD own'), [], ICON_SIZE_SMALL).'< / a > ';
$return_value .= '< a href = "'.api_get_self().'?'.api_get_cidreq().'&action=move&direction=down&content='.$content.'&forumcategory='.$forumCategory.'&id='.$id.'" title = "'.get_lang('Move d own').'" > '.
Display::return_icon('down.png', get_lang('Move d own'), [], ICON_SIZE_SMALL).'< / a > ';
} else {
$return_value .= Display::return_icon('down_na.png', '-', [], ICON_SIZE_SMALL);
}
@ -1377,7 +1377,7 @@ function change_visibility($content, $id, $target_visibility)
handle_mail_cue($content, $id);
}
return get_lang('VisibilityChanged ');
return get_lang('The visibility has been changed. ');
}
/**
@ -1418,10 +1418,10 @@ function change_lock_status($content, $id, $action)
// Determine what we are doing => defines the value for the database and the return message.
if ($action == 'lock') {
$db_locked = 1;
$return_message = get_lang('Locked');
$return_message = get_lang('Locked: students can no longer post new messages in this forum category, forum or thread but they can still read the messages that were already posted ');
} elseif ($action == 'unlock') {
$db_locked = 0;
$return_message = get_lang('Unlocked');
$return_message = get_lang('Unlocked: learners can post new messages in this forum category, forum or thread ');
} else {
return get_lang('Error');
}
@ -2809,7 +2809,7 @@ function updateThread($values)
}
}
$message = get_lang('EditPostStor ed').'< br / > ';
$message = get_lang('The post has been modifi ed').'< br / > ';
Display::addFlash(Display::return_message($message, 'confirmation', false));
}
@ -2860,7 +2860,7 @@ function store_thread(
if ($showMessage) {
Display::addFlash(
Display::return_message(
get_lang('UplNoFileUploaded '),
get_lang('No file was uploaded. '),
'error',
false
)
@ -3052,13 +3052,13 @@ function store_thread(
c_id = $course_id AND
thread_id='".Database::escape_string($lastThread->getIid())."'";
$result = Database::query($sql);
$message = get_lang('NewThreadStor ed');
$message = get_lang('The new thread has been add ed');
// Overwrite default message.
if ($current_forum['moderated'] & &
!api_is_allowed_to_edit(null, true)
) {
$message = get_lang('MessageHasToBeApproved ');
$message = get_lang('Your message has to be approved before people can view it. ');
}
// Storing the attachments if any.
@ -3072,7 +3072,7 @@ function store_thread(
if (!filter_extension($new_file_name)) {
if ($showMessage) {
Display::addFlash(Display::return_message(
get_lang('UplUnableToSaveFileFilteredExtension '),
get_lang('File upload failed: this file extension or file type is prohibited '),
'error'
));
}
@ -3091,13 +3091,13 @@ function store_thread(
if ($current_forum['approval_direct_post'] == '1' & &
!api_is_allowed_to_edit(null, true)
) {
$message .= get_lang('MessageHasToBeApproved ').'< br / > ';
$message .= get_lang('ReturnTo ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'" > '.
$message .= get_lang('Your message has to be approved before people can view it. ').'< br / > ';
$message .= get_lang('You can now return to the ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'" > '.
get_lang('Forum').'< / a > < br / > ';
} else {
$message .= get_lang('ReturnTo ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'" > '.
$message .= get_lang('You can now return to the ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'" > '.
get_lang('Forum').'< / a > < br / > ';
$message .= get_lang('ReturnTo ').' < a href = "viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&thread='.$lastThread->getIid().'" > '.
$message .= get_lang('You can now return to the ').' < a href = "viewthread.php?'.api_get_cidreq().'&forum='.$values['forum_id'].'&thread='.$lastThread->getIid().'" > '.
get_lang('Message').'< / a > ';
}
$reply_info['new_post_id'] = $lastPostId;
@ -3201,7 +3201,7 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
'UserStatus' => 'student',
]
);
$form->addRule('post_text', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('post_text', get_lang('Required fiel d'), 'required');
if (in_array($action, ['newthread', 'replythread', 'replymessage', 'quote'])) {
$extraFields = new ExtraField('forum_post');
@ -3232,7 +3232,7 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
if (Gradebook::is_active() & &
(api_is_course_admin() || api_is_session_general_coach() || api_is_course_tutor()) & & !($myThread)
) {
$form->addElement('advanced_settings', 'advanced_params', get_lang('AdvancedParameter s'));
$form->addElement('advanced_settings', 'advanced_params', get_lang('Advanced setting s'));
$form->addElement('html', '< div id = "advanced_params_options" style = "display:none" > ');
// Thread qualify
@ -3243,7 +3243,7 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
'checkbox',
'thread_qualify_gradebook',
'',
get_lang('QualifyThreadGradebook '),
get_lang('Grade this thread '),
'onclick="javascript:if(this.checked==true){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"'
);
} else {
@ -3251,15 +3251,15 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
}
$form->addElement('html', '< div id = "options_field" style = "display:none" > ');
$form->addElement('text', 'numeric_calification', get_lang('QualificationNumeric '));
$form->addElement('text', 'numeric_calification', get_lang('Maximum score '));
$form->applyFilter('numeric_calification', 'html_filter');
$form->addElement('text', 'calification_notebook_title', get_lang('TitleColumnGradebook '));
$form->addElement('text', 'calification_notebook_title', get_lang('Column header in Competences Report '));
$form->applyFilter('calification_notebook_title', 'html_filter');
$form->addElement(
'text',
'weight_calification',
get_lang('Qualify Weight'),
get_lang('Weight in Repor t'),
['value' => '0.00', 'onfocus' => "javascript: this.select();"]
);
$form->applyFilter('weight_calification', 'html_filter');
@ -3271,8 +3271,8 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
$group,
'',
[
get_lang('ForumThreadPeerScoring '),
get_lang('ForumThreadPeerScoring Comment'),
get_lang('Thread scored by peers '),
get_lang('Thread scored by peers Comment'),
]
);
$form->addElement('html', '< / div > ');
@ -3284,14 +3284,14 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
}
if (api_is_allowed_to_edit(null, true) & & $action == 'newthread') {
$form->addElement('checkbox', 'thread_sticky', '', get_lang('StickyPost '));
$form->addElement('checkbox', 'thread_sticky', '', get_lang('This is a sticky message (appears always on top and has a special sticky icon) '));
}
if (in_array($action, ['quote', 'replymessage'])) {
$form->addFile('user_upload[]', get_lang('Attachment'));
$form->addButton(
'add_attachment',
get_lang('AddA ttachment'),
get_lang('Add a ttachment'),
'paperclip',
'default',
'default',
@ -3324,13 +3324,13 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
// Setting the class and text of the form title and submit button.
if ($action == 'quote') {
$form->addButtonCreate(get_lang('QuoteM essage'), 'SubmitPost');
$form->addButtonCreate(get_lang('Quote this m essage'), 'SubmitPost');
} elseif ($action == 'replythread') {
$form->addButtonCreate(get_lang('ReplyToT hread'), 'SubmitPost');
$form->addButtonCreate(get_lang('Reply to this t hread'), 'SubmitPost');
} elseif ($action == 'replymessage') {
$form->addButtonCreate(get_lang('ReplyToM essage'), 'SubmitPost');
$form->addButtonCreate(get_lang('Reply to this m essage'), 'SubmitPost');
} else {
$form->addButtonCreate(get_lang('CreateT hread'), 'SubmitPost');
$form->addButtonCreate(get_lang('Create t hread'), 'SubmitPost');
}
$defaults['thread_peer_qualify'] = 0;
@ -3356,7 +3356,7 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
if ($posterInfo) {
$posterName = $posterInfo['complete_name'];
}
$defaults['post_title'] = get_lang('ReplyShort ').api_html_entity_decode($values['post_title'], ENT_QUOTES);
$defaults['post_title'] = get_lang('Re: ').api_html_entity_decode($values['post_title'], ENT_QUOTES);
// When we are quoting a message then we have to put that message into the wysiwyg editor.
// Note: The style has to be hardcoded here because using class="quote" didn't work.
if ($action == 'quote') {
@ -3380,11 +3380,11 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
$form->setDefaults(isset($defaults) ? $defaults : []);
// The course admin can make a thread sticky (=appears with special icon and always on top).
$form->addRule('post_title', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('post_title', get_lang('Required fiel d'), 'required');
if ($current_forum['allow_anonymous'] == 1 & & !isset($_user['user_id'])) {
$form->addRule(
'poster_name',
get_lang('ThisFieldIs Required'),
get_lang('Required fiel d'),
'required'
);
}
@ -3400,7 +3400,7 @@ function show_add_post_form($current_forum, $action, $form_values = '', $showPre
) {
Display::addFlash(
Display::return_message(
get_lang('YouMustAssignWeightOfQualification ').' < a href = "javascript:window.history.go(-1);" > '.get_lang('Back').'< / a > ',
get_lang('You must assign a score to this activity ').' < a href = "javascript:window.history.go(-1);" > '.get_lang('Back').'< / a > ',
'error',
false
)
@ -3852,7 +3852,7 @@ function store_reply($current_forum, $values, $courseId = 0, $userId = 0)
Database::query($sql);
$values['new_post_id'] = $new_post_id;
$message = get_lang('ReplyA dded');
$message = get_lang('The reply has been a dded');
if (!empty($_POST['file_ids']) & & is_array($_POST['file_ids'])) {
foreach ($_POST['file_ids'] as $key => $id) {
@ -3890,13 +3890,13 @@ function store_reply($current_forum, $values, $courseId = 0, $userId = 0)
if ($current_forum['approval_direct_post'] == '1' & &
!api_is_allowed_to_edit(null, true)
) {
$message .= '< br / > '.get_lang('MessageHasToBeApproved ').'< br / > ';
$message .= '< br / > '.get_lang('Your message has to be approved before people can view it. ').'< br / > ';
}
if ($current_forum['moderated'] & &
!api_is_allowed_to_edit(null, true)
) {
$message .= '< br / > '.get_lang('MessageHasToBeApproved ').'< br / > ';
$message .= '< br / > '.get_lang('Your message has to be approved before people can view it. ').'< br / > ';
}
// Setting the notification correctly.
@ -3933,7 +3933,7 @@ function store_reply($current_forum, $values, $courseId = 0, $userId = 0)
} else {
Display::addFlash(
Display::return_message(
get_lang('UplNoFileUploaded').' '.get_lang('UplSelectFileFirst '),
get_lang('No file was uploaded.').' '.get_lang('Please select a file before pressing the upload button. '),
'error'
)
);
@ -3967,7 +3967,7 @@ function show_edit_post_form(
'post',
api_get_self().'?'.api_get_cidreq().'& forum='.intval($_GET['forum']).'& thread='.intval($_GET['thread']).'& post='.intval($_GET['post'])
);
$form->addElement('header', get_lang('EditP ost'));
$form->addElement('header', get_lang('Edit a p ost'));
// Setting the form elements.
$form->addElement('hidden', 'post_id', $current_post['post_id']);
$form->addElement('hidden', 'thread_id', $current_thread['thread_id']);
@ -3995,7 +3995,7 @@ function show_edit_post_form(
'UserStatus' => 'student',
]
);
$form->addRule('post_text', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('post_text', get_lang('Required fiel d'), 'required');
$extraFields = new ExtraField('forum_post');
$extraFields->addElements($form, $current_post['post_id']);
@ -4016,7 +4016,7 @@ function show_edit_post_form(
'radio',
'status',
null,
get_lang('WaitingM oderation'),
get_lang('Waiting for m oderation'),
2
);
$group[] = $form->createElement(
@ -4034,14 +4034,14 @@ function show_edit_post_form(
'checkbox',
'post_notification',
'',
get_lang('NotifyByEmail ').' ('.$current_post['email'].')'
get_lang('Notify me by e-mail when somebody replies ').' ('.$current_post['email'].')'
);
if (api_is_allowed_to_edit(null, true) & &
empty($current_post['post_parent_id'])
) {
// The sticky checkbox only appears when it is the first post of a thread.
$form->addElement('checkbox', 'thread_sticky', '', get_lang('StickyPost '));
$form->addElement('checkbox', 'thread_sticky', '', get_lang('This is a sticky message (appears always on top and has a special sticky icon) '));
if ($current_thread['thread_sticky'] == 1) {
$defaults['thread_sticky'] = true;
}
@ -4052,7 +4052,7 @@ function show_edit_post_form(
$form->addFile('user_upload[]', get_lang('Attachment'));
$form->addButton(
'add_attachment',
get_lang('AddA ttachment'),
get_lang('Add a ttachment'),
'paperclip',
'default',
'default',
@ -4060,7 +4060,7 @@ function show_edit_post_form(
['id' => 'reply-add-attachment']
);
$form->addButtonUpdate(get_lang('Modify '), 'SubmitPost');
$form->addButtonUpdate(get_lang('Edit '), 'SubmitPost');
// Setting the default values for the form elements.
$defaults['post_title'] = $current_post['post_title'];
@ -4079,7 +4079,7 @@ function show_edit_post_form(
// The course admin can make a thread sticky (=appears with special icon and always on top).
$form->addRule('post_title', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('post_title', get_lang('Required fiel d'), 'required');
// Validation or display
if ($form->validate()) {
@ -4201,9 +4201,9 @@ function store_edit_post($forumInfo, $values)
);
}
$message = get_lang('EditPostStor ed').'< br / > ';
$message .= get_lang('ReturnTo ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&" > '.get_lang('Forum').'< / a > < br / > ';
$message .= get_lang('ReturnTo ').' < a href = "viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.$values['thread_id'].'&post='.Security::remove_XSS($_GET['post']).'" > '.get_lang('Message').'< / a > ';
$message = get_lang('The post has been modifi ed').'< br / > ';
$message .= get_lang('You can now return to the ').' < a href = "viewforum.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&" > '.get_lang('Forum').'< / a > < br / > ';
$message .= get_lang('You can now return to the ').' < a href = "viewthread.php?'.api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.$values['thread_id'].'&post='.Security::remove_XSS($_GET['post']).'" > '.get_lang('Message').'< / a > ';
Session::erase('formelements');
Session::erase('origin');
@ -4392,7 +4392,7 @@ function approve_post($post_id, $action)
$return = Database::query($sql);
if ($return) {
return 'PostVisibilityChanged ';
return 'PostThe visibility has been changed. ';
}
}
@ -4608,14 +4608,14 @@ function send_mail($userInfo, $forumInfo, $thread_information, $postInfo = [])
'forum/viewthread.php?'.api_get_cidreq().'&forum='.$thread_information['forum_id'].'&thread='.$thread_information['thread_id'];
}
$email_body = get_lang('Dear').' '.api_get_person_name($userInfo['firstname'], $userInfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS).", < br / > \n\r";
$email_body .= get_lang('NewForumPost ').': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$email_body .= get_lang('New Post in the forum ').': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$courseId = api_get_configuration_value('global_forums_course_id');
$subject = get_lang('NewForumPost ').' - '.$_course['official_code'].': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$subject = get_lang('New Post in the forum ').' - '.$_course['official_code'].': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$courseInfoTitle = get_lang('Course').': '.$_course['name'].' - ['.$_course['official_code']."] - < br / > \n";
if (!empty($courseId) & & $_course['real_id'] == $courseId) {
$subject = get_lang('NewForumPost ').': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$subject = get_lang('New Post in the forum ').': '.$forumInfo['forum_title'].' - '.$thread_information['thread_title']." < br / > \n";
$courseInfoTitle = " < br / > \n";
}
$email_body .= $courseInfoTitle;
@ -4629,10 +4629,10 @@ function send_mail($userInfo, $forumInfo, $thread_information, $postInfo = [])
}
}
$email_body .= get_lang('YouWantedToStayInforme d')."< br / > \n";
$email_body .= get_lang('You stated that you wanted to be informed by e-mail whenever somebody replies on the threa d')."< br / > \n";
if (!empty($thread_link)) {
$email_body .= get_lang('ThreadCanBeFoundH ere')." : < br / > < a href = \"".$thread_link."\" > ".$thread_link."< / a > \n";
$email_body .= get_lang('The thread can be found h ere')." : < br / > < a href = \"".$thread_link."\" > ".$thread_link."< / a > \n";
}
if ($userInfo['user_id'] != $user_id) {
@ -4666,7 +4666,7 @@ function move_thread_form()
api_get_self().'?forum='.intval($_GET['forum']).'& thread='.intval($_GET['thread']).'& action='.Security::remove_XSS($_GET['action']).'& '.api_get_cidreq()
);
// The header for the form
$form->addElement('header', get_lang('MoveThread'));
$form->addElement('header', get_lang('Move Thread'));
// Invisible form: the thread_id
$form->addElement('hidden', 'thread_id', intval($_GET['thread']));
// the fora
@ -4675,7 +4675,7 @@ function move_thread_form()
$htmlcontent = '< div class = "row" >
< div class = "label" >
< span class = "form_required" > *< / span > '.get_lang('MoveT o').'
< span class = "form_required" > *< / span > '.get_lang('Move t o').'
< / div >
< div class = "formw" > ';
$htmlcontent .= '< select name = "forum" > ';
@ -4697,7 +4697,7 @@ function move_thread_form()
$form->addElement('html', $htmlcontent);
// The OK button
$form->addButtonSave(get_lang('MoveThread'), 'SubmitForum');
$form->addButtonSave(get_lang('Move Thread'), 'SubmitForum');
// Validation or display
if ($form->validate()) {
@ -4725,7 +4725,7 @@ function move_post_form()
api_get_self().'?'.api_get_cidreq().'& forum='.intval($_GET['forum']).'& thread='.intval($_GET['thread']).'& post='.Security::remove_XSS($_GET['post']).'& action='.Security::remove_XSS($_GET['action']).'& post='.Security::remove_XSS($_GET['post'])
);
// The header for the form
$form->addElement('header', '', get_lang('MoveP ost'));
$form->addElement('header', '', get_lang('Move p ost'));
// Invisible form: the post_id
$form->addElement('hidden', 'post_id', intval($_GET['post']));
@ -4733,18 +4733,18 @@ function move_post_form()
// Dropdown list: Threads of this forum
$threads = get_threads($_GET['forum']);
//my_print_r($threads);
$threads_list[0] = get_lang('ANewT hread');
$threads_list[0] = get_lang('A new t hread');
foreach ($threads as $key => $value) {
$threads_list[$value['thread_id']] = $value['thread_title'];
}
$form->addElement('select', 'thread', get_lang('MoveT oThread'), $threads_list);
$form->addElement('select', 'thread', get_lang('Move t oThread'), $threads_list);
$form->applyFilter('thread', 'html_filter');
// The OK button
$form->addButtonSave(get_lang('MoveP ost'), 'submit');
$form->addButtonSave(get_lang('Move p ost'), 'submit');
// Setting the rules
$form->addRule('thread', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('thread', get_lang('Required fiel d'), 'required');
// Validation or display
if ($form->validate()) {
@ -4875,7 +4875,7 @@ function store_move_post($values)
Database::query($sql);
}
return get_lang('ThreadM oved');
return get_lang('Thread m oved');
}
/**
@ -4946,7 +4946,7 @@ function store_move_thread($values)
}
}
return get_lang('ThreadM oved');
return get_lang('Thread m oved');
}
/**
@ -5014,15 +5014,15 @@ function forum_search()
);
// Setting the form elements.
$form->addElement('header', '', get_lang('Forum Search'));
$form->addElement('text', 'search_term', get_lang('SearchT erm'), ['autofocus']);
$form->addElement('header', '', get_lang('Search in the Forum '));
$form->addElement('text', 'search_term', get_lang('Search t erm'), ['autofocus']);
$form->applyFilter('search_term', 'html_filter');
$form->addElement('static', 'search_information', '', get_lang('Forum SearchInformation'));
$form->addElement('static', 'search_information', '', get_lang('Search in the Forum Information'));
$form->addButtonSearch(get_lang('Search'));
// Setting the rules.
$form->addRule('search_term', get_lang('ThisFieldIs Required'), 'required');
$form->addRule('search_term', get_lang('TooS hort'), 'minlength', 3);
$form->addRule('search_term', get_lang('Required fiel d'), 'required');
$form->addRule('search_term', get_lang('Too s hort'), 'minlength', 3);
// Validation or display.
if ($form->validate()) {
@ -5145,7 +5145,7 @@ function display_forum_search_results($search_term)
$search_results[] = $search_results_item;
}
}
echo '< legend > '.count($search_results).' '.get_lang('Forum SearchResults').'< / legend > ';
echo '< legend > '.count($search_results).' '.get_lang('Search in the Forum Results').'< / legend > ';
echo '< ol > ';
if ($search_results) {
echo implode($search_results);
@ -5178,7 +5178,7 @@ function search_link()
}
}
$url = $url.implode('& ', $url_parameter);
$return .= '< a href = "'.$url.'" > '.Display::return_icon('delete.gif', get_lang('RemoveSearchR esults')).'< / a > ';
$return .= '< a href = "'.$url.'" > '.Display::return_icon('delete.gif', get_lang('Clean search r esults')).'< / a > ';
}
}
@ -5242,7 +5242,7 @@ function add_forum_attachment_file($file_comment, $last_id)
if (!filter_extension($new_file_name)) {
Display::addFlash(
Display::return_message(
get_lang('UplUnableToSaveFileFilteredExtension '),
get_lang('File upload failed: this file extension or file type is prohibited '),
'error'
)
);
@ -5335,7 +5335,7 @@ function edit_forum_attachment_file($file_comment, $post_id, $id_attach)
if (!filter_extension($new_file_name)) {
Display::addFlash(
Display::return_message(
get_lang('UplUnableToSaveFileFilteredExtension '),
get_lang('File upload failed: this file extension or file type is prohibited '),
'error'
)
);
@ -5489,7 +5489,7 @@ function delete_attachment($post_id, $id_attach = 0)
);
if (!empty($result) & & !empty($id_attach)) {
Display::addFlash(Display::return_message(get_lang('AttachmentFileDeleteSuccess '), 'confirmation'));
Display::addFlash(Display::return_message(get_lang('The attached file has been deleted '), 'confirmation'));
}
return $affectedRows;
@ -5693,7 +5693,7 @@ function set_notification($content, $id, $addOnly = false, $userInfo = [], $cour
Session::erase('forum_notification');
getNotificationsPerUser(0, true);
return get_lang('YouWillBeNotifiedOfNewPosts ');
return get_lang('You will be notified of new posts by e-mail. ');
} else {
if (!$addOnly) {
$sql = "DELETE FROM $table_notification
@ -5705,7 +5705,7 @@ function set_notification($content, $id, $addOnly = false, $userInfo = [], $cour
Session::erase('forum_notification');
getNotificationsPerUser(0, true);
return get_lang('YouWillNoLongerBeNotifiedOfNewPosts ');
return get_lang('You will no longer be notified of new posts by email ');
}
}
}
@ -6086,7 +6086,7 @@ function get_all_post_from_user($user_id, $course_code)
Display::return_icon('forum.gif', get_lang('Forum')).' '.Security::remove_XSS($forum['forum_title'], STUDENT).
'< div style = "float:right;margin-top:-35px" >
< a href = "../forum/viewforum.php?'.api_get_cidreq_params($course_code).'&forum='.$forum['forum_id'].' " > '.
get_lang('SeeF orum').'
get_lang('See f orum').'
< / a >
< / div > < / div > ';
$forum_results .= '< br / > ';
@ -6331,11 +6331,11 @@ function getAttachmentsAjaxTable($postId = 0)
// Forum attachment Ajax table
$fileData = '
< div class = "control-group " style = "'.$style.'" >
< label class = "control-label" > '.get_lang('AttachmentL ist').'< / label >
< label class = "control-label" > '.get_lang('Attachments l ist').'< / label >
< div class = "controls" >
< table id = "attachmentFileList" class = "files data_table span10" >
< tr >
< th > '.get_lang('FileN ame').'< / th >
< th > '.get_lang('Filen ame').'< / th >
< th > '.get_lang('Size').'< / th >
< th > '.get_lang('Status').'< / th >
< th > '.get_lang('Comment').'< / th >
@ -6417,7 +6417,7 @@ function getAttachedFiles(
// Check if $row is consistent
if (!empty($row) & & is_array($row)) {
// Set result as success and bring delete URL
$json['result'] = Display::return_icon('accept.png', get_lang('Uploaded'));
$json['result'] = Display::return_icon('accept.png', get_lang('Uploaded. '));
$url = api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&action=delete_attach&forum='.$forumId.'&thread='.$threadId.'&id_attach='.$row['iid'];
$json['delete'] = Display::url(
Display::return_icon('delete.png', get_lang('Delete'), [], ICON_SIZE_SMALL),
@ -6611,7 +6611,7 @@ function getPostStatus($current_forum, $row, $addWrapper = true)
$buttonType = 'success';
break;
case CForumPost::STATUS_WAITING_MODERATION:
$label = get_lang('WaitingM oderation');
$label = get_lang('Waiting for m oderation');
$icon = 'warning';
$buttonType = 'warning';
break;
@ -6800,10 +6800,10 @@ function getAskRevisionButton($postId, $threadInfo)
}
return Display::url(
get_lang('AskR evision'),
get_lang('Ask for a r evision'),
api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.
api_get_cidreq().'& action=ask_revision& post_id='.$postId.'& forum='.$threadInfo['forum_id'].'& thread='.$threadInfo['thread_id'],
['class' => "btn $status", 'title' => get_lang('AskR evision')]
['class' => "btn $status", 'title' => get_lang('Ask for a r evision')]
);
}
@ -6818,7 +6818,7 @@ function giveRevisionButton($postId, $threadInfo)
$postId = (int) $postId;
return Display::toolbarButton(
get_lang('GiveR evision'),
get_lang('Give r evision'),
api_get_path(WEB_CODE_PATH).'forum/reply.php?'.api_get_cidreq().'& '.http_build_query(
[
'forum' => $threadInfo['forum_id'],
@ -6944,9 +6944,9 @@ function reportPost($postId, $forumInfo, $threadInfo)
$postData['post_title'],
$url
);
$subject = get_lang('ForumPostR eported');
$subject = get_lang('Post r eported');
$content = sprintf(
get_lang('UserXReportedPostXInForumX '),
get_lang('User %s has reported the message %s in the forum %s '),
$currentUser['complete_name'],
$postLink,
$forumInfo['forum_title']