@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | if ((!$is_allowed_to_edit) || ($isStudentView)) { |
41 | 41 | error_log('New LP - User not authorized in lp_edit_item_prereq.php'); |
42 | - header('location:lp_controller.php?action=view&lp_id=' . $learnpath_id); |
|
42 | + header('location:lp_controller.php?action=view&lp_id='.$learnpath_id); |
|
43 | 43 | } |
44 | 44 | $course_id = api_get_course_int_id(); |
45 | 45 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | if (!empty($gradebook) && $gradebook == 'view') { |
57 | 57 | $interbreadcrumb[] = array( |
58 | - 'url' => '../gradebook/' . $_SESSION['gradebook_dest'], |
|
58 | + 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
|
59 | 59 | 'name' => get_lang('ToolGradebook') |
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | 63 | $interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths')); |
64 | -$interbreadcrumb[] = array('url' => api_get_self() . "?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
65 | -$interbreadcrumb[] = array('url' => api_get_self() . "?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep')); |
|
64 | +$interbreadcrumb[] = array('url' => api_get_self()."?action=build&lp_id=$learnpath_id", 'name' => stripslashes("{$therow['name']}")); |
|
65 | +$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=$learnpath_id", 'name' => get_lang('NewStep')); |
|
66 | 66 | |
67 | 67 | // Theme calls. |
68 | 68 | $show_learn_path = true; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // View |
108 | 108 | $interbreadcrumb[] = [ |
109 | - 'url' => api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?'.api_get_cidreq(), |
|
109 | + 'url' => api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq(), |
|
110 | 110 | 'name' => get_lang('LearningPaths') |
111 | 111 | ]; |
112 | 112 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | array(), |
118 | 118 | ICON_SIZE_MEDIUM |
119 | 119 | ), |
120 | - api_get_path(WEB_CODE_PATH) . 'newscorm/lp_controller.php?' . api_get_cidreq() |
|
120 | + api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq() |
|
121 | 121 | ); |
122 | 122 | |
123 | 123 | $template = new Template(get_lang('StudentScore')); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | // Create the directory |
53 | 53 | $this->base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
54 | 54 | ///learning_path/ppt_dirname directory |
55 | - $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
|
55 | + $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) - 1); |
|
56 | 56 | $this->file_path = $this->created_dir.'/'.api_replace_dangerous_char($file['name']); |
57 | 57 | |
58 | 58 | //var_dump($this->file_name, $this->file_path, $this->base_work_dir, $this->created_dir); |
@@ -89,18 +89,18 @@ discard block |
||
89 | 89 | $perm = api_get_setting('permissions_for_new_files'); |
90 | 90 | |
91 | 91 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
92 | - $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
93 | - $class_path = $converter_path . ';' . $converter_path . '/jodconverter-2.2.2.jar;' . $converter_path . '/jodconverter-cli-2.2.2.jar'; |
|
92 | + $converter_path = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
93 | + $class_path = $converter_path.';'.$converter_path.'/jodconverter-2.2.2.jar;'.$converter_path.'/jodconverter-cli-2.2.2.jar'; |
|
94 | 94 | //$cmd = 'java -cp "'.$class_path.'" DokeosConverter'; |
95 | - $cmd = 'java -Dfile.encoding=UTF-8 -cp "' . $class_path . '" DokeosConverter'; |
|
95 | + $cmd = 'java -Dfile.encoding=UTF-8 -cp "'.$class_path.'" DokeosConverter'; |
|
96 | 96 | } else { |
97 | - $converter_path = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
97 | + $converter_path = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
98 | 98 | //$class_path = '-cp .:jodconverter-2.2.1.jar:jodconverter-cli-2.2.1.jar'; |
99 | 99 | $class_path = ' -Dfile.encoding=UTF-8 -cp .:jodconverter-2.2.2.jar:jodconverter-cli-2.2.2.jar'; |
100 | - $cmd = 'cd ' . $converter_path . ' && java ' . $class_path . ' DokeosConverter'; |
|
100 | + $cmd = 'cd '.$converter_path.' && java '.$class_path.' DokeosConverter'; |
|
101 | 101 | } |
102 | 102 | |
103 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
103 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
104 | 104 | // Call to the function implemented by child. |
105 | 105 | $cmd .= $this->add_command_parameters(); |
106 | 106 | // To allow openoffice to manipulate docs. |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | @chmod($this->base_work_dir.$this->file_path, 0777); |
110 | 110 | |
111 | 111 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
112 | - putenv('LC_ALL=' . $locale); |
|
112 | + putenv('LC_ALL='.$locale); |
|
113 | 113 | |
114 | 114 | $files = array(); |
115 | 115 | $return = 0; |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | if (!empty($result['images'])) { |
140 | 140 | foreach ($result['images'] as $image => $img_data) { |
141 | 141 | $image_path = $this->base_work_dir.$this->created_dir; |
142 | - @file_put_contents($image_path . '/' . $image, base64_decode($img_data)); |
|
143 | - @chmod($image_path . '/' . $image, 0777); |
|
142 | + @file_put_contents($image_path.'/'.$image, base64_decode($img_data)); |
|
143 | + @chmod($image_path.'/'.$image, 0777); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -233,38 +233,38 @@ discard block |
||
233 | 233 | $ppt2lpHost = api_get_setting('service_ppt2lp', 'host'); |
234 | 234 | $permissionFile = api_get_permissions_for_new_files(); |
235 | 235 | $permissionFolder = api_get_permissions_for_new_directories(); |
236 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
236 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
237 | 237 | |
238 | 238 | return $ids; |
239 | 239 | } |
240 | 240 | |
241 | 241 | if ($ppt2lpHost == 'localhost') { |
242 | 242 | if (IS_WINDOWS_OS) { // IS_WINDOWS_OS has been defined in main_api.lib.php |
243 | - $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'); |
|
244 | - $classPath = $converterPath . ';' . $converterPath . '/jodconverter-2.2.2.jar;' . $converterPath . '/jodconverter-cli-2.2.2.jar'; |
|
245 | - $cmd = 'java -Dfile.encoding=UTF-8 -jar "' . $classPath . '/jodconverter-2.2.2.jar"'; |
|
243 | + $converterPath = str_replace('/', '\\', api_get_path(SYS_PATH).'main/inc/lib/ppt2png'); |
|
244 | + $classPath = $converterPath.';'.$converterPath.'/jodconverter-2.2.2.jar;'.$converterPath.'/jodconverter-cli-2.2.2.jar'; |
|
245 | + $cmd = 'java -Dfile.encoding=UTF-8 -jar "'.$classPath.'/jodconverter-2.2.2.jar"'; |
|
246 | 246 | } else { |
247 | - $converterPath = api_get_path(SYS_PATH) . 'main/inc/lib/ppt2png'; |
|
247 | + $converterPath = api_get_path(SYS_PATH).'main/inc/lib/ppt2png'; |
|
248 | 248 | $classPath = ' -Dfile.encoding=UTF-8 -jar jodconverter-cli-2.2.2.jar'; |
249 | - $cmd = 'cd ' . $converterPath . ' && java ' . $classPath . ' '; |
|
249 | + $cmd = 'cd '.$converterPath.' && java '.$classPath.' '; |
|
250 | 250 | } |
251 | 251 | |
252 | - $cmd .= ' -p ' . api_get_setting('service_ppt2lp', 'port'); |
|
252 | + $cmd .= ' -p '.api_get_setting('service_ppt2lp', 'port'); |
|
253 | 253 | // Call to the function implemented by child. |
254 | - $cmd .= ' "' . $this->base_work_dir . '/' . $this->file_path . '" "' . $this->base_work_dir . '/' . $this->created_dir . '"'; |
|
254 | + $cmd .= ' "'.$this->base_work_dir.'/'.$this->file_path.'" "'.$this->base_work_dir.'/'.$this->created_dir.'"'; |
|
255 | 255 | // To allow openoffice to manipulate docs. |
256 | 256 | @chmod($this->base_work_dir, $permissionFolder); |
257 | - @chmod($this->base_work_dir . '/' . $this->file_path, $permissionFile); |
|
257 | + @chmod($this->base_work_dir.'/'.$this->file_path, $permissionFile); |
|
258 | 258 | |
259 | 259 | $locale = $this->original_locale; // TODO: Improve it because we're not sure this locale is present everywhere. |
260 | - putenv('LC_ALL=' . $locale); |
|
260 | + putenv('LC_ALL='.$locale); |
|
261 | 261 | |
262 | 262 | $files = array(); |
263 | 263 | $return = 0; |
264 | 264 | $shell = exec($cmd, $files, $return); |
265 | 265 | // TODO: Chown is not working, root keep user privileges, should be www-data |
266 | - @chown($this->base_work_dir . '/' . $this->created_dir, 'www-data'); |
|
267 | - @chmod($this->base_work_dir . '/' . $this->created_dir, $permissionFile); |
|
266 | + @chown($this->base_work_dir.'/'.$this->created_dir, 'www-data'); |
|
267 | + @chmod($this->base_work_dir.'/'.$this->created_dir, $permissionFile); |
|
268 | 268 | |
269 | 269 | if ($return != 0) { // If the java application returns an error code. |
270 | 270 | switch ($return) { |
@@ -303,14 +303,14 @@ discard block |
||
303 | 303 | */ |
304 | 304 | } |
305 | 305 | |
306 | - if (file_exists($this->base_work_dir . '/' . $this->created_dir)) { |
|
306 | + if (file_exists($this->base_work_dir.'/'.$this->created_dir)) { |
|
307 | 307 | |
308 | 308 | // Register Files to Document tool |
309 | 309 | $ids[] = add_document( |
310 | 310 | $_course, |
311 | - '/' . $this->created_dir, |
|
311 | + '/'.$this->created_dir, |
|
312 | 312 | 'file', |
313 | - filesize($this->base_work_dir . '/' . $this->created_dir), |
|
313 | + filesize($this->base_work_dir.'/'.$this->created_dir), |
|
314 | 314 | $convertedTitle, |
315 | 315 | sprintf( |
316 | 316 | get_lang('FileConvertedFromXToY'), |
@@ -28,10 +28,10 @@ |
||
28 | 28 | error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0); |
29 | 29 | } |
30 | 30 | $mylp = learnpath::getLpFromSession(api_get_course_id(), $lp_id, $user_id); |
31 | - $mylpi =& $mylp->items[$item_id]; |
|
32 | - if (is_array($objectives) && count($objectives)>0){ |
|
33 | - foreach ($objectives as $index=>$objective){ |
|
34 | - $mylpi->add_objective($index,$objectives[$index]); |
|
31 | + $mylpi = & $mylp->items[$item_id]; |
|
32 | + if (is_array($objectives) && count($objectives) > 0) { |
|
33 | + foreach ($objectives as $index=>$objective) { |
|
34 | + $mylpi->add_objective($index, $objectives[$index]); |
|
35 | 35 | } |
36 | 36 | $mylpi->write_objectives_to_db(); |
37 | 37 | } |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $a_dir = realpath($dir.'/../../archive/'); |
16 | 16 | $list = scandir($a_dir); |
17 | 17 | // calculate 7 days |
18 | -$t = time()-(86400*7); |
|
18 | +$t = time() - (86400 * 7); |
|
19 | 19 | foreach ($list as $item) { |
20 | - if (substr($item,0,1) == '.') { |
|
20 | + if (substr($item, 0, 1) == '.') { |
|
21 | 21 | continue; |
22 | 22 | } |
23 | 23 | $stat = @stat($a_dir.'/'.$item); |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | * Delete a file or recursively delete a directory |
35 | 35 | * @param string $str Path to file or directory |
36 | 36 | */ |
37 | -function recursive_delete($str){ |
|
37 | +function recursive_delete($str) { |
|
38 | 38 | if (is_file($str)) { |
39 | 39 | return @unlink($str); |
40 | 40 | } elseif (is_dir($str)) { |
41 | - $scan = glob(rtrim($str,'/').'/*'); |
|
41 | + $scan = glob(rtrim($str, '/').'/*'); |
|
42 | 42 | foreach ($scan as $index=>$path) { |
43 | 43 | recursive_delete($path); |
44 | 44 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @package chamilo.cron |
6 | 6 | * @author Imanol Losada <[email protected]> |
7 | 7 | */ |
8 | -require_once __DIR__ . '/../inc/global.inc.php'; |
|
8 | +require_once __DIR__.'/../inc/global.inc.php'; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Initialization |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | foreach ($sessions as $sessionId => $userIds) { |
66 | 66 | $userId = 0; |
67 | - $userIds = $userIds ? " AND sessionUser.user_id NOT IN (" . implode(", ", $userIds) . ")" : null; |
|
67 | + $userIds = $userIds ? " AND sessionUser.user_id NOT IN (".implode(", ", $userIds).")" : null; |
|
68 | 68 | $query = " |
69 | 69 | SELECT sessionUser.session_id, sessionUser.user_id, session.name, session.access_end_date |
70 | 70 | FROM $sessionUserTable AS sessionUser |
@@ -156,10 +156,10 @@ discard block |
||
156 | 156 | $administrator['completeName'], |
157 | 157 | $administrator['email'] |
158 | 158 | ); |
159 | - echo "Email sent to $userCompleteName (" . $user['email'] . ")\n"; |
|
160 | - echo "Session: " . $session['name'] . "\n"; |
|
161 | - echo "Date end: " . $session['access_end_date'] . "\n"; |
|
162 | - echo "Days remaining: " . $daysRemaining->format("%d") . "\n\n"; |
|
159 | + echo "Email sent to $userCompleteName (".$user['email'].")\n"; |
|
160 | + echo "Session: ".$session['name']."\n"; |
|
161 | + echo "Date end: ".$session['access_end_date']."\n"; |
|
162 | + echo "Days remaining: ".$daysRemaining->format("%d")."\n\n"; |
|
163 | 163 | } |
164 | 164 | echo "======================================================================\n\n"; |
165 | 165 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @author Angel Fernando Quiroz Campos <[email protected]> |
7 | 7 | * @package chamilo.cron |
8 | 8 | */ |
9 | -require_once __DIR__ . '/../inc/global.inc.php'; |
|
9 | +require_once __DIR__.'/../inc/global.inc.php'; |
|
10 | 10 | |
11 | 11 | if (php_sapi_name() != 'cli') { |
12 | 12 | exit; //do not run from browser |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | ->getResult(); |
33 | 33 | |
34 | 34 | if (empty($sessions)) { |
35 | - echo "No sessions finishing today $endDate" . PHP_EOL; |
|
35 | + echo "No sessions finishing today $endDate".PHP_EOL; |
|
36 | 36 | exit; |
37 | 37 | } |
38 | 38 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $sessionUsers = $session->getUsers(); |
51 | 51 | |
52 | 52 | if (empty($sessionUsers)) { |
53 | - echo 'No users to send mail' . PHP_EOL; |
|
53 | + echo 'No users to send mail'.PHP_EOL; |
|
54 | 54 | exit; |
55 | 55 | } |
56 | 56 | |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | $administrator['email'] |
82 | 82 | ); |
83 | 83 | |
84 | - echo '============' . PHP_EOL; |
|
85 | - echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})" . PHP_EOL; |
|
86 | - echo "Session: {$session->getName()}" . PHP_EOL; |
|
87 | - echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}" . PHP_EOL; |
|
84 | + echo '============'.PHP_EOL; |
|
85 | + echo "Email sent to: {$user->getCompleteName()} ({$user->getEmail()})".PHP_EOL; |
|
86 | + echo "Session: {$session->getName()}".PHP_EOL; |
|
87 | + echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}".PHP_EOL; |
|
88 | 88 | } |
89 | 89 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $totalSize = $row['total']; |
98 | 98 | |
99 | 99 | if ($debug) { |
100 | - echo "Total size in table $table " . (round($totalSize / 1024)) . " MB \n"; |
|
100 | + echo "Total size in table $table ".(round($totalSize / 1024))." MB \n"; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $table = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $subTotal = $row['total']; |
108 | 108 | $totalSize += $subTotal; |
109 | 109 | if ($debug) { |
110 | - echo "Total size in table $table " . (round($subTotal / 1024)) . " MB \n"; |
|
110 | + echo "Total size in table $table ".(round($subTotal / 1024))." MB \n"; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $totalSize = $totalSize / 1024; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | /** |
8 | 8 | * Initialization |
9 | 9 | */ |
10 | -if (PHP_SAPI!='cli') { |
|
10 | +if (PHP_SAPI != 'cli') { |
|
11 | 11 | die('Run this script through the command line or comment this line in the code'); |
12 | 12 | } |
13 | 13 |