19declare(strict_types=1);
46 $settings->getObjId(),
49 move_uploaded_file($file_info[
'tmp_name'], $target);
51 if ($which === self::IMG_ABSTRACT) {
54 if ($which === self::IMG_EXTRO) {
64 if ($which === self::IMG_ABSTRACT) {
68 if ($which === self::IMG_EXTRO) {
72 if ($delete !==
'' && str_starts_with($delete, $this->getStoragePath())) {
73 $this->deleteFile($delete);
80 return $this->getStoragePath()
88 public function getSuffix(
string $file_name): string
90 return pathinfo($file_name, PATHINFO_EXTENSION);
95 return $this->getAbsolutePath() .
'/';
103 return self::PATH_PRE;
111 return self::PATH_POST;
getAbsolutePath()
Calculates the full path on the filesystem.
Storage of images in settings.
getSuffix(string $file_name)
getPathPostfix()
Get directory name.E.g for files => file Only relative path, no trailing slash '_<obj_id>' will be ap...
delete_image(string $which, ilLearningSequenceSettings $settings)
getPathPrefix()
Get path prefix.Prefix that will be prepended to the path No trailing slash. E.g ilFiles for files
getStoragePathFor(string $which, int $obj_id, string $suffix)
moveUploaded(string $which, array $file_info, ilLearningSequenceSettings $settings)
Settings for an LSO (like abstract, extro)
withExtroImage(?string $path=null)
withAbstractImage(?string $path=null)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc