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()))); } }
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()))); } }
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; } }
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; } }
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; } }
/** * 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()); } } }