Minor - format code

pull/2970/head
Julio Montoya 6 years ago
parent 96d44a45f2
commit b60ec8ae45
  1. 12
      main/gradebook/index.php

@ -178,8 +178,6 @@ $my_actions = implode(';', $list_actions);
$my_actions_values = implode(';', $list_values); $my_actions_values = implode(';', $list_values);
$logInfo = [ $logInfo = [
'tool' => TOOL_GRADEBOOK, 'tool' => TOOL_GRADEBOOK,
'tool_id' => 0,
'tool_id_detail' => 0,
'action' => $my_actions, 'action' => $my_actions,
'action_details' => $my_actions_values, 'action_details' => $my_actions_values,
]; ];
@ -260,19 +258,19 @@ if (isset($_GET['visiblelog'])) {
//move a category //move a category
if (isset($_GET['movecat'])) { if (isset($_GET['movecat'])) {
GradebookUtils::block_students(); GradebookUtils::block_students();
$cats = Category::load($_GET['movecat']); $moveCategoryId = isset($_GET['movecat']) ? (int) $_GET['movecat'] : 0;
$cats = Category::load($moveCategoryId);
if (!isset($_GET['targetcat'])) { if (!isset($_GET['targetcat'])) {
$move_form = new CatForm( $move_form = new CatForm(
CatForm::TYPE_MOVE, CatForm::TYPE_MOVE,
$cats[0], $cats[0],
'move_cat_form', 'move_cat_form',
null, null,
api_get_self().'?movecat='.intval($_GET['movecat']).'&selectcat='.$selectCat api_get_self().'?movecat='.$moveCategoryId.'&selectcat='.$selectCat
); );
if ($move_form->validate()) { if ($move_form->validate()) {
header('Location: '.api_get_self().'?selectcat='.$selectCat header('Location: '.api_get_self().'?selectcat='.$selectCat
.'&movecat='.intval($_GET['movecat']) .'&movecat='.$moveCategoryId.'&targetcat='.$move_form->exportValue('move_cat'));
.'&targetcat='.$move_form->exportValue('move_cat'));
exit; exit;
} }
} else { } else {
@ -492,7 +490,7 @@ if (!empty($course_to_crsind) && !isset($_GET['confirm'])) {
die('Error: movecat or moveeval not defined'); die('Error: movecat or moveeval not defined');
} }
$button = '<form name="confirm" method="post" action="'.api_get_self().'?confirm=' $button = '<form name="confirm" method="post" action="'.api_get_self().'?confirm='
.(isset($_GET['movecat']) ? '&movecat='.intval($_GET['movecat']) .(isset($_GET['movecat']) ? '&movecat='.$moveCategoryId
: '&moveeval='.intval($_GET['moveeval'])).'&selectcat='.$selectCat.'&targetcat='.intval($_GET['targetcat']).'"> : '&moveeval='.intval($_GET['moveeval'])).'&selectcat='.$selectCat.'&targetcat='.intval($_GET['targetcat']).'">
<input type="submit" value="'.get_lang('Ok').'"> <input type="submit" value="'.get_lang('Ok').'">
</form>'; </form>';

Loading…
Cancel
Save