diff options
Diffstat (limited to 'inc/media.php')
-rw-r--r-- | inc/media.php | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/inc/media.php b/inc/media.php index 960b96e65..4fff95d94 100644 --- a/inc/media.php +++ b/inc/media.php @@ -284,7 +284,7 @@ function media_upload_xhr($ns,$auth){ 'copy' ); unlink($path); - if ($tmp) dir_delete($tmp); + if ($tmp) io_rmdir($tmp, true); if (is_array($res)) { msg($res[0], $res[1]); return false; @@ -704,7 +704,7 @@ function media_tab_files_options(){ if ($checked == $option) { $attrs['checked'] = 'checked'; } - $form->addElement(form_makeRadioField($group, $option, + $form->addElement(form_makeRadioField($group . '_dwmedia', $option, $lang['media_' . $group . '_' . $option], $content[0] . '__' . $option, $option, $attrs)); @@ -728,10 +728,23 @@ function _media_get_sort_type() { return _media_get_display_param('sort', array('default' => 'name', 'date')); } +/** + * Returns type of listing for the list of files in media manager + * + * @author Kate Arzamastseva <pshns@ukr.net> + * @return string - list type + */ function _media_get_list_type() { return _media_get_display_param('list', array('default' => 'thumbs', 'rows')); } +/** + * Get display parameters + * + * @param string $param name of parameter + * @param array $values allowed values, where default value has index key 'default' + * @return string the parameter value + */ function _media_get_display_param($param, $values) { global $INPUT; if (in_array($INPUT->str($param), $values)) { @@ -859,6 +872,10 @@ function media_tab_history($image, $ns, $auth=null) { /** * Prints mediafile details * + * @param string $image media id + * @param $auth + * @param int|bool $rev + * @param JpegMeta|bool $meta * @author Kate Arzamastseva <pshns@ukr.net> */ function media_preview($image, $auth, $rev=false, $meta=false) { @@ -1039,7 +1056,6 @@ function media_details($image, $auth, $rev=false, $meta=false) { * @author Kate Arzamastseva <pshns@ukr.net> */ function media_diff($image, $ns, $auth, $fromajax = false) { - global $lang; global $conf; global $INPUT; @@ -1098,9 +1114,15 @@ function media_diff($image, $ns, $auth, $fromajax = false) { } +/** + * Callback for media file diff + * + * @param $data + * @return bool|void + */ function _media_file_diff($data) { if(is_array($data) && count($data)===6) { - return media_file_diff($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]); + media_file_diff($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]); } else { return false; } @@ -1559,7 +1581,7 @@ function media_printimgdetail($item, $fullscreen=false){ * @param string $amp - separator * @param bool $abs * @param bool $params_array - * @return string - link + * @return string|array - link */ function media_managerURL($params=false, $amp='&', $abs=false, $params_array=false) { global $ID; @@ -1819,7 +1841,7 @@ function media_resize_image($file, $ext, $w, $h=0){ if( $mtime > filemtime($file) || media_resize_imageIM($ext,$file,$info[0],$info[1],$local,$w,$h) || media_resize_imageGD($ext,$file,$info[0],$info[1],$local,$w,$h) ){ - if($conf['fperm']) chmod($local, $conf['fperm']); + if($conf['fperm']) @chmod($local, $conf['fperm']); return $local; } //still here? resizing failed @@ -1880,7 +1902,7 @@ function media_crop_image($file, $ext, $w, $h=0){ if( $mtime > @filemtime($file) || media_crop_imageIM($ext,$file,$info[0],$info[1],$local,$cw,$ch,$cx,$cy) || media_resize_imageGD($ext,$file,$cw,$ch,$local,$cw,$ch,$cx,$cy) ){ - if($conf['fperm']) chmod($local, $conf['fperm']); + if($conf['fperm']) @chmod($local, $conf['fperm']); return media_resize_image($local,$ext, $w, $h); } @@ -2164,7 +2186,7 @@ function media_alternativefiles($src, $exts){ /** * Check if video/audio is supported to be embedded. * - * @param string $src - mimetype of media file + * @param string $mime - mimetype of media file * @param string $type - type of media files to check ('video', 'audio', or none) * @return boolean * |