@@ -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); |
@@ -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 { |
@@ -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> |
@@ -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 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | api_block_anonymous_users(); |
12 | 12 | |
13 | 13 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
14 | -$curdirpath='/images/gallery'; //path of library directory |
|
14 | +$curdirpath = '/images/gallery'; //path of library directory |
|
15 | 15 | $course_info = api_get_course_info(); |
16 | 16 | |
17 | 17 | // Get all files and folders |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $slideshow_extension = strrchr($file, '.'); |
42 | 42 | $slideshow_extension = strtolower($slideshow_extension); |
43 | 43 | if (in_array($slideshow_extension, $accepted_extensions)) { |
44 | - $png_svg_files[] =$file; |
|
44 | + $png_svg_files[] = $file; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $style = '<style>'; |
53 | 53 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
54 | 54 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
55 | -$style .='</style>'; |
|
55 | +$style .= '</style>'; |
|
56 | 56 | |
57 | 57 | ?> |
58 | 58 | <!doctype html> |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | if (!empty($png_svg_files)) { |
65 | 65 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
66 | 66 | echo '<ul>'; |
67 | - foreach($png_svg_files as $filename) { |
|
68 | - $image=$disk_path.$filename; |
|
67 | + foreach ($png_svg_files as $filename) { |
|
68 | + $image = $disk_path.$filename; |
|
69 | 69 | |
70 | - if (strpos($filename, "svg")){ |
|
70 | + if (strpos($filename, "svg")) { |
|
71 | 71 | $new_sizes['width'] = 60; |
72 | 72 | $new_sizes['height'] = 60; |
73 | 73 | } |
@@ -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>'); |
@@ -48,59 +48,59 @@ discard block |
||
48 | 48 | // Please, do not modify this dirname formatting |
49 | 49 | |
50 | 50 | if (strstr($dir, '..')) { |
51 | - $dir = '/'; |
|
51 | + $dir = '/'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | if ($dir[0] == '.') { |
55 | - $dir = substr($dir, 1); |
|
55 | + $dir = substr($dir, 1); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if ($dir[0] != '/') { |
59 | - $dir = '/'.$dir; |
|
59 | + $dir = '/'.$dir; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if ($dir[strlen($dir) - 1] != '/') { |
63 | - $dir .= '/'; |
|
63 | + $dir .= '/'; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
67 | 67 | |
68 | 68 | if (!is_dir($filepath)) { |
69 | - $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
70 | - $dir = '/'; |
|
69 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
70 | + $dir = '/'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $groupId = api_get_group_id(); |
74 | 74 | |
75 | 75 | if (!empty($groupId)) { |
76 | - $interbreadcrumb[] = array ( |
|
76 | + $interbreadcrumb[] = array ( |
|
77 | 77 | "url" => "../group/group_space.php?".api_get_cidreq(), |
78 | 78 | "name" => get_lang('GroupSpace') |
79 | 79 | ); |
80 | - $noPHP_SELF = true; |
|
81 | - $group = GroupManager :: get_group_properties($groupId); |
|
82 | - $path = explode('/', $dir); |
|
83 | - if ('/'.$path[1] != $group['directory']) { |
|
84 | - api_not_allowed(true); |
|
85 | - } |
|
80 | + $noPHP_SELF = true; |
|
81 | + $group = GroupManager :: get_group_properties($groupId); |
|
82 | + $path = explode('/', $dir); |
|
83 | + if ('/'.$path[1] != $group['directory']) { |
|
84 | + api_not_allowed(true); |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $interbreadcrumb[] = array( |
89 | - "url" => "./document.php?".api_get_cidreq(), |
|
90 | - "name" => get_lang('Documents') |
|
89 | + "url" => "./document.php?".api_get_cidreq(), |
|
90 | + "name" => get_lang('Documents') |
|
91 | 91 | ); |
92 | 92 | |
93 | 93 | if (!api_is_allowed_in_course()) { |
94 | - api_not_allowed(true); |
|
94 | + api_not_allowed(true); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | if (!($is_allowed_to_edit || $groupRights || |
98 | - DocumentManager::is_my_shared_folder( |
|
99 | - api_get_user_id(), |
|
100 | - Security::remove_XSS($dir), |
|
101 | - api_get_session_id())) |
|
98 | + DocumentManager::is_my_shared_folder( |
|
99 | + api_get_user_id(), |
|
100 | + Security::remove_XSS($dir), |
|
101 | + api_get_session_id())) |
|
102 | 102 | ) { |
103 | - api_not_allowed(true); |
|
103 | + api_not_allowed(true); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | Event::event_access_tool(TOOL_DOCUMENT); |
109 | 109 | $display_dir = $dir; |
110 | 110 | if (isset ($group)) { |
111 | - $display_dir = explode('/', $dir); |
|
112 | - unset ($display_dir[0]); |
|
113 | - unset ($display_dir[1]); |
|
114 | - $display_dir = implode('/', $display_dir); |
|
111 | + $display_dir = explode('/', $dir); |
|
112 | + unset ($display_dir[0]); |
|
113 | + unset ($display_dir[1]); |
|
114 | + $display_dir = implode('/', $display_dir); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | // Interbreadcrumb for the current directory root path |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | } else { |
126 | 126 | foreach ($document_data['parents'] as $document_sub_data) { |
127 | 127 | $interbreadcrumb[] = array( |
128 | - 'url' => $document_sub_data['document_url'], |
|
129 | - 'name' => $document_sub_data['title'] |
|
130 | - ); |
|
128 | + 'url' => $document_sub_data['document_url'], |
|
129 | + 'name' => $document_sub_data['title'] |
|
130 | + ); |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | Display :: display_header($nameTools, 'Doc'); |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | |
140 | 140 | if (api_browser_support('svg')) { |
141 | 141 | |
142 | - //automatic loading the course language |
|
143 | - $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
144 | - $langsvgedit = api_get_language_isocode(); |
|
145 | - $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
146 | - $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
147 | - $svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
148 | - ?> |
|
142 | + //automatic loading the course language |
|
143 | + $svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn'); |
|
144 | + $langsvgedit = api_get_language_isocode(); |
|
145 | + $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; |
|
146 | + $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'javascript/svgedit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; |
|
147 | + $svg_url= api_get_path(WEB_LIBRARY_PATH).'javascript/svgedit/svg-editor.php?lang='.$langsvgedit; |
|
148 | + ?> |
|
149 | 149 | <script> |
150 | 150 | 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>'); |
151 | 151 | function resizeIframe() { |
@@ -163,10 +163,10 @@ discard block |
||
163 | 163 | |
164 | 164 | <?php |
165 | 165 | echo '<noscript>'; |
166 | - 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>'; |
|
167 | - echo '</noscript>'; |
|
166 | + 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>'; |
|
167 | + echo '</noscript>'; |
|
168 | 168 | } else { |
169 | - Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
169 | + Display::display_error_message(get_lang('BrowserDontSupportsSVG')); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | Display :: display_footer(); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | interface HookResubscribeObserverInterface extends HookObserverInterface |
13 | 13 | { |
14 | 14 | /** |
15 | - * @param HookResubscribeObserverInterface $hook |
|
15 | + * @param HookResubscribeEventInterface $hook |
|
16 | 16 | * |
17 | 17 | * @return int |
18 | 18 | */ |
@@ -12,7 +12,7 @@ |
||
12 | 12 | interface HookSkypeObserverInterface extends HookObserverInterface |
13 | 13 | { |
14 | 14 | /** |
15 | - * @param HookSkypeObserverInterface $hook |
|
15 | + * @param HookSkypeEventInterface $hook |
|
16 | 16 | * |
17 | 17 | * @return int |
18 | 18 | */ |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** |
22 | 22 | * @param array $additionalParameters |
23 | 23 | * |
24 | - * @return mixed |
|
24 | + * @return void |
|
25 | 25 | */ |
26 | 26 | public function send($additionalParameters); |
27 | 27 |