@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * Establishes a connection to the LDAP server and sets the protocol version |
30 | 30 | * |
31 | - * @return resource ldap link identifier or false |
|
31 | + * @return boolean ldap link identifier or false |
|
32 | 32 | * @author ndiechburg <[email protected]> |
33 | 33 | * */ |
34 | 34 | function extldap_connect() |
@@ -77,6 +77,7 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Authenticate user on external ldap server and return user ldap entry if that succeeds |
79 | 79 | * |
80 | + * @param string $password |
|
80 | 81 | * @return mixed false if user cannot authenticate on ldap, user ldap entry if tha succeeds |
81 | 82 | * @author ndiechburg <[email protected]> |
82 | 83 | * Modified by [email protected] |
@@ -237,7 +238,7 @@ discard block |
||
237 | 238 | |
238 | 239 | /** |
239 | 240 | * Imports all LDAP users into Chamilo |
240 | - * @return bool false on error, true otherwise |
|
241 | + * @return false|null false on error, true otherwise |
|
241 | 242 | */ |
242 | 243 | function extldap_import_all_users() |
243 | 244 | { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * Creates the 'shibb_unique_id' field in the table 'user' of the main Chamilo database if it doesn't exist yet |
36 | 36 | * |
37 | 37 | * @author Nicolas Rod |
38 | - * @return void |
|
38 | + * @return false|null |
|
39 | 39 | */ |
40 | 40 | public static function create_shibb_unique_id_field_if_missing() |
41 | 41 | { |
@@ -346,6 +346,9 @@ |
||
346 | 346 | return $result; |
347 | 347 | } |
348 | 348 | |
349 | + /** |
|
350 | + * @param string $sql |
|
351 | + */ |
|
349 | 352 | protected function execute($sql) |
350 | 353 | { |
351 | 354 | return Database::query($sql, null, __FILE__); |
@@ -107,8 +107,7 @@ discard block |
||
107 | 107 | if ($this->is_new($object)) |
108 | 108 | { |
109 | 109 | $result = $this->insert($object); |
110 | - } |
|
111 | - else |
|
110 | + } else |
|
112 | 111 | { |
113 | 112 | $result = $this->update($object); |
114 | 113 | } |
@@ -257,8 +256,7 @@ discard block |
||
257 | 256 | $object->{$this->id_name} = $id; |
258 | 257 | $object->{db_name} = $db_name; |
259 | 258 | return $id; |
260 | - } |
|
261 | - else |
|
259 | + } else |
|
262 | 260 | { |
263 | 261 | return false; |
264 | 262 | } |
@@ -278,16 +276,13 @@ discard block |
||
278 | 276 | return ''; |
279 | 277 | } |
280 | 278 | $args = array($this->pk_name, $arg); |
281 | - } |
|
282 | - else if (is_string($arg)) |
|
279 | + } else if (is_string($arg)) |
|
283 | 280 | { |
284 | 281 | return $arg; |
285 | - } |
|
286 | - else if (is_array($arg)) |
|
282 | + } else if (is_array($arg)) |
|
287 | 283 | { |
288 | 284 | $args = $arg; |
289 | - } |
|
290 | - else |
|
285 | + } else |
|
291 | 286 | { |
292 | 287 | return $arg; |
293 | 288 | } |
@@ -309,17 +304,14 @@ discard block |
||
309 | 304 | if (is_bool($var)) |
310 | 305 | { |
311 | 306 | return $value ? '1' : '0'; |
312 | - } |
|
313 | - else if (is_numeric($value)) |
|
307 | + } else if (is_numeric($value)) |
|
314 | 308 | { |
315 | 309 | return empty($value) ? '0' : $value; |
316 | - } |
|
317 | - else if (is_string($value)) |
|
310 | + } else if (is_string($value)) |
|
318 | 311 | { |
319 | 312 | $value = mysql_escape_string($value); |
320 | 313 | return "'$value'"; |
321 | - } |
|
322 | - else |
|
314 | + } else |
|
323 | 315 | { |
324 | 316 | return $value; |
325 | 317 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | |
91 | 91 | /** |
92 | 92 | * Validates the received active connection data with the database |
93 | - * @return bool Return the loginFailed variable value to local.inc.php |
|
93 | + * @return null|false Return the loginFailed variable value to local.inc.php |
|
94 | 94 | */ |
95 | 95 | public function check_user() |
96 | 96 | { |
@@ -327,6 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | /** |
329 | 329 | * Serialize the course with the best serializer available |
330 | + * @return string |
|
330 | 331 | */ |
331 | 332 | public static function serialize($course) |
332 | 333 | { |
@@ -339,6 +340,7 @@ discard block |
||
339 | 340 | |
340 | 341 | /** |
341 | 342 | * Unserialize the course with the best serializer available |
343 | + * @param string $course |
|
342 | 344 | */ |
343 | 345 | public static function unserialize($course) |
344 | 346 | { |
@@ -173,7 +173,7 @@ |
||
173 | 173 | |
174 | 174 | /** |
175 | 175 | * @param array $file |
176 | - * @return bool|string |
|
176 | + * @return string|false |
|
177 | 177 | */ |
178 | 178 | public static function import_uploaded_file($file) |
179 | 179 | { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @param array $array |
|
94 | + * @param string[] $array |
|
95 | 95 | */ |
96 | 96 | public function set_tools_to_build($array) |
97 | 97 | { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @param string $courseCode |
124 | 124 | * @param bool true if you want to get the elements that exists in the course and |
125 | 125 | * in the session, (session_id = 0 or session_id = X) |
126 | - * @return object The course object structure |
|
126 | + * @return Course The course object structure |
|
127 | 127 | */ |
128 | 128 | public function build( |
129 | 129 | $session_id = 0, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | /** |
15 | 15 | * Display the form |
16 | - * @param array $hidden_fiels Hidden fields to add to the form. |
|
16 | + * @param array $hidden_fields Hidden fields to add to the form. |
|
17 | 17 | * @param boolean the document array will be serialize. This is used in the course_copy.php file |
18 | 18 | */ |
19 | 19 | static function display_form($course, $hidden_fields = null, $avoid_serialize = false) |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | |
571 | 571 | /** |
572 | 572 | * Display the form session export |
573 | - * @param array $hidden_fiels Hidden fields to add to the form. |
|
573 | + * @param array $hidden_fields Hidden fields to add to the form. |
|
574 | 574 | * @param boolean the document array will be serialize. This is used in the course_copy.php file |
575 | 575 | */ |
576 | 576 | public static function display_form_session_export($list_course, $hidden_fields = null, $avoid_serialize = false) |
@@ -527,14 +527,15 @@ |
||
527 | 527 | // Mark folders to import which are not selected by the user to import, |
528 | 528 | // but in which a document was selected. |
529 | 529 | $documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null; |
530 | - if (!empty($resources) && is_array($resources)) |
|
531 | - foreach ($resources as $id => $obj) { |
|
530 | + if (!empty($resources) && is_array($resources)) { |
|
531 | + foreach ($resources as $id => $obj) { |
|
532 | 532 | if (isset($obj->file_type) && $obj->file_type == 'folder' && |
533 | 533 | !isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) && |
534 | 534 | is_array($documents) |
535 | 535 | ) { |
536 | 536 | foreach ($documents as $id_to_check => $post_value) { |
537 | 537 | $obj_to_check = $resources[$id_to_check]; |
538 | + } |
|
538 | 539 | $shared_path_part = substr($obj_to_check->path,0,strlen($obj->path)); |
539 | 540 | if ($id_to_check != $id && $obj->path == $shared_path_part) { |
540 | 541 | $_POST['resource'][RESOURCE_DOCUMENT][$id] = 1; |
@@ -280,6 +280,7 @@ |
||
280 | 280 | } |
281 | 281 | /** |
282 | 282 | * Get dummy titles, descriptions and texts |
283 | + * @param string $type |
|
283 | 284 | */ |
284 | 285 | function get_dummy_content($type) |
285 | 286 | { |