Example #1
0
 function resizeImage()
 {
     $this->throw_if_not_magick();
     $oldimage = coreFfile::getRealPath($this->main->old_image_name_f);
     if ($this->main->isOn('copy_old_image_flag_f')) {
         lxfile_cp($this->main->getFullPath(), "{$this->main->root}/{$oldimage}");
     }
     $tfile = lx_tmp_file("resizeimage");
     lxfile_rm($tfile);
     $fp = $this->main->getFullPath();
     $fp = expand_real_root($fp);
     $ext = coreFfile::getExtension($fp);
     $tfile .= ".{$ext}";
     $geom = "{$this->main->image_width}x{$this->main->image_height}";
     lxfile_cp($this->main->getFullPath(), $tfile);
     lxuser_return($this->main->__username_o, "convert", "-scale", $geom, $tfile, $this->main->getFullPath());
     lxfile_rm($tfile);
 }
Example #2
0
 function updateform($subaction, $param)
 {
     $vlist = null;
     switch ($subaction) {
         case "thumbnail":
             $this->image_width = '20';
             $this->image_height = '20';
             $vlist['image_width'] = null;
             $vlist['image_height'] = null;
             return $vlist;
         case "convert_image":
             $extlist = array('gif' => 'gif', 'jpg' => 'jpg', 'png' => 'png');
             $ext = coreFfile::getExtension($this->nname);
             unset($extlist[$ext]);
             $vlist['nname'] = array('M', null);
             $vlist['new_format_f'] = array('s', $extlist);
             return $vlist;
         case "diskspace":
             $vlist['diskspace'] = array('M', "calculate disk space");
             $vlist['__v_button'] = 'calculate disk space';
             break;
         case "zip_file":
             dprintr($param);
             $vlist['zip_file_f'] = null;
             break;
         case "newdir":
             $vlist['newfolder_f'] = null;
             break;
         case "newfile":
             $vlist['newfile_f'] = null;
             break;
         case "content":
             return $this->show_content($param);
         case "fancyedit":
             $this->getContent();
             if ($this->isOn('not_full_size')) {
                 $vlist['fake_f'] = array('M', "File Too Large to Edit");
                 $vlist['__v_button'] = array();
             } else {
                 $vlist['content'] = array('V', $this->content);
                 $vlist['__v_button'] = array();
             }
             break;
         case "edit":
             $this->getContent();
             if ($this->isOn('not_full_size')) {
                 $vlist['fake_f'] = array('M', "File Too Large to Edit");
                 $vlist['__v_button'] = array();
             } else {
                 $vlist['content'] = null;
                 $vlist['__v_button'] = "Save";
             }
             break;
         case "zipextract":
             dprint($this->nname);
             $this->getContent();
             $vlist['zipcontent'] = null;
             $vlist['zip_extract_dir_f'] = array('m', dirname($this->nname));
             //$vlist['zip_overwrite_f'] = null;
             $vlist['__v_button'] = "Extract";
             return $vlist;
         case "perm":
             $vlist['file_permission_f'] = array();
             $vlist['recursive_f'] = array();
             break;
         case "rename":
             $vlist['new_name_f'] = array('m', basename($this->nname));
             $vlist['__v_button'] = "Rename";
             break;
         case "upload_s":
             $vlist['upload_file_f'] = null;
             $vlist['upload_overwrite_f'] = null;
             $vlist['__v_button'] = "Upload";
             return $vlist;
         case "download_from_ftp":
             $vlist['download_ftp_f'] = null;
             $vlist['download_username_f'] = null;
             $vlist['download_password_f'] = null;
             $vlist['download_ftp_file_f'] = null;
             $vlist['download_overwrite_f'] = null;
             $vlist['__v_button'] = "Upload";
             return $vlist;
         case "backupftpupload":
             $this->downloadFromBackup($vlist);
             return $vlist;
         case "download_from_http":
             $vlist['download_url_f'] = null;
             $vlist['download_overwrite_f'] = null;
             $vlist['__v_button'] = "Upload";
             return $vlist;
     }
     dprint($subaction);
     return $vlist;
 }