Verified Commit ca02d18e authored by Jan Wennrich's avatar Jan Wennrich 🎓

style: code formatting

parent a70be8dd
......@@ -61,7 +61,7 @@ class Utils
/* @var $Item \QUI\Projects\Media\Folder */
return [
'icon' => 'fa fa-home',
'icon80x80' => URL_BIN_DIR.'80x80/media.png',
'icon80x80' => URL_BIN_DIR . '80x80/media.png',
'id' => $Item->getId(),
'name' => $Item->getAttribute('name'),
'title' => $Item->getAttribute('title'),
......@@ -82,7 +82,7 @@ class Utils
/* @var $Item \QUI\Projects\Media\Folder */
return [
'icon' => 'fa fa-folder-o',
'icon80x80' => URL_BIN_DIR.'80x80/extensions/folder.png',
'icon80x80' => URL_BIN_DIR . '80x80/extensions/folder.png',
'id' => $Item->getId(),
'name' => $Item->getAttribute('name'),
'title' => $Item->getAttribute('title'),
......@@ -146,59 +146,59 @@ class Utils
}
$extensions['16x16'] = [
'folder' => URL_BIN_DIR.'16x16/extensions/folder.png',
'pdf' => URL_BIN_DIR.'16x16/extensions/pdf.png',
'folder' => URL_BIN_DIR . '16x16/extensions/folder.png',
'pdf' => URL_BIN_DIR . '16x16/extensions/pdf.png',
// Images
'jpg' => URL_BIN_DIR.'16x16/extensions/image.png',
'jpeg' => URL_BIN_DIR.'16x16/extensions/image.png',
'gif' => URL_BIN_DIR.'16x16/extensions/image.png',
'png' => URL_BIN_DIR.'16x16/extensions/image.png',
'jpg' => URL_BIN_DIR . '16x16/extensions/image.png',
'jpeg' => URL_BIN_DIR . '16x16/extensions/image.png',
'gif' => URL_BIN_DIR . '16x16/extensions/image.png',
'png' => URL_BIN_DIR . '16x16/extensions/image.png',
// Movie
'avi' => URL_BIN_DIR.'16x16/extensions/film.png',
'mpeg' => URL_BIN_DIR.'16x16/extensions/film.png',
'mpg' => URL_BIN_DIR.'16x16/extensions/film.png',
'avi' => URL_BIN_DIR . '16x16/extensions/film.png',
'mpeg' => URL_BIN_DIR . '16x16/extensions/film.png',
'mpg' => URL_BIN_DIR . '16x16/extensions/film.png',
// Archiv
'tar' => URL_BIN_DIR.'16x16/extensions/archive.png',
'rar' => URL_BIN_DIR.'16x16/extensions/archive.png',
'zip' => URL_BIN_DIR.'16x16/extensions/archive.png',
'gz' => URL_BIN_DIR.'16x16/extensions/archive.png',
'7z' => URL_BIN_DIR.'16x16/extensions/archive.png',
'tar' => URL_BIN_DIR . '16x16/extensions/archive.png',
'rar' => URL_BIN_DIR . '16x16/extensions/archive.png',
'zip' => URL_BIN_DIR . '16x16/extensions/archive.png',
'gz' => URL_BIN_DIR . '16x16/extensions/archive.png',
'7z' => URL_BIN_DIR . '16x16/extensions/archive.png',
//Office
// Music
'mp3' => URL_BIN_DIR.'16x16/extensions/sound.png',
'ogg' => URL_BIN_DIR.'16x16/extensions/sound.png',
'mp3' => URL_BIN_DIR . '16x16/extensions/sound.png',
'ogg' => URL_BIN_DIR . '16x16/extensions/sound.png',
];
$extensions['80x80'] = [
'folder' => URL_BIN_DIR.'80x80/extensions/folder.png',
'pdf' => URL_BIN_DIR.'80x80/extensions/pdf.png',
'folder' => URL_BIN_DIR . '80x80/extensions/folder.png',
'pdf' => URL_BIN_DIR . '80x80/extensions/pdf.png',
// Images
'jpg' => URL_BIN_DIR.'80x80/extensions/image.png',
'jpeg' => URL_BIN_DIR.'80x80/extensions/image.png',
'gif' => URL_BIN_DIR.'80x80/extensions/image.png',
'png' => URL_BIN_DIR.'80x80/extensions/image.png',
'jpg' => URL_BIN_DIR . '80x80/extensions/image.png',
'jpeg' => URL_BIN_DIR . '80x80/extensions/image.png',
'gif' => URL_BIN_DIR . '80x80/extensions/image.png',
'png' => URL_BIN_DIR . '80x80/extensions/image.png',
// Movie
'avi' => URL_BIN_DIR.'80x80/extensions/film.png',
'mpeg' => URL_BIN_DIR.'80x80/extensions/film.png',
'mpg' => URL_BIN_DIR.'80x80/extensions/film.png',
'avi' => URL_BIN_DIR . '80x80/extensions/film.png',
'mpeg' => URL_BIN_DIR . '80x80/extensions/film.png',
'mpg' => URL_BIN_DIR . '80x80/extensions/film.png',
// Archiv
'tar' => URL_BIN_DIR.'80x80/extensions/archive.png',
'rar' => URL_BIN_DIR.'80x80/extensions/archive.png',
'zip' => URL_BIN_DIR.'80x80/extensions/archive.png',
'gz' => URL_BIN_DIR.'80x80/extensions/archive.png',
'7z' => URL_BIN_DIR.'80x80/extensions/archive.png',
'tar' => URL_BIN_DIR . '80x80/extensions/archive.png',
'rar' => URL_BIN_DIR . '80x80/extensions/archive.png',
'zip' => URL_BIN_DIR . '80x80/extensions/archive.png',
'gz' => URL_BIN_DIR . '80x80/extensions/archive.png',
'7z' => URL_BIN_DIR . '80x80/extensions/archive.png',
//Office
// Music
'mp3' => URL_BIN_DIR.'80x80/extensions/sound.png',
'mp3' => URL_BIN_DIR . '80x80/extensions/sound.png',
];
if (isset($extensions[$size][$ext])) {
return $extensions[$size][$ext];
}
return URL_BIN_DIR.$size.'/extensions/empty.png';
return URL_BIN_DIR . $size . '/extensions/empty.png';
}
/**
......@@ -380,7 +380,7 @@ class Utils
$img = '<img ';
foreach ($attributes as $key => $value) {
$img .= htmlspecialchars($key).'="'.htmlspecialchars($value).'" ';
$img .= htmlspecialchars($key) . '="' . htmlspecialchars($value) . '" ';
}
// responsive image
......@@ -402,7 +402,7 @@ class Utils
// $img .= ' srcset="'. implode(",\n", $srcset) .'"';
// }
$img .= ' src="'.htmlspecialchars($src).'" />';
$img .= ' src="' . htmlspecialchars($src) . '" />';
return $img;
}
......@@ -443,7 +443,7 @@ class Utils
$id = $params['id'];
$project = $params['project'];
$cache = 'cache/links/'.$project.'/media/'.$id;
$cache = 'cache/links/' . $project . '/media/' . $id;
$url = '';
// exist cache?
......@@ -467,14 +467,14 @@ class Utils
'trace' => $Exception->getTrace()
]);
return URL_DIR.$output;
return URL_DIR . $output;
} catch (\Exception $Exception) {
Log::addDebug($Exception->getMessage(), [
'url' => $output,
'trace' => $Exception->getTrace()
]);
return URL_DIR.$output;
return URL_DIR . $output;
}
}
......@@ -495,10 +495,10 @@ class Utils
$url_explode[1] = '';
}
$url = $url_explode[0].'__'.$size['width'].'x'.$size['height'].'.'.$url_explode[1];
$url = $url_explode[0] . '__' . $size['width'] . 'x' . $size['height'] . '.' . $url_explode[1];
}
if (!file_exists(CMS_DIR.$url)) {
if (!file_exists(CMS_DIR . $url)) {
$Project = QUI::getProject($project);
$Media = $Project->getMedia();
$Obj = $Media->get((int)$id);
......@@ -760,8 +760,8 @@ class Utils
$lastpos_ul = strrpos($file_name, '__') + 2;
$pos_dot = strpos($file_name, '.', $lastpos_ul);
$file_name = substr($file_name, 0, ($lastpos_ul - 2)).
substr($file_name, $pos_dot);
$file_name = substr($file_name, 0, ($lastpos_ul - 2)) .
substr($file_name, $pos_dot);
}
$parts[] = $file_name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment