Пример #1
0
 /**
  * @return Import_Preview
  */
 private function getPreview()
 {
     if (!isset($this->preview)) {
         $this->preview = new Import_Preview($this->file->getCsvContent());
     }
     return $this->preview;
 }
Пример #2
0
 /**
  * @param $name     string
  * @param $content  string binary data
  * @param $embedded boolean
  */
 public function __construct($name = null, $content = null, $embedded = null)
 {
     parent::__construct(isset($content) ? null : $name);
     if (isset($name) && isset($content)) {
         $this->name = $name;
     }
     if (isset($content)) {
         $this->content = $content;
     }
     if (isset($embedded)) {
         $this->embedded = $embedded;
     }
 }
Пример #3
0
 /**
  * @param $file File
  * @return Anchor
  */
 protected function buildFileAnchor(File $file)
 {
     /** @var $session_files Files */
     $session_files = Session::current()->get(Files::class, true);
     $session_files->files[] = $file;
     $image = $file->getType()->is('image') ? new Image(View::link(Session_File::class, 'output', [$file->name], ['size' => 22])) : '';
     $anchor = new Anchor(View::link(Session_File::class, 'image', [$file->name]), $image . new Span($file->name));
     if ($file->getType()->is('image')) {
         $anchor->setAttribute('target', Target::BLANK);
         //$anchor->addClass('popup');
     }
     return $anchor;
 }