@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | $dir = $document_data['path']; |
33 | 33 | |
34 | 34 | //make some vars |
35 | -$webcamdir=$dir; |
|
36 | -if($webcamdir=="/"){ |
|
37 | - $webcamdir=""; |
|
35 | +$webcamdir = $dir; |
|
36 | +if ($webcamdir == "/") { |
|
37 | + $webcamdir = ""; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $groupId = api_get_group_id(); |
69 | 69 | |
70 | 70 | if (!empty($groupId)) { |
71 | - $interbreadcrumb[] = array ("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
71 | + $interbreadcrumb[] = array("url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace')); |
|
72 | 72 | $noPHP_SELF = true; |
73 | 73 | $group = GroupManager :: get_group_properties($groupId); |
74 | 74 | $path = explode('/', $dir); |
@@ -77,14 +77,14 @@ discard block |
||
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | -$interbreadcrumb[] = array ("url" => "./document.php?id=".$document_id."&".api_get_cidreq(), "name" => get_lang('Documents')); |
|
80 | +$interbreadcrumb[] = array("url" => "./document.php?id=".$document_id."&".api_get_cidreq(), "name" => get_lang('Documents')); |
|
81 | 81 | |
82 | 82 | if (!$is_allowed_in_course) { |
83 | 83 | api_not_allowed(true); |
84 | 84 | } |
85 | 85 | |
86 | 86 | if (!($is_allowed_to_edit || $_SESSION['group_member_with_upload_rights'] || |
87 | - DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir),api_get_session_id()))) { |
|
87 | + DocumentManager::is_my_shared_folder(api_get_user_id(), Security::remove_XSS($dir), api_get_session_id()))) { |
|
88 | 88 | api_not_allowed(true); |
89 | 89 | } |
90 | 90 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // Interbreadcrumb for the current directory root path |
103 | 103 | $counter = 0; |
104 | 104 | if (isset($document_data['parents'])) { |
105 | - foreach($document_data['parents'] as $document_sub_data) { |
|
105 | + foreach ($document_data['parents'] as $document_sub_data) { |
|
106 | 106 | //fixing double group folder in breadcrumb |
107 | 107 | if (api_get_group_id()) { |
108 | 108 | if ($counter == 0) { |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | } |
117 | 117 | |
118 | 118 | //make some vars |
119 | -$webcamuserid=api_get_user_id(); |
|
119 | +$webcamuserid = api_get_user_id(); |
|
120 | 120 | |
121 | 121 | Display :: display_header($nameTools, 'Doc'); |
122 | 122 | echo '<div class="actions">'; |
123 | 123 | echo '<a href="document.php?id='.$document_id.'">'. |
124 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
124 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
125 | 125 | echo '</div>'; |
126 | 126 | ?> |
127 | 127 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if (!api_is_allowed_to_edit() && !$is_visible) { |
98 | - Display::display_error_message(get_lang('ProtectedDocument'));//api_not_allowed backbutton won't work. |
|
98 | + Display::display_error_message(get_lang('ProtectedDocument')); //api_not_allowed backbutton won't work. |
|
99 | 99 | exit; // You shouldn't be here anyway. |
100 | 100 | } |
101 | 101 | // Launch event |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | # Save the audio to a URL-accessible directory for playback. |
14 | 14 | parse_str($_SERVER['QUERY_STRING'], $params); |
15 | 15 | |
16 | -if(isset($params['webcamname']) && isset($params['webcamdir']) && isset($params['webcamuserid'])) { |
|
16 | +if (isset($params['webcamname']) && isset($params['webcamdir']) && isset($params['webcamuserid'])) { |
|
17 | 17 | $webcamname = $params['webcamname']; |
18 | 18 | $webcamdir = $params['webcamdir']; |
19 | 19 | $webcamuserid = $params['webcamuserid']; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | die(); |
24 | 24 | } |
25 | 25 | |
26 | -if ($webcamuserid!= api_get_user_id() || api_get_user_id()==0 || $webcamuserid==0) { |
|
26 | +if ($webcamuserid != api_get_user_id() || api_get_user_id() == 0 || $webcamuserid == 0) { |
|
27 | 27 | api_not_allowed(); |
28 | 28 | die(); |
29 | 29 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $ext = explode('.', $webcamname); |
42 | 42 | $ext = strtolower($ext[sizeof($ext) - 1]); |
43 | 43 | |
44 | -if($ext!= 'jpg'){ |
|
44 | +if ($ext != 'jpg') { |
|
45 | 45 | die(); |
46 | 46 | } |
47 | 47 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | $groupId = api_get_group_id(); |
54 | 54 | |
55 | 55 | //Avoid duplicates |
56 | -$webcamname_to_save=$webcamname; |
|
57 | -$title_to_save=str_replace('_',' ',$webcamname); |
|
58 | -$webcamname_noex=basename($webcamname, ".jpg"); |
|
59 | -if (file_exists($saveDir.'/'.$webcamname_noex.'.'.$ext)){ |
|
56 | +$webcamname_to_save = $webcamname; |
|
57 | +$title_to_save = str_replace('_', ' ', $webcamname); |
|
58 | +$webcamname_noex = basename($webcamname, ".jpg"); |
|
59 | +if (file_exists($saveDir.'/'.$webcamname_noex.'.'.$ext)) { |
|
60 | 60 | $i = 1; |
61 | 61 | while (file_exists($saveDir.'/'.$webcamname_noex.'_'.$i.'.'.$ext)) $i++; |
62 | - $webcamname_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
|
63 | - $title_to_save = $webcamname_noex . '_' . $i . '.'.$ext; |
|
64 | - $title_to_save = str_replace('_',' ',$title_to_save); |
|
62 | + $webcamname_to_save = $webcamname_noex.'_'.$i.'.'.$ext; |
|
63 | + $title_to_save = $webcamname_noex.'_'.$i.'.'.$ext; |
|
64 | + $title_to_save = str_replace('_', ' ', $title_to_save); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | $documentPath = $saveDir.'/'.$webcamname_to_save; |
@@ -78,5 +78,5 @@ discard block |
||
78 | 78 | $doc_id = add_document($_course, $webcamdir.'/'.$webcamname_to_save, 'file', filesize($documentPath), $title_to_save); |
79 | 79 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
80 | 80 | /// |
81 | -$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . $documentPath; |
|
81 | +$url = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['REQUEST_URI']).'/'.$documentPath; |
|
82 | 82 | print get_lang('ClipSent'); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | // A student should not be able to download a root shared directory |
53 | 53 | if (($path == '/shared_folder' || |
54 | - $path == '/shared_folder_session_' . api_get_session_id()) && |
|
54 | + $path == '/shared_folder_session_'.api_get_session_id()) && |
|
55 | 55 | (!api_is_allowed_to_edit() || !api_is_platform_admin()) |
56 | 56 | ) { |
57 | 57 | api_not_allowed(true); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | (props.session_id IN ('0', '$sessionId') OR props.session_id IS NULL) AND |
150 | 150 | docs.c_id = ".$courseId." "; |
151 | 151 | |
152 | - $sql.= DocumentManager::getSessionFolderFilters($querypath, $sessionId); |
|
152 | + $sql .= DocumentManager::getSessionFolderFilters($querypath, $sessionId); |
|
153 | 153 | |
154 | 154 | $result = Database::query($sql); |
155 | 155 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $groupCondition |
215 | 215 | "; |
216 | 216 | |
217 | - $sql.= DocumentManager::getSessionFolderFilters($querypath, $sessionId); |
|
217 | + $sql .= DocumentManager::getSessionFolderFilters($querypath, $sessionId); |
|
218 | 218 | $result = Database::query($sql); |
219 | 219 | |
220 | 220 | $files = array(); |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | // Add all files in our final array to the zipfile |
295 | 295 | for ($i = 0; $i < count($files_for_zipfile); $i++) { |
296 | 296 | $zip->add( |
297 | - $sysCoursePath . $courseInfo['path'] . '/document' . $files_for_zipfile[$i], |
|
297 | + $sysCoursePath.$courseInfo['path'].'/document'.$files_for_zipfile[$i], |
|
298 | 298 | PCLZIP_OPT_REMOVE_PATH, |
299 | - $sysCoursePath . $courseInfo['path'] . '/document' . $remove_dir, |
|
299 | + $sysCoursePath.$courseInfo['path'].'/document'.$remove_dir, |
|
300 | 300 | PCLZIP_CB_PRE_ADD, |
301 | 301 | 'fixDocumentNameCallback' |
302 | 302 | ); |
@@ -16,36 +16,36 @@ discard block |
||
16 | 16 | api_protect_course_script(); |
17 | 17 | api_block_anonymous_users(); |
18 | 18 | |
19 | -if ($_user['user_id']!= api_get_user_id() || api_get_user_id()==0 || $_user['user_id']==0) { |
|
19 | +if ($_user['user_id'] != api_get_user_id() || api_get_user_id() == 0 || $_user['user_id'] == 0) { |
|
20 | 20 | api_not_allowed(); |
21 | 21 | die(); |
22 | 22 | } |
23 | 23 | |
24 | -if(!isset($_GET['title']) || !isset($_GET['type']) || !isset($_GET['image'])) { |
|
24 | +if (!isset($_GET['title']) || !isset($_GET['type']) || !isset($_GET['image'])) { |
|
25 | 25 | api_not_allowed(); |
26 | 26 | die(); |
27 | 27 | } |
28 | 28 | |
29 | -if(!isset($_SESSION['paint_dir']) || !isset($_SESSION['whereami']) ){ |
|
29 | +if (!isset($_SESSION['paint_dir']) || !isset($_SESSION['whereami'])) { |
|
30 | 30 | api_not_allowed(); |
31 | 31 | die(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | //pixlr return |
35 | 35 | |
36 | -$filename=Security::remove_XSS($_GET['title']);//The user preferred file name of the image. |
|
37 | -$extension=Security::remove_XSS($_GET['type']);//The image type, "pdx", "jpg", "bmp" or "png". |
|
38 | -$urlcontents=Security::remove_XSS($_GET['image']);//A URL to the image on Pixlr.com server or the raw file post of the saved image. |
|
36 | +$filename = Security::remove_XSS($_GET['title']); //The user preferred file name of the image. |
|
37 | +$extension = Security::remove_XSS($_GET['type']); //The image type, "pdx", "jpg", "bmp" or "png". |
|
38 | +$urlcontents = Security::remove_XSS($_GET['image']); //A URL to the image on Pixlr.com server or the raw file post of the saved image. |
|
39 | 39 | |
40 | 40 | //make variables |
41 | 41 | |
42 | -$title = Database::escape_string(str_replace('_',' ',$filename)); |
|
42 | +$title = Database::escape_string(str_replace('_', ' ', $filename)); |
|
43 | 43 | $current_session_id = api_get_session_id(); |
44 | -$groupId= api_get_group_id(); |
|
45 | -$relativeUrlPath=$_SESSION['paint_dir']; |
|
46 | -$currentTool=$_SESSION['whereami']; |
|
44 | +$groupId = api_get_group_id(); |
|
45 | +$relativeUrlPath = $_SESSION['paint_dir']; |
|
46 | +$currentTool = $_SESSION['whereami']; |
|
47 | 47 | $dirBaseDocuments = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
48 | -$saveDir=$dirBaseDocuments.$_SESSION['paint_dir']; |
|
48 | +$saveDir = $dirBaseDocuments.$_SESSION['paint_dir']; |
|
49 | 49 | |
50 | 50 | $contents = file_get_contents($urlcontents); |
51 | 51 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | $filename = api_replace_dangerous_char($filename); |
72 | 72 | $filename = disable_dangerous_file($filename); |
73 | 73 | |
74 | -if (strlen(trim($filename))==0) { |
|
75 | - echo "The title is empty";//if title is empty, headers Content-Type = application/octet-stream, then not create a new title here please |
|
74 | +if (strlen(trim($filename)) == 0) { |
|
75 | + echo "The title is empty"; //if title is empty, headers Content-Type = application/octet-stream, then not create a new title here please |
|
76 | 76 | exit; |
77 | 77 | } |
78 | 78 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Extension security |
86 | -if($extension!= 'jpg' && $extension!= 'png' && $extension!= 'pxd'){ |
|
86 | +if ($extension != 'jpg' && $extension != 'png' && $extension != 'pxd') { |
|
87 | 87 | die(); |
88 | 88 | } |
89 | -if($extension=='pxd') { |
|
90 | - echo "pxd file type does not supported";// not secure because check security headers and finfo() return Content-Type = application/octet-stream |
|
89 | +if ($extension == 'pxd') { |
|
90 | + echo "pxd file type does not supported"; // not secure because check security headers and finfo() return Content-Type = application/octet-stream |
|
91 | 91 | exit; |
92 | 92 | } |
93 | 93 | |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | |
102 | 102 | //Verify that the file is an image. Fileinfo method |
103 | 103 | $finfo = new finfo(FILEINFO_MIME); |
104 | -$current_mime=$finfo->buffer($contents); |
|
104 | +$current_mime = $finfo->buffer($contents); |
|
105 | 105 | finfo_close($finfo); |
106 | -if(strpos($current_mime, 'image')===false) { |
|
106 | +if (strpos($current_mime, 'image') === false) { |
|
107 | 107 | echo "Invalid mime type file"; |
108 | 108 | exit; |
109 | 109 | } |
@@ -113,46 +113,46 @@ discard block |
||
113 | 113 | $paintFileName = $filename.'.'.$extension; |
114 | 114 | $title = $title.'.'.$extension; |
115 | 115 | |
116 | -if($currentTool=='document/createpaint'){ |
|
116 | +if ($currentTool == 'document/createpaint') { |
|
117 | 117 | //check save as and prevent rewrite an older file with same name |
118 | - if (0 != $groupId){ |
|
119 | - $group_properties = GroupManager :: get_group_properties($groupId); |
|
118 | + if (0 != $groupId) { |
|
119 | + $group_properties = GroupManager :: get_group_properties($groupId); |
|
120 | 120 | $groupPath = $group_properties['directory']; |
121 | 121 | } else { |
122 | - $groupPath =''; |
|
122 | + $groupPath = ''; |
|
123 | 123 | } |
124 | 124 | |
125 | - if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
|
125 | + if (file_exists($saveDir.'/'.$filename.'.'.$extension)) { |
|
126 | 126 | $i = 1; |
127 | 127 | while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
128 | - $paintFileName = $filename . '_' . $i . '.'.$extension; |
|
129 | - $title = $filename . '_' . $i . '.'.$extension; |
|
128 | + $paintFileName = $filename.'_'.$i.'.'.$extension; |
|
129 | + $title = $filename.'_'.$i.'.'.$extension; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // |
133 | 133 | $documentPath = $saveDir.'/'.$paintFileName; |
134 | 134 | //add new document to disk |
135 | - file_put_contents( $documentPath, $contents ); |
|
135 | + file_put_contents($documentPath, $contents); |
|
136 | 136 | //add document to database |
137 | 137 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
138 | 138 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
139 | 139 | |
140 | -}elseif($currentTool=='document/editpaint'){ |
|
140 | +}elseif ($currentTool == 'document/editpaint') { |
|
141 | 141 | |
142 | 142 | $documentPath = $saveDir.'/'.$paintFileName; |
143 | 143 | //add new document to disk |
144 | - file_put_contents( $documentPath, $contents ); |
|
144 | + file_put_contents($documentPath, $contents); |
|
145 | 145 | |
146 | 146 | //check path |
147 | - if(!isset($_SESSION['paint_file'])){ |
|
147 | + if (!isset($_SESSION['paint_file'])) { |
|
148 | 148 | api_not_allowed(); |
149 | 149 | die(); |
150 | 150 | } |
151 | - if($_SESSION['paint_file']==$paintFileName){ |
|
151 | + if ($_SESSION['paint_file'] == $paintFileName) { |
|
152 | 152 | $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
153 | 153 | update_existing_document($_course, $document_id, filesize($documentPath), null); |
154 | 154 | api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
155 | - }else{ |
|
155 | + } else { |
|
156 | 156 | //add a new document |
157 | 157 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
158 | 158 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | |
163 | 163 | //delete temporal file |
164 | -$temp_file_2delete=$_SESSION['temp_realpath_image']; |
|
164 | +$temp_file_2delete = $_SESSION['temp_realpath_image']; |
|
165 | 165 | unlink($temp_file_2delete); |
166 | 166 | |
167 | 167 | //Clean sessions and return to Chamilo file list |
@@ -171,12 +171,12 @@ discard block |
||
171 | 171 | unset($_SESSION['temp_realpath_image']); |
172 | 172 | |
173 | 173 | if (!isset($_SESSION['exit_pixlr'])) { |
174 | - $location=api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
174 | + $location = api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
175 | 175 | echo '<script>window.parent.location.href="'.$location.'"</script>'; |
176 | 176 | api_not_allowed(true); |
177 | 177 | } else { |
178 | 178 | echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>'; |
179 | - $location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); |
|
179 | + $location = api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); |
|
180 | 180 | echo '<script>window.parent.location.href="'.$location.'"</script>'; |
181 | 181 | unset($_SESSION['exit_pixlr']); |
182 | 182 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // bypass the $nametools thing and use <b></b> tags in the $interbreadcrump array |
40 | 40 | $url = 'slideshowoptions.php?curdirpath='.$pathurl; |
41 | 41 | $originaltoolname = '<b>'.get_lang('SlideshowOptions').'</b>'; |
42 | -$interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname ); |
|
42 | +$interbreadcrumb[] = array('url' => $url, 'name' => $originaltoolname); |
|
43 | 43 | |
44 | 44 | Display::display_header($originalToolName, 'Doc'); |
45 | 45 | $image_resizing = isset($_SESSION['image_resizing']) ? $_SESSION['image_resizing'] : null; |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | </script> |
64 | 64 | |
65 | 65 | <?php |
66 | -$actions = '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
67 | -$actions .= '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('slideshow.png',get_lang('BackTo').' '.get_lang('SlideShow'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
66 | +$actions = '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
67 | +$actions .= '<a href="slideshow.php?curdirpath='.$pathurl.'">'.Display::return_icon('slideshow.png', get_lang('BackTo').' '.get_lang('SlideShow'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
68 | 68 | Display::toolbarAction('toolbar-slideshow', $content) |
69 | 69 | ?> |
70 | 70 | <div class="panel panel-default"> |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | ?>> |
81 | 81 | </label> |
82 | - <?php echo '<b>'. get_lang('NoResizing') . '</b>, ' . get_lang('NoResizingComment') ;?> |
|
82 | + <?php echo '<b>'.get_lang('NoResizing').'</b>, '.get_lang('NoResizingComment'); ?> |
|
83 | 83 | </div> |
84 | 84 | <div class="radio"> |
85 | 85 | <label> |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | ?>> |
91 | 91 | </label> |
92 | - <?php echo '<b>'. get_lang('ResizingAuto') . '</b>, ' . get_lang('ResizingAutoComment');?> |
|
92 | + <?php echo '<b>'.get_lang('ResizingAuto').'</b>, '.get_lang('ResizingAutoComment'); ?> |
|
93 | 93 | </div> |
94 | 94 | <div class="radio"> |
95 | 95 | <label> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | ?>> |
103 | 103 | </label> |
104 | - <?php echo '<b>'. get_lang('Resizing') . '</b>, ' . get_lang('ResizingComment'); ?> |
|
104 | + <?php echo '<b>'.get_lang('Resizing').'</b>, '.get_lang('ResizingComment'); ?> |
|
105 | 105 | </div> |
106 | 106 | <div class="form-group"> |
107 | 107 | <label class="col-sm-1 control-label"><?php echo get_lang('Width'); ?></label> |
@@ -23,13 +23,13 @@ |
||
23 | 23 | unset($_SESSION['whereami']); |
24 | 24 | unset($_SESSION['temp_realpath_image']); |
25 | 25 | |
26 | -if (!isset($_SESSION['exit_pixlr'])){ |
|
27 | - $location=api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
26 | +if (!isset($_SESSION['exit_pixlr'])) { |
|
27 | + $location = api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
28 | 28 | echo '<script>window.parent.location.href="'.$location.'"</script>'; |
29 | 29 | api_not_allowed(true); |
30 | 30 | } else { |
31 | 31 | echo '<div align="center" style="padding-top:150; font-family:Arial, Helvetica, Sans-serif;font-size:25px;color:#aaa;font-weight:bold;">'.get_lang('PleaseStandBy').'</div>'; |
32 | - $location=api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); |
|
32 | + $location = api_get_path(WEB_CODE_PATH).'document/document.php?id='.Security::remove_XSS($_SESSION['exit_pixlr']); |
|
33 | 33 | echo '<script>window.parent.location.href="'.$location.'"</script>'; |
34 | 34 | unset($_SESSION['exit_pixlr']); |
35 | 35 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | function resize_image($image, $target_width, $target_height, $slideshow = 0) { |
37 | 37 | // Modifications by Ivan Tcholakov, 04-MAY-2009. |
38 | 38 | $result = array(); |
39 | - if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
39 | + if ((isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] == 'resizing') or $slideshow == 1) { |
|
40 | 40 | $new_sizes = api_resize_image($image, $target_width, $target_height); |
41 | 41 | $result[] = $new_sizes['height']; |
42 | 42 | $result[] = $new_sizes['width']; |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | $session = array(); |
33 | 33 | $user_name = $user_info['complete_name']; |
34 | 34 | |
35 | -$course_list = SessionManager::get_course_list_by_session_id ($session_id); |
|
35 | +$course_list = SessionManager::get_course_list_by_session_id($session_id); |
|
36 | 36 | $session_list = SessionManager::get_session_by_course($course_id); |
37 | 37 | $total_quota_bytes = DocumentManager::get_course_quota(); |
38 | -$quota_bytes = DocumentManager::documents_total_space($course_id, 0 , 0); |
|
39 | -$quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
38 | +$quota_bytes = DocumentManager::documents_total_space($course_id, 0, 0); |
|
39 | +$quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
40 | 40 | |
41 | 41 | $session[] = array(get_lang('Course').' ('.format_file_size($quota_bytes).')', $quota_percentage); |
42 | 42 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | foreach ($session_list as $session_data) { |
47 | 47 | $quota_percentage = 0; |
48 | 48 | $quota_bytes = intval(DocumentManager::documents_total_space($course_id, null, $session_data['id'])); |
49 | - if (!empty($quota_bytes)) { |
|
50 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
49 | + if (!empty($quota_bytes)) { |
|
50 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
51 | 51 | } |
52 | 52 | if ($session_id == $session_data['id']) { |
53 | - $session_data['name'] = $session_data['name'] . ' * '; |
|
53 | + $session_data['name'] = $session_data['name'].' * '; |
|
54 | 54 | } |
55 | 55 | $used_quota_bytes += $quota_bytes; |
56 | 56 | $session[] = array( |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | $quota_percentage = 0; |
67 | 67 | $my_group_id = $group_data['id']; |
68 | 68 | $quota_bytes = intval(DocumentManager::documents_total_space($course_id, $my_group_id, 0)); |
69 | - if (!empty($quota_bytes)) { |
|
70 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
69 | + if (!empty($quota_bytes)) { |
|
70 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
71 | 71 | } |
72 | 72 | if ($group_id == $my_group_id) { |
73 | - $group_data['name'] = $group_data['name'] . ' * '; |
|
73 | + $group_data['name'] = $group_data['name'].' * '; |
|
74 | 74 | } |
75 | 75 | $used_quota_bytes += $quota_bytes; |
76 | 76 | $session[] = array(addslashes(get_lang('Group').': '.$group_data['name']).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | if ($quota_bytes != 0) { |
88 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
88 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $session[] = array(addslashes(get_lang('Teacher').': '.$user_name).' ('.format_file_size($quota_bytes).')', $quota_percentage); |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $total_quota_bytes += DocumentManager::get_course_quota($course_data['id']); |
99 | 99 | } |
100 | 100 | if ($quota_bytes != 0) { |
101 | - $quota_percentage = round($quota_bytes/$total_quota_bytes, 2)*100; |
|
101 | + $quota_percentage = round($quota_bytes / $total_quota_bytes, 2) * 100; |
|
102 | 102 | } |
103 | 103 | } |
104 | - $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'),$user_name)), $quota_percentage); |
|
104 | + $session[] = array(addslashes(sprintf(get_lang('TeacherXInSession'), $user_name)), $quota_percentage); |
|
105 | 105 | |
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
109 | -$quota_percentage = round(($total_quota_bytes - $used_quota_bytes)/$total_quota_bytes, 2)*100; |
|
109 | +$quota_percentage = round(($total_quota_bytes - $used_quota_bytes) / $total_quota_bytes, 2) * 100; |
|
110 | 110 | $session[] = array(addslashes(get_lang('ShowCourseQuotaUse')).' ('.format_file_size($total_quota_bytes - $used_quota_bytes).') ', $quota_percentage); |
111 | 111 | $quota_data = json_encode($session); |
112 | 112 |