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