コード例 #1
0
ファイル: File.php プロジェクト: moiseh/codegen
 public function proccessField(\Meta\Form $form)
 {
     // move the uploaded file to the files directory
     if ($this->uploadedFile()) {
         if (!$this->hasErrors()) {
             $tmpName = $_FILES[$this->altName()]['tmp_name'];
             $file = \Meta\FileSystem::getFilesPath() . '/' . $this->getValue();
             move_uploaded_file($tmpName, $file);
         }
     }
     parent::proccessField($form);
 }
コード例 #2
0
ファイル: File.php プロジェクト: moiseh/codegen
 public function getFullPath()
 {
     return \Meta\FileSystem::getFilesPath() . '/' . $this->name;
 }
コード例 #3
0
ファイル: FileSystem.php プロジェクト: moiseh/codegen
 public static function init()
 {
     if (!is_writable(\Meta\FileSystem::getFilesPath())) {
         \Meta\Flash::warning(t('The file system directory is not writable. To set permission, type: <b>chmod 777 ' . \Meta\FileSystem::getFilesPath() . ' -R</b>'));
     }
 }