コード例 #1
0
ファイル: file.php プロジェクト: knigherrant/decopatio
 /**
  * Prepares the data of the files
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return	
  */
 private function prepareFiles($value)
 {
     if (!is_array($value)) {
         $value = array();
     }
     $files = array();
     foreach ($value as $file) {
         $table = FD::table('file');
         $state = $table->load($file->id);
         if ($state) {
             $table->downloadLink = FRoute::fields(array('group' => $this->group, 'element' => $this->element, 'task' => 'download', 'id' => $this->field->id, 'uid' => $file->id, 'external' => true));
             $table->previewLink = FRoute::fields(array('group' => $this->group, 'element' => $this->element, 'task' => 'preview', 'id' => $this->field->id, 'uid' => $file->id, 'external' => true));
             $files[] = $table;
         }
     }
     return $files;
 }