@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <script> |
21 | 21 | $(document).ready(function() { |
22 | 22 | $.ajax({ |
23 | - url: "'. api_get_path(WEB_CODE_PATH) .'inc/ajax/statistics.ajax.php?a=recentlogins", |
|
23 | + url: "'. api_get_path(WEB_CODE_PATH).'inc/ajax/statistics.ajax.php?a=recentlogins", |
|
24 | 24 | type: "POST", |
25 | 25 | success: function(data) { |
26 | 26 | Chart.defaults.global.responsive = true; |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | // users ... |
51 | 51 | $tools[$strUsers]['report=users'] = get_lang('CountUsers'); |
52 | 52 | $tools[$strUsers]['report=recentlogins'] = get_lang('Logins'); |
53 | -$tools[$strUsers]['report=logins&type=month'] = get_lang('Logins') . ' (' . get_lang('PeriodMonth') . ')'; |
|
54 | -$tools[$strUsers]['report=logins&type=day'] = get_lang('Logins') . ' (' . get_lang('PeriodDay') . ')'; |
|
55 | -$tools[$strUsers]['report=logins&type=hour'] = get_lang('Logins') . ' (' . get_lang('PeriodHour') . ')'; |
|
56 | -$tools[$strUsers]['report=pictures'] = get_lang('CountUsers') . ' (' . get_lang('UserPicture') . ')'; |
|
53 | +$tools[$strUsers]['report=logins&type=month'] = get_lang('Logins').' ('.get_lang('PeriodMonth').')'; |
|
54 | +$tools[$strUsers]['report=logins&type=day'] = get_lang('Logins').' ('.get_lang('PeriodDay').')'; |
|
55 | +$tools[$strUsers]['report=logins&type=hour'] = get_lang('Logins').' ('.get_lang('PeriodHour').')'; |
|
56 | +$tools[$strUsers]['report=pictures'] = get_lang('CountUsers').' ('.get_lang('UserPicture').')'; |
|
57 | 57 | $tools[$strUsers]['report=no_login_users'] = get_lang('StatsUsersDidNotLoginInLastPeriods'); |
58 | 58 | $tools[$strUsers]['report=zombies'] = get_lang('Zombies'); |
59 | 59 | |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | echo '<table><tr>'; |
69 | 69 | foreach ($tools as $section => $items) { |
70 | 70 | echo '<td style="vertical-align:top;">'; |
71 | - echo '<h3>' . $section . '</h3>'; |
|
71 | + echo '<h3>'.$section.'</h3>'; |
|
72 | 72 | echo '<ul>'; |
73 | 73 | foreach ($items as $key => $value) { |
74 | - echo '<li><a href="index.php?' . $key . '">' . $value . '</a></li>'; |
|
74 | + echo '<li><a href="index.php?'.$key.'">'.$value.'</a></li>'; |
|
75 | 75 | } |
76 | 76 | echo '</ul>'; |
77 | 77 | echo '</td>'; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | echo '</tr></table>'; |
80 | 80 | |
81 | 81 | $course_categories = Statistics::getCourseCategories(); |
82 | -echo '<br/><br/>';//@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation |
|
82 | +echo '<br/><br/>'; //@todo: spaces between elements should be handled in the css, br should be removed if only there for presentation |
|
83 | 83 | |
84 | 84 | switch ($report) { |
85 | 85 | case 'courses': |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | Statistics::printStats(get_lang('Students'), $students); |
122 | 122 | break; |
123 | 123 | case 'recentlogins': |
124 | - echo '<h2>'. sprintf(get_lang('LastXDays'), '15') . '</h2>'; |
|
124 | + echo '<h2>'.sprintf(get_lang('LastXDays'), '15').'</h2>'; |
|
125 | 125 | echo '<canvas class="col-md-12" id="canvas" height="100px" style="margin-bottom: 20px"></canvas>'; |
126 | 126 | Statistics::printRecentLoginStats(); |
127 | 127 | Statistics::printRecentLoginStats(true); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * @since 25/september/2010 |
6 | 6 | */ |
7 | 7 | |
8 | -require_once '../../../../inc/global.inc.php';//hack for Chamilo |
|
8 | +require_once '../../../../inc/global.inc.php'; //hack for Chamilo |
|
9 | 9 | api_protect_course_script(); |
10 | 10 | api_block_anonymous_users(); |
11 | 11 | if (!isset($_SESSION['draw_dir'])) { |
@@ -6,7 +6,7 @@ |
||
6 | 6 | 'jpeg' => 'image/jpeg', |
7 | 7 | 'bmp' => 'image/bmp', |
8 | 8 | 'webp' => 'image/webp', |
9 | - 'pdf' => 'application/pdf' |
|
9 | + 'pdf' => 'application/pdf' |
|
10 | 10 | ); |
11 | 11 | |
12 | 12 | ?> |
13 | 13 | \ No newline at end of file |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | - // You must first create a file "savefile_config.php" in this extensions directory and do whatever |
|
3 | - // checking of user credentials, etc. that you wish; otherwise anyone will be able to post SVG |
|
4 | - // files to your server which may cause disk space or possibly security problems |
|
5 | - require('savefile_config.php'); |
|
6 | - if (!isset($_POST['output_svg'])) { |
|
7 | - print "You must supply output_svg"; |
|
8 | - exit; |
|
9 | - } |
|
10 | - $svg = $_POST['output_svg']; |
|
11 | - $filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows |
|
2 | + // You must first create a file "savefile_config.php" in this extensions directory and do whatever |
|
3 | + // checking of user credentials, etc. that you wish; otherwise anyone will be able to post SVG |
|
4 | + // files to your server which may cause disk space or possibly security problems |
|
5 | + require('savefile_config.php'); |
|
6 | + if (!isset($_POST['output_svg'])) { |
|
7 | + print "You must supply output_svg"; |
|
8 | + exit; |
|
9 | + } |
|
10 | + $svg = $_POST['output_svg']; |
|
11 | + $filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows |
|
12 | 12 | |
13 | - $fh = fopen($filename, 'w') or die("Can't open file"); |
|
14 | - fwrite($fh, $svg); |
|
15 | - fclose($fh); |
|
13 | + $fh = fopen($filename, 'w') or die("Can't open file"); |
|
14 | + fwrite($fh, $svg); |
|
15 | + fclose($fh); |
|
16 | 16 | ?> |
@@ -8,7 +8,7 @@ |
||
8 | 8 | exit; |
9 | 9 | } |
10 | 10 | $svg = $_POST['output_svg']; |
11 | - $filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved') . '.svg'; // These characters are indicated as prohibited by Windows |
|
11 | + $filename = (isset($_POST['filename']) && !empty($_POST['filename']) ? preg_replace('@[\\\\/:*?"<>|]@u', '_', $_POST['filename']) : 'saved').'.svg'; // These characters are indicated as prohibited by Windows |
|
12 | 12 | |
13 | 13 | $fh = fopen($filename, 'w') or die("Can't open file"); |
14 | 14 | fwrite($fh, $svg); |
@@ -16,19 +16,19 @@ discard block |
||
16 | 16 | //get all files and folders |
17 | 17 | $scan_files = []; |
18 | 18 | if (is_dir($user_disk_path)) { |
19 | - $scan_files = scandir($user_disk_path); |
|
19 | + $scan_files = scandir($user_disk_path); |
|
20 | 20 | } |
21 | 21 | //get all svg and png files |
22 | 22 | $accepted_extensions = array('.svg', '.png'); |
23 | 23 | |
24 | 24 | if (is_array($scan_files) && count($scan_files) > 0) { |
25 | - foreach ($scan_files as & $file) { |
|
26 | - $slideshow_extension = strrchr($file, '.'); |
|
27 | - $slideshow_extension = strtolower($slideshow_extension); |
|
28 | - if (in_array($slideshow_extension, $accepted_extensions)) { |
|
29 | - $png_svg_files[] =$file; |
|
30 | - } |
|
31 | - } |
|
25 | + foreach ($scan_files as & $file) { |
|
26 | + $slideshow_extension = strrchr($file, '.'); |
|
27 | + $slideshow_extension = strtolower($slideshow_extension); |
|
28 | + if (in_array($slideshow_extension, $accepted_extensions)) { |
|
29 | + $png_svg_files[] =$file; |
|
30 | + } |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | $style = '<style>'; |
34 | 34 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
@@ -47,23 +47,23 @@ discard block |
||
47 | 47 | echo '<h2>'.get_lang('SocialNetwork').': '.get_lang('MyFiles').'</h2>'; |
48 | 48 | |
49 | 49 | if (!empty($png_svg_files)) { |
50 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
51 | - echo '<ul>'; |
|
52 | - foreach($png_svg_files as $filename) { |
|
53 | - $image = $user_disk_path.$filename; |
|
50 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
51 | + echo '<ul>'; |
|
52 | + foreach($png_svg_files as $filename) { |
|
53 | + $image = $user_disk_path.$filename; |
|
54 | 54 | |
55 | - if (strpos($filename, "svg")){ |
|
56 | - $new_sizes['width'] = 60; |
|
57 | - $new_sizes['height'] = 60; |
|
58 | - } else { |
|
59 | - $new_sizes = api_resize_image($image, 60, 60); |
|
60 | - } |
|
55 | + if (strpos($filename, "svg")){ |
|
56 | + $new_sizes['width'] = 60; |
|
57 | + $new_sizes['height'] = 60; |
|
58 | + } else { |
|
59 | + $new_sizes = api_resize_image($image, 60, 60); |
|
60 | + } |
|
61 | 61 | |
62 | - echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
63 | - } |
|
64 | - echo '</ul>'; |
|
62 | + echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
63 | + } |
|
64 | + echo '</ul>'; |
|
65 | 65 | } else { |
66 | - Display::display_warning_message(get_lang('NoSVGImages')); |
|
66 | + Display::display_warning_message(get_lang('NoSVGImages')); |
|
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | </body> |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | $slideshow_extension = strrchr($file, '.'); |
26 | 26 | $slideshow_extension = strtolower($slideshow_extension); |
27 | 27 | if (in_array($slideshow_extension, $accepted_extensions)) { |
28 | - $png_svg_files[] =$file; |
|
28 | + $png_svg_files[] = $file; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | } |
32 | 32 | $style = '<style>'; |
33 | 33 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
34 | 34 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
35 | -$style .='</style>'; |
|
35 | +$style .= '</style>'; |
|
36 | 36 | |
37 | 37 | ?> |
38 | 38 | <!doctype html> |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | if (!empty($png_svg_files)) { |
49 | 49 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
50 | 50 | echo '<ul>'; |
51 | - foreach($png_svg_files as $filename) { |
|
51 | + foreach ($png_svg_files as $filename) { |
|
52 | 52 | $image = $user_disk_path.$filename; |
53 | 53 | |
54 | - if (strpos($filename, "svg")){ |
|
54 | + if (strpos($filename, "svg")) { |
|
55 | 55 | $new_sizes['width'] = 60; |
56 | 56 | $new_sizes['height'] = 60; |
57 | 57 | } else { |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
35 | 35 | |
36 | 36 | if (count($array_to_search) > 0) { |
37 | - while (list($key) = each($array_to_search)) { |
|
38 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
39 | - } |
|
37 | + while (list($key) = each($array_to_search)) { |
|
38 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
39 | + } |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | //get all svg and png group files |
@@ -70,26 +70,26 @@ discard block |
||
70 | 70 | ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1 |
71 | 71 | ){ |
72 | 72 | |
73 | - if (!empty($png_svg_files)) { |
|
74 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
75 | - echo '<ul>'; |
|
76 | - foreach($png_svg_files as $filename) { |
|
77 | - $image = $group_disk_path.$filename; |
|
78 | - |
|
79 | - if (strpos($filename, "svg")){ |
|
80 | - $new_sizes['width'] = 60; |
|
81 | - $new_sizes['height'] = 60; |
|
82 | - } else { |
|
83 | - $new_sizes = api_resize_image($image, 60, 60); |
|
84 | - } |
|
73 | + if (!empty($png_svg_files)) { |
|
74 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
75 | + echo '<ul>'; |
|
76 | + foreach($png_svg_files as $filename) { |
|
77 | + $image = $group_disk_path.$filename; |
|
78 | + |
|
79 | + if (strpos($filename, "svg")){ |
|
80 | + $new_sizes['width'] = 60; |
|
81 | + $new_sizes['height'] = 60; |
|
82 | + } else { |
|
83 | + $new_sizes = api_resize_image($image, 60, 60); |
|
84 | + } |
|
85 | 85 | echo '<li style="display:inline; padding:8px;">'; |
86 | 86 | echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">'; |
87 | 87 | echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
88 | - } |
|
89 | - echo '</ul>'; |
|
90 | - } |
|
88 | + } |
|
89 | + echo '</ul>'; |
|
90 | + } |
|
91 | 91 | } else { |
92 | - echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
92 | + echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
93 | 93 | } |
94 | 94 | ?> |
95 | 95 | </body> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $slideshow_extension = strrchr($file, '.'); |
48 | 48 | $slideshow_extension = strtolower($slideshow_extension); |
49 | 49 | if (in_array($slideshow_extension, $accepted_extensions)) { |
50 | - $png_svg_files[] =$file; |
|
50 | + $png_svg_files[] = $file; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $style = '<style>'; |
56 | 56 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
57 | 57 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
58 | -$style .='</style>'; |
|
58 | +$style .= '</style>'; |
|
59 | 59 | |
60 | 60 | ?> |
61 | 61 | <!doctype html> |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | if (( |
69 | 69 | $group_properties['doc_state'] == 2 && |
70 | 70 | ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1 |
71 | -){ |
|
71 | +) { |
|
72 | 72 | |
73 | 73 | if (!empty($png_svg_files)) { |
74 | 74 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
75 | 75 | echo '<ul>'; |
76 | - foreach($png_svg_files as $filename) { |
|
76 | + foreach ($png_svg_files as $filename) { |
|
77 | 77 | $image = $group_disk_path.$filename; |
78 | 78 | |
79 | - if (strpos($filename, "svg")){ |
|
79 | + if (strpos($filename, "svg")) { |
|
80 | 80 | $new_sizes['width'] = 60; |
81 | 81 | $new_sizes['height'] = 60; |
82 | 82 | } else { |
@@ -23,22 +23,22 @@ discard block |
||
23 | 23 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
24 | 24 | |
25 | 25 | if (count($array_to_search) > 0) { |
26 | - while (list($key) = each($array_to_search)) { |
|
27 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
28 | - } |
|
26 | + while (list($key) = each($array_to_search)) { |
|
27 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | //get all svg and png files |
32 | 32 | $accepted_extensions = array('.svg', '.png'); |
33 | 33 | |
34 | 34 | if (is_array($all_files) && count($all_files) > 0) { |
35 | - foreach ($all_files as & $file) { |
|
36 | - $slideshow_extension = strrchr($file, '.'); |
|
37 | - $slideshow_extension = strtolower($slideshow_extension); |
|
38 | - if (in_array($slideshow_extension, $accepted_extensions)) { |
|
39 | - $png_svg_files[] =$file; |
|
40 | - } |
|
41 | - } |
|
35 | + foreach ($all_files as & $file) { |
|
36 | + $slideshow_extension = strrchr($file, '.'); |
|
37 | + $slideshow_extension = strtolower($slideshow_extension); |
|
38 | + if (in_array($slideshow_extension, $accepted_extensions)) { |
|
39 | + $png_svg_files[] =$file; |
|
40 | + } |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images/gallery/'; |
@@ -57,24 +57,24 @@ discard block |
||
57 | 57 | <?php |
58 | 58 | echo '<h2>'.get_lang('Course').': '.$course_info['name'].'</h2>'; |
59 | 59 | if (!empty($png_svg_files)) { |
60 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
61 | - echo '<ul>'; |
|
62 | - foreach($png_svg_files as $filename) { |
|
63 | - $image=$disk_path.$filename; |
|
64 | - |
|
65 | - if (strpos($filename, "svg")){ |
|
66 | - $new_sizes['width'] = 60; |
|
67 | - $new_sizes['height'] = 60; |
|
68 | - } |
|
69 | - else { |
|
70 | - $new_sizes = api_resize_image($image, 60, 60); |
|
71 | - } |
|
72 | - |
|
73 | - echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
74 | - } |
|
75 | - echo '</ul>'; |
|
60 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
61 | + echo '<ul>'; |
|
62 | + foreach($png_svg_files as $filename) { |
|
63 | + $image=$disk_path.$filename; |
|
64 | + |
|
65 | + if (strpos($filename, "svg")){ |
|
66 | + $new_sizes['width'] = 60; |
|
67 | + $new_sizes['height'] = 60; |
|
68 | + } |
|
69 | + else { |
|
70 | + $new_sizes = api_resize_image($image, 60, 60); |
|
71 | + } |
|
72 | + |
|
73 | + echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
74 | + } |
|
75 | + echo '</ul>'; |
|
76 | 76 | } else { |
77 | - Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
77 | + Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
78 | 78 | } |
79 | 79 | ?> |
80 | 80 | </body> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
14 | 14 | |
15 | -$curdirpath='/images/gallery'; //path of library directory |
|
15 | +$curdirpath = '/images/gallery'; //path of library directory |
|
16 | 16 | |
17 | 17 | $course_info = api_get_course_info(); |
18 | 18 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $slideshow_extension = strrchr($file, '.'); |
37 | 37 | $slideshow_extension = strtolower($slideshow_extension); |
38 | 38 | if (in_array($slideshow_extension, $accepted_extensions)) { |
39 | - $png_svg_files[] =$file; |
|
39 | + $png_svg_files[] = $file; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $style = '<style>'; |
48 | 48 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
49 | 49 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
50 | -$style .='</style>'; |
|
50 | +$style .= '</style>'; |
|
51 | 51 | |
52 | 52 | ?> |
53 | 53 | <!doctype html> |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | if (!empty($png_svg_files)) { |
60 | 60 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
61 | 61 | echo '<ul>'; |
62 | - foreach($png_svg_files as $filename) { |
|
63 | - $image=$disk_path.$filename; |
|
62 | + foreach ($png_svg_files as $filename) { |
|
63 | + $image = $disk_path.$filename; |
|
64 | 64 | |
65 | - if (strpos($filename, "svg")){ |
|
65 | + if (strpos($filename, "svg")) { |
|
66 | 66 | $new_sizes['width'] = 60; |
67 | 67 | $new_sizes['height'] = 60; |
68 | 68 | } |
@@ -65,8 +65,7 @@ |
||
65 | 65 | if (strpos($filename, "svg")){ |
66 | 66 | $new_sizes['width'] = 60; |
67 | 67 | $new_sizes['height'] = 60; |
68 | - } |
|
69 | - else { |
|
68 | + } else { |
|
70 | 69 | $new_sizes = api_resize_image($image, 60, 60); |
71 | 70 | } |
72 | 71 |
@@ -46,59 +46,59 @@ discard block |
||
46 | 46 | // Please, do not modify this dirname formatting |
47 | 47 | |
48 | 48 | if (strstr($dir, '..')) { |
49 | - $dir = '/'; |
|
49 | + $dir = '/'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($dir[0] == '.') { |
53 | - $dir = substr($dir, 1); |
|
53 | + $dir = substr($dir, 1); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($dir[0] != '/') { |
57 | - $dir = '/'.$dir; |
|
57 | + $dir = '/'.$dir; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($dir[strlen($dir) - 1] != '/') { |
61 | - $dir .= '/'; |
|
61 | + $dir .= '/'; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
65 | 65 | |
66 | 66 | if (!is_dir($filepath)) { |
67 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
68 | - $dir = '/'; |
|
67 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
68 | + $dir = '/'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $groupId = api_get_group_id(); |
72 | 72 | |
73 | 73 | if (!empty($groupId)) { |
74 | - $interbreadcrumb[] = array ( |
|
74 | + $interbreadcrumb[] = array ( |
|
75 | 75 | "url" => "../group/group_space.php?".api_get_cidreq(), |
76 | 76 | "name" => get_lang('GroupSpace') |
77 | 77 | ); |
78 | - $noPHP_SELF = true; |
|
79 | - $group = GroupManager :: get_group_properties($groupId); |
|
80 | - $path = explode('/', $dir); |
|
81 | - if ('/'.$path[1] != $group['directory']) { |
|
82 | - api_not_allowed(true); |
|
83 | - } |
|
78 | + $noPHP_SELF = true; |
|
79 | + $group = GroupManager :: get_group_properties($groupId); |
|
80 | + $path = explode('/', $dir); |
|
81 | + if ('/'.$path[1] != $group['directory']) { |
|
82 | + api_not_allowed(true); |
|
83 | + } |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | $interbreadcrumb[] = array( |
87 | - "url" => "./document.php?".api_get_cidreq(), |
|
88 | - "name" => get_lang('Documents') |
|
87 | + "url" => "./document.php?".api_get_cidreq(), |
|
88 | + "name" => get_lang('Documents') |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | if (!$is_allowed_in_course) { |
92 | - api_not_allowed(true); |
|
92 | + api_not_allowed(true); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || |
96 | - DocumentManager::is_my_shared_folder( |
|
97 | - api_get_user_id(), |
|
98 | - Security::remove_XSS($dir), |
|
99 | - api_get_session_id())) |
|
96 | + DocumentManager::is_my_shared_folder( |
|
97 | + api_get_user_id(), |
|
98 | + Security::remove_XSS($dir), |
|
99 | + api_get_session_id())) |
|
100 | 100 | ) { |
101 | - api_not_allowed(true); |
|
101 | + api_not_allowed(true); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | Event::event_access_tool(TOOL_DOCUMENT); |
107 | 107 | $display_dir = $dir; |
108 | 108 | if (isset ($group)) { |
109 | - $display_dir = explode('/', $dir); |
|
110 | - unset ($display_dir[0]); |
|
111 | - unset ($display_dir[1]); |
|
112 | - $display_dir = implode('/', $display_dir); |
|
109 | + $display_dir = explode('/', $dir); |
|
110 | + unset ($display_dir[0]); |
|
111 | + unset ($display_dir[1]); |
|
112 | + $display_dir = implode('/', $display_dir); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // Interbreadcrumb for the current directory root path |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | } else { |
124 | 124 | foreach ($document_data['parents'] as $document_sub_data) { |
125 | 125 | $interbreadcrumb[] = array( |
126 | - 'url' => $document_sub_data['document_url'], |
|
127 | - 'name' => $document_sub_data['title'] |
|
128 | - ); |
|
126 | + 'url' => $document_sub_data['document_url'], |
|
127 | + 'name' => $document_sub_data['title'] |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | Display :: display_header($nameTools, 'Doc'); |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | |
138 | 138 | if (api_browser_support('svg')) { |
139 | 139 | |
140 | - //automatic loading the course language |
|
141 | - $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
142 | - $langsvgedit = api_get_language_isocode(); |
|
143 | - $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
144 | - $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
145 | - $svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
146 | - ?> |
|
140 | + //automatic loading the course language |
|
141 | + $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
142 | + $langsvgedit = api_get_language_isocode(); |
|
143 | + $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
144 | + $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
145 | + $svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
146 | + ?> |
|
147 | 147 | <script> |
148 | 148 | document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'); |
149 | 149 | function resizeIframe() { |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | |
162 | 162 | <?php |
163 | 163 | echo '<noscript>'; |
164 | - echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0" src="'.$svg_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; |
|
165 | - echo '</noscript>'; |
|
164 | + echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0" src="'.$svg_url.'"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; |
|
165 | + echo '</noscript>'; |
|
166 | 166 | } else { |
167 | - Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
167 | + Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | Display :: display_footer(); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $groupId = api_get_group_id(); |
72 | 72 | |
73 | 73 | if (!empty($groupId)) { |
74 | - $interbreadcrumb[] = array ( |
|
74 | + $interbreadcrumb[] = array( |
|
75 | 75 | "url" => "../group/group_space.php?".api_get_cidreq(), |
76 | 76 | "name" => get_lang('GroupSpace') |
77 | 77 | ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | echo '<div class="actions">'; |
134 | 134 | echo '<a href="document.php?id='.$document_id.'">'. |
135 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
135 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
136 | 136 | echo '</div>'; |
137 | 137 | |
138 | 138 | if (api_browser_support('svg')) { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $langsvgedit = api_get_language_isocode(); |
143 | 143 | $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
144 | 144 | $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
145 | - $svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
145 | + $svg_url = api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
146 | 146 | ?> |
147 | 147 | <script> |
148 | 148 | document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'); |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | api_protect_course_script(); |
19 | 19 | api_block_anonymous_users(); |
20 | 20 | |
21 | -if(!isset($_POST['output_svg']) && !isset($_POST['output_png'])) { |
|
22 | - api_not_allowed();//from Chamilo |
|
21 | +if (!isset($_POST['output_svg']) && !isset($_POST['output_png'])) { |
|
22 | + api_not_allowed(); //from Chamilo |
|
23 | 23 | die(); |
24 | 24 | } |
25 | 25 | |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | //get SVG-Edit values |
46 | -$filename = $file;//from svg-edit |
|
47 | -$extension = $suffix;// from svg-edit |
|
48 | -$content = $contents;//from svg-edit |
|
46 | +$filename = $file; //from svg-edit |
|
47 | +$extension = $suffix; // from svg-edit |
|
48 | +$content = $contents; //from svg-edit |
|
49 | 49 | |
50 | -$title = Database::escape_string(str_replace('_',' ',$filename)); |
|
50 | +$title = Database::escape_string(str_replace('_', ' ', $filename)); |
|
51 | 51 | |
52 | 52 | //get Chamilo variables |
53 | 53 | |
54 | 54 | if (!isset($_SESSION['draw_dir']) && !isset($_SESSION['whereami'])) { |
55 | - api_not_allowed();//from Chamilo |
|
55 | + api_not_allowed(); //from Chamilo |
|
56 | 56 | die(); |
57 | 57 | } |
58 | 58 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $relativeUrlPath = $_SESSION['draw_dir']; |
62 | 62 | $currentTool = $_SESSION['whereami']; |
63 | 63 | $dirBaseDocuments = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
64 | -$saveDir=$dirBaseDocuments.$_SESSION['draw_dir']; |
|
64 | +$saveDir = $dirBaseDocuments.$_SESSION['draw_dir']; |
|
65 | 65 | |
66 | 66 | // a bit title security |
67 | 67 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | |
96 | 96 | //checks if the file exists, then rename the new |
97 | -if (file_exists($saveDir.'/'.$filename.'.'.$extension) && $currentTool=='document/createdraw') { |
|
97 | +if (file_exists($saveDir.'/'.$filename.'.'.$extension) && $currentTool == 'document/createdraw') { |
|
98 | 98 | $message = get_lang('FileExistsChangeToSave'); |
99 | 99 | $params = array( |
100 | 100 | 'message' => $message, |
@@ -110,21 +110,21 @@ discard block |
||
110 | 110 | $documentPath = $saveDir.'/'.$drawFileName; |
111 | 111 | |
112 | 112 | //add new document to disk |
113 | -file_put_contents( $documentPath, $contents ); |
|
113 | +file_put_contents($documentPath, $contents); |
|
114 | 114 | |
115 | -if ($currentTool=='document/createdraw') { |
|
115 | +if ($currentTool == 'document/createdraw') { |
|
116 | 116 | //add document to database |
117 | 117 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$drawFileName, 'file', filesize($documentPath), $title); |
118 | 118 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
119 | 119 | |
120 | -} elseif($currentTool=='document/editdraw') { |
|
120 | +} elseif ($currentTool == 'document/editdraw') { |
|
121 | 121 | |
122 | 122 | //check path |
123 | - if (!isset($_SESSION['draw_file'])){ |
|
124 | - api_not_allowed();//from Chamilo |
|
123 | + if (!isset($_SESSION['draw_file'])) { |
|
124 | + api_not_allowed(); //from Chamilo |
|
125 | 125 | die(); |
126 | 126 | } |
127 | - if ($_SESSION['draw_file'] == $drawFileName ){ |
|
127 | + if ($_SESSION['draw_file'] == $drawFileName) { |
|
128 | 128 | $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$drawFileName); |
129 | 129 | update_existing_document($_course, $document_id, filesize($documentPath), null); |
130 | 130 | api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |