Beispiel #1
0
 public function build(fs\editable\file $file, $iWidth, $iHeight, $sFilter = '')
 {
     $sExtension = strtolower($file->getExtension());
     if ($sExtension == 'jpg') {
         $sExtension = 'jpeg';
     }
     $img = $this->resize($sExtension, $iWidth, $iHeight, true);
     if ($sFilter) {
         $this->filter($img, $sFilter);
     }
     $sFunction = 'image' . $sExtension;
     $sFunction($img, $file->getRealPath());
     imagedestroy($img);
 }
Beispiel #2
0
 public function saveFile(fs\editable\file $file, $bFormat = false)
 {
     if ($this->isEmpty()) {
         $this->throwException(sprintf('You cannot save empty document in %s', $file->asToken()));
     }
     if ($bFormat) {
         $this->getRoot()->prepareHTML();
     }
     $file->saveText($this->asString(dom\handler::STRING_HEAD));
 }
Beispiel #3
0
 protected function moveFile(fs\editable\file $file, $sName)
 {
     return $file->move($this->getDirectory(), $sName);
 }