/**
  * Returns a more detailed information about logged operation.
  *
  * Note: Due to the fact that all paths used by CKFinder needs to be relative, all paths in the log use following format:
  * [backend name]://backend/relative/path
  *
  * @param CKFinderEvent $event     Event object
  * @param string        $eventName Event name
  *
  * @return string more detailed information about the event - depending on event type
  */
 protected function getInfoFromEvent(CKFinderEvent $event, $eventName)
 {
     $workingFolder = $event->getContainer()->getWorkingFolder();
     switch ($eventName) {
         case CKFinderEvent::MOVE_FILE:
         case CKFinderEvent::COPY_FILE:
             /* @var $event \CKSource\CKFinder\Event\CopyFileEvent */
             $copiedFile = $event->getFile();
             $sourcePath = $this->createPath($copiedFile->getResourceType(), $copiedFile->getSourceFilePath());
             $targetPath = $this->createPath($copiedFile->getTargetFolder()->getResourceType(), $copiedFile->getTargetFilePath());
             return $sourcePath . ' -> ' . $targetPath;
         case CKFinderEvent::DELETE_FILE:
         case CKFinderEvent::DOWNLOAD_FILE:
         case CKFinderEvent::SAVE_IMAGE:
         case CKFinderEvent::EDIT_IMAGE:
             /* @var $file \CKSource\CKFinder\Filesystem\File\ExistingFile */
             $file = $event->getFile();
             return $this->createPath($file->getResourceType(), $file->getFilePath());
         case CKFinderEvent::RENAME_FILE:
             /* @var $event \CKSource\CKFinder\Event\RenameFileEvent */
             $renamedFile = $event->getFile();
             $resourceType = $renamedFile->getResourceType();
             $sourcePath = $this->createPath($resourceType, $renamedFile->getFilePath());
             $targetPath = $this->createPath($resourceType, $renamedFile->getNewFilePath());
             return $sourcePath . ' -> ' . $targetPath;
         case CKFinderEvent::CREATE_RESIZED_IMAGE:
             /* @var $event \CKSource\CKFinder\Event\ResizeImageEvent */
             $resizedImage = $event->getResizedImage();
             return $this->createPath($resizedImage->getResourceType(), $resizedImage->getFilePath());
         case CKFinderEvent::CREATE_FOLDER:
             /* @var $event \CKSource\CKFinder\Event\CreateFolderEvent */
             return $this->createPath($workingFolder->getResourceType(), Path::combine($workingFolder->getPath(), $event->getNewFolderName()));
         case CKFinderEvent::DELETE_FOLDER:
             return $this->createPath($workingFolder->getResourceType(), $workingFolder->getPath());
         case CKFinderEvent::RENAME_FOLDER:
             /* @var $event \CKSource\CKFinder\Event\RenameFolderEvent */
             $resourceType = $workingFolder->getResourceType();
             return $this->createPath($resourceType, $workingFolder->getPath()) . ' -> ' . $this->createPath($resourceType, Path::combine(dirname($workingFolder->getPath()), $event->getNewFolderName()));
     }
 }
 /**
  * Constructor
  *
  * @param CKFinder     $app
  * @param MovedFile    $movedFile
  */
 public function __construct(CKFinder $app, MovedFile $movedFile)
 {
     $this->movedFile = $movedFile;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder     $app
  * @param UploadedFile $uploadedFile
  */
 public function __construct(CKFinder $app, UploadedFile $uploadedFile)
 {
     $this->uploadedFile = $uploadedFile;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder   $app
  * @param EditedFile $editedFile
  * @param string     $newContents new file contents
  */
 public function __construct(CKFinder $app, EditedFile $editedFile, $newContents)
 {
     $this->editedFile = $editedFile;
     $this->newContents = $newContents;
     parent::__construct($app);
 }
Beispiel #5
0
 /**
  * Constructor.
  *
  * @param CKFinder       $app
  * @param DownloadedFile $downloadedFile
  */
 public function __construct(CKFinder $app, DownloadedFile $downloadedFile)
 {
     $this->downloadedFile = $downloadedFile;
     parent::__construct($app);
 }
Beispiel #6
0
 /**
  * Constructor.
  *
  * @param CKFinder    $app
  * @param RenamedFile $renamedFile
  */
 public function __construct(CKFinder $app, RenamedFile $renamedFile)
 {
     $this->renamedFile = $renamedFile;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder      $app
  * @param WorkingFolder $workingFolder
  * @param string        $newFolderName
  */
 public function __construct(CKFinder $app, WorkingFolder $workingFolder, $newFolderName)
 {
     $this->workingFolder = $workingFolder;
     $this->newFolderName = $newFolderName;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder $app
  * @param string   $commandName
  * @param Response $response
  */
 public function __construct(CKFinder $app, $commandName, Response $response)
 {
     $this->commandName = $commandName;
     $this->response = $response;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder      $app
  * @param WorkingFolder $workingFolder
  */
 public function __construct(CKFinder $app, WorkingFolder $workingFolder)
 {
     $this->workingFolder = $workingFolder;
     parent::__construct($app);
 }
Beispiel #10
0
 /**
  * Constructor
  *
  * @param CKFinder     $app
  * @param CopiedFile   $copiedFile
  */
 public function __construct(CKFinder $app, CopiedFile $copiedFile)
 {
     $this->copiedFile = $copiedFile;
     parent::__construct($app);
 }
 /**
  * Constructor
  *
  * @param CKFinder      $app
  * @param DeletedFile   $deletedFile
  */
 public function __construct(CKFinder $app, DeletedFile $deletedFile)
 {
     $this->deletedFile = $deletedFile;
     parent::__construct($app);
 }
 /**
  * @param CKFinder             $app
  * @param ResizedImageAbstract $resizedImage
  */
 public function __construct(CKFinder $app, ResizedImageAbstract $resizedImage)
 {
     parent::__construct($app);
     $this->resizedImage = $resizedImage;
 }
Beispiel #13
0
 /**
  * Constructor
  *
  * @param CKFinder   $app
  * @param EditedFile $editedFile
  */
 public function __construct(CKFinder $app, EditedFile $editedFile)
 {
     $this->editedFile = $editedFile;
     parent::__construct($app);
 }
Beispiel #14
0
 /**
  * Constructor.
  *
  * @param CKFinder        $app
  * @param string          $commandName
  * @param CommandAbstract $commandObject
  */
 public function __construct(CKFinder $app, $commandName, CommandAbstract $commandObject)
 {
     $this->commandName = $commandName;
     $this->commandObject = $commandObject;
     parent::__construct($app);
 }