예제 #1
0
파일: Plugin.php 프로젝트: GHarutyunyan/cms
 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     if ($args->isAction("add") && (!isset($args->getData()->thumb) || !$args->getData()->thumb)) {
         $this->add($args->getFile()->getPublicPath());
     }
     if ($args->isAction("delete")) {
         $this->remove((object) array("paths" => array($args->getFile()->getPublicPath())));
     }
 }
예제 #2
0
 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     if ($args->isAction("insert")) {
         $this->add($args->getFile()->getPublicPath());
     }
     if ($args->isAction("delete")) {
         $this->remove((object) array("paths" => array($args->getFile()->getPublicPath())));
     }
 }
예제 #3
0
 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     switch ($args->getAction()) {
         case MOXMAN_Core_FileActionEventArgs::ADD:
             if (!isset($args->getData()->format) && !isset($args->getData()->thumb)) {
                 $this->applyFormat($args->getFile());
             }
             break;
         case MOXMAN_Core_FileActionEventArgs::DELETE:
             if (!isset($args->getData()->format) && !isset($args->getData()->thumb)) {
                 $this->removeFormat($args->getFile());
             }
             break;
     }
 }
예제 #4
0
파일: Plugin.php 프로젝트: GHarutyunyan/cms
 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     switch ($args->getAction()) {
         case MOXMAN_Core_FileActionEventArgs::LIST_FILES:
             // Recalculate quota size when listing files
             $dirs = MOXMAN::getUserStorage()->get("quota.dirs", new stdClass());
             $this->recalcQuota($args->getFile(), $dirs);
             MOXMAN::getUserStorage()->put("quota.dirs", $dirs);
             break;
     }
 }
예제 #5
0
 public function onBeforeFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     switch ($args->getAction()) {
         case MOXMAN_Core_FileActionEventArgs::ADD:
             $args->setFile($this->renameFile($args->getFile()));
             break;
         case MOXMAN_Core_FileActionEventArgs::MOVE:
             $args->setTargetFile($this->renameFile($args->getTargetFile()));
             break;
     }
 }
예제 #6
0
파일: Plugin.php 프로젝트: GHarutyunyan/cms
 /**
  * Event handler function. Gets executed when a file action event occurs.
  *
  * @param MOXMAN_Core_FileActionEventArgs $args File action event arguments.
  */
 public function onFileAction(MOXMAN_Core_FileActionEventArgs $args)
 {
     if ($args->getAction() == MOXMAN_Core_FileActionEventArgs::DELETE) {
         if (!isset($args->getData()->thumb)) {
             $this->deleteThumbnail($args->getFile());
         }
     }
 }