@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | exit; |
20 | 20 | } |
21 | 21 | |
22 | -$interbreadcrumb[] = array ("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array("url" => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | 23 | $tool_name = get_lang('MultipleAccessURLs'); |
24 | 24 | Display :: display_header($tool_name); |
25 | 25 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | case 'register': |
56 | 56 | // we are going to register the admin |
57 | 57 | if (api_is_platform_admin()) { |
58 | - if ($current_access_url_id!=-1) { |
|
58 | + if ($current_access_url_id != -1) { |
|
59 | 59 | $url_str = ''; |
60 | 60 | foreach ($url_list as $my_url) { |
61 | 61 | if (!in_array($my_url['id'], $my_user_url_list)) { |
62 | 62 | UrlManager::add_user_to_url(api_get_user_id(), $my_url['id']); |
63 | - $url_str.=$my_url['url'].' <br />'; |
|
63 | + $url_str .= $my_url['url'].' <br />'; |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | Display:: display_normal_message( |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | $url_string .= $my_url['url'].' <br />'; |
85 | 85 | } |
86 | 86 | } |
87 | -if(!empty($url_string)) { |
|
88 | - Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string,false); |
|
87 | +if (!empty($url_string)) { |
|
88 | + Display :: display_warning_message(get_lang('AdminShouldBeRegisterInSite').'<br />'.$url_string, false); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // checking the current installation |
92 | -if ($current_access_url_id==-1) { |
|
92 | +if ($current_access_url_id == -1) { |
|
93 | 93 | Display::display_warning_message(get_lang('URLNotConfiguredPleaseChangedTo').': '.api_get_path(WEB_PATH)); |
94 | -} elseif(api_is_platform_admin()) { |
|
95 | - $quant= UrlManager::relation_url_user_exist(api_get_user_id(),$current_access_url_id); |
|
96 | - if ($quant==0) { |
|
94 | +} elseif (api_is_platform_admin()) { |
|
95 | + $quant = UrlManager::relation_url_user_exist(api_get_user_id(), $current_access_url_id); |
|
96 | + if ($quant == 0) { |
|
97 | 97 | Display:: display_warning_message( |
98 | 98 | '<a href="'.api_get_self().'?action=register&sec_token='.$parameters['sec_token'].'">'.get_lang('ClickToRegisterAdmin').'</a>', |
99 | 99 | false |
@@ -142,16 +142,16 @@ discard block |
||
142 | 142 | |
143 | 143 | //Status |
144 | 144 | $active = $row['active']; |
145 | - if ($active=='1') { |
|
146 | - $action='lock'; |
|
147 | - $image='right'; |
|
145 | + if ($active == '1') { |
|
146 | + $action = 'lock'; |
|
147 | + $image = 'right'; |
|
148 | 148 | } |
149 | - if ($active=='0') { |
|
150 | - $action='unlock'; |
|
151 | - $image='wrong'; |
|
149 | + if ($active == '0') { |
|
150 | + $action = 'unlock'; |
|
151 | + $image = 'wrong'; |
|
152 | 152 | } |
153 | 153 | // you cannot lock the default |
154 | - if ($row['id']=='1') { |
|
154 | + if ($row['id'] == '1') { |
|
155 | 155 | $status = Display::return_icon($image.'.gif', get_lang(ucfirst($action))); |
156 | 156 | } else { |
157 | 157 | $status = '<a href="access_urls.php?action='.$action.'&url_id='.$row['id'].'">'. |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $url_id = $row['id']; |
162 | 162 | $actions = Display::url(Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), "access_url_edit.php?url_id=$url_id"); |
163 | 163 | if ($url_id != '1') { |
164 | - $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'. |
|
164 | + $actions .= '<a href="access_urls.php?action=delete_url&url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;">'. |
|
165 | 165 | Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>'; |
166 | 166 | } |
167 | 167 | $urls[] = array($url, $description, $status, $actions); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | if (!empty($gradebook) && $gradebook == 'view') { |
48 | - $interbreadcrumb[] = array ( |
|
48 | + $interbreadcrumb[] = array( |
|
49 | 49 | 'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), |
50 | 50 | 'name' => get_lang('ToolGradebook') |
51 | 51 | ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); |
108 | 108 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); |
109 | 109 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $currentForum['forum_title']); |
110 | - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('EditThread')); |
|
110 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('EditThread')); |
|
111 | 111 | } else { |
112 | 112 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); |
113 | 113 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | echo '<div class="actions">'; |
157 | 157 | echo '<span style="float:right;">'.search_link().'</span>'; |
158 | 158 | echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.$cidreq.'">'. |
159 | - Display::return_icon('back.png',get_lang('BackToForum'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
159 | + Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
160 | 160 | echo '</div>'; |
161 | 161 | |
162 | 162 | $threadData = getThreadInfo($threadId, $cId); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // Are we in a lp ? |
41 | 41 | $origin = ''; |
42 | 42 | if (isset($_GET['origin'])) { |
43 | - $origin = Security::remove_XSS($_GET['origin']); |
|
43 | + $origin = Security::remove_XSS($_GET['origin']); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // Name of the tool |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | |
49 | 49 | // Breadcrumbs |
50 | 50 | |
51 | -if (isset($_SESSION['gradebook'])){ |
|
51 | +if (isset($_SESSION['gradebook'])) { |
|
52 | 52 | $gradebook = $_SESSION['gradebook']; |
53 | 53 | } |
54 | 54 | |
55 | 55 | if (!empty($gradebook) && $gradebook == 'view') { |
56 | - $interbreadcrumb[] = array ( |
|
56 | + $interbreadcrumb[] = array( |
|
57 | 57 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
58 | 58 | 'name' => get_lang('ToolGradebook') |
59 | 59 | ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')); |
67 | 67 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')'); |
68 | 68 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title'])); |
69 | - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch')); |
|
69 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch')); |
|
70 | 70 | } else { |
71 | 71 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools); |
72 | 72 | $nameTools = get_lang('ForumSearch'); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if ($slide_id != 'all') { |
65 | 65 | $image = null; |
66 | 66 | if (isset($image_files_only[$slide])) { |
67 | - $image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide]; |
|
67 | + $image = $sys_course_path.$_course['path'].'/document'.$folder.$image_files_only[$slide]; |
|
68 | 68 | } |
69 | 69 | if (file_exists($image)) { |
70 | 70 | echo '<div class="actions-pagination">'; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $last = Display::return_icon('action_last_na.png', get_lang('LastSlide')); |
106 | 106 | } else { |
107 | 107 | $imgn = 'action_next.png'; |
108 | - $last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'"> |
|
108 | + $last = '<a href="slideshow.php?slide_id='.($total_slides - 1).'&curdirpath='.$pathurl.'"> |
|
109 | 109 | '.Display::return_icon('action_last.png', get_lang('LastSlide')).' |
110 | 110 | </a>'; |
111 | 111 | } |
@@ -122,18 +122,18 @@ discard block |
||
122 | 122 | |
123 | 123 | // Exit the slideshow |
124 | 124 | echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'. |
125 | - Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
125 | + Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
126 | 126 | |
127 | 127 | // Show thumbnails |
128 | 128 | if ($slide_id != 'all') { |
129 | 129 | echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'. |
130 | - Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
130 | + Display::return_icon('thumbnails.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
131 | 131 | } else { |
132 | - echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM); |
|
132 | + echo Display::return_icon('thumbnails_na.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM); |
|
133 | 133 | } |
134 | 134 | // Slideshow options |
135 | 135 | echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'. |
136 | - Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
136 | + Display::return_icon('settings.png', get_lang('SetSlideshowOptions'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
137 | 137 | |
138 | 138 | echo '</div>'; |
139 | 139 | echo '<br />'; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | $target_width = $target_height = null; |
159 | 159 | // The target height and width depends if we choose resizing or no resizing |
160 | -if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") { |
|
160 | +if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") { |
|
161 | 161 | $target_width = $_SESSION["image_resizing_width"]; |
162 | 162 | $target_height = $_SESSION["image_resizing_height"]; |
163 | 163 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /* THUMBNAIL VIEW */ |
166 | 166 | |
167 | 167 | // This is for viewing all the images in the slideshow as thumbnails. |
168 | -$image_tag = array (); |
|
168 | +$image_tag = array(); |
|
169 | 169 | $html = ''; |
170 | 170 | if ($slide_id == 'all') { |
171 | 171 | |
@@ -173,16 +173,16 @@ discard block |
||
173 | 173 | $allowed_thumbnail_types = array('jpg', 'jpeg', 'gif', 'png'); |
174 | 174 | $max_thumbnail_width = 250; |
175 | 175 | $max_thumbnail_height = 250; |
176 | - $png_compression = 0;//0(none)-9 |
|
177 | - $jpg_quality = 75;//from 0 to 100 (default is 75). More quality less compression |
|
176 | + $png_compression = 0; //0(none)-9 |
|
177 | + $jpg_quality = 75; //from 0 to 100 (default is 75). More quality less compression |
|
178 | 178 | |
179 | 179 | $directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/'; |
180 | 180 | |
181 | 181 | //Other parameters only for show tumbnails |
182 | - $row_items = 4;//only in slideshow.php |
|
183 | - $number_image = 7;//num icons cols to show |
|
184 | - $thumbnail_width_frame=$max_thumbnail_width;//optional $max_thumbnail_width+x |
|
185 | - $thumbnail_height_frame=$max_thumbnail_height; |
|
182 | + $row_items = 4; //only in slideshow.php |
|
183 | + $number_image = 7; //num icons cols to show |
|
184 | + $thumbnail_width_frame = $max_thumbnail_width; //optional $max_thumbnail_width+x |
|
185 | + $thumbnail_height_frame = $max_thumbnail_height; |
|
186 | 186 | |
187 | 187 | // Create the template_thumbnails folder (if no exist) |
188 | 188 | |
@@ -195,20 +195,20 @@ discard block |
||
195 | 195 | |
196 | 196 | foreach ($image_files_only as $one_image_file) { |
197 | 197 | $image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file; |
198 | - $image_thumbnail= $directory_thumbnails.'.'.$one_image_file; |
|
198 | + $image_thumbnail = $directory_thumbnails.'.'.$one_image_file; |
|
199 | 199 | |
200 | 200 | if (file_exists($image)) { |
201 | 201 | //check thumbnail |
202 | 202 | $imagetype = explode(".", $image); |
203 | 203 | //or check $imagetype = image_type_to_extension(exif_imagetype($image), false); |
204 | - $imagetype = strtolower($imagetype[count($imagetype)-1]); |
|
204 | + $imagetype = strtolower($imagetype[count($imagetype) - 1]); |
|
205 | 205 | |
206 | - if(in_array($imagetype,$allowed_thumbnail_types)) { |
|
207 | - if (!file_exists($image_thumbnail)){ |
|
206 | + if (in_array($imagetype, $allowed_thumbnail_types)) { |
|
207 | + if (!file_exists($image_thumbnail)) { |
|
208 | 208 | //run each once we view thumbnails is too heavy, then need move into !file_exists($image_thumbnail, and only run when haven't the thumbnail |
209 | 209 | $original_image_size = api_getimagesize($image); |
210 | 210 | |
211 | - switch($imagetype) { |
|
211 | + switch ($imagetype) { |
|
212 | 212 | case 'gif': |
213 | 213 | $source_img = imagecreatefromgif($image); |
214 | 214 | break; |
@@ -230,17 +230,17 @@ discard block |
||
230 | 230 | $max_thumbnail_height |
231 | 231 | ); |
232 | 232 | |
233 | - if($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){ |
|
234 | - $new_thumbnail_size['width']=$original_image_size['width']; |
|
235 | - $new_thumbnail_size['height']=$original_image_size['height']; |
|
233 | + if ($max_thumbnail_width > $original_image_size['width'] && $max_thumbnail_height > $original_image_size['height']) { |
|
234 | + $new_thumbnail_size['width'] = $original_image_size['width']; |
|
235 | + $new_thumbnail_size['height'] = $original_image_size['height']; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | $crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']); |
239 | 239 | |
240 | 240 | // preserve transparency |
241 | - if($imagetype == "png"){ |
|
241 | + if ($imagetype == "png") { |
|
242 | 242 | imagesavealpha($crop, true); |
243 | - $color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127); |
|
243 | + $color = imagecolorallocatealpha($crop, 0x00, 0x00, 0x00, 127); |
|
244 | 244 | imagefill($crop, 0, 0, $color); |
245 | 245 | } |
246 | 246 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $transindex = imagecolortransparent($source_img); |
249 | 249 | $palletsize = imagecolorstotal($source_img); |
250 | 250 | //GIF89a for transparent and anim (first clip), either GIF87a |
251 | - if ($transindex >= 0 && $transindex < $palletsize){ |
|
251 | + if ($transindex >= 0 && $transindex < $palletsize) { |
|
252 | 252 | $transcol = imagecolorsforindex($source_img, $transindex); |
253 | 253 | $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127); |
254 | 254 | imagefill($crop, 0, 0, $transindex); |
@@ -272,16 +272,16 @@ discard block |
||
272 | 272 | |
273 | 273 | switch ($imagetype) { |
274 | 274 | case 'gif': |
275 | - imagegif($crop,$image_thumbnail); |
|
275 | + imagegif($crop, $image_thumbnail); |
|
276 | 276 | break; |
277 | 277 | case 'jpg': |
278 | - imagejpeg($crop,$image_thumbnail,$jpg_quality); |
|
278 | + imagejpeg($crop, $image_thumbnail, $jpg_quality); |
|
279 | 279 | break; |
280 | 280 | case 'jpeg': |
281 | - imagejpeg($crop,$image_thumbnail,$jpg_quality); |
|
281 | + imagejpeg($crop, $image_thumbnail, $jpg_quality); |
|
282 | 282 | break; |
283 | 283 | case 'png': |
284 | - imagepng($crop,$image_thumbnail,$png_compression); |
|
284 | + imagepng($crop, $image_thumbnail, $png_compression); |
|
285 | 285 | break; |
286 | 286 | } |
287 | 287 | |
@@ -291,26 +291,26 @@ discard block |
||
291 | 291 | |
292 | 292 | //show thumbnail and link |
293 | 293 | |
294 | - $one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail |
|
294 | + $one_image_thumbnail_file = '.thumbs/.'.$one_image_file; //get path thumbnail |
|
295 | 295 | $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file; |
296 | 296 | $image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">'; |
297 | 297 | } else { |
298 | 298 | //if images aren't support by gd (not gif, jpg, jpeg, png) |
299 | - if ($imagetype=="bmp") { |
|
299 | + if ($imagetype == "bmp") { |
|
300 | 300 | // use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy |
301 | 301 | $original_image_size = getimagesize($image); |
302 | - if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){ |
|
303 | - $thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files |
|
302 | + if ($max_thumbnail_width < $original_image_size[0] || $max_thumbnail_height < $original_image_size[1]) { |
|
303 | + $thumbnail_size = api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height); //don't use resize_image because doesn't run with bmp files |
|
304 | 304 | $image_height = $thumbnail_size['height']; |
305 | 305 | $image_width = $thumbnail_size['width']; |
306 | 306 | } else { |
307 | - $image_height=$original_image_size[0]; |
|
308 | - $image_width=$original_image_size[1]; |
|
307 | + $image_height = $original_image_size[0]; |
|
308 | + $image_width = $original_image_size[1]; |
|
309 | 309 | } |
310 | 310 | } else { |
311 | 311 | //example for svg files,... |
312 | - $image_width=$max_thumbnail_width; |
|
313 | - $image_height=$max_thumbnail_height; |
|
312 | + $image_width = $max_thumbnail_width; |
|
313 | + $image_height = $max_thumbnail_height; |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | $doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | $i = 0; |
328 | 328 | $count_image = count($image_tag); |
329 | - $number_iteration = ceil($count_image/$number_image); |
|
329 | + $number_iteration = ceil($count_image / $number_image); |
|
330 | 330 | $p = 0; |
331 | 331 | $html = ''; |
332 | 332 | $html .= '<div class="gallery">'; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">'; |
339 | 339 | $html .= '<div class="frame">'; |
340 | 340 | $html .= '<div class="photo">'; |
341 | - $html .= $image_tag[$p]; |
|
341 | + $html .= $image_tag[$p]; |
|
342 | 342 | $html .= '</div>'; |
343 | 343 | $html .= '</div>'; |
344 | 344 | $html .= '</a>'; |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | list($width, $height) = getimagesize($image); |
395 | 395 | // Auto resize |
396 | - if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') { |
|
396 | + if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') { |
|
397 | 397 | ?> |
398 | 398 | |
399 | 399 | <script type="text/javascript"> |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | start_height=initial_height; |
411 | 411 | } |
412 | 412 | |
413 | - document.write('<img id="image" src="<?php echo 'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'" border="0" alt="<?php echo $image_files_only[$slide] ;?>">'); |
|
413 | + document.write('<img id="image" src="<?php echo 'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'" border="0" alt="<?php echo $image_files_only[$slide]; ?>">'); |
|
414 | 414 | |
415 | 415 | function resizeImage() { |
416 | 416 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | echo '</a>'; |
455 | 455 | echo '<div class="caption text-center">'; |
456 | 456 | echo Display::tag('h3', $row['title']); |
457 | - echo '<p>' . $row['comment'] . '</p>'; |
|
457 | + echo '<p>'.$row['comment'].'</p>'; |
|
458 | 458 | echo '</div>'; |
459 | 459 | echo '</div>'; |
460 | 460 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | $resize_info = get_lang('Resizing').'<br />'; |
468 | 468 | $resize_width = $_SESSION["image_resizing_width"].' x '; |
469 | 469 | $resize_height = $_SESSION['image_resizing_height']; |
470 | - } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing'){ |
|
470 | + } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing') { |
|
471 | 471 | $resize_info = get_lang('Resizing').'<br />'; |
472 | 472 | $resize_width = get_lang('Auto').' x '; |
473 | 473 | $resize_height = get_lang('Auto'); |
@@ -478,10 +478,10 @@ discard block |
||
478 | 478 | } |
479 | 479 | |
480 | 480 | echo '<li class="text-center">'; |
481 | - echo $image_files_only[$slide] . ' '; |
|
481 | + echo $image_files_only[$slide].' '; |
|
482 | 482 | echo Display::toolbarButton( |
483 | 483 | get_lang('Modify'), |
484 | - 'edit_document.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
484 | + 'edit_document.php?'.api_get_cidreq().'&'.http_build_query([ |
|
485 | 485 | 'id' => $row['id'], |
486 | 486 | 'origin' => 'slideshow', |
487 | 487 | 'origin_opt' => $edit_slide_id, |
@@ -493,11 +493,11 @@ discard block |
||
493 | 493 | false |
494 | 494 | ); |
495 | 495 | echo '</li>'; |
496 | - echo '<li class="text-center">' . $width.' x '.$height . '</li>'; |
|
497 | - echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>'; |
|
498 | - echo '<li class="text-center">' . $resize_info . '</li>'; |
|
499 | - echo '<li class="text-center">' . $resize_width . '</li>'; |
|
500 | - echo '<li class="text-center">' . $resize_height . '</li>'; |
|
496 | + echo '<li class="text-center">'.$width.' x '.$height.'</li>'; |
|
497 | + echo '<li class="text-center">'.round((filesize($image) / 1024), 2).' KB - '.$ext.'</li>'; |
|
498 | + echo '<li class="text-center">'.$resize_info.'</li>'; |
|
499 | + echo '<li class="text-center">'.$resize_width.'</li>'; |
|
500 | + echo '<li class="text-center">'.$resize_height.'</li>'; |
|
501 | 501 | echo '</ul>'; |
502 | 502 | } |
503 | 503 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | SubLanguageManager::make_unavailable_language($_POST['id']); |
36 | 36 | echo 'set_hidden'; |
37 | 37 | } else { |
38 | - echo 'confirm:' . intval($_POST['id']); |
|
38 | + echo 'confirm:'.intval($_POST['id']); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | var disabledLang = "'.$disabledLang.'" |
58 | 58 | |
59 | 59 | if (msgLang == 1) { |
60 | - $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually') . ' <br /> " + disabledLang + "</div"); |
|
60 | + $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div"); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | $("#disable_all_except_default").click(function () { |
64 | - if(confirm("'. get_lang('ConfirmYourChoice') .'")) { |
|
64 | + if(confirm("'. get_lang('ConfirmYourChoice').'")) { |
|
65 | 65 | $.ajax({ |
66 | 66 | contentType: "application/x-www-form-urlencoded", |
67 | 67 | beforeSend: function(objeto) { |
68 | - $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading') . '</div>"); |
|
68 | + $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading').'</div>"); |
|
69 | 69 | }, |
70 | 70 | type: "GET", |
71 | 71 | url: "../admin/languages.php", |
72 | 72 | data: "action=disable_all_except_default", |
73 | 73 | success: function(datos) { |
74 | - window.location.href = "' . api_get_self() . '"; |
|
74 | + window.location.href = "' . api_get_self().'"; |
|
75 | 75 | } |
76 | 76 | }); |
77 | 77 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | $.ajax({ |
108 | 108 | contentType: "application/x-www-form-urlencoded", |
109 | 109 | beforeSend: function(objeto) { |
110 | - $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading') . '</div>"); |
|
110 | + $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em> ' . get_lang('Loading').'</div>"); |
|
111 | 111 | }, |
112 | 112 | type: "POST", |
113 | 113 | url: "../admin/languages.php", |
@@ -118,26 +118,26 @@ discard block |
||
118 | 118 | $("#"+id_img_link_tool).attr("src",path_name_of_imglinktool); |
119 | 119 | |
120 | 120 | if (my_image_tool=="visible.png") { |
121 | - $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '') . '"); |
|
122 | - $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '') . '"); |
|
121 | + $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '').'"); |
|
122 | + $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '').'"); |
|
123 | 123 | } else { |
124 | - $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '') . '"); |
|
125 | - $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '') . '"); |
|
124 | + $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '').'"); |
|
125 | + $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '').'"); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | if (datos=="set_visible") { |
129 | - $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '') . '</div>"); |
|
129 | + $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '').'</div>"); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | if (datos=="set_hidden") { |
133 | - $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '') . '</div>"); |
|
133 | + $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '').'</div>"); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | 137 | var action = datos.split(":")[0]; |
138 | 138 | if (action && action == "confirm") { |
139 | 139 | var id = datos.split(":")[1]; |
140 | - var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> ' . get_lang('MakeUnavailable') . '</a></div>"; |
|
140 | + var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> '.get_lang('MakeUnavailable').'</a></div>"; |
|
141 | 141 | $("#id_content_message").html(sure); |
142 | 142 | $("html, body").animate({ scrollTop: 0 }, 200); |
143 | 143 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | SubLanguageManager::make_unavailable_language($language['id']); |
183 | 183 | } else { |
184 | 184 | if (intval(SubLanguageManager::get_platform_language_id()) !== intval($language['id'])) { |
185 | - $failedDisabledLanguages .= ' - ' .$language['english_name'] . '<br />'; |
|
185 | + $failedDisabledLanguages .= ' - '.$language['english_name'].'<br />'; |
|
186 | 186 | $checkFailed = true; |
187 | 187 | } |
188 | 188 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | foreach ($_POST['id'] as $index => $id) { |
214 | 214 | $ids[] = intval($id); |
215 | 215 | } |
216 | - $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('" . implode("','", $ids) . "')"; |
|
216 | + $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('".implode("','", $ids)."')"; |
|
217 | 217 | Database::query($sql); |
218 | 218 | } |
219 | 219 | break; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | foreach ($_POST['id'] as $index => $id) { |
224 | 224 | $ids[] = intval($id); |
225 | 225 | } |
226 | - $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('" . implode("','", $ids) . "')"; |
|
226 | + $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('".implode("','", $ids)."')"; |
|
227 | 227 | Database::query($sql); |
228 | 228 | } |
229 | 229 | break; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | // displaying the explanation for this tool |
253 | 253 | Display::display_normal_message(get_lang('PlatformLanguagesExplanation')); |
254 | 254 | |
255 | -echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> ' . get_lang('LanguagesDisableAllExceptDefault') . '</a><br /><br />'; |
|
255 | +echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> '.get_lang('LanguagesDisableAllExceptDefault').'</a><br /><br />'; |
|
256 | 256 | |
257 | 257 | // selecting all the languages |
258 | 258 | $sql_select = "SELECT * FROM $tbl_admin_languages"; |
@@ -273,8 +273,8 @@ discard block |
||
273 | 273 | $checked = ' checked="checked" '; |
274 | 274 | } |
275 | 275 | |
276 | - $row_td[] = '<input type="hidden" name="edit_id" value="' . Security::remove_XSS($_GET['id']) . '" /><input type="text" name="txt_name" value="' . $row['original_name'] . '" /> ' |
|
277 | - . '<input type="checkbox" ' . $checked . 'name="platformlanguage" id="platformlanguage" value="' . $row['english_name'] . '" /><label for="platformlanguage">' . $row['original_name'] . ' ' . get_lang('AsPlatformLanguage') . '</label> <input type="submit" name="Submit" value="' . get_lang('Ok') . '" /><a name="value" />'; |
|
276 | + $row_td[] = '<input type="hidden" name="edit_id" value="'.Security::remove_XSS($_GET['id']).'" /><input type="text" name="txt_name" value="'.$row['original_name'].'" /> ' |
|
277 | + . '<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />'; |
|
278 | 278 | } else { |
279 | 279 | $row_td[] = $row['original_name']; |
280 | 280 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if ($row['english_name'] == $row_lang['selected_value']) { |
289 | 289 | $setplatformlanguage = Display::return_icon('languages.png', get_lang('CurrentLanguagesPortal'), '', ICON_SIZE_SMALL); |
290 | 290 | } else { |
291 | - $setplatformlanguage = "<a href=\"javascript:if (confirm('" . addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault')) . "')) { location.href='" . api_get_self() . "?action=setplatformlanguage&id=" . $row['id'] . "'; }\">" . Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL) . "</a>"; |
|
291 | + $setplatformlanguage = "<a href=\"javascript:if (confirm('".addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault'))."')) { location.href='".api_get_self()."?action=setplatformlanguage&id=".$row['id']."'; }\">".Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL)."</a>"; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $allow_delete_sub_language = null; |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | if ($verified_if_is_sub_language === false) { |
302 | 302 | $verified_if_is_father = SubLanguageManager::check_if_language_is_father($row['id']); |
303 | - $allow_use_sub_language = " <a href='sub_language_add.php?action=definenewsublanguage&id=" . $row['id'] . "'>" . Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL) . "</a>"; |
|
303 | + $allow_use_sub_language = " <a href='sub_language_add.php?action=definenewsublanguage&id=".$row['id']."'>".Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL)."</a>"; |
|
304 | 304 | if ($verified_if_is_father === true) { |
305 | 305 | //$allow_add_term_sub_language = " <a href='sub_language.php?action=registersublanguage&id=".$row['id']."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'),array('width'=>ICON_SIZE_SMALL,'height'=>ICON_SIZE_SMALL))."</a>"; |
306 | 306 | $allow_add_term_sub_language = ''; |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | } else { |
311 | 311 | $allow_use_sub_language = ''; |
312 | 312 | $all_information_of_sub_language = SubLanguageManager::get_all_information_of_language($row['id']); |
313 | - $allow_add_term_sub_language = " <a href='sub_language.php?action=registersublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>"; |
|
314 | - $allow_delete_sub_language = " <a href='sub_language_add.php?action=deletesublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>"; |
|
313 | + $allow_add_term_sub_language = " <a href='sub_language.php?action=registersublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>"; |
|
314 | + $allow_delete_sub_language = " <a href='sub_language_add.php?action=deletesublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>"; |
|
315 | 315 | } |
316 | 316 | } else { |
317 | 317 | $allow_use_sub_language = ''; |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | } |
320 | 320 | |
321 | 321 | if ($row['english_name'] == $row_lang['selected_value']) { |
322 | - $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a> |
|
323 | - " . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language; |
|
322 | + $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a> |
|
323 | + " . $setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; |
|
324 | 324 | } else { |
325 | 325 | if ($row['available'] == 1) { |
326 | - $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeunavailable&id=" . $row['id'] . "'>" . Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a> " . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language; |
|
326 | + $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeunavailable&id=".$row['id']."'>".Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a> ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; |
|
327 | 327 | } else { |
328 | - $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeavailable&id=" . $row['id'] . "'>" . Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a> " . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language; |
|
328 | + $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeavailable&id=".$row['id']."'>".Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a> ".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | $language_data[] = $row_td; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @param string View to print as a title for the table |
13 | 13 | * @param string Course name to print as title for the table |
14 | 14 | */ |
15 | -function print_table($data_array,$header_names,$view,$coursename) |
|
15 | +function print_table($data_array, $header_names, $view, $coursename) |
|
16 | 16 | { |
17 | 17 | $printdata = '<!DOCTYPE html |
18 | 18 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $count_pages = ceil(count($data_table) / $items_per_page); |
162 | 162 | $content_table = ''; |
163 | - for ($x = 0; $x<$count_pages; $x++) { |
|
163 | + for ($x = 0; $x < $count_pages; $x++) { |
|
164 | 164 | $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">'; |
165 | 165 | // header table |
166 | 166 | $content_table .= '<tr>'; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | |
170 | 170 | foreach ($headers_table as $head_table) { |
171 | 171 | if (!empty($head_table[0])) { |
172 | - $width = (!empty($head_table[1])?$head_table[1].'%':''); |
|
172 | + $width = (!empty($head_table[1]) ? $head_table[1].'%' : ''); |
|
173 | 173 | $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>'; |
174 | 174 | $i++; |
175 | 175 | } |
@@ -178,16 +178,16 @@ discard block |
||
178 | 178 | $content_table .= '</tr>'; |
179 | 179 | // body table |
180 | 180 | if (is_array($data_table) && count($data_table) > 0) { |
181 | - $offset = $x*$items_per_page; |
|
182 | - $data_table = array_slice ($data_table, $offset, count($data_table)); |
|
181 | + $offset = $x * $items_per_page; |
|
182 | + $data_table = array_slice($data_table, $offset, count($data_table)); |
|
183 | 183 | $i = 1; |
184 | - $item = $offset+1; |
|
184 | + $item = $offset + 1; |
|
185 | 185 | foreach ($data_table as $data) { |
186 | 186 | $content_table .= '<tr>'; |
187 | - $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>'; |
|
187 | + $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>'; |
|
188 | 188 | foreach ($data as $key => $content) { |
189 | 189 | if (isset($content)) { |
190 | - $key == 1 ? $align='align="left"':$align='align="center"'; |
|
190 | + $key == 1 ? $align = 'align="left"' : $align = 'align="center"'; |
|
191 | 191 | $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>'; |
192 | 192 | } |
193 | 193 | } |
@@ -240,10 +240,10 @@ discard block |
||
240 | 240 | <h1>'.$title_pdf.'</h1></td></tr>'; |
241 | 241 | foreach ($headers_pdf as $header_pdf) { |
242 | 242 | if (!empty($header_pdf[0]) && !empty($header_pdf[1])) { |
243 | - $header.= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>'; |
|
243 | + $header .= '<tr><td><strong>'.$header_pdf[0].'</strong> </td><td>'.$header_pdf[1].'</td></tr>'; |
|
244 | 244 | } |
245 | 245 | } |
246 | - $header.='</table><br />'; |
|
246 | + $header .= '</table><br />'; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // preparing footer pdf |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | } |
268 | 268 | $items_per_page = 30; |
269 | 269 | $count_pages = ceil(count($data_table) / $items_per_page); |
270 | - for ($x = 0; $x<$count_pages; $x++) { |
|
270 | + for ($x = 0; $x < $count_pages; $x++) { |
|
271 | 271 | $content_table .= '<table width="100%" border="1" style="border-collapse:collapse">'; |
272 | 272 | // header table |
273 | 273 | $content_table .= '<tr>'; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | if (is_array($headers_table)) { |
276 | 276 | foreach ($headers_table as $head_table) { |
277 | 277 | if (!empty($head_table[0])) { |
278 | - $width = (!empty($head_table[1])?$head_table[1].'%':''); |
|
278 | + $width = (!empty($head_table[1]) ? $head_table[1].'%' : ''); |
|
279 | 279 | $content_table .= '<th width="'.$width.'">'.$head_table[0].'</th>'; |
280 | 280 | $i++; |
281 | 281 | } |
@@ -285,16 +285,16 @@ discard block |
||
285 | 285 | // body table |
286 | 286 | |
287 | 287 | if (is_array($data_table) && count($data_table) > 0) { |
288 | - $offset = $x*$items_per_page; |
|
289 | - $data_table = array_slice ($data_table, $offset, count($data_table)); |
|
288 | + $offset = $x * $items_per_page; |
|
289 | + $data_table = array_slice($data_table, $offset, count($data_table)); |
|
290 | 290 | $i = 1; |
291 | - $item = $offset+1; |
|
291 | + $item = $offset + 1; |
|
292 | 292 | foreach ($data_table as $data) { |
293 | 293 | $content_table .= '<tr>'; |
294 | - $content_table .= '<td>'.($item<10?'0'.$item:$item).'</td>'; |
|
294 | + $content_table .= '<td>'.($item < 10 ? '0'.$item : $item).'</td>'; |
|
295 | 295 | foreach ($data as $key => $content) { |
296 | 296 | if (isset($content)) { |
297 | - $key == 1 ? $align='align="left"':$align='align="center"'; |
|
297 | + $key == 1 ? $align = 'align="left"' : $align = 'align="center"'; |
|
298 | 298 | $content_table .= '<td '.$align.' style="padding:4px;" >'.$content.'</td>'; |
299 | 299 | } |
300 | 300 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $pdf = new PDF(); |
313 | 313 | $pdf->set_custom_footer($footer); |
314 | 314 | $pdf->set_custom_header($headers_in_pdf); |
315 | - $pdf->content_to_pdf($header.$content_table, $css, $title_pdf ); |
|
315 | + $pdf->content_to_pdf($header.$content_table, $css, $title_pdf); |
|
316 | 316 | exit; |
317 | 317 | |
318 | 318 | } |
@@ -327,8 +327,8 @@ discard block |
||
327 | 327 | function export_pdf($pdf, $newarray, $header_names, $format) |
328 | 328 | { |
329 | 329 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
330 | - $pdf->ezSetCmMargins(0,0,0,0); |
|
331 | - $pdf->ezSetY(($format=='portrait')?'820':'570'); |
|
330 | + $pdf->ezSetCmMargins(0, 0, 0, 0); |
|
331 | + $pdf->ezSetY(($format == 'portrait') ? '820' : '570'); |
|
332 | 332 | $pdf->selectFont(api_get_path(LIBRARY_PATH).'ezpdf/fonts/Courier.afm'); |
333 | 333 | if ($format == 'portrait') { |
334 | 334 | $pdf->line(40, 790, 540, 790); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $pdf->line(40, 540, 790, 540); |
338 | 338 | $pdf->line(40, 40, 790, 40); |
339 | 339 | } |
340 | - $pdf->ezSetY(($format=='portrait')?'750':'520'); |
|
340 | + $pdf->ezSetY(($format == 'portrait') ? '750' : '520'); |
|
341 | 341 | $pdf->ezTable($newarray, $header_names, '', array( |
342 | 342 | 'showHeadings' => 1, |
343 | 343 | 'shaded' => 1, |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
31 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
32 | 32 | $interbreadcrumb[] = array( |
33 | 33 | 'url' => "resume_session.php?id_session=".$sessionId, |
34 | 34 | "name" => get_lang('SessionOverview') |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ($days > 0) { |
61 | 61 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateInZDays'), $firstAccessString, $duration, $days); |
62 | 62 | } else { |
63 | - $endDateInSeconds = $firstAccess + $duration * 24*60*60; |
|
63 | + $endDateInSeconds = $firstAccess + $duration * 24 * 60 * 60; |
|
64 | 64 | $last = api_convert_and_format_date($endDateInSeconds, DATE_FORMAT_SHORT); |
65 | 65 | $msg = sprintf(get_lang('FirstAccessWasXSessionDurationYEndDateWasZ'), $firstAccessString, $duration, $last); |
66 | 66 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $tool_name = get_lang('SessionOverview'); |
30 | 30 | |
31 | 31 | //$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
32 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
32 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
33 | 33 | |
34 | 34 | $orig_param = '&origin=resume_session'; |
35 | 35 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | $coachs = array(); |
185 | 185 | if (Database::num_rows($rs) > 0) { |
186 | - while($info_coach = Database::fetch_array($rs)) { |
|
186 | + while ($info_coach = Database::fetch_array($rs)) { |
|
187 | 187 | $coachs[] = api_get_person_name( |
188 | 188 | $info_coach['firstname'], |
189 | 189 | $info_coach['lastname'] |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | if (count($coachs) > 0) { |
197 | - $coach = implode('<br />',$coachs); |
|
197 | + $coach = implode('<br />', $coachs); |
|
198 | 198 | } else { |
199 | 199 | $coach = get_lang('None'); |
200 | 200 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $downIcon = 'down.png'; |
218 | 218 | $downUrl = api_get_self().'?id_session='.$sessionId.'&course_id='.$course->getId().'&action=move_down'; |
219 | 219 | |
220 | - if ($count +1 == count($courses)) { |
|
220 | + if ($count + 1 == count($courses)) { |
|
221 | 221 | $downIcon = 'down_na.png'; |
222 | 222 | $downUrl = '#'; |
223 | 223 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | <td>'.$coach.'</td> |
245 | 245 | <td>'.$numberOfUsers.'</td> |
246 | 246 | <td> |
247 | - <a href="'. $courseUrl . '">'. |
|
247 | + <a href="'. $courseUrl.'">'. |
|
248 | 248 | Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
249 | 249 | '.$orderButtons.' |
250 | 250 | <a href="session_course_user_list.php?id_session='.$sessionId.'&course_code='.$course->getCode().'">'. |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | array('onclick' => "javascript:if(!confirm('".get_lang('ConfirmYourChoice')."')) return false;") |
310 | 310 | ); |
311 | 311 | |
312 | - $addUserToUrlLink= ''; |
|
312 | + $addUserToUrlLink = ''; |
|
313 | 313 | if ($multiple_url_is_on) { |
314 | 314 | if ($user['access_url_id'] != $url_id) { |
315 | 315 | $userLink .= ' '.Display::return_icon( |
@@ -108,7 +108,7 @@ |
||
108 | 108 | ], |
109 | 109 | ['BulletedList', 'NumberedList', 'HorizontalRule'], |
110 | 110 | ['JustifyLeft', 'JustifyCenter', 'JustifyBlock'], |
111 | - [ 'Styles', |
|
111 | + ['Styles', |
|
112 | 112 | 'Format', |
113 | 113 | 'Font', |
114 | 114 | 'FontSize', |