|
4 | 4 | * HotPotatoes administration.
|
5 | 5 | * @package chamilo.exercise
|
6 | 6 | * @author Istvan Mandak
|
7 |
| -* @version $Id: adminhp.php 20089 2009-04-24 21:12:54Z cvargas1 $ |
8 | 7 | */
|
| 8 | + |
9 | 9 | require_once '../inc/global.inc.php';
|
10 | 10 |
|
11 |
| -$this_section=SECTION_COURSES; |
| 11 | +$this_section = SECTION_COURSES; |
| 12 | + |
| 13 | +$_course = api_get_course_info(); |
12 | 14 |
|
13 | 15 | if (isset($_REQUEST["cancel"])) {
|
14 |
| - if ($_REQUEST["cancel"]==get_lang('Cancel')) { |
| 16 | + if ($_REQUEST["cancel"] == get_lang('Cancel')) { |
15 | 17 | header("Location: exercise.php");
|
| 18 | + exit; |
16 | 19 | }
|
17 | 20 | }
|
18 | 21 |
|
19 |
| -//$is_courseAdmin = $_SESSION['is_courseAdmin']; |
20 |
| -$newName = (!empty($_REQUEST['newName'])?$_REQUEST['newName']:''); |
21 |
| -$hotpotatoesName = (!empty($_REQUEST['hotpotatoesName'])?$_REQUEST['hotpotatoesName']:''); |
| 22 | +$newName = !empty($_REQUEST['newName']) ? $_REQUEST['newName'] : ''; |
| 23 | +$hotpotatoesName = !empty($_REQUEST['hotpotatoesName']) ? $_REQUEST['hotpotatoesName'] : ''; |
22 | 24 |
|
23 | 25 | $is_allowedToEdit=api_is_allowed_to_edit(null,true);
|
24 | 26 |
|
25 | 27 | // document path
|
26 |
| -$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
| 28 | +$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
27 | 29 |
|
28 | 30 | // picture path
|
29 | 31 | $picturePath=$documentPath.'/images';
|
|
40 | 42 | $gradebook= $_SESSION['gradebook'];
|
41 | 43 | }
|
42 | 44 |
|
43 |
| -if (!empty($gradebook) && $gradebook=='view') { |
44 |
| - $interbreadcrumb[]= array ( |
| 45 | +if (!empty($gradebook) && $gradebook == 'view') { |
| 46 | + $interbreadcrumb[] = array( |
45 | 47 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
|
46 |
| - 'name' => get_lang('ToolGradebook') |
| 48 | + 'name' => get_lang('ToolGradebook'), |
47 | 49 | );
|
48 | 50 | }
|
49 | 51 |
|
50 |
| -$interbreadcrumb[]=array("url" => "exercise.php","name" => get_lang('Exercises')); |
51 |
| - |
| 52 | +$interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
52 | 53 | $nameTools = get_lang('adminHP');
|
53 | 54 |
|
54 | 55 | Display::display_header($nameTools,"Exercise");
|
55 | 56 |
|
56 | 57 | /** @todo probably wrong !!!! */
|
57 |
| -require_once(api_get_path(SYS_CODE_PATH).'/exercice/hotpotatoes.lib.php'); |
| 58 | +require_once api_get_path(SYS_CODE_PATH).'/exercice/hotpotatoes.lib.php'; |
58 | 59 |
|
59 | 60 | ?>
|
60 |
| - |
61 | 61 | <h4>
|
62 |
| - <?php echo $nameTools; ?> |
| 62 | +<?php echo $nameTools; ?> |
63 | 63 | </h4>
|
64 | 64 |
|
65 | 65 | <?php
|
66 | 66 | if (isset($newName)) {
|
67 | 67 | if ($newName!="") {
|
68 | 68 | //alter database record for that test
|
69 |
| - SetComment($hotpotatoesName,$newName); |
| 69 | + SetComment($hotpotatoesName, $newName); |
70 | 70 | echo "<script language='Javascript' type='text/javascript'> window.location='exercise.php'; </script>";
|
71 | 71 | }
|
72 | 72 | }
|
|
75 | 75 | echo "<input type=\"hidden\" name=\"hotpotatoesName\" value=\"$hotpotatoesName\">";
|
76 | 76 | echo "<input type=\"text\" name=\"newName\" value=\"";
|
77 | 77 |
|
78 |
| - |
79 |
| -$lstrComment = ""; |
| 78 | +$lstrComment = ''; |
80 | 79 | $lstrComment = GetComment($hotpotatoesName);
|
81 |
| -if ($lstrComment=="") { |
82 |
| - $lstrComment = GetQuizName($hotpotatoesName,$documentPath); |
| 80 | +if ($lstrComment == '') { |
| 81 | + $lstrComment = GetQuizName($hotpotatoesName, $documentPath); |
83 | 82 | }
|
84 |
| -if ($lstrComment=="") { |
85 |
| - $lstrComment = basename($hotpotatoesName,$documentPath); |
| 83 | +if ($lstrComment == '') { |
| 84 | + $lstrComment = basename($hotpotatoesName, $documentPath); |
86 | 85 | }
|
87 | 86 |
|
88 | 87 | echo $lstrComment;
|
|
0 commit comments