@@ -458,7 +458,7 @@ |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if ($myLP->get_type() == 2) { |
461 | - $return .= "update_stats();"; |
|
461 | + $return .= "update_stats();"; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | // To be sure progress is updated. |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | /** |
4 | - * This is a learning path creation and player tool in Chamilo - previously learnpath_handler.php |
|
5 | - * |
|
6 | - * @author Patrick Cool |
|
7 | - * @author Denes Nagy |
|
8 | - * @author Roan Embrechts, refactoring and code cleaning |
|
9 | - * @author Yannick Warnier <[email protected]> - cleaning and update for new SCORM tool |
|
10 | - * @package chamilo.learnpath |
|
11 | - */ |
|
4 | + * This is a learning path creation and player tool in Chamilo - previously learnpath_handler.php |
|
5 | + * |
|
6 | + * @author Patrick Cool |
|
7 | + * @author Denes Nagy |
|
8 | + * @author Roan Embrechts, refactoring and code cleaning |
|
9 | + * @author Yannick Warnier <[email protected]> - cleaning and update for new SCORM tool |
|
10 | + * @package chamilo.learnpath |
|
11 | + */ |
|
12 | 12 | $this_section = SECTION_COURSES; |
13 | 13 | |
14 | 14 | api_protect_course_script(); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | // Create the directory |
50 | 50 | $result = $this->generate_lp_folder($_course, $this->file_name); |
51 | 51 | |
52 | - // Create the directory |
|
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 | 55 | $this->created_dir = substr($result['dir'], 0, strlen($result['dir']) -1); |
@@ -310,7 +310,7 @@ |
||
310 | 310 | $myname = api_utf8_decode($myname); |
311 | 311 | |
312 | 312 | $sql = "INSERT INTO $new_lp (c_id, lp_type, name, ref, description, path, force_commit, default_view_mod, default_encoding, js_lib,display_order, session_id, use_max_score)" . |
313 | - "VALUES ($courseId , 2,'".$myname."', '".$oOrganization->get_ref()."','','".$this->subdir."', 0, 'embedded', '".$this->manifest_encoding."', 'scorm_api.php', $dsp, $sessionId, $userMaxScore)"; |
|
313 | + "VALUES ($courseId , 2,'".$myname."', '".$oOrganization->get_ref()."','','".$this->subdir."', 0, 'embedded', '".$this->manifest_encoding."', 'scorm_api.php', $dsp, $sessionId, $userMaxScore)"; |
|
314 | 314 | if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting path: '. $sql, 0); } |
315 | 315 | |
316 | 316 | Database::query($sql); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Automatic cleanup procedure. Cleans the archive directory of anything |
|
4 | - * older than 7 days |
|
5 | - * @package chamilo.cron |
|
6 | - * @author Yannick Warnier <[email protected]> |
|
7 | - */ |
|
3 | + * Automatic cleanup procedure. Cleans the archive directory of anything |
|
4 | + * older than 7 days |
|
5 | + * @package chamilo.cron |
|
6 | + * @author Yannick Warnier <[email protected]> |
|
7 | + */ |
|
8 | 8 | /** |
9 | - * Initialization |
|
10 | - */ |
|
9 | + * Initialization |
|
10 | + */ |
|
11 | 11 | if (php_sapi_name() != 'cli') { |
12 | 12 | exit; //do not run from browser |
13 | 13 | } |
@@ -1,26 +1,26 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Script to find a document with a specific title or path in all courses |
|
4 | - */ |
|
3 | + * Script to find a document with a specific title or path in all courses |
|
4 | + */ |
|
5 | 5 | /** |
6 | - * Code init - comment die() call to enable |
|
7 | - */ |
|
6 | + * Code init - comment die() call to enable |
|
7 | + */ |
|
8 | 8 | die(); |
9 | 9 | require '../../inc/global.inc.php'; |
10 | 10 | if (empty($_GET['doc'])) { |
11 | - echo "To add a document name to search, add ?doc=abc to the URL"; |
|
11 | + echo "To add a document name to search, add ?doc=abc to the URL"; |
|
12 | 12 | } else { |
13 | - echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />"; |
|
13 | + echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />"; |
|
14 | 14 | } |
15 | 15 | $courses_list = CourseManager::get_courses_list(); |
16 | 16 | foreach ($courses_list as $course) { |
17 | - $title = Database::escape_string($_GET['doc']); |
|
18 | - $td = Database::get_course_table(TABLE_DOCUMENT); |
|
19 | - $sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'"; |
|
20 | - $res = Database::query($sql); |
|
21 | - if (Database::num_rows($res)>0) { |
|
17 | + $title = Database::escape_string($_GET['doc']); |
|
18 | + $td = Database::get_course_table(TABLE_DOCUMENT); |
|
19 | + $sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'"; |
|
20 | + $res = Database::query($sql); |
|
21 | + if (Database::num_rows($res)>0) { |
|
22 | 22 | while ($row = Database::fetch_array($res)) { |
23 | - echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />"; |
|
23 | + echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />"; |
|
24 | + } |
|
24 | 25 | } |
25 | - } |
|
26 | 26 | } |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This script gets users details of a given list of users |
|
4 | - * (given by e-mail) and prints the details in /tmp/list.txt |
|
5 | - * To enable script, prefix the first die(); with // |
|
6 | - * @package chamilo.cron.user_import |
|
7 | - */ |
|
3 | + * This script gets users details of a given list of users |
|
4 | + * (given by e-mail) and prints the details in /tmp/list.txt |
|
5 | + * To enable script, prefix the first die(); with // |
|
6 | + * @package chamilo.cron.user_import |
|
7 | + */ |
|
8 | 8 | /** |
9 | - * Initialization |
|
10 | - */ |
|
9 | + * Initialization |
|
10 | + */ |
|
11 | 11 | /* Example of input file: |
12 | 12 | [email protected] |
13 | 13 | [email protected] |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | $users = Database::get_main_table(TABLE_MAIN_USER); |
21 | 21 | $string=''; |
22 | 22 | foreach ($list as $mail) { |
23 | - $mail = trim($mail); |
|
24 | - $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n"; |
|
25 | - $res = Database::query($sql); |
|
26 | - if ($res === false) { die(mysql_error());} |
|
27 | - if (Database::num_rows($res) == 0) { |
|
23 | + $mail = trim($mail); |
|
24 | + $sql = "SELECT user_id, official_code, firstname, lastname, email FROM $users WHERE email = '$mail'\n"; |
|
25 | + $res = Database::query($sql); |
|
26 | + if ($res === false) { die(mysql_error());} |
|
27 | + if (Database::num_rows($res) == 0) { |
|
28 | 28 | $string .= 'No encontrado;'.$row['email']; |
29 | - } else { |
|
29 | + } else { |
|
30 | 30 | $row = Database::fetch_assoc($res); |
31 | - $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n"; |
|
32 | - } |
|
31 | + $string .= $row['user_id'].';'.$row['email'].';'.$row['firstname'].';'.$row['lastname'].';'.$row['official_code']."\r\n"; |
|
32 | + } |
|
33 | 33 | } |
34 | 34 | echo $string; |
35 | 35 | file_put_contents('/tmp/list.txt',$string); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | /** |
4 | - * Create course sessions procedure. It creates sessions for courses that haven't it yet. |
|
5 | - * If today is greater than OFFSET, it will create them also for the next quarter |
|
6 | - * @package chamilo.cron |
|
7 | - * @author Imanol Losada <[email protected]> |
|
8 | - */ |
|
4 | + * Create course sessions procedure. It creates sessions for courses that haven't it yet. |
|
5 | + * If today is greater than OFFSET, it will create them also for the next quarter |
|
6 | + * @package chamilo.cron |
|
7 | + * @author Imanol Losada <[email protected]> |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Initialization |
@@ -1,80 +1,80 @@ |
||
1 | 1 | <?php |
2 | 2 | /* For licensing terms, see /license.txt */ |
3 | 3 | /** |
4 | - * This script prints a list of most used language terms. The registration of |
|
5 | - * frequency for language variables is a very heavy operation. |
|
6 | - * To enable, add "$_configuration['language_measure_frequency' ] = 1;" at the |
|
7 | - * end of main/inc/conf/configuration.php. Remove when done. |
|
8 | - * Add ?output=1 to the URL to generate languag files in /tmp/lang/ with just |
|
9 | - * the number of terms you want. |
|
10 | - */ |
|
4 | + * This script prints a list of most used language terms. The registration of |
|
5 | + * frequency for language variables is a very heavy operation. |
|
6 | + * To enable, add "$_configuration['language_measure_frequency' ] = 1;" at the |
|
7 | + * end of main/inc/conf/configuration.php. Remove when done. |
|
8 | + * Add ?output=1 to the URL to generate languag files in /tmp/lang/ with just |
|
9 | + * the number of terms you want. |
|
10 | + */ |
|
11 | 11 | /** |
12 | - * Requires |
|
13 | - */ |
|
12 | + * Requires |
|
13 | + */ |
|
14 | 14 | die(); |
15 | 15 | require_once '../../inc/global.inc.php'; |
16 | 16 | require_once 'langstats.class.php'; |
17 | 17 | /** |
18 | - * Init |
|
19 | - */ |
|
18 | + * Init |
|
19 | + */ |
|
20 | 20 | $terms_limit = 10000 + 50; |
21 | 21 | $x_most_popular = 2000; |
22 | 22 | $output = false; |
23 | 23 | $ls = new langstats(); |
24 | 24 | if ($ls === false) { |
25 | - exit($ls->error); |
|
25 | + exit($ls->error); |
|
26 | 26 | } |
27 | 27 | $list = $ls->get_popular_terms($x_most_popular); |
28 | 28 | if ($_GET['output'] == 1) { |
29 | - $output = true; |
|
30 | - $variables_origin = $ls->get_variables_origin(); |
|
29 | + $output = true; |
|
30 | + $variables_origin = $ls->get_variables_origin(); |
|
31 | 31 | } |
32 | 32 | /** |
33 | - * Display |
|
34 | - */ |
|
33 | + * Display |
|
34 | + */ |
|
35 | 35 | if (count($list)==0) { echo 'No terms loaded so far'; } |
36 | 36 | if (count($list)>0) { |
37 | - $i = 1; |
|
38 | - $j = 1; |
|
39 | - $k = 0; |
|
40 | - $files = array(); |
|
41 | - $trans = array(); |
|
42 | - echo 'Number of records: '.count($list).'<br />'; |
|
43 | - echo '<table><tr><th>Index</th><th>Registration order</th><th>Term</th>'.($output==1?'<th>Origin</th>':'').'<th>Count</th></tr>'; |
|
44 | - foreach($list as $elem) { |
|
37 | + $i = 1; |
|
38 | + $j = 1; |
|
39 | + $k = 0; |
|
40 | + $files = array(); |
|
41 | + $trans = array(); |
|
42 | + echo 'Number of records: '.count($list).'<br />'; |
|
43 | + echo '<table><tr><th>Index</th><th>Registration order</th><th>Term</th>'.($output==1?'<th>Origin</th>':'').'<th>Count</th></tr>'; |
|
44 | + foreach($list as $elem) { |
|
45 | 45 | if ($k > $terms_limit) { break; } |
46 | 46 | $fixed_elem = $elem; |
47 | 47 | if ($output) { |
48 | - if (empty($variables_origin[$elem['term_name']]) && !empty($variables_origin['lang'.$elem['term_name']])) { |
|
48 | + if (empty($variables_origin[$elem['term_name']]) && !empty($variables_origin['lang'.$elem['term_name']])) { |
|
49 | 49 | $fixed_elem = array('id' => $elem['id'], 'term_name' => 'lang'.$elem['term_name'], 'term_count' => $elem['term_count']); |
50 | - } |
|
51 | - if (empty($variables_origin[$fixed_elem['term_name']])) { |
|
50 | + } |
|
51 | + if (empty($variables_origin[$fixed_elem['term_name']])) { |
|
52 | 52 | continue; |
53 | - } |
|
54 | - $files[$variables_origin[$fixed_elem['term_name']]][] = $fixed_elem['term_name']; |
|
55 | - $translation = get_lang($fixed_elem['term_name']); |
|
56 | - $k += str_word_count($translation); |
|
57 | - $trans[$fixed_elem['term_name']] = $translation; |
|
58 | - $j++; |
|
53 | + } |
|
54 | + $files[$variables_origin[$fixed_elem['term_name']]][] = $fixed_elem['term_name']; |
|
55 | + $translation = get_lang($fixed_elem['term_name']); |
|
56 | + $k += str_word_count($translation); |
|
57 | + $trans[$fixed_elem['term_name']] = $translation; |
|
58 | + $j++; |
|
59 | 59 | } |
60 | 60 | echo '<tr><td>',$i, |
61 | - '</td><td>',$fixed_elem['id'], |
|
62 | - '</td><td>',$fixed_elem['term_name']; |
|
61 | + '</td><td>',$fixed_elem['id'], |
|
62 | + '</td><td>',$fixed_elem['term_name']; |
|
63 | 63 | if ($output) { |
64 | - echo '</td><td>'.$variables_origin[$fixed_elem['term_name']]; |
|
64 | + echo '</td><td>'.$variables_origin[$fixed_elem['term_name']]; |
|
65 | 65 | } |
66 | 66 | echo '</td><td>',$fixed_elem['term_count'],'</td></tr>'; |
67 | 67 | $i++; |
68 | - } |
|
69 | - echo '</table>'; |
|
70 | - if ($output) { |
|
68 | + } |
|
69 | + echo '</table>'; |
|
70 | + if ($output) { |
|
71 | 71 | @mkdir('/tmp/lang'); |
72 | 72 | foreach ($files as $file => $terms) { |
73 | - @touch('/tmp/lang/'.$file); |
|
74 | - file_put_contents('/tmp/lang/'.$file,"<?php".PHP_EOL); |
|
75 | - foreach ($terms as $term) { |
|
73 | + @touch('/tmp/lang/'.$file); |
|
74 | + file_put_contents('/tmp/lang/'.$file,"<?php".PHP_EOL); |
|
75 | + foreach ($terms as $term) { |
|
76 | 76 | file_put_contents('/tmp/lang/'.$file,'$'.$term.' = "'.str_replace('"','\"',$trans[$term]).'";'.PHP_EOL, FILE_APPEND); |
77 | - } |
|
77 | + } |
|
78 | 78 | } |
79 | - } |
|
79 | + } |
|
80 | 80 | } |