Minor - code formatting

skala
Julio Montoya 12 years ago
parent 13fe571435
commit bde9d83d8b
  1. 43
      main/forum/editpost.php

@ -21,11 +21,10 @@
*
* @package chamilo.forum
*/
/* INIT SECTION */
// Language files that need to be included.
$language_file = array ('forum', 'group', 'gradebook');
$language_file = array('forum', 'group', 'gradebook');
// Including the global initialization file.
require_once '../inc/global.inc.php';
@ -49,7 +48,7 @@ require_once 'forumfunction.inc.php';
$origin = '';
if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
$origin = Security::remove_XSS($_GET['origin']);
}
// javascript
@ -57,11 +56,11 @@ $htmlHeadXtra[] = '<script>
function advanced_parameters() {
if(document.getElementById(\'id_qualify\').style.display == \'none\') {
document.getElementById(\'id_qualify\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_hide.gif', get_lang('Hide'), array('style' => 'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
} else {
document.getElementById(\'id_qualify\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;'.Display::return_icon('div_show.gif', get_lang('Show'), array('style' => 'vertical-align:middle')).'&nbsp;'.get_lang('AdvancedParameters').'\';
}
}
</script>';
@ -73,10 +72,10 @@ $htmlHeadXtra[] = '<script>
// 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,
// but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
$current_thread = get_thread_information($_GET['thread']); // Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($_GET['forum']); // Note: This has to be validated that it is an existing forum.
$current_thread = get_thread_information($_GET['thread']); // Note: This has to be validated that it is an existing thread.
$current_forum = get_forum_information($_GET['forum']); // Note: This has to be validated that it is an existing forum.
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$current_post = get_post_information($_GET['post']);
$current_post = get_post_information($_GET['post']);
api_block_course_item_locked_by_gradebook($_GET['thread'], LINK_FORUM_THREAD);
@ -87,20 +86,19 @@ if (isset($_SESSION['gradebook'])) {
}
if (!empty($gradebook) && $gradebook == 'view') {
$interbreadcrumb[] = array (
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
$interbreadcrumb[] = array(
'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
'name' => get_lang('ToolGradebook')
);
}
if ($origin == 'group') {
$_clean['toolgroup'] = (int)$_SESSION['toolgroup'];
$_clean['toolgroup'] = (int) $_SESSION['toolgroup'];
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
$interbreadcrumb[] = array('url' => '../group/group.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url'=>'../group/group_space.php?gidReq='.$_SESSION['toolgroup'], 'name'=> get_lang('GroupSpace').' '.$group_properties['name']);
$interbreadcrumb[] = array('url' => '../group/group_space.php?gidReq='.$_SESSION['toolgroup'], 'name' => get_lang('GroupSpace').' '.$group_properties['name']);
$interbreadcrumb[] = array('url' => 'viewforum.php?origin='.$origin.'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;forum='.Security::remove_XSS($_GET['forum']), 'name' => prepare4display($current_forum['forum_title']));
$interbreadcrumb[] = array('url' => 'javascript: void (0);', 'name' => get_lang('EditPost'));
} else {
$interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook, 'name' => $nameTools);
$interbreadcrumb[] = array('url' => 'viewforumcategory.php?forumcategory='.$current_forum_category['cat_id'], 'name' => prepare4display($current_forum_category['cat_title']));
@ -112,9 +110,9 @@ if ($origin == 'group') {
/* Resource Linker */
if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Resources')) {
$_SESSION['formelements'] = $_POST;
$_SESSION['origin'] = $_SERVER['REQUEST_URI'];
$_SESSION['breadcrumbs'] = $interbreadcrumb;
$_SESSION['formelements'] = $_POST;
$_SESSION['origin'] = $_SERVER['REQUEST_URI'];
$_SESSION['breadcrumbs'] = $interbreadcrumb;
header('Location: ../resourcelinker/resourcelinker.php');
}
$table_link = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
@ -124,13 +122,13 @@ $table_link = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
// Are we in a lp ?
$origin = '';
if (isset($_GET['origin'])) {
$origin = Security::remove_XSS($_GET['origin']);
$origin = Security::remove_XSS($_GET['origin']);
}
if ($origin == 'learnpath') {
Display::display_reduced_header();
} else {
Display :: display_header(null);
Display :: display_header(null);
}
/* Is the user allowed here? */
@ -149,7 +147,7 @@ if (!api_is_allowed_to_edit(null, true) AND (($current_forum_category && $curren
exit;
}
}
if (!api_is_allowed_to_edit(null, true) AND (($current_forum_category && $current_forum_category['locked'] <> 0 ) OR $current_forum['locked'] <> 0 OR $current_thread['locked'] <> 0)) {
$forum_allow = forum_not_allowed_here();
if ($forum_allow === false) {
@ -191,7 +189,8 @@ echo "<table class=\"forum_table\" width=\"100%\">\n";
// The forum category
echo "<tr><th class=\"forum_head\" colspan=\"2\">";
echo '<a href="viewforum.php?&amp;origin='.$origin.'&amp;forum='.$current_forum['forum_id'].'" '.class_visible_invisible($current_forum['visibility']).'>'.prepare4display($current_forum['forum_title']).'</a><br />';
echo '<span class="forum_description">'.prepare4display($current_forum['forum_comment']).'</span>';echo "</th>\n";
echo '<span class="forum_description">'.prepare4display($current_forum['forum_comment']).'</span>';
echo "</th>\n";
echo "</th>\n";
echo "\t</tr>\n";
echo '</table>';

Loading…
Cancel
Save