@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $javascript .= "'".$dropbox_person->sentWork[$i]->title."'"; |
217 | 217 | } |
218 | 218 | } |
219 | - $javascript .= "); |
|
219 | + $javascript .= "); |
|
220 | 220 | |
221 | 221 | function checkfile(str) |
222 | 222 | { |
@@ -326,15 +326,15 @@ discard block |
||
326 | 326 | 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(), |
327 | 327 | 'name' => get_lang('Dropbox', ''), |
328 | 328 | ); |
329 | - $nameTools = get_lang('ReceivedFiles'); |
|
329 | + $nameTools = get_lang('ReceivedFiles'); |
|
330 | 330 | |
331 | - if ($action == 'addreceivedcategory') { |
|
331 | + if ($action == 'addreceivedcategory') { |
|
332 | 332 | $interbreadcrumb[] = array( |
333 | 333 | 'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=received&'.api_get_cidreq(), |
334 | 334 | 'name' => get_lang('ReceivedFiles'), |
335 | 335 | ); |
336 | - $nameTools = get_lang('AddNewCategory'); |
|
337 | - } |
|
336 | + $nameTools = get_lang('AddNewCategory'); |
|
337 | + } |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | if ($view == 'sent' || empty($view)) { |
@@ -214,9 +214,9 @@ |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | - * Check if system is installed |
|
218 | - * @return bool |
|
219 | - */ |
|
217 | + * Check if system is installed |
|
218 | + * @return bool |
|
219 | + */ |
|
220 | 220 | public function isInstalled() |
221 | 221 | { |
222 | 222 | return !empty($this->getContainer()->getParameter('installed')); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * |
16 | 16 | * @ORM\MappedSuperclass |
17 | 17 | */ |
18 | - class ExtraField// extends BaseAttribute |
|
18 | + class ExtraField// extends BaseAttribute |
|
19 | 19 | { |
20 | 20 | const USER_FIELD_TYPE = 1; |
21 | 21 | const COURSE_FIELD_TYPE = 2; |
@@ -263,9 +263,9 @@ discard block |
||
263 | 263 | return $this; |
264 | 264 | } |
265 | 265 | |
266 | - /** |
|
267 | - * @return boolean |
|
268 | - */ |
|
266 | + /** |
|
267 | + * @return boolean |
|
268 | + */ |
|
269 | 269 | public function isChangeable() |
270 | 270 | { |
271 | 271 | return $this->changeable; |
@@ -132,38 +132,38 @@ discard block |
||
132 | 132 | */ |
133 | 133 | function my_rename($file_path, $new_file_name) { |
134 | 134 | |
135 | - $save_dir = getcwd(); |
|
136 | - $path = dirname($file_path); |
|
137 | - $old_file_name = basename($file_path); |
|
138 | - $new_file_name = api_replace_dangerous_char($new_file_name); |
|
135 | + $save_dir = getcwd(); |
|
136 | + $path = dirname($file_path); |
|
137 | + $old_file_name = basename($file_path); |
|
138 | + $new_file_name = api_replace_dangerous_char($new_file_name); |
|
139 | 139 | |
140 | - // If no extension, take the old one |
|
141 | - if ((strpos($new_file_name, '.') === false) && ($dotpos = strrpos($old_file_name, '.'))) { |
|
142 | - $new_file_name .= substr($old_file_name, $dotpos); |
|
143 | - } |
|
140 | + // If no extension, take the old one |
|
141 | + if ((strpos($new_file_name, '.') === false) && ($dotpos = strrpos($old_file_name, '.'))) { |
|
142 | + $new_file_name .= substr($old_file_name, $dotpos); |
|
143 | + } |
|
144 | 144 | |
145 | - // Note: still possible: 'xx.yy' -rename-> '.yy' -rename-> 'zz' |
|
146 | - // This is useful for folder names, where otherwise '.' would be sticky |
|
145 | + // Note: still possible: 'xx.yy' -rename-> '.yy' -rename-> 'zz' |
|
146 | + // This is useful for folder names, where otherwise '.' would be sticky |
|
147 | 147 | |
148 | - // Extension PHP is not allowed, change to PHPS |
|
149 | - $new_file_name = php2phps($new_file_name); |
|
148 | + // Extension PHP is not allowed, change to PHPS |
|
149 | + $new_file_name = php2phps($new_file_name); |
|
150 | 150 | |
151 | - if ($new_file_name == $old_file_name) { |
|
152 | - return $old_file_name; |
|
153 | - } |
|
151 | + if ($new_file_name == $old_file_name) { |
|
152 | + return $old_file_name; |
|
153 | + } |
|
154 | 154 | |
155 | - if (strtolower($new_file_name) != strtolower($old_file_name) && check_name_exist($path.'/'.$new_file_name)) { |
|
156 | - return false; |
|
157 | - } |
|
158 | - // On a Windows server, it would be better not to do the above check |
|
159 | - // because it succeeds for some new names resembling the old name. |
|
160 | - // But on Unix/Linux the check must be done because rename overwrites. |
|
155 | + if (strtolower($new_file_name) != strtolower($old_file_name) && check_name_exist($path.'/'.$new_file_name)) { |
|
156 | + return false; |
|
157 | + } |
|
158 | + // On a Windows server, it would be better not to do the above check |
|
159 | + // because it succeeds for some new names resembling the old name. |
|
160 | + // But on Unix/Linux the check must be done because rename overwrites. |
|
161 | 161 | |
162 | - chdir($path); |
|
163 | - $res = rename($old_file_name, $new_file_name) ? $new_file_name : false; |
|
164 | - chdir($save_dir); |
|
162 | + chdir($path); |
|
163 | + $res = rename($old_file_name, $new_file_name) ? $new_file_name : false; |
|
164 | + chdir($save_dir); |
|
165 | 165 | |
166 | - return $res; |
|
166 | + return $res; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $file_name = basename($source); |
186 | 186 | // move onto self illegal: mv a/b/c a/b/c or mv a/b/c a/b |
187 | 187 | if (strcasecmp($target, dirname($source)) === 0) { |
188 | - return false; |
|
188 | + return false; |
|
189 | 189 | } |
190 | 190 | $isWindowsOS = api_is_windows_os(); |
191 | 191 | $canExec = function_exists('exec'); |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | */ |
266 | 266 | function getextension($filename) |
267 | 267 | { |
268 | - $bouts = explode('.', $filename); |
|
269 | - return array(array_pop($bouts), implode('.', $bouts)); |
|
268 | + $bouts = explode('.', $filename); |
|
269 | + return array(array_pop($bouts), implode('.', $bouts)); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -277,17 +277,17 @@ discard block |
||
277 | 277 | * @param boolean $recursive if true , include subdirectory in total |
278 | 278 | */ |
279 | 279 | function dirsize($root, $recursive = true) { |
280 | - $dir = @opendir($root); |
|
281 | - $size = 0; |
|
282 | - while ($file = @readdir($dir)) { |
|
283 | - if (!in_array($file, array('.', '..'))) { |
|
284 | - if (is_dir($root.'/'.$file)) { |
|
285 | - $size += $recursive ? dirsize($root.'/'.$file) : 0; |
|
286 | - } else { |
|
287 | - $size += @filesize($root.'/'.$file); |
|
288 | - } |
|
289 | - } |
|
290 | - } |
|
291 | - @closedir($dir); |
|
292 | - return $size; |
|
280 | + $dir = @opendir($root); |
|
281 | + $size = 0; |
|
282 | + while ($file = @readdir($dir)) { |
|
283 | + if (!in_array($file, array('.', '..'))) { |
|
284 | + if (is_dir($root.'/'.$file)) { |
|
285 | + $size += $recursive ? dirsize($root.'/'.$file) : 0; |
|
286 | + } else { |
|
287 | + $size += @filesize($root.'/'.$file); |
|
288 | + } |
|
289 | + } |
|
290 | + } |
|
291 | + @closedir($dir); |
|
292 | + return $size; |
|
293 | 293 | } |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | public function getFunctions() |
32 | 32 | { |
33 | 33 | return array( |
34 | - new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
35 | - new \Twig_SimpleFunction('chamilo_settings_get', array($this, 'getSettingsParameter')), |
|
36 | - new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
34 | + new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
35 | + new \Twig_SimpleFunction('chamilo_settings_get', array($this, 'getSettingsParameter')), |
|
36 | + new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
37 | 37 | ); |
38 | 38 | } |
39 | 39 | |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | public function getFilters() |
45 | 45 | { |
46 | 46 | return array( |
47 | - //new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
48 | - new \Twig_SimpleFilter('get_setting', array($this, 'getSettingsParameter')), |
|
49 | - //new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
47 | + //new \Twig_SimpleFunction('chamilo_settings_all', array($this, 'getSettings')), |
|
48 | + new \Twig_SimpleFilter('get_setting', array($this, 'getSettingsParameter')), |
|
49 | + //new \Twig_SimpleFunction('chamilo_settings_has', [$this, 'hasSettingsParameter']), |
|
50 | 50 | ); |
51 | 51 | } |
52 | 52 |
@@ -996,7 +996,7 @@ |
||
996 | 996 | } |
997 | 997 | } |
998 | 998 | |
999 | - return array( |
|
999 | + return array( |
|
1000 | 1000 | 'content' => $html, |
1001 | 1001 | 'tool_list' => $items |
1002 | 1002 | ); |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $media .= '<div class="col-md-2 col-xs-2 social-post-answers">'; |
1409 | 1409 | $media .= '<div class="user-image pull-right">'; |
1410 | 1410 | $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] . |
1411 | - '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>'; |
|
1411 | + '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>'; |
|
1412 | 1412 | $media .= '</div>'; |
1413 | 1413 | $media .= '</div>'; |
1414 | 1414 | $media .= '<div class="col-md-9 col-xs-9 social-post-answers">'; |
@@ -1623,10 +1623,10 @@ discard block |
||
1623 | 1623 | } |
1624 | 1624 | |
1625 | 1625 | /** |
1626 | - * Delete messages delete logic |
|
1627 | - * @param int $id id message to delete. |
|
1628 | - * @return bool status query |
|
1629 | - */ |
|
1626 | + * Delete messages delete logic |
|
1627 | + * @param int $id id message to delete. |
|
1628 | + * @return bool status query |
|
1629 | + */ |
|
1630 | 1630 | public static function deleteMessage($id) |
1631 | 1631 | { |
1632 | 1632 | $id = intval($id); |
@@ -747,10 +747,10 @@ discard block |
||
747 | 747 | Database::query($sql); |
748 | 748 | } |
749 | 749 | |
750 | - /** |
|
751 | - * Delete this category from the database |
|
752 | - * @param int $courseId |
|
753 | - */ |
|
750 | + /** |
|
751 | + * Delete this category from the database |
|
752 | + * @param int $courseId |
|
753 | + */ |
|
754 | 754 | public static function deleteCategoryFromCourse($courseId) |
755 | 755 | { |
756 | 756 | $table = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY); |
@@ -1617,7 +1617,6 @@ discard block |
||
1617 | 1617 | * @param string $course_code Course code (optional) |
1618 | 1618 | * @param int $session_id Session ID (optional) |
1619 | 1619 | * @param bool $order |
1620 | - |
|
1621 | 1620 | * @return array Array of subcategories |
1622 | 1621 | */ |
1623 | 1622 | public function get_subcategories($stud_id = null, $course_code = null, $session_id = null, $order = null) |
@@ -1896,7 +1895,6 @@ discard block |
||
1896 | 1895 | * This function, locks a category , only one who can unlock it is |
1897 | 1896 | * the platform administrator. |
1898 | 1897 | * @param int locked 1 or unlocked 0 |
1899 | - |
|
1900 | 1898 | * @return boolean|null |
1901 | 1899 | * */ |
1902 | 1900 | public function lock($locked) |
@@ -20,24 +20,18 @@ |
||
20 | 20 | * src/Chamilo/CourseBundle/Tool |
21 | 21 | * |
22 | 22 | * All this classes are registered as a service with the tag "chamilo_course.tool" here: |
23 | - |
|
24 | 23 | * src/Chamilo/CourseBundle/Resources/config/services.yml |
25 | 24 | * |
26 | 25 | * The register process is made using the class ToolCompilerClass: |
27 | 26 | * |
28 | 27 | * src/Chamilo/CourseBundle/DependencyInjection/Compiler/ToolCompilerClass.php |
29 | - |
|
30 | 28 | * The tool chain is just an array that includes all the tools registered in services.yml |
31 | 29 | * |
32 | 30 | * The tool chain is hook when a new course is created via a listener here: |
33 | - |
|
34 | 31 | * src/Chamilo/CoreBundle/Entity/Listener/CourseListener.php |
35 | - |
|
36 | 32 | * After a course is created this function is called: CourseListener::prePersist() |
37 | 33 | * This function includes the called to the function "addToolsInCourse" inside the tool chain. |
38 | - |
|
39 | 34 | * This allows to create course tools more easily. Steps: |
40 | - |
|
41 | 35 | * 1. Create a new tool class here: src/Chamilo/CourseBundle/Tool |
42 | 36 | * 2. Add the class as a service here: src/Chamilo/CourseBundle/Resources/config/services.yml (see examples there) |
43 | 37 | * 3. Create a new course. When you create a new course the new tool will be created |