Exemplo n.º 1
0
 /**
  * Validate the incoming fileHandler object
  * @param modFileSystemResource $fileobj
  * @return boolean
  */
 public function validate(modFileSystemResource $fileobj)
 {
     if (empty($this->properties['path'])) {
         $this->addFieldError('path', $this->modx->lexicon('file_folder_err_invalid_path'));
     }
     if (!$fileobj->getParentDirectory()->isWritable()) {
         $this->addFieldError('path', $this->modx->lexicon('files_dirwritable'));
     }
     if (!$fileobj->exists()) {
         $this->addFieldError('path', $this->modx->lexicon('file_err_nf'));
     }
     return !$this->hasErrors();
 }
Exemplo n.º 2
0
 /**
  * @see modFileSystemResource::parseMode
  *
  * @param string $mode
  * @return boolean
  */
 protected function parseMode($mode = '')
 {
     if (empty($mode)) {
         $mode = $this->fileHandler->context->getOption('new_folder_permissions', '0755', $this->fileHandler->config);
     }
     return parent::parseMode($mode);
 }
Exemplo n.º 3
0
 /**
  * @see modFileSystemResource::parseMode
  */
 protected function parseMode($mode = '')
 {
     if (empty($mode)) {
         $mode = $this->modx->getOption('new_folder_permissions', null, '0755');
     }
     return parent::parseMode($mode);
 }