Minor - format code

pull/2487/head
jmontoyaa 8 years ago
parent 3a860199d7
commit b25425d5ae
  1. 12
      main/extrafield/translate.php
  2. 33
      main/forum/editthread.php
  3. 1
      main/forum/forumfunction.inc.php
  4. 29
      main/forum/forumsearch.php
  5. 1
      main/forum/iframe_thread.php
  6. 32
      main/forum/newthread.php
  7. 1
      main/forum/viewthread_flat.inc.php
  8. 2
      main/gamification/my_progress.php

@ -49,12 +49,18 @@ $form = new FormValidator('new_lang_variable', 'POST', $translateUrl);
$form->addHeader(get_lang('AddWordForTheSubLanguage')); $form->addHeader(get_lang('AddWordForTheSubLanguage'));
$form->addText('variable_language', get_lang('LanguageVariable'), false); $form->addText('variable_language', get_lang('LanguageVariable'), false);
$form->addText('original_name', get_lang('OriginalName'), false); $form->addText('original_name', get_lang('OriginalName'), false);
$form->addSelect('sub_language', [get_lang('SubLanguage'), get_lang('OnlyActiveSubLanguagesAreListed')], $languagesOptions); $form->addSelect(
'sub_language',
[get_lang('SubLanguage'), get_lang('OnlyActiveSubLanguagesAreListed')],
$languagesOptions
);
if ($languageId) { if ($languageId) {
$languageInfo = api_get_language_info($languageId); $languageInfo = api_get_language_info($languageId);
$form->addText(
$form->addText('new_language', [get_lang('Translation'), get_lang('IfThisTranslationExistsThisWillReplaceTheTerm')]); 'new_language',
[get_lang('Translation'), get_lang('IfThisTranslationExistsThisWillReplaceTheTerm')]
);
$form->addHidden('file_id', 0); $form->addHidden('file_id', 0);
$form->addHidden('id', $languageInfo['parent_id']); $form->addHidden('id', $languageInfo['parent_id']);
$form->addHidden('sub', $languageInfo['id']); $form->addHidden('sub', $languageInfo['id']);

@ -94,22 +94,39 @@ if (api_is_invitee()) {
$groupId = api_get_group_id(); $groupId = api_get_group_id();
if (!empty($groupId)) { if (!empty($groupId)) {
$groupProperties = GroupManager :: get_group_properties($groupId); $groupProperties = GroupManager:: get_group_properties($groupId);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq,
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, 'name' => $currentForum['forum_title']); 'name' => get_lang('Groups'),
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId, 'name' => get_lang('EditThread')); );
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq,
'name' => get_lang('GroupSpace').' '.$groupProperties['name'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId,
'name' => $currentForum['forum_title'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId,
'name' => get_lang('EditThread'),
);
} else { } else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, 'name' => $currentForum['forum_title']); 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'],
'name' => $currentForumCategory['cat_title'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId,
'name' => $currentForum['forum_title'],
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditThread')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditThread'));
} }
$tableLink = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $tableLink = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
/* Header */ /* Header */
$htmlHeadXtra[] = <<<JS $htmlHeadXtra[] = <<<JS
<script> <script>
$(document).on('ready', function() { $(document).on('ready', function() {

@ -4241,7 +4241,6 @@ function move_thread_form()
/** /**
* This function displays the form for moving a post message to a different (already existing) or a new thread. * This function displays the form for moving a post message to a different (already existing) or a new thread.
* @return void HTML
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version february 2006, dokeos 1.8 * @version february 2006, dokeos 1.8

@ -49,13 +49,28 @@ if (api_is_in_gradebook()) {
$groupId = api_get_group_id(); $groupId = api_get_group_id();
if ($origin == 'group') { if ($origin == 'group') {
$group_properties = GroupManager :: get_group_properties($groupId); $group_properties = GroupManager:: get_group_properties($groupId);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')'); 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(),
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title'])); 'name' => get_lang('Groups'),
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch')); );
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')',
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(),
'name' => prepare4display($current_forum['forum_title']),
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),
'name' => get_lang('ForumSearch'),
);
} else { } else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools); $interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(),
'name' => $nameTools,
);
$nameTools = get_lang('ForumSearch'); $nameTools = get_lang('ForumSearch');
} }
@ -63,7 +78,7 @@ if ($origin == 'group') {
if ($origin == 'learnpath') { if ($origin == 'learnpath') {
Display::display_reduced_header(); Display::display_reduced_header();
} else { } else {
Display :: display_header($nameTools); Display::display_header($nameTools);
} }
// Tool introduction // Tool introduction

@ -64,7 +64,6 @@ $course_id = api_get_course_int_id();
// We are getting all the information about the current forum and forum category. // We are getting all the information about the current forum and forum category.
// Note pcool: I tried to use only one sql statement (and function) for this, // Note pcool: I tried to use only one sql statement (and function) for this,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table. // but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
$sql = "SELECT * FROM $table_posts posts $sql = "SELECT * FROM $table_posts posts
INNER JOIN $table_users users INNER JOIN $table_users users
ON (posts.poster_id = users.user_id) ON (posts.poster_id = users.user_id)

@ -100,15 +100,33 @@ if (api_is_invitee()) {
$groupId = api_get_group_id(); $groupId = api_get_group_id();
if (!empty($groupId)) { if (!empty($groupId)) {
$groupProperties = GroupManager :: get_group_properties($groupId); $groupProperties = GroupManager::get_group_properties($groupId);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); 'url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq,
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); 'name' => get_lang('Groups'),
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic')); );
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq,
'name' => get_lang('GroupSpace').' '.$groupProperties['name'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']),
'name' => $current_forum['forum_title'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),
'name' => get_lang('NewTopic'),
);
} else { } else {
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'],
'name' => $current_forum_category['cat_title'],
);
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']),
'name' => $current_forum['forum_title'],
);
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewTopic')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('NewTopic'));
} }

@ -240,7 +240,6 @@ if (isset($current_thread['thread_id'])) {
$my_forum_id = $clean_forum_id; $my_forum_id = $clean_forum_id;
$info_thread = get_thread_information($clean_forum_id, $clean_thread_id); $info_thread = get_thread_information($clean_forum_id, $clean_thread_id);
$my_forum_id = $info_thread['forum_id']; $my_forum_id = $info_thread['forum_id'];
$userCanEdit = $current_thread['thread_peer_qualify'] == 1 && $row['poster_id'] != $userId; $userCanEdit = $current_thread['thread_peer_qualify'] == 1 && $row['poster_id'] != $userId;
/*if ($row['poster_id'] != $userId && $current_forum['moderated'] == 1 && $row['status']) { /*if ($row['poster_id'] != $userId && $current_forum['moderated'] == 1 && $row['status']) {
}*/ }*/

@ -1,6 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* See the progress for a user when the gamification mode is active * See the progress for a user when the gamification mode is active
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com> * @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>

Loading…
Cancel
Save