@@ -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 | } |
@@ -124,7 +124,9 @@ discard block |
||
124 | 124 | |
125 | 125 | if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
126 | 126 | $i = 1; |
127 | - while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
127 | + while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) { |
|
128 | + $i++; |
|
129 | + } |
|
128 | 130 | $paintFileName = $filename . '_' . $i . '.'.$extension; |
129 | 131 | $title = $filename . '_' . $i . '.'.$extension; |
130 | 132 | } |
@@ -137,7 +139,7 @@ discard block |
||
137 | 139 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
138 | 140 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
139 | 141 | |
140 | -}elseif($currentTool=='document/editpaint'){ |
|
142 | +} elseif($currentTool=='document/editpaint'){ |
|
141 | 143 | |
142 | 144 | $documentPath = $saveDir.'/'.$paintFileName; |
143 | 145 | //add new document to disk |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
153 | 155 | update_existing_document($_course, $document_id, filesize($documentPath), null); |
154 | 156 | api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
155 | - }else{ |
|
157 | + } else{ |
|
156 | 158 | //add a new document |
157 | 159 | $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
158 | 160 | api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | api_block_anonymous_users(); |
18 | 18 | |
19 | 19 | if ($_user['user_id']!= api_get_user_id() || api_get_user_id()==0 || $_user['user_id']==0) { |
20 | - api_not_allowed(); |
|
21 | - die(); |
|
20 | + api_not_allowed(); |
|
21 | + die(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if(!isset($_GET['title']) || !isset($_GET['type']) || !isset($_GET['image'])) { |
25 | - api_not_allowed(); |
|
26 | - die(); |
|
25 | + api_not_allowed(); |
|
26 | + die(); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | if(!isset($_SESSION['paint_dir']) || !isset($_SESSION['whereami']) ){ |
30 | - api_not_allowed(); |
|
31 | - die(); |
|
30 | + api_not_allowed(); |
|
31 | + die(); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | //pixlr return |
@@ -72,22 +72,22 @@ discard block |
||
72 | 72 | $filename = disable_dangerous_file($filename); |
73 | 73 | |
74 | 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 | - exit; |
|
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 | + exit; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | //check file_get_contents |
80 | 80 | if ($contents === false) { |
81 | - echo "I cannot read: ".$urlcontents; |
|
81 | + echo "I cannot read: ".$urlcontents; |
|
82 | 82 | exit; |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Extension security |
86 | 86 | if($extension!= 'jpg' && $extension!= 'png' && $extension!= 'pxd'){ |
87 | - die(); |
|
87 | + die(); |
|
88 | 88 | } |
89 | 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 |
|
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 | |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | $headers = get_headers($urlcontents, 1); |
96 | 96 | $content_type = explode("/", $headers['Content-Type']); |
97 | 97 | if ($content_type[0] != "image") { |
98 | - echo "Invalid file type"; |
|
99 | - exit; |
|
98 | + echo "Invalid file type"; |
|
99 | + exit; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | //Verify that the file is an image. Fileinfo method |
@@ -114,49 +114,49 @@ discard block |
||
114 | 114 | $title = $title.'.'.$extension; |
115 | 115 | |
116 | 116 | if($currentTool=='document/createpaint'){ |
117 | - //check save as and prevent rewrite an older file with same name |
|
118 | - if (0 != $groupId){ |
|
117 | + //check save as and prevent rewrite an older file with same name |
|
118 | + if (0 != $groupId){ |
|
119 | 119 | $group_properties = GroupManager :: get_group_properties($groupId); |
120 | 120 | $groupPath = $group_properties['directory']; |
121 | - } else { |
|
122 | - $groupPath =''; |
|
123 | - } |
|
124 | - |
|
125 | - if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
|
126 | - $i = 1; |
|
127 | - while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
128 | - $paintFileName = $filename . '_' . $i . '.'.$extension; |
|
129 | - $title = $filename . '_' . $i . '.'.$extension; |
|
130 | - } |
|
131 | - |
|
132 | - // |
|
133 | - $documentPath = $saveDir.'/'.$paintFileName; |
|
134 | - //add new document to disk |
|
135 | - file_put_contents( $documentPath, $contents ); |
|
136 | - //add document to database |
|
137 | - $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
|
138 | - api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
121 | + } else { |
|
122 | + $groupPath =''; |
|
123 | + } |
|
124 | + |
|
125 | + if (file_exists($saveDir.'/'.$filename.'.'.$extension)){ |
|
126 | + $i = 1; |
|
127 | + while (file_exists($saveDir.'/'.$filename.'_'.$i.'.'.$extension)) $i++; |
|
128 | + $paintFileName = $filename . '_' . $i . '.'.$extension; |
|
129 | + $title = $filename . '_' . $i . '.'.$extension; |
|
130 | + } |
|
131 | + |
|
132 | + // |
|
133 | + $documentPath = $saveDir.'/'.$paintFileName; |
|
134 | + //add new document to disk |
|
135 | + file_put_contents( $documentPath, $contents ); |
|
136 | + //add document to database |
|
137 | + $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
|
138 | + api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
139 | 139 | |
140 | 140 | }elseif($currentTool=='document/editpaint'){ |
141 | 141 | |
142 | - $documentPath = $saveDir.'/'.$paintFileName; |
|
143 | - //add new document to disk |
|
144 | - file_put_contents( $documentPath, $contents ); |
|
145 | - |
|
146 | - //check path |
|
147 | - if(!isset($_SESSION['paint_file'])){ |
|
148 | - api_not_allowed(); |
|
149 | - die(); |
|
150 | - } |
|
151 | - if($_SESSION['paint_file']==$paintFileName){ |
|
152 | - $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
|
153 | - update_existing_document($_course, $document_id, filesize($documentPath), null); |
|
154 | - api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
155 | - }else{ |
|
156 | - //add a new document |
|
157 | - $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
|
158 | - api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
159 | - } |
|
142 | + $documentPath = $saveDir.'/'.$paintFileName; |
|
143 | + //add new document to disk |
|
144 | + file_put_contents( $documentPath, $contents ); |
|
145 | + |
|
146 | + //check path |
|
147 | + if(!isset($_SESSION['paint_file'])){ |
|
148 | + api_not_allowed(); |
|
149 | + die(); |
|
150 | + } |
|
151 | + if($_SESSION['paint_file']==$paintFileName){ |
|
152 | + $document_id = DocumentManager::get_document_id($_course, $relativeUrlPath.'/'.$paintFileName); |
|
153 | + update_existing_document($_course, $document_id, filesize($documentPath), null); |
|
154 | + api_item_property_update($_course, TOOL_DOCUMENT, $document_id, 'DocumentUpdated', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
155 | + }else{ |
|
156 | + //add a new document |
|
157 | + $doc_id = add_document($_course, $relativeUrlPath.'/'.$paintFileName, 'file', filesize($documentPath), $title); |
|
158 | + api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', $_user['user_id'], $groupId, null, null, null, $current_session_id); |
|
159 | + } |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
@@ -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'; |
|
175 | - echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
176 | - api_not_allowed(true); |
|
174 | + $location=api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
175 | + echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
176 | + api_not_allowed(true); |
|
177 | 177 | } else { |
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']); |
|
180 | - echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
181 | - unset($_SESSION['exit_pixlr']); |
|
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']); |
|
180 | + echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
181 | + unset($_SESSION['exit_pixlr']); |
|
182 | 182 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if ($image_resizing == 'noresizing' || $image_resizing == '') { |
78 | 78 | echo ' checked'; |
79 | 79 | } |
80 | - ?>> |
|
80 | + ?>> |
|
81 | 81 | </label> |
82 | 82 | <?php echo '<b>'. get_lang('NoResizing') . '</b>, ' . get_lang('NoResizingComment') ;?> |
83 | 83 | </div> |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ($image_resizing == 'resizing_auto' || $image_resizing == '') { |
88 | 88 | echo ' checked'; |
89 | 89 | } |
90 | - ?>> |
|
90 | + ?>> |
|
91 | 91 | </label> |
92 | 92 | <?php echo '<b>'. get_lang('ResizingAuto') . '</b>, ' . get_lang('ResizingAutoComment');?> |
93 | 93 | </div> |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $width = $_SESSION['image_resizing_width']; |
100 | 100 | $height = $_SESSION['image_resizing_height']; |
101 | 101 | } |
102 | - ?>> |
|
102 | + ?>> |
|
103 | 103 | </label> |
104 | 104 | <?php echo '<b>'. get_lang('Resizing') . '</b>, ' . get_lang('ResizingComment'); ?> |
105 | 105 | </div> |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | <label class="col-sm-1 control-label"><?php echo get_lang('Width'); ?></label> |
108 | 108 | <div class="col-sm-3"> |
109 | 109 | <input class="form-control" name="width" type="text" id="width" <?php |
110 | - if ($image_resizing == 'resizing') { |
|
111 | - echo ' value="'.$width.'"'; |
|
112 | - echo ' class="enabled_input"'; |
|
110 | + if ($image_resizing == 'resizing') { |
|
111 | + echo ' value="'.$width.'"'; |
|
112 | + echo ' class="enabled_input"'; |
|
113 | 113 | } else { |
114 | 114 | echo ' class="disabled_input"'; |
115 | 115 | } |
116 | - ?> > |
|
116 | + ?> > |
|
117 | 117 | </div> |
118 | 118 | <div class="col-sm-8"></div> |
119 | 119 | </div> |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | <label class="col-sm-1 control-label"><?php echo get_lang('Height'); ?></label> |
122 | 122 | <div class="col-sm-3"> |
123 | 123 | <input class="form-control" name="height" type="text" id="height" <?php |
124 | - if ($image_resizing == 'resizing') { |
|
125 | - echo ' value="'.$height.'"'; |
|
126 | - echo ' class="enabled_input"'; |
|
127 | - } else { |
|
124 | + if ($image_resizing == 'resizing') { |
|
125 | + echo ' value="'.$height.'"'; |
|
126 | + echo ' class="enabled_input"'; |
|
127 | + } else { |
|
128 | 128 | echo ' class="disabled_input"'; |
129 | 129 | } |
130 | - ?> > |
|
130 | + ?> > |
|
131 | 131 | </div> |
132 | 132 | <div class="col-sm-8"></div> |
133 | 133 | </div> |
@@ -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> |
@@ -24,12 +24,12 @@ |
||
24 | 24 | unset($_SESSION['temp_realpath_image']); |
25 | 25 | |
26 | 26 | if (!isset($_SESSION['exit_pixlr'])){ |
27 | - $location=api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
28 | - echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
29 | - api_not_allowed(true); |
|
27 | + $location=api_get_path(WEB_CODE_PATH).'document/document.php'; |
|
28 | + echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
29 | + api_not_allowed(true); |
|
30 | 30 | } else { |
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']); |
|
33 | - echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
34 | - unset($_SESSION['exit_pixlr']); |
|
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']); |
|
33 | + echo '<script>window.parent.location.href="'.$location.'"</script>'; |
|
34 | + unset($_SESSION['exit_pixlr']); |
|
35 | 35 | } |
@@ -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 | } |
@@ -15,8 +15,6 @@ discard block |
||
15 | 15 | This file has two large sections. |
16 | 16 | 1. code that belongs in document.php, but to avoid clutter I put the code here |
17 | 17 | 2. the function resize_image that handles the image resizing |
18 | - |
|
19 | - |
|
20 | 18 | * @author Patrick Cool |
21 | 19 | * @package chamilo.document |
22 | 20 | * @todo convert comments to be understandable to phpDocumentor |
@@ -34,16 +32,16 @@ discard block |
||
34 | 32 | * view is also possible when you choose not to resize the source images |
35 | 33 | */ |
36 | 34 | function resize_image($image, $target_width, $target_height, $slideshow = 0) { |
37 | - // Modifications by Ivan Tcholakov, 04-MAY-2009. |
|
38 | - $result = array(); |
|
39 | - if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
40 | - $new_sizes = api_resize_image($image, $target_width, $target_height); |
|
41 | - $result[] = $new_sizes['height']; |
|
42 | - $result[] = $new_sizes['width']; |
|
43 | - } else { |
|
35 | + // Modifications by Ivan Tcholakov, 04-MAY-2009. |
|
36 | + $result = array(); |
|
37 | + if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { |
|
38 | + $new_sizes = api_resize_image($image, $target_width, $target_height); |
|
39 | + $result[] = $new_sizes['height']; |
|
40 | + $result[] = $new_sizes['width']; |
|
41 | + } else { |
|
44 | 42 | $size = api_getimagesize($image); |
45 | - $result[] = $size['height']; |
|
46 | - $result[] = $size['width']; |
|
47 | - } |
|
48 | - return $result; |
|
43 | + $result[] = $size['height']; |
|
44 | + $result[] = $size['width']; |
|
45 | + } |
|
46 | + return $result; |
|
49 | 47 | } |
@@ -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']; |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | |
29 | 29 | // COURSES WITH CATEGORIES |
30 | 30 | if (!empty($user_course_categories)) { |
31 | - foreach ($user_course_categories as $row) { |
|
32 | - echo Display::page_subheader($row['title']); |
|
33 | - echo '<a name="category'.$row['id'].'"></a>'; |
|
31 | + foreach ($user_course_categories as $row) { |
|
32 | + echo Display::page_subheader($row['title']); |
|
33 | + echo '<a name="category'.$row['id'].'"></a>'; |
|
34 | 34 | |
35 | - if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?> |
|
35 | + if (isset($_GET['categoryid']) && $_GET['categoryid'] == $row['id']) { ?> |
|
36 | 36 | <!-- We display the edit form for the category --> |
37 | 37 | |
38 | 38 | <form name="edit_course_category" method="post" action="courses.php?action=<?php echo $action; ?>"> |
@@ -243,15 +243,15 @@ discard block |
||
243 | 243 | </a> |
244 | 244 | <?php } else { |
245 | 245 | echo Display::display_icon('up_na.png', get_lang('Up'),'',22); |
246 | - } |
|
246 | + } |
|
247 | 247 | |
248 | - if ($key < $number_of_courses - 1) { ?> |
|
248 | + if ($key < $number_of_courses - 1) { ?> |
|
249 | 249 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
250 | 250 | <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
251 | 251 | </a> |
252 | 252 | <?php } else { |
253 | 253 | echo Display::display_icon('down_na.png', get_lang('Down'),'',22); |
254 | - }?> |
|
254 | + }?> |
|
255 | 255 | </div> |
256 | 256 | <div style="float:left; margin-right:10px;"> |
257 | 257 | <!-- cancel subscrioption--> |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | </div> |
270 | 270 | <?php } |
271 | 271 | } |
272 | - ?> |
|
272 | + ?> |
|
273 | 273 | </td> |
274 | 274 | </tr> |
275 | 275 | <?php |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <div id="actions" class="actions"> |
19 | 19 | <?php if ($action != 'createcoursecategory') { ?> |
20 | 20 | <a href="<?php echo api_get_self(); ?>?action=createcoursecategory"> |
21 | - <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'),'','32'); ?></a> |
|
21 | + <?php echo Display::return_icon('new_folder.png', get_lang('CreateCourseCategory'), '', '32'); ?></a> |
|
22 | 22 | <?php } ?> |
23 | 23 | </div> |
24 | 24 | |
@@ -50,26 +50,26 @@ discard block |
||
50 | 50 | $max_category_key = count($user_course_categories); |
51 | 51 | if ($action != 'unsubscribe') { ?> |
52 | 52 | <a href="courses.php?action=sortmycourses&categoryid=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>#category<?php echo $row['id']; ?>"> |
53 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
53 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
54 | 54 | </a> |
55 | 55 | |
56 | 56 | <?php if ($row['id'] != $user_course_categories[0]['id']) { ?> |
57 | 57 | <a href="courses.php?action=<?php echo $action ?>&move=up&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
58 | - <?php echo Display::return_icon('up.png', get_lang('Up'),'',22); ?> |
|
58 | + <?php echo Display::return_icon('up.png', get_lang('Up'), '', 22); ?> |
|
59 | 59 | </a> |
60 | 60 | <?php } else { ?> |
61 | - <?php echo Display::return_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
61 | + <?php echo Display::return_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
62 | 62 | <?php } ?> |
63 | 63 | |
64 | 64 | <?php if ($row['id'] != $user_course_categories[$max_category_key - 1]['id']) { ?> |
65 | 65 | <a href="courses.php?action=<?php echo $action; ?>&move=down&category=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
66 | - <?php echo Display::return_icon('down.png', get_lang('Down'),'',22); ?> |
|
66 | + <?php echo Display::return_icon('down.png', get_lang('Down'), '', 22); ?> |
|
67 | 67 | </a> |
68 | 68 | <?php } else { ?> |
69 | - <?php echo Display::return_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
69 | + <?php echo Display::return_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
70 | 70 | <?php } ?> |
71 | 71 | <a href="courses.php?action=deletecoursecategory&id=<?php echo $row['id']; ?>&sec_token=<?php echo $stok; ?>"> |
72 | - <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"),22) ?> |
|
72 | + <?php echo Display::display_icon('delete.png', get_lang('Delete'), array('onclick' => "javascript: if (!confirm('".addslashes(api_htmlentities(get_lang("CourseCategoryAbout2bedeleted"), ENT_QUOTES, api_get_system_encoding()))."')) return false;"), 22) ?> |
|
73 | 73 | </a> |
74 | 74 | <?php } |
75 | 75 | echo '<br /><br />'; |
@@ -123,35 +123,35 @@ discard block |
||
123 | 123 | <div style="float:left;width:110px;"> |
124 | 124 | <?php |
125 | 125 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
126 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
126 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
127 | 127 | ?> |
128 | 128 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
129 | - <?php echo Display::return_icon('info.png', $icon_title,'','22') ?> |
|
129 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22') ?> |
|
130 | 130 | <?php } ?> |
131 | 131 | </a> |
132 | 132 | |
133 | 133 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
134 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
134 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
135 | 135 | <?php } else { ?> |
136 | 136 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
137 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
137 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
138 | 138 | </a> |
139 | 139 | <?php } ?> |
140 | 140 | |
141 | 141 | <?php if ($key > 0) { ?> |
142 | 142 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
143 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22); ?> |
|
143 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22); ?> |
|
144 | 144 | </a> |
145 | 145 | <?php } else { ?> |
146 | - <?php echo Display::display_icon('up_na.png', get_lang('Up'),'',22); ?> |
|
146 | + <?php echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); ?> |
|
147 | 147 | <?php } ?> |
148 | 148 | |
149 | 149 | <?php if ($key < $number_of_courses - 1) { ?> |
150 | 150 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
151 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
151 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
152 | 152 | </a> |
153 | 153 | <?php } else { ?> |
154 | - <?php echo Display::display_icon('down_na.png', get_lang('Down'),'',22); ?> |
|
154 | + <?php echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); ?> |
|
155 | 155 | <?php } ?> |
156 | 156 | |
157 | 157 | </div> |
@@ -219,36 +219,36 @@ discard block |
||
219 | 219 | <div style="float:left; width:110px"> |
220 | 220 | <?php |
221 | 221 | if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
222 | - $icon_title = get_lang('CourseDetails') . ' - ' . $course['title']; |
|
222 | + $icon_title = get_lang('CourseDetails').' - '.$course['title']; |
|
223 | 223 | ?> |
224 | 224 | <a href="<?php echo api_get_path(WEB_CODE_PATH); ?>inc/ajax/course_home.ajax.php?a=show_course_information&code=<?php echo $course['code'] ?>" data-title="<?php echo $icon_title ?>" title="<?php echo $icon_title ?>" class="ajax"> |
225 | - <?php echo Display::return_icon('info.png', $icon_title, '','22'); ?> |
|
225 | + <?php echo Display::return_icon('info.png', $icon_title, '', '22'); ?> |
|
226 | 226 | </a> |
227 | 227 | <?php } ?> |
228 | 228 | |
229 | 229 | <?php if (isset($_GET['edit']) && $course['code'] == $_GET['edit']) { ?> |
230 | - <?php echo Display::display_icon('edit_na.png', get_lang('Edit'),'',22); ?> |
|
230 | + <?php echo Display::display_icon('edit_na.png', get_lang('Edit'), '', 22); ?> |
|
231 | 231 | <?php } else { ?> |
232 | 232 | <a href="courses.php?action=<?php echo $action; ?>&edit=<?php echo $course['code']; ?>&sec_token=<?php echo $stok; ?>"> |
233 | - <?php echo Display::display_icon('edit.png', get_lang('Edit'),'',22); ?> |
|
233 | + <?php echo Display::display_icon('edit.png', get_lang('Edit'), '', 22); ?> |
|
234 | 234 | </a> |
235 | 235 | <?php } ?> |
236 | 236 | |
237 | 237 | <!-- up /down icons--> |
238 | 238 | <?php if ($key > 0) { ?> |
239 | 239 | <a href="courses.php?action=<?php echo $action; ?>&move=up&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
240 | - <?php echo Display::display_icon('up.png', get_lang('Up'),'',22) ?> |
|
240 | + <?php echo Display::display_icon('up.png', get_lang('Up'), '', 22) ?> |
|
241 | 241 | </a> |
242 | 242 | <?php } else { |
243 | - echo Display::display_icon('up_na.png', get_lang('Up'),'',22); |
|
243 | + echo Display::display_icon('up_na.png', get_lang('Up'), '', 22); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | if ($key < $number_of_courses - 1) { ?> |
247 | 247 | <a href="courses.php?action=<?php echo $action; ?>&move=down&course=<?php echo $course['code']; ?>&category=<?php echo $course['user_course_cat']; ?>&sec_token=<?php echo $stok; ?>"> |
248 | - <?php echo Display::display_icon('down.png', get_lang('Down'),'',22); ?> |
|
248 | + <?php echo Display::display_icon('down.png', get_lang('Down'), '', 22); ?> |
|
249 | 249 | </a> |
250 | 250 | <?php } else { |
251 | - echo Display::display_icon('down_na.png', get_lang('Down'),'',22); |
|
251 | + echo Display::display_icon('down_na.png', get_lang('Down'), '', 22); |
|
252 | 252 | }?> |
253 | 253 | </div> |
254 | 254 | <div style="float:left; margin-right:10px;"> |
@@ -16,7 +16,7 @@ |
||
16 | 16 | <!-- Actions: The menu with the different options in cathe course management --> |
17 | 17 | <div id="actions" class="actions"> |
18 | 18 | <a href="<?php echo api_get_self() ?>?action=sortmycourses"> |
19 | - <?php echo Display::return_icon('back.png', get_lang('Back'),'','32'); ?> |
|
19 | + <?php echo Display::return_icon('back.png', get_lang('Back'), '', '32'); ?> |
|
20 | 20 | </a> |
21 | 21 | </div> |
22 | 22 |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | /** |
5 | 5 | * This script displays an area where teachers can edit the group properties and member list. |
6 | - * |
|
6 | + * |
|
7 | 7 | * @author various contributors |
8 | 8 | * @author Roan Embrechts (VUB), partial code cleanup, initial virtual course support |
9 | 9 | * @package chamilo.group |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | require_once __DIR__.'/../inc/global.inc.php'; |
14 | 14 | $this_section = SECTION_COURSES; |
15 | -$current_course_tool = TOOL_GROUP; |
|
15 | +$current_course_tool = TOOL_GROUP; |
|
16 | 16 | |
17 | 17 | // Notice for unauthorized people. |
18 | 18 | api_protect_course_script(true); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $form->addGroup( |
84 | 84 | $group, |
85 | 85 | '', |
86 | - Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . '<span>' . get_lang('GroupSelfRegistration') . '</span>', |
|
86 | + Display::return_icon('user.png', get_lang('GroupSelfRegistration')).'<span>'.get_lang('GroupSelfRegistration').'</span>', |
|
87 | 87 | null, |
88 | 88 | false |
89 | 89 | ); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $form->addGroup( |
98 | 98 | $group, |
99 | 99 | '', |
100 | - Display::return_icon('folder.png', get_lang('GroupDocument')) . '<span>' . get_lang('GroupDocument') . '</span>', |
|
100 | + Display::return_icon('folder.png', get_lang('GroupDocument')).'<span>'.get_lang('GroupDocument').'</span>', |
|
101 | 101 | null, |
102 | 102 | false |
103 | 103 | ); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $form->addGroup( |
112 | 112 | $group, |
113 | 113 | '', |
114 | - Display::return_icon('works.png', get_lang('GroupWork')) . '<span>' . get_lang('GroupWork') . '</span>', |
|
114 | + Display::return_icon('works.png', get_lang('GroupWork')).'<span>'.get_lang('GroupWork').'</span>', |
|
115 | 115 | null, |
116 | 116 | false |
117 | 117 | ); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $form->addGroup( |
126 | 126 | $group, |
127 | 127 | '', |
128 | - Display::return_icon('agenda.png', get_lang('GroupCalendar')) . '<span>' . get_lang('GroupCalendar') . '</span>', |
|
128 | + Display::return_icon('agenda.png', get_lang('GroupCalendar')).'<span>'.get_lang('GroupCalendar').'</span>', |
|
129 | 129 | null, |
130 | 130 | false |
131 | 131 | ); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $form->addGroup( |
143 | 143 | $group, |
144 | 144 | '', |
145 | - Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . '<span>' . get_lang('GroupAnnouncements') . '</span>', |
|
145 | + Display::return_icon('announce.png', get_lang('GroupAnnouncements')).'<span>'.get_lang('GroupAnnouncements').'</span>', |
|
146 | 146 | null, |
147 | 147 | false |
148 | 148 | ); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $form->addGroup( |
157 | 157 | $group, |
158 | 158 | '', |
159 | - Display::return_icon('forum.png', get_lang('GroupForum')) . '<span>' . get_lang('GroupForum') . '</span>', |
|
159 | + Display::return_icon('forum.png', get_lang('GroupForum')).'<span>'.get_lang('GroupForum').'</span>', |
|
160 | 160 | null, |
161 | 161 | false |
162 | 162 | ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $form->addGroup( |
184 | 184 | $group, |
185 | 185 | '', |
186 | - Display::return_icon('chat.png', get_lang('Chat')) . '<span>' . get_lang('Chat') . '</span>', |
|
186 | + Display::return_icon('chat.png', get_lang('Chat')).'<span>'.get_lang('Chat').'</span>', |
|
187 | 187 | null, |
188 | 188 | false |
189 | 189 | ); |
@@ -89,7 +89,7 @@ |
||
89 | 89 | 'error' |
90 | 90 | ) |
91 | 91 | ); |
92 | - exit; |
|
92 | + exit; |
|
93 | 93 | } else { |
94 | 94 | /* DOWNLOAD THE FILE */ |
95 | 95 | // the user is allowed to download the file |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | if ($_GET['sent_received'] == 'sent') { |
33 | 33 | // here we also incorporate the person table to make sure that deleted sent documents are not included. |
34 | 34 | $sql = "SELECT DISTINCT file.id, file.filename, file.title |
35 | - FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ." file |
|
36 | - INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." person |
|
35 | + FROM ". Database::get_course_table(TABLE_DROPBOX_FILE)." file |
|
36 | + INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON)." person |
|
37 | 37 | ON (person.file_id=file.id AND file.c_id = $course_id AND person.c_id = $course_id) |
38 | 38 | WHERE |
39 | 39 | file.uploader_id = $user_id AND |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | |
44 | 44 | if ($_GET['sent_received'] == 'received') { |
45 | 45 | $sql = "SELECT DISTINCT file.id, file.filename, file.title |
46 | - FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ." file |
|
47 | - INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." person |
|
46 | + FROM ". Database::get_course_table(TABLE_DROPBOX_FILE)." file |
|
47 | + INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON)." person |
|
48 | 48 | ON (person.file_id=file.id AND file.c_id = $course_id AND person.c_id = $course_id) |
49 | 49 | INNER JOIN ".Database::get_course_table(TABLE_DROPBOX_POST)." post |
50 | 50 | ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id) |
51 | 51 | WHERE |
52 | 52 | post.cat_id = ".intval($_GET['cat_id'])." AND |
53 | - post.dest_user_id = $user_id" ; |
|
53 | + post.dest_user_id = $user_id"; |
|
54 | 54 | } |
55 | 55 | $files_to_download = array(); |
56 | 56 | $result = Database::query($sql); |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | |
98 | 98 | $work = new Dropbox_Work($_GET['id']); |
99 | 99 | |
100 | - $path = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/' . $work -> filename; //path to file as stored on server |
|
100 | + $path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox/'.$work -> filename; //path to file as stored on server |
|
101 | 101 | |
102 | - if (!Security::check_abs_path($path, api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/')) { |
|
102 | + if (!Security::check_abs_path($path, api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox/')) { |
|
103 | 103 | exit; |
104 | 104 | } |
105 | 105 | $file = $work->title; |
@@ -83,11 +83,11 @@ |
||
83 | 83 | if (strstr($_POST['action'], 'move_')) { |
84 | 84 | // check move_received_n or move_sent_n command |
85 | 85 | if (strstr($_POST['action'], 'received')) { |
86 | - $part = 'received'; |
|
87 | - $to_cat_id = str_replace('move_received_', '', $_POST['action']); |
|
86 | + $part = 'received'; |
|
87 | + $to_cat_id = str_replace('move_received_', '', $_POST['action']); |
|
88 | 88 | } else { |
89 | - $part = 'sent'; |
|
90 | - $to_cat_id = str_replace('move_sent_', '', $_POST['action']); |
|
89 | + $part = 'sent'; |
|
90 | + $to_cat_id = str_replace('move_sent_', '', $_POST['action']); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | foreach ($checked_file_ids as $value) { |
@@ -750,10 +750,15 @@ |
||
750 | 750 | "; |
751 | 751 | $result = Database::query($sql); |
752 | 752 | |
753 | - if (!($res = Database::fetch_array($result))) |
|
754 | - die(get_lang('GeneralError').' (code 901)'); |
|
755 | - if ($owner == 0) return $res['uploader_id']; |
|
756 | - if ($res['uploader_id'] == $owner) return true; |
|
753 | + if (!($res = Database::fetch_array($result))) { |
|
754 | + die(get_lang('GeneralError').' (code 901)'); |
|
755 | + } |
|
756 | + if ($owner == 0) { |
|
757 | + return $res['uploader_id']; |
|
758 | + } |
|
759 | + if ($res['uploader_id'] == $owner) { |
|
760 | + return true; |
|
761 | + } |
|
757 | 762 | die(get_lang('GeneralError').' (code '.$or_die.')'); |
758 | 763 | } |
759 | 764 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | // STEP 2: at least one file has to be selected. If not we return an error message |
44 | 44 | $ids = isset($_GET['id']) ? $_GET['id'] : array(); |
45 | - if (count($ids)>0) { |
|
45 | + if (count($ids) > 0) { |
|
46 | 46 | $checked_file_ids = $_POST['id']; |
47 | 47 | } else { |
48 | 48 | foreach ($_POST as $key => $value) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | $cat = get_dropbox_category($id); |
136 | - if (count($cat)==0) { |
|
136 | + if (count($cat) == 0) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | // step 1: delete the category |
160 | - $sql = "DELETE FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." |
|
160 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." |
|
161 | 161 | WHERE c_id = $course_id AND cat_id='".intval($id)."' AND $sentreceived='1'"; |
162 | 162 | Database::query($sql); |
163 | 163 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $return_message = get_lang('ReceivedFileMoved'); |
236 | 236 | } |
237 | 237 | if ($part == 'sent') { |
238 | - $sql = "UPDATE ". Database::get_course_table(TABLE_DROPBOX_FILE) ." |
|
238 | + $sql = "UPDATE ".Database::get_course_table(TABLE_DROPBOX_FILE)." |
|
239 | 239 | SET cat_id = ".intval($target)." |
240 | 240 | WHERE |
241 | 241 | c_id = $course_id AND |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $session_id = api_get_session_id(); |
271 | 271 | $condition_session = api_get_session_condition($session_id); |
272 | 272 | |
273 | - $sql = "SELECT * FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." |
|
273 | + $sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." |
|
274 | 274 | WHERE c_id = $course_id AND user_id='".$_user['user_id']."' $condition_session"; |
275 | 275 | |
276 | 276 | $result = Database::query($sql); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | { |
293 | 293 | $course_id = api_get_course_int_id(); |
294 | 294 | if (empty($id) or $id != intval($id)) { return array(); } |
295 | - $sql = "SELECT * FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." |
|
295 | + $sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." |
|
296 | 296 | WHERE c_id = $course_id AND cat_id='".$id."'"; |
297 | 297 | $res = Database::query($sql); |
298 | 298 | if ($res === false) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | if (!isset($_POST['edit_id'])) { |
342 | 342 | $session_id = api_get_session_id(); |
343 | 343 | // step 3a, we check if the category doesn't already exist |
344 | - $sql = "SELECT * FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." |
|
344 | + $sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." |
|
345 | 345 | WHERE |
346 | 346 | c_id = $course_id AND |
347 | 347 | user_id='".$_user['user_id']."' AND |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | ]; |
365 | 365 | $id = Database::insert(Database::get_course_table(TABLE_DROPBOX_CATEGORY), $params); |
366 | 366 | if ($id) { |
367 | - $sql = "UPDATE ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." SET cat_id = iid WHERE iid = $id"; |
|
367 | + $sql = "UPDATE ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." SET cat_id = iid WHERE iid = $id"; |
|
368 | 368 | Database::query($sql); |
369 | 369 | } |
370 | 370 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | if (isset($id) && $id != '') { |
415 | 415 | // retrieve the category we are editing |
416 | - $sql = "SELECT * FROM ". Database::get_course_table(TABLE_DROPBOX_CATEGORY) ." |
|
416 | + $sql = "SELECT * FROM ".Database::get_course_table(TABLE_DROPBOX_CATEGORY)." |
|
417 | 417 | WHERE c_id = $course_id AND cat_id = ".intval($id); |
418 | 418 | $result = Database::query($sql); |
419 | 419 | $row = Database::fetch_array($result); |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | $full_name = $userInfo['complete_name'].$groupNameListToString; |
604 | 604 | $current_user_id = $current_user['user_id']; |
605 | - $options['user_' . $current_user_id] = $full_name; |
|
605 | + $options['user_'.$current_user_id] = $full_name; |
|
606 | 606 | } |
607 | 607 | } |
608 | 608 | } |
@@ -702,8 +702,8 @@ discard block |
||
702 | 702 | |
703 | 703 | // select all files that aren't referenced anymore |
704 | 704 | $sql = "SELECT DISTINCT f.id, f.filename |
705 | - FROM " . Database::get_course_table(TABLE_DROPBOX_FILE) . " f |
|
706 | - LEFT JOIN " . Database::get_course_table(TABLE_DROPBOX_PERSON) . " p |
|
705 | + FROM " . Database::get_course_table(TABLE_DROPBOX_FILE)." f |
|
706 | + LEFT JOIN " . Database::get_course_table(TABLE_DROPBOX_PERSON)." p |
|
707 | 707 | ON (f.id = p.file_id) |
708 | 708 | WHERE p.user_id IS NULL AND |
709 | 709 | f.c_id = $course_id |
@@ -711,14 +711,14 @@ discard block |
||
711 | 711 | $result = Database::query($sql); |
712 | 712 | while ($res = Database::fetch_array($result)) { |
713 | 713 | //delete the selected files from the post and file tables |
714 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_DROPBOX_POST) . " |
|
715 | - WHERE c_id = $course_id AND file_id = '" . $res['id'] . "'"; |
|
714 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_POST)." |
|
715 | + WHERE c_id = $course_id AND file_id = '".$res['id']."'"; |
|
716 | 716 | Database::query($sql); |
717 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_DROPBOX_FILE) . " |
|
718 | - WHERE c_id = $course_id AND id ='" . $res['id'] . "'"; |
|
717 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_FILE)." |
|
718 | + WHERE c_id = $course_id AND id ='".$res['id']."'"; |
|
719 | 719 | Database::query($sql); |
720 | 720 | //delete file from server |
721 | - @unlink( api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/' . $res['filename']); |
|
721 | + @unlink(api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox/'.$res['filename']); |
|
722 | 722 | } |
723 | 723 | } |
724 | 724 | |
@@ -740,11 +740,11 @@ discard block |
||
740 | 740 | |
741 | 741 | $mailingPseudoId = intval($mailingPseudoId); |
742 | 742 | $sql = "SELECT f.uploader_id |
743 | - FROM " . Database::get_course_table(TABLE_DROPBOX_FILE) . " f |
|
744 | - LEFT JOIN " . Database::get_course_table(TABLE_DROPBOX_POST) . " p |
|
743 | + FROM " . Database::get_course_table(TABLE_DROPBOX_FILE)." f |
|
744 | + LEFT JOIN " . Database::get_course_table(TABLE_DROPBOX_POST)." p |
|
745 | 745 | ON (f.id = p.file_id AND f.c_id = $course_id AND p.c_id = $course_id) |
746 | 746 | WHERE |
747 | - p.dest_user_id = '" . $mailingPseudoId . "' AND |
|
747 | + p.dest_user_id = '".$mailingPseudoId."' AND |
|
748 | 748 | p.c_id = $course_id |
749 | 749 | "; |
750 | 750 | $result = Database::query($sql); |
@@ -770,21 +770,21 @@ discard block |
||
770 | 770 | // for all content files, replace mailingPseudoId by owner as uploader |
771 | 771 | $file_id = intval($file_id); |
772 | 772 | $sql = "SELECT p.dest_user_id |
773 | - FROM " . Database::get_course_table(TABLE_DROPBOX_POST) . " p |
|
774 | - WHERE c_id = $course_id AND p.file_id = '" . $file_id . "'"; |
|
773 | + FROM " . Database::get_course_table(TABLE_DROPBOX_POST)." p |
|
774 | + WHERE c_id = $course_id AND p.file_id = '".$file_id."'"; |
|
775 | 775 | $result = Database::query($sql); |
776 | 776 | |
777 | 777 | if ($res = Database::fetch_array($result)) { |
778 | 778 | $mailingPseudoId = $res['dest_user_id']; |
779 | 779 | $mailId = get_mail_id_base(); |
780 | 780 | if ($mailingPseudoId > $mailId) { |
781 | - $sql = "DELETE FROM " . Database::get_course_table(TABLE_DROPBOX_PERSON) . " |
|
782 | - WHERE c_id = $course_id AND user_id='" . $mailingPseudoId . "'"; |
|
781 | + $sql = "DELETE FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)." |
|
782 | + WHERE c_id = $course_id AND user_id='".$mailingPseudoId."'"; |
|
783 | 783 | Database::query($sql); |
784 | 784 | |
785 | - $sql = "UPDATE " . Database::get_course_table(TABLE_DROPBOX_FILE) ." |
|
786 | - SET uploader_id='" . api_get_user_id() . "' |
|
787 | - WHERE c_id = $course_id AND uploader_id='" . $mailingPseudoId . "'"; |
|
785 | + $sql = "UPDATE ".Database::get_course_table(TABLE_DROPBOX_FILE)." |
|
786 | + SET uploader_id='" . api_get_user_id()."' |
|
787 | + WHERE c_id = $course_id AND uploader_id='".$mailingPseudoId."'"; |
|
788 | 788 | Database::query($sql); |
789 | 789 | } |
790 | 790 | } |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | } |
926 | 926 | } |
927 | 927 | } else { // rename file to login_filename_uniqueId format |
928 | - $dropbox_filename = $_user['username'] . "_" . $dropbox_filename . "_".uniqid(''); |
|
928 | + $dropbox_filename = $_user['username']."_".$dropbox_filename."_".uniqid(''); |
|
929 | 929 | } |
930 | 930 | |
931 | 931 | // creating the array that contains all the users who will receive the file |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | } |
945 | 945 | } |
946 | 946 | |
947 | - @move_uploaded_file($dropbox_filetmpname, api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox/' . $dropbox_filename); |
|
947 | + @move_uploaded_file($dropbox_filetmpname, api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox/'.$dropbox_filename); |
|
948 | 948 | |
949 | 949 | $b_send_mail = api_get_course_setting('email_alert_on_new_doc_dropbox'); |
950 | 950 | |
@@ -965,14 +965,14 @@ discard block |
||
965 | 965 | ), |
966 | 966 | $recipent_temp['email'], |
967 | 967 | get_lang('NewDropboxFileUploaded'), |
968 | - get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?' . api_get_cidreq() . '">'.get_lang('SeeFile').'</a>'. |
|
968 | + get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq().'">'.get_lang('SeeFile').'</a>'. |
|
969 | 969 | "\n\n". |
970 | 970 | api_get_person_name( |
971 | 971 | $_user['firstName'], |
972 | 972 | $_user['lastName'], |
973 | 973 | null, |
974 | 974 | PERSON_NAME_EMAIL_ADDRESS |
975 | - )."\n". get_lang('Email') ." : ".$_user['mail'], |
|
975 | + )."\n".get_lang('Email')." : ".$_user['mail'], |
|
976 | 976 | api_get_person_name( |
977 | 977 | $_user['firstName'], |
978 | 978 | $_user['lastName'], |
@@ -1068,12 +1068,12 @@ discard block |
||
1068 | 1068 | $id = intval($id); |
1069 | 1069 | $user_id = intval($user_id); |
1070 | 1070 | |
1071 | - $sql = "SELECT file_id FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." |
|
1071 | + $sql = "SELECT file_id FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)." |
|
1072 | 1072 | WHERE c_id = $course_id AND user_id = $user_id AND file_id = ".$id; |
1073 | 1073 | $result = Database::query($sql); |
1074 | 1074 | $number_users_who_see_file = Database::num_rows($result); |
1075 | 1075 | |
1076 | - $sql = "SELECT file_id FROM ". Database::get_course_table(TABLE_DROPBOX_POST) ." |
|
1076 | + $sql = "SELECT file_id FROM ".Database::get_course_table(TABLE_DROPBOX_POST)." |
|
1077 | 1077 | WHERE c_id = $course_id AND dest_user_id = $user_id AND file_id = ".$id; |
1078 | 1078 | $result = Database::query($sql); |
1079 | 1079 | $count = Database::num_rows($result); |
@@ -1087,12 +1087,12 @@ discard block |
||
1087 | 1087 | { |
1088 | 1088 | $id = intval($id); |
1089 | 1089 | $course_id = api_get_course_int_id(); |
1090 | - $sql = "SELECT file_id FROM ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." |
|
1090 | + $sql = "SELECT file_id FROM ".Database::get_course_table(TABLE_DROPBOX_PERSON)." |
|
1091 | 1091 | WHERE c_id = $course_id AND file_id = ".$id; |
1092 | 1092 | $result = Database::query($sql); |
1093 | 1093 | $number_users_who_see_file = Database::num_rows($result); |
1094 | 1094 | |
1095 | - $sql = "SELECT file_id FROM ". Database::get_course_table(TABLE_DROPBOX_POST) ." |
|
1095 | + $sql = "SELECT file_id FROM ".Database::get_course_table(TABLE_DROPBOX_POST)." |
|
1096 | 1096 | WHERE c_id = $course_id AND file_id = ".$id; |
1097 | 1097 | $result = Database::query($sql); |
1098 | 1098 | $count = Database::num_rows($result); |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | |
1125 | 1125 | $id = Database::insert(Database::get_course_table(TABLE_DROPBOX_FEEDBACK), $params); |
1126 | 1126 | if ($id) { |
1127 | - $sql = "UPDATE ". Database::get_course_table(TABLE_DROPBOX_FEEDBACK) ." SET feedback_id = iid WHERE iid = $id"; |
|
1127 | + $sql = "UPDATE ".Database::get_course_table(TABLE_DROPBOX_FEEDBACK)." SET feedback_id = iid WHERE iid = $id"; |
|
1128 | 1128 | Database::query($sql); |
1129 | 1129 | } |
1130 | 1130 | |
@@ -1151,10 +1151,10 @@ discard block |
||
1151 | 1151 | |
1152 | 1152 | // note: we also have to add the check if the user has received or sent this file. |
1153 | 1153 | $sql = "SELECT DISTINCT file.filename, file.title, file.author, file.description |
1154 | - FROM ". Database::get_course_table(TABLE_DROPBOX_FILE) ." file |
|
1155 | - INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON) ." person |
|
1154 | + FROM ". Database::get_course_table(TABLE_DROPBOX_FILE)." file |
|
1155 | + INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_PERSON)." person |
|
1156 | 1156 | ON (person.file_id=file.id AND file.c_id = $course_id AND person.c_id = $course_id) |
1157 | - INNER JOIN ". Database::get_course_table(TABLE_DROPBOX_POST) ." post |
|
1157 | + INNER JOIN ".Database::get_course_table(TABLE_DROPBOX_POST)." post |
|
1158 | 1158 | ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id) |
1159 | 1159 | WHERE |
1160 | 1160 | file.id IN (".implode(', ', $fileList).") AND |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | // Adding the content. |
1249 | 1249 | $return .= "\n<tr>"; |
1250 | 1250 | foreach ($column as $column_key => $column_value) { |
1251 | - if (!in_array($column_value,$dont_show_columns)) { |
|
1251 | + if (!in_array($column_value, $dont_show_columns)) { |
|
1252 | 1252 | $return .= "\n\t<td>"; |
1253 | 1253 | if (in_array($column_value, $make_link)) { |
1254 | 1254 | $return .= '<a href="'.$value[$column_value].'">'.$value[$column_value].'</a>'; |
@@ -1276,11 +1276,11 @@ discard block |
||
1276 | 1276 | { |
1277 | 1277 | $course_id = api_get_course_int_id(); |
1278 | 1278 | $sql = "SELECT COUNT(feedback_id) AS total, file_id |
1279 | - FROM ". Database::get_course_table(TABLE_DROPBOX_FEEDBACK) ." |
|
1279 | + FROM ". Database::get_course_table(TABLE_DROPBOX_FEEDBACK)." |
|
1280 | 1280 | WHERE c_id = $course_id GROUP BY file_id"; |
1281 | 1281 | $result = Database::query($sql); |
1282 | 1282 | $return = array(); |
1283 | - while ($row=Database::fetch_array($result)) { |
|
1283 | + while ($row = Database::fetch_array($result)) { |
|
1284 | 1284 | $return[$row['file_id']] = $row['total']; |
1285 | 1285 | } |
1286 | 1286 | return $return; |