From aad11725fc1eb0efad8301c6d66652c4e48ea0f1 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Sat, 22 Nov 2003 03:05:00 +0000 Subject: [PATCH] Complete restyle and almost complete rewrite of the filemanager. Please help testing there's still a lot to do but it beginning to mature ;) When you want the old filemanager set the boolean switch "$experimental_new_code" to false in the head of index.php See todo file for what's more to come --- filemanager/CHANGELOG | 0 filemanager/inc/class.bofilemanager.inc.php | 88 +- filemanager/inc/class.bophpwebhosting.inc.php | 709 ---- filemanager/inc/class.sofilemanager.inc.php | 60 + filemanager/inc/class.sophpwebhosting.inc.php | 34 - filemanager/inc/class.uifilemanager.inc.php | 3297 +++++++---------- filemanager/inc/class.uiphpwebhosting.inc.php | 1060 ------ filemanager/inc/hook_preferences.inc.php | 3 +- filemanager/inc/hook_settings.inc.php | 65 + filemanager/index.php | 75 +- filemanager/indexold.php | 1785 +++++++++ filemanager/preferences.php | 16 +- filemanager/setup/phpgw_nl.lang | 92 +- filemanager/setup/setup.inc.php | 1 + filemanager/templates/default/edit_file.tpl | 33 + filemanager/templates/default/filelisting.tpl | 34 + .../default/images/button_bookmark.png | Bin 0 -> 996 bytes .../default/images/button_bookmark_add.png | Bin 0 -> 961 bytes .../default/images/button_cancel.png | Bin 0 -> 883 bytes .../default/images/button_copy_to.png | Bin 0 -> 590 bytes .../default/images/button_createdir.png | Bin 0 -> 1278 bytes .../default/images/button_createfile.png | Bin 0 -> 1058 bytes .../templates/default/images/button_cut.png | Bin 0 -> 1196 bytes .../default/images/button_delete.png | Bin 0 -> 951 bytes .../default/images/button_download.png | Bin 0 -> 663 bytes .../templates/default/images/button_edit.png | Bin 0 -> 1076 bytes .../default/images/button_edit_comments.png | Bin 0 -> 1101 bytes .../default/images/button_edit_preview.png | Bin 0 -> 1230 bytes .../templates/default/images/button_goto.png | Bin 0 -> 1263 bytes .../templates/default/images/button_home.png | Bin 0 -> 1617 bytes .../templates/default/images/button_info.png | Bin 0 -> 1195 bytes .../templates/default/images/button_mail.png | Bin 0 -> 1066 bytes .../default/images/button_move_to.png | Bin 0 -> 998 bytes .../templates/default/images/button_ok.png | Bin 0 -> 769 bytes .../templates/default/images/button_paste.png | Bin 0 -> 881 bytes .../default/images/button_reload.png | Bin 0 -> 1157 bytes .../default/images/button_rename.png | Bin 0 -> 1253 bytes .../templates/default/images/button_save.png | Bin 0 -> 991 bytes .../default/images/button_search.png | Bin 0 -> 1382 bytes .../default/images/button_search2.png | Bin 0 -> 1393 bytes .../templates/default/images/button_trash.png | Bin 0 -> 1348 bytes .../templates/default/images/button_tree.png | Bin 0 -> 667 bytes .../templates/default/images/button_up.png | Bin 0 -> 1128 bytes .../default/images/button_upload.png | Bin 0 -> 1571 bytes .../templates/default/images/button_zip.png | Bin 0 -> 1336 bytes .../templates/default/images/editcopy.png | Bin 0 -> 590 bytes .../templates/default/images/editcut.png | Bin 0 -> 1196 bytes .../templates/default/images/editpaste.png | Bin 0 -> 881 bytes .../default/images/mime16_directory.png | Bin 0 -> 695 bytes .../default/images/mime16_text_plain.png | Bin 0 -> 805 bytes .../default/images/mime16_unknown.png | Bin 0 -> 544 bytes .../images/source/buttonbackground.xcf | Bin 0 -> 1846 bytes .../templates/default/images/spacer.gif | Bin 0 -> 43 bytes filemanager/templates/default/pref.tpl | 2 +- filemanager/templates/default/pref_list.tpl | 2 +- filemanager/templates/default/upload.tpl | 30 + filemanager/todo | 27 +- 57 files changed, 3570 insertions(+), 3843 deletions(-) create mode 100644 filemanager/CHANGELOG delete mode 100755 filemanager/inc/class.bophpwebhosting.inc.php create mode 100755 filemanager/inc/class.sofilemanager.inc.php delete mode 100755 filemanager/inc/class.sophpwebhosting.inc.php delete mode 100755 filemanager/inc/class.uiphpwebhosting.inc.php create mode 100644 filemanager/inc/hook_settings.inc.php create mode 100755 filemanager/indexold.php create mode 100644 filemanager/templates/default/edit_file.tpl create mode 100644 filemanager/templates/default/filelisting.tpl create mode 100644 filemanager/templates/default/images/button_bookmark.png create mode 100644 filemanager/templates/default/images/button_bookmark_add.png create mode 100644 filemanager/templates/default/images/button_cancel.png create mode 100644 filemanager/templates/default/images/button_copy_to.png create mode 100644 filemanager/templates/default/images/button_createdir.png create mode 100644 filemanager/templates/default/images/button_createfile.png create mode 100644 filemanager/templates/default/images/button_cut.png create mode 100644 filemanager/templates/default/images/button_delete.png create mode 100644 filemanager/templates/default/images/button_download.png create mode 100644 filemanager/templates/default/images/button_edit.png create mode 100644 filemanager/templates/default/images/button_edit_comments.png create mode 100644 filemanager/templates/default/images/button_edit_preview.png create mode 100644 filemanager/templates/default/images/button_goto.png create mode 100644 filemanager/templates/default/images/button_home.png create mode 100644 filemanager/templates/default/images/button_info.png create mode 100644 filemanager/templates/default/images/button_mail.png create mode 100644 filemanager/templates/default/images/button_move_to.png create mode 100644 filemanager/templates/default/images/button_ok.png create mode 100644 filemanager/templates/default/images/button_paste.png create mode 100644 filemanager/templates/default/images/button_reload.png create mode 100644 filemanager/templates/default/images/button_rename.png create mode 100644 filemanager/templates/default/images/button_save.png create mode 100644 filemanager/templates/default/images/button_search.png create mode 100644 filemanager/templates/default/images/button_search2.png create mode 100644 filemanager/templates/default/images/button_trash.png create mode 100644 filemanager/templates/default/images/button_tree.png create mode 100644 filemanager/templates/default/images/button_up.png create mode 100644 filemanager/templates/default/images/button_upload.png create mode 100644 filemanager/templates/default/images/button_zip.png create mode 100644 filemanager/templates/default/images/editcopy.png create mode 100644 filemanager/templates/default/images/editcut.png create mode 100644 filemanager/templates/default/images/editpaste.png create mode 100644 filemanager/templates/default/images/mime16_directory.png create mode 100644 filemanager/templates/default/images/mime16_text_plain.png create mode 100644 filemanager/templates/default/images/mime16_unknown.png create mode 100644 filemanager/templates/default/images/source/buttonbackground.xcf create mode 100755 filemanager/templates/default/images/spacer.gif create mode 100644 filemanager/templates/default/upload.tpl diff --git a/filemanager/CHANGELOG b/filemanager/CHANGELOG new file mode 100644 index 0000000000..e69de29bb2 diff --git a/filemanager/inc/class.bofilemanager.inc.php b/filemanager/inc/class.bofilemanager.inc.php index a8e534b0b7..047298307f 100755 --- a/filemanager/inc/class.bofilemanager.inc.php +++ b/filemanager/inc/class.bofilemanager.inc.php @@ -4,6 +4,7 @@ { var $so; var $vfs; + var $sep; var $file_attributes; var $help_info; @@ -51,16 +52,13 @@ function bofilemanager() { + $this->so = CreateObject('filemanager.sofilemanager'); + $this->so->db_init(); + $this->vfs = CreateObject('phpgwapi.vfs'); - // This comes from the top of main (pim) // error_reporting (4); - /* if (@!is_object($GLOBALS['phpgw']->vfs)) - { - $GLOBALS['phpgw']->vfs = CreateObject ('phpgwapi.vfs'); - } - */ ### Start Configuration Options ### ### These are automatically set in phpGW - do not edit ### @@ -97,35 +95,6 @@ define ('NULL', ''); } - - // FIXME - require (PHPGW_APP_INC . '/db.inc.php'); - - /* Set up any initial db settings */ - db_init (); - //die('hallo?'); - - ### - # Get user settings from database - ### - - /* We have to define these by hand in phpGW, or rely on it's templates */ - - define ('HTML_TABLE_FILES_HEADER_BG_COLOR', ''); - define ('HTML_TABLE_FILES_HEADER_TEXT_COLOR', 'maroon'); - define ('HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR', '#cccccc'); - define ('HTML_TABLE_FILES_COLUMN_HEADER_TEXT_COLOR', '#000000'); - define ('HTML_TABLE_FILES_BG_COLOR', '#dedede'); - define ('HTML_TABLE_FILES_TEXT_COLOR', 'maroon'); - define ('HTML_TEXT_ERROR_COLOR', 'red'); - define ('HTML_TEXT_NAVIGATION_BACK_TO_USER', lang('Back to file manager')); - - ### - # Need to include this here so they recognize the settings - ### - - // require (PHPGW_APP_INC . '/html.inc.php'); - ### # Define the list of file attributes. Format is "internal_name" => "Displayed name" # This is used both by internally and externally for things like preferences @@ -152,47 +121,10 @@ # but it does do something ### - $this->help_info = Array( -array ("up", "The Up button takes you to the directory above the current directory. For example, if you're in /home/jdoe/mydir, the Up button would take you to /home/jdoe."), -array ("directory_name", "The name of the directory you're currently in."), -array ("home", "The Home button takes you to your personal home directory."), -array ("sort_by", "Click on any of the column headers to sort the list by that column."), -array ("filename", "The name of the file or directory."), -array ("mime_type", "The MIME-type of the file. Examples include text/plain, text/html, image/jpeg. The special MIME-type Directory is used for directories."), -array ("size", "The size of the file or directory in the most convenient units: bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB). Sizes for directories include subfiles and subdirectories."), -array ("created", "When the file or directory was created."), -array ("modified", "When the file or directory was last modified."), -array ("owner", "The owner of the file or directory. This can be a user or group name."), -array ("created_by", "Displays who created the file or directory."), -array ("modified_by", "Displays who last modified the file or directory."), -array ("application", "The application associated with the file or directory. Usually the application used to create it. A blank application field is ok."), -array ("comment", "The comment for the file or directory. Comments can be set when creating the file or directory, and created or edited any time thereafter."), -array ("version", "The current version for the file or directory. Clicking on the version number will display a list of changes made to the file or directory."), -array ("edit", "Edit the text of the selected file(s). You can select more than one file; this is useful when you want to copy part of one file into another. Clicking Preview will show you a preview of the file. Click Save to save your changes."), -array ("rename", "Rename the selected file(s). You can select as many files or directories as you want. You are presented with a text field to enter the new name of each file or directory."), -array ("delete", "Delete the selected file(s). You can select as many files or directories as you want. When deleting directories, the entire directory and all of its contents are deleted. You will not be prompted to make sure you want to delete the file(s); make sure you really want to delete them before clicking Delete."), -array ("edit_comments", "Create a comment for a file or directory, or edit an existing comment. You can select as many files or directories as you want."), -array ("go_to", "The Go to button takes you to the directory selected in the drop down [directory_list|Directory List]."), -array ("copy_to", "This will copy all selected files and directories to the directory selected in the drop down [directory_list|Directory List]."), -array ("move_to", "This will move all selected files and directories to the directory selected in the drop down [directory_list|Directory List]."), -array ("directory_list", "The Directory List contains a list of all directories you have (at least) read access to. Selecting a directory and clicking one of the [go_to|Go to]/[copy_to|Copy to]/[move_to|Move to] buttons will perform the selected action on that directory. For example, if you select \"/home/somegroup/reports\" from the Directory List, and click the \"[copy_to|Copy to]\" button, all selected files and directories will be copied to \"/home/somegroup/reports\"."), -array ("download", "Download the first selected file to your local computer. You can only download one file at a time. Directories cannot be downloaded, only files."), -array ("create_folder", "Creates a directory (folder == directory). The name of the directory is specified in the text box next to the Create Folder button."), -array ("create_file", "Creates a file in the current directory. The name of the file is specified in the text box next to the Create File button. After clicking the Create File button you will be presented with the [edit|Edit] screen, where you may edit the file you just created. If you do not with to make any changes to the file at this time, simply click the Save button and the file will be saved as an empty file."), -array ("command_line", "Enter a Unix-style command line here, which will be executed when the [execute|Execute] button is pressed. If you don't know what this is, you probably should turn the option off in the Preferences."), -array ("execute", "Clicking the Execute button will execute the Unix-style [command_line|command line] specified in the text box above. If you don't know what this is, you probably should turn the option off in the Preferences."), -array ("update", "Sync the database with the filesystem for the current directory. This is useful if you use another interface to access the same files. Any new files or directories in the current directory will be read in, and the attributes for the other files will be updated to reflect any changes to the filesystem. Update is run automatically every few page loads (currently every 20 page loads as of this writing, but that may have changed by now)."), -array ("file_stats", "Various statistics on the number and size of the files in the current directory. In some situations, these reflect different statistics. For example, when in / or the base directory."), -array ("upload_file", "The full path of the local file to upload. You can type it in or use the Browse.. button to select it. The file will be uploaded to the current directory. You cannot upload directories, only files."), -array ("upload_comment", "The inital comment to use for the newly uploaded file. Totally optional and completely arbitrary. You can [edit_comments|create or edit the comment] at any time in the future."), -array ("upload_files", "This will upload the files listed in the input boxes above, and store them in the current directory."), -array ("show_upload_fields", "This setting determines how many [upload_files|upload fields] will be shown at once. You can change the default number that will be shown in the [preferences].") -); - } - function borkb ($size, $enclosed = NULL, $return = 0) + function borkb ($size, $enclosed = NULL, $return = 1) { if (!$size) $size = 0; @@ -270,7 +202,7 @@ array ("show_upload_fields", "This setting determines how many [upload_files|upl global $phpgw; if ($lang) - $string = $this->translate ($string); + $string = lang($string); if ($times == NULL) $times = 1; @@ -294,6 +226,7 @@ array ("show_upload_fields", "This setting determines how many [upload_files|upl function string_encode ($string, $return = False) { + //var_dump($string); if (preg_match ("/=(.*)(&|$)/U", $string)) { $rstring = $string; @@ -342,12 +275,5 @@ array ("show_upload_fields", "This setting determines how many [upload_files|upl return ($this->eor ($rstring, $return)); } - - function translate ($text) - { - return ($GLOBALS['phpgw']->lang($text)); - } - - } ?> diff --git a/filemanager/inc/class.bophpwebhosting.inc.php b/filemanager/inc/class.bophpwebhosting.inc.php deleted file mode 100755 index 63e717aaea..0000000000 --- a/filemanager/inc/class.bophpwebhosting.inc.php +++ /dev/null @@ -1,709 +0,0 @@ - True - ); - - var $so; - var $vfs; - var $rootdir; - var $fakebase; - var $appname; - var $settings; - var $filesdir; - var $hostname; - var $userinfo = Array(); - var $homedir; - var $file_attributes; - var $help_info; - - var $errors; - - var $rename; - var $delete; - var $go; - var $copy; - var $move; - var $download; - var $createdir; - var $newdir; - var $createfile; - var $newfile; - - var $fileman = Array(); - var $op; - var $file; - var $help_name; - var $path; - var $disppath; - var $dispsep; - var $sortby = 'name'; - var $messages = Array(); - var $renamefiles; - var $comment_files = Array(); - var $show_upload_boxes = 5; - var $memberships; - var $now; - var $matches; - -// var $debug = True; - var $debug = False; - - function bophpwebhosting() - { - $this->vfs = CreateObject('phpgwapi.vfs'); - - $to_decode = Array( - /* - Decode - 'var' when 'avar' == 'value' - or - 'var' when 'var' is set - */ - - 'errors', - 'op', - 'path', - 'file', - 'todir', - 'sortby', - 'fileman', - 'messages', - 'help_name', - 'renamefiles', - 'comment_files', - 'show_upload_boxes', - 'submit', - 'rename', - 'delete', - 'go', - 'copy', - 'move', - 'download', - 'newfile', - 'createfile', - 'newdir', - 'createdir' - ); - - $c_to_decode = count($to_decode); - for($i=0;$i<$c_to_decode;$i++) - { - $this->initialize_vars($to_decode[$i]); - } - - $this->rootdir = $this->vfs->basedir; - $this->fakebase = $this->vfs->fakebase; - $this->appname = $GLOBALS['phpgw_info']['flags']['currentapp']; - $this->settings = $GLOBALS['phpgw_info']['user']['preferences'][$this->appname]; - - if(stristr($this->rootdir,PHPGW_SERVER_ROOT)) - { - $this->filesdir = substr($this->rootdir,strlen(PHPGW_SERVER_ROOT)); - } - else - { - $this->filesdir = ''; - } - $this->hostname = $GLOBALS['phpgw_info']['server']['webserver_url'].$this->filesdir; - $this->userinfo['username'] = $GLOBALS['phpgw_info']['user']['account_id']; - $this->userinfo['account_lid'] = $GLOBALS['phpgw']->accounts->id2name($this->userinfo['username']); - $this->userinfo['hdspace'] = 10000000000; - $this->homedir = $this->fakebase.SEP.$this->userinfo['account_lid']; - - if(!defined('NULL')) - { - define('NULL',''); - } - - $this->so = CreateObject('filemanager.sophpwebhosting'); - - $this->file_attributes = Array( - 'name' => 'Filename', - 'deletable' => 'Deletable', - 'mime_type' => 'MIME Type', - 'size' => 'Size', - 'created' => 'Created', - 'modified' => 'Modified', - 'owner' => 'Owner', - 'createdby_id' => 'Created by', - 'modifiedby_id' => 'Modified by', - 'app' => 'Application', - 'comment' => 'Comment', - 'version' => 'Version' - ); - - if($this->go) - { - $this->path = $this->todir; - } - - if($this->debug) - { - echo 'DEBUG: bo.bophpwebhosting: PATH = '.$this->path.'
'."\n"; - } - - if(!$this->path) - { - $this->path = $this->vfs->pwd(); - if (!$this->path || $this->vfs->pwd(False) == '') - { - $this->path = $this->homedir; - } - } - $this->vfs->cd(False,False,Array(RELATIVE_NONE)); - $this->vfs->cd($this->path,False,Array(RELATIVE_NONE)); - - $this->pwd = $this->vfs->pwd(); - - if (!$this->cwd = substr($this->path,strlen($this->homedir) + 1)) - { - $this->cwd = '/'; - } - else - { - $this->cwd = substr($this->pwd,strrpos($this->pwd,'/')+1); - } - - $this->disppath = $this->path; - - /* This just prevents // in some cases */ - if($this->path == '/') - { - $this->dispsep = ''; - } - else - { - $this->dispsep = '/'; - } - - if (!($this->lesspath = substr($this->path,0,strrpos($this->path, '/')))) - { - $this->lesspath = '/'; - } - - $this->now = date('Y-m-d'); - - if($this->debug) - { - echo 'PHPWebHosting debug:
' - . 'path: '.$this->path.'
' - . 'disppath: '.$this->disppath.'
' - . 'cwd: '.$this->cwd.'
' - . 'lesspath: '.$this->lesspath.'
' - . 'fakebase: '.$this->fakebase.'
' - . 'homedir: '.$this->homedir.'

' - . 'phpGW debug:
' - . 'real getabsolutepath: '.$this->vfs->getabsolutepath(False, False, False).'
' - . 'fake getabsolutepath: '.$this->vfs->getabsolutepath(False).'
' - . 'appsession: '.$GLOBALS['phpgw']->session->appsession('vfs','').'
' - . 'pwd: '.$this->vfs->pwd().'
'; - } - - - ### - # Get their memberships to be used throughout the script - ### - - $this->memberships = $GLOBALS['phpgw']->accounts->membership($this->userinfo['username']); - - if(!is_array($this->memberships)) - { - settype($this->memberships,'array'); - $this->memberships = Array(); - } - - $group_applications = CreateObject('phpgwapi.applications'); - while(list($num,$group_array) = each($this->memberships)) - { - $group_applications->account_id = get_account_id($GLOBALS['phpgw']->accounts->name2id($group_array['account_name'])); - $this->membership_applications[$group_array['account_name']] = $group_applications->read_account_specific(); - } - - ### - # We determine if they're in their home directory or a group's directory, - # and set the VFS working_id appropriately - ### - if((preg_match('+^'.$this->fakebase.'\/(.*)(\/|$)+U',$this->path,$this->matches)) && $this->matches[1] != $this->userinfo['account_lid']) - { - $this->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id($matches[1]); - } - else - { - $this->vfs->working_id = $this->userinfo['username']; - } - } - - function initialize_vars($name) - { - $var = ($GLOBALS['HTTP_GET_VARS'][$name]?$GLOBALS['HTTP_GET_VARS'][$name]:''); - $var = ($GLOBALS['HTTP_POST_VARS'][$name]?$GLOBALS['HTTP_POST_VARS'][$name]:$var); - if($this->debug) - { - echo ''."\n"; - } - if(is_array($this->$name) && $var) - { - $temp = Array(); - while(list($varkey,$varvalue) = each($var)) - { - if(is_int($varkey)) - { - $temp[$varkey] = urldecode($varvalue); - } - else - { - $temp[urldecode($varkey)] = $varvalue; - } - } - } - elseif($var) - { - $temp = urldecode($var); - } - if(isset($temp)) - { - $this->$name = $temp; - } - } - - function load_files() - { - ### - # Read in file info from database to use in the rest of the script - # $fakebase is a special directory. In that directory, we list the user's - # home directory and the directories for the groups they're in - ### - - if ($this->path == $this->fakebase) - { - if (!$this->vfs->file_exists($this->homedir,Array(RELATIVE_NONE))) - { - $this->vfs->mkdir($this->homedir,Array(RELATIVE_NONE)); - } - - $ls_array = $this->vfs->ls($this->homedir,Array(RELATIVE_NONE),False,False,True); - $this->files_array[] = $ls_array[0]; - - reset ($this->memberships); - while(list($num, $group_array) = each($this->memberships)) - { - ### - # If the group doesn't have access to this app, we don't show it - ### - - if (!$this->membership_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) - { - continue; - } - - if (!$this->vfs->file_exists($this->fakebase.'/'.$group_array['account_name'],Array(RELATIVE_NONE))) - { - $this->vfs->mkdir($this->fakebase.'/'.$group_array['account_name'],Array(RELATIVE_NONE)); - $this->vfs->set_attributes($this->fakebase.'/'.$group_array['account_name'],Array(RELATIVE_NONE),Array('owner_id' => $group_array['account_id'], 'createdby_id' => $group_array['account_id'])); - } - - $ls_array = $this->vfs->ls($this->fakebase.'/'.$group_array['account_name'],Array(RELATIVE_NONE),False,False,True); - - $this->files_array[] = $ls_array[0]; - } - } - else - { - $ls_array = $this->vfs->ls($this->path,Array(RELATIVE_NONE),False,False,False,$this->sortby); - - if ($this->debug) - { - echo '# of files found in "'.$this->path.'" : '.count($ls_array).'
'."\n"; - } - - while(list($num,$file_array) = each($ls_array)) - { - $this->files_array[] = $file_array; - if ($this->debug) - { - echo 'Filename: '.$file_array['name'].'
'."\n"; - } - } - } - if(!is_array($this->files_array)) - { - $this->files_array = Array(); - } - - return $this->files_array; - } - - function convert_date($data) - { - if($data && $data != '0000-00-00') - { - $year = substr($data,0,4); - $month = substr($data,5,2); - $day = substr($data,8,2); - $datetime = mktime(0,0,0,$month,$day,$year); - $data = date($GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'],$datetime); - } - else - { - $data = ' '; - } - return $data; - } - - function f_go() - { - $this->path = $this->todir; - } - - function f_delete() - { - $numoffiles = count($this->fileman); - for($i=0;$i!=$numoffiles;$i++) - { - if($this->fileman[$i]) - { - $ls_array = $this->vfs->ls($this->path.SEP.$this->fileman[$i],Array(RELATIVE_NONE),False,False,True); - $fileinfo = $ls_array[0]; - if($fileinfo) - { - if($fileinfo['mime_type'] == 'Directory') - { - $mime_type = $fileinfo['mime_type']; - } - else - { - $mime_type = 'File'; - } - if($this->vfs->delete($this->path.SEP.$this->fileman[$i],Array(RELATIVE_USER_NONE))) - { - $errors[] = ''.$mime_type.' Deleted: '.$this->path.SEP.$this->fileman[$i].''; - } - else - { - $errors[] = 'Could not delete '.$this->path.SEP.$this->fileman[$i].''; - } - } - else - { - $errors[] = ''.$this->path.SEP.$this->fileman[$i].' does not exist!'; - } - } - } - return $errors; - } - - function f_copy() - { - $numoffiles = count($this->fileman); - for($i=0;$i!=$numoffiles;$i++) - { - if($this->fileman[$i]) - { - if($this->vfs->cp($this->path.SEP.$this->fileman[$i],$this->todir.SEP.$this->fileman[$i],Array(RELATIVE_NONE,RELATIVE_NONE))) - { - $errors[] = 'File copied: '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].''; - } - else - { - $errors[] = 'Could not copy '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].''; - } - } - } - return $errors; - } - - function f_move() - { - $numoffiles = count($this->fileman); - for($i=0;$i!=$numoffiles;$i++) - { - if($this->fileman[$i]) - { - if($this->vfs->mv($this->path.SEP.$this->fileman[$i],$this->todir.SEP.$this->fileman[$i],Array(RELATIVE_NONE,RELATIVE_NONE))) - { - $errors[] = 'File moved: '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].''; - } - else - { - $errors[] = 'Could not move '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].''; - } - } - } - return $errors; - } - - function f_download() - { - $numoffiles = count($this->fileman); - for($i=0;$i!=$numoffiles;$i++) - { - if($this->fileman[$i] && $this->vfs->file_exists($this->bo->path.SEP.$this->bo->fileman[$i],Array(RELATIVE_NONE))) - { - execmethod($this->appname.'.ui'.$this->appname.'.view_file', - Array( - 'path' => $this->path, - 'file' => $this->fileman[$i] - ) - ); - $errors[] = 'File downloaded: '.$this->path.SEP.$this->fileman[$i].''; - } - else - { - $errors[] = 'File does not exist: '.$this->path.SEP.$this->fileman[$i].''; - } - } - return $errors; - } - - function f_newdir() - { - if ($this->newdir && $this->createdir) - { - if ($badchar = $this->bad_chars($this->createdir,True,True)) - { - $errors[] = 'Directory names cannot contain "'.$badchar.'"'; - return $errors; - } - - if (substr($this->createdir,strlen($this->createdir)-1,1) == ' ' || substr($this->createdir,0,1) == ' ') - { - $errors[] = 'Cannot create directory because it begins or ends in a space'; - return $errors; - } - - $ls_array = $this->vfs->ls($this->path.SEP.$this->createdir,Array(RELATIVE_NONE),False,False,True); - $fileinfo = $ls_array[0]; - - if ($fileinfo['name']) - { - if ($fileinfo['mime_type'] != 'Directory') - { - $errors[] = ''.$fileinfo['name'].' already exists as a file'; - } - else - { - $errors[] = 'Directory '.$fileinfo['name'].' already exists.'; - } - } - else - { - if ($this->vfs->mkdir($this->path.SEP.$this->createdir,Array(RELATIVE_NONE))) - { - $errors[] = 'Created directory '.$this->path.SEP.$this->createdir.''; -// $this->path = $this->path.SEP.$this->createdir; - } - else - { - $errors[] = 'Could not create '.$this->path.SEP.$this->createdir.''; - } - } - } - return $errors; - } - - function f_newfile() - { - if ($this->newfile && $this->createfile) - { - if($badchar = $this->bad_chars($this->createfile,True,True)) - { - $errors[] = 'Filenames cannot contain "'.$badchar.'"'; - return $errors; - } - if($this->vfs->file_exists($this->path.SEP.$this->createfile,Array(RELATIVE_NONE))) - { - $errors[] = 'File '.$this->path.SEP.$this->createfile.' already exists. Please edit it or delete it first.'; - return $errors; - } - if(!$this->vfs->touch($this->path.SEP.$this->createfile,Array(RELATIVE_NONE))) - { - $errors[] = 'File '.$this->path.SEP.$this->createfile.' could not be created.'; - } - } - else - { - $errors[] = 'Filename not provided!'; - } - return $errors; - } - - function load_help_info() - { - $this->help_info = Array( - array ("up", "The Up button takes you to the directory above the current directory. For example, if you're in /home/jdoe/mydir, the Up button would take you to /home/jdoe."), - array ("directory_name", "The name of the directory you're currently in."), - array ("home", "The Home button takes you to your personal home directory."), - array ("sort_by", "Click on any of the column headers to sort the list by that column."), - array ("filename", "The name of the file or directory."), - array ("mime_type", "The MIME-type of the file. Examples include text/plain, text/html, image/jpeg. The special MIME-type Directory is used for directories."), - array ("size", "The size of the file or directory in the most convenient units: bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB). Sizes for directories include subfiles and subdirectories."), - array ("created", "When the file or directory was created."), - array ("modified", "When the file or directory was last modified."), - array ("owner", "The owner of the file or directory. This can be a user or group name."), - array ("created_by", "Displays who created the file or directory."), - array ("modified_by", "Displays who last modified the file or directory."), - array ("application", "The application associated with the file or directory. Usually the application used to create it. A blank application field is ok."), - array ("comment", "The comment for the file or directory. Comments can be set when creating the file or directory, and created or edited any time thereafter."), - array ("version", "The current version for the file or directory. Clicking on the version number will display a list of changes made to the file or directory."), - array ("edit", "Edit the text of the selected file(s). You can select more than one file; this is useful when you want to copy part of one file into another. Clicking Preview will show you a preview of the file. Click Save to save your changes."), - array ("rename", "Rename the selected file(s). You can select as many files or directories as you want. You are presented with a text field to enter the new name of each file or directory."), - array ("delete", "Delete the selected file(s). You can select as many files or directories as you want. When deleting directories, the entire directory and all of its contents are deleted. You will not be prompted to make sure you want to delete the file(s); make sure you really want to delete them before clicking Delete."), - array ("edit_comments", "Create a comment for a file or directory, or edit an existing comment. You can select as many files or directories as you want."), - array ("go_to", "The Go to button takes you to the directory selected in the drop down [directory_list|Directory List]."), - array ("copy_to", "This will copy all selected files and directories to the directory selected in the drop down [directory_list|Directory List]."), - array ("move_to", "This will move all selected files and directories to the directory selected in the drop down [directory_list|Directory List]."), - array ("directory_list", "The Directory List contains a list of all directories you have (at least) read access to. Selecting a directory and clicking one of the [go_to|Go to]/[copy_to|Copy to]/[move_to|Move to] buttons will perform the selected action on that directory. For example, if you select \"/home/somegroup/reports\" from the Directory List, and click the \"[copy_to|Copy to]\" button, all selected files and directories will be copied to \"/home/somegroup/reports\"."), - array ("download", "Download the first selected file to your local computer. You can only download one file at a time. Directories cannot be downloaded, only files."), - array ("create_folder", "Creates a directory (folder == directory). The name of the directory is specified in the text box next to the Create Folder button."), - array ("create_file", "Creates a file in the current directory. The name of the file is specified in the text box next to the Create File button. After clicking the Create File button you will be presented with the [edit|Edit] screen, where you may edit the file you just created. If you do not with to make any changes to the file at this time, simply click the Save button and the file will be saved as an empty file."), - array ("command_line", "Enter a Unix-style command line here, which will be executed when the [execute|Execute] button is pressed. If you don't know what this is, you probably should turn the option off in the Preferences."), - array ("execute", "Clicking the Execute button will execute the Unix-style [command_line|command line] specified in the text box above. If you don't know what this is, you probably should turn the option off in the Preferences."), - array ("update", "Sync the database with the filesystem for the current directory. This is useful if you use another interface to access the same files. Any new files or directories in the current directory will be read in, and the attributes for the other files will be updated to reflect any changes to the filesystem. Update is run automatically every few page loads (currently every 20 page loads as of this writing, but that may have changed by now)."), - array ("file_stats", "Various statistics on the number and size of the files in the current directory. In some situations, these reflect different statistics. For example, when in / or the base directory."), - array ("upload_file", "The full path of the local file to upload. You can type it in or use the Browse.. button to select it. The file will be uploaded to the current directory. You cannot upload directories, only files."), - array ("upload_comment", "The inital comment to use for the newly uploaded file. Totally optional and completely arbitrary. You can [edit_comments|create or edit the comment] at any time in the future."), - array ("upload_files", "This will upload the files listed in the input boxes above, and store them in the current directory."), - array ("show_upload_fields", "This setting determines how many [upload_files|upload fields] will be shown at once. You can change the default number that will be shown in the preferences.") - ); - } - - function borkb ($size,$enclosed = NULL,$return = 0) - { - if(!$size) - { - $size = 0; - } - - if($enclosed) - { - $left = '('; - $right = ')'; - } - - if($size<1024) - { - return $left.$size.' B  '.$right; - } - else - { - return $left.round($size/1024).' KB'.$right; - } - } - - ### - # Check for and return the first unwanted character - ### - - function bad_chars($string,$all = True,$return = 0) - { - if($all) - { - if (preg_match("-([\\/<>\'\"\&])-", $string, $badchars)) - { - $rstring = $badchars[1]; - } - } - else - { - if (preg_match("-([\\/<>])-", $string, $badchars)) - { - $rstring = $badchars[1]; - } - } - return $rstring; - } - - ### - # Match character in string using ord (). - ### - function ord_match($string, $charnum) - { - for ($i=0;$ihostname,$string)) - { - $rstring = ereg_replace('^'.$this->hostname.'/','',$string); - $rstring = preg_replace("/(.*)(\/|$)/Ue","rawurlencode (base64_encode ('\\1')).'\\2'",$rstring); - $rstring = $this->hostname.'/'.$rstring; - } - else - { - $rstring = rawurlencode($string); - - /* Terrible hack, decodes all /'s back to normal */ - $rstring = preg_replace("/%2F/",'/',$rstring); - } - - return($this->eor($rstring,$return)); - } - - function string_decode($string,$return = False) - { - $rstring = rawurldecode($string); - - return($this->eor($rstring,$return)); - } - - ### - # HTML encode a string - # This should be used with anything in an HTML tag that might contain < or > - ### - - function html_encode($string, $return) - { - return($this->eor(htmlspecialchars($string),$return)); - } - - function translate ($text) - { - return($GLOBALS['phpgw']->lang($text)); - } - } -?> diff --git a/filemanager/inc/class.sofilemanager.inc.php b/filemanager/inc/class.sofilemanager.inc.php new file mode 100755 index 0000000000..66300e8d86 --- /dev/null +++ b/filemanager/inc/class.sofilemanager.inc.php @@ -0,0 +1,60 @@ +db = $GLOBALS['phpgw']->db; +// $this->phpgw=$GLOBALS[phpgw]; +// $this->phpgw_info=$GLOBALS[phpgw_info]; + } + + /* Any initializations that need to be done */ + function db_init () + { + //global $phpgw; + //global $phpgw_info; + + $this->db->Auto_Free = 0; + } + + /* General SQL query */ + function db_query ($query) + { + // global $phpgw; + // global $phpgw_info; + + return $this->db->query ($query); + } + + /* Fetch next array for $query_id */ + function db_fetch_array ($query_id) + { +// global $phpgw; +// global $phpgw_info; + + // $phpgw->db->Query_ID = $query_id; + $this->db->next_record (); + return $this->db->Record; + } + + /* + General wrapper for all other db calls + Calls in here are simply returned, so not all will work + */ + function db_call ($function, $query_id) + { +// global $phpgw; +// global $phpgw_info; + + // $phpgw->db->Query_ID = $query_id; + return $this->db->$function (); + } + + + } +?> diff --git a/filemanager/inc/class.sophpwebhosting.inc.php b/filemanager/inc/class.sophpwebhosting.inc.php deleted file mode 100755 index f3f5097500..0000000000 --- a/filemanager/inc/class.sophpwebhosting.inc.php +++ /dev/null @@ -1,34 +0,0 @@ -db->Auto_Free = 0; - } - - /* General SQL query */ - function query($query) - { - return $GLOBALS['phpgw']->db->query($query); - } - - /* Fetch next array for $query_id */ - function fetch_array($query_id) - { - $GLOBALS['phpgw']->db->next_record (); - return $GLOBALS['phpgw']->db->Record; - } - - /* - General wrapper for all other db calls - Calls in here are simply returned, so not all will work - */ - function call($function, $query_id) - { - return $GLOBALS['phpgw']->db->$function(); - } - } -?> diff --git a/filemanager/inc/class.uifilemanager.inc.php b/filemanager/inc/class.uifilemanager.inc.php index 68c7d82227..a2d14f8040 100755 --- a/filemanager/inc/class.uifilemanager.inc.php +++ b/filemanager/inc/class.uifilemanager.inc.php @@ -21,42 +21,80 @@ var $public_functions = array( 'index' => True, + 'help' => True, + 'view' => True, + 'history' => True, + 'edit' => True, + 'download'=>True ); + //keep var $bo; -// var $pref; - var $imgroot; + var $t; //template object + var $dispath; + var $cwd; + var $lesspath; + var $readable_groups; + var $files_array; + var $numoffiles; + var $dispsep; + + var $target; + + + var $prefs;//array + + //originally post_vars + var $goto; + var $todir; + var $createdir; + var $newfile_or_dir; + var $newdir; + var $newfile; + var $createfile; + var $delete; + var $renamefiles; + var $rename; + var $move_to; + var $copy_to; + var $edit; + var $edit_file; + var $edit_preview; + var $edit_save; + var $edit_save_done; + var $edit_cancel; + var $comment_files; + var $upload; + var $uploadprocess; + + // this ones must be checked thorougly; + var $fileman; + var $path; + var $file; + var $sortby; + var $messages; + var $show_upload_boxes; + + var $debug = false; + var $now; function uifilemanager() { +// error_reporting (8); + + $this->now = date ('Y-m-d'); + $this->bo = CreateObject('filemanager.bofilemanager'); - - //FIXME remove this one - $this->imgroot='filemanager/templates/default/'; - - - } + $this->t = $GLOBALS['phpgw']->template; - function index() - { - global $download,$path,$sortby,$op,$go,$file,$show_upload_boxes; - - ### - # Enable this to display some debugging info - ### - - $phpwh_debug = 0; - + // here local vars are created from the HTTP vars @reset ($GLOBALS['HTTP_POST_VARS']); while (list ($name,) = @each ($GLOBALS['HTTP_POST_VARS'])) { - $$name = $GLOBALS['HTTP_POST_VARS'][$name]; + $this->$name = $GLOBALS['HTTP_POST_VARS'][$name]; } - - // var_dump($GLOBALS['HTTP_POST_VARS']); - - + @reset ($GLOBALS['HTTP_GET_VARS']); while (list ($name,) = @each ($GLOBALS['HTTP_GET_VARS'])) { @@ -75,18 +113,14 @@ 'path' => array ('path' => ''), 'file' => array ('file' => ''), 'sortby' => array ('sortby' => ''), - 'fileman' => array ('fileman' => ''), +// 'fileman' => array ('fileman' => ''), 'messages' => array ('messages' => ''), - 'help_name' => array ('help_name' => ''), - 'renamefiles' => array ('renamefiles' => ''), +// 'help_name' => array ('help_name' => ''), +// 'renamefiles' => array ('renamefiles' => ''), 'comment_files' => array ('comment_files' => ''), 'show_upload_boxes' => array ('show_upload_boxes' => '') ); - // FIXME (pim) decode doesn't work and I don't know where its for - - /* - reset ($to_decode); while (list ($var, $conditions) = each ($to_decode)) { @@ -97,7 +131,6 @@ if (is_array ($$var)) { $temp = array (); - //some fixes in this section were supplied by Michael Totschnig while (list ($varkey, $varvalue) = each ($$var)) { if (is_int ($varkey)) @@ -109,789 +142,444 @@ $temp[stripslashes (base64_decode(urldecode(($varkey))))] = $varvalue; } } - $$var = $temp; + $this->$var = $temp; } elseif (isset ($$var)) { - $$var = stripslashes (base64_decode(urldecode ($$var))); + $this->$var = stripslashes (base64_decode(urldecode ($$var))); } } } } - */ + // get appl. and user prefs + $pref = CreateObject ('phpgwapi.preferences', $GLOBALS['userinfo']['username']); + $pref->read_repository (); +// $GLOBALS['phpgw']->hooks->single ('add_def_pref', $GLOBALS['appname']); + $pref->save_repository (True); + $pref_array = $pref->read_repository (); + $this->prefs = $pref_array[$GLOBALS['appname']]; + + //always show name + + $this->prefs[name] =1; - //FIXME re-enable this here above - if ($noheader || $nofooter || ($download && (count ($fileman) > 0)) || ($op == 'view' && $file) || ($op == 'history' && $file) || ($op == 'help' && $help_name)) + if ($this->prefs['viewinnewwin']) + { + $this->target = '_blank'; + } + } + + function index() + { + if ($noheader || $nofooter || ($this->download && (count ($this->fileman) > 0))) { $noheader = True; $nofooter = True; + $noappheader= True; + $nonavbar=True; } - - $GLOBALS['phpgw_info']['flags'] = array - ( - 'currentapp' => 'filemanager', - 'noheader' => $noheader, - 'nofooter' => $nofooter, - 'noappheader' => False, - 'enable_browser_class' => True - ); - -// var_dump($GLOBALS['phpgw_info']['flags']); - $GLOBALS['phpgw']->common->phpgw_header(); - - - if ($execute && $command_line) + else { - if ($result = $this->bo->vfs->command_line (array ('command_line' => stripslashes ($command_line)))) - { - $messages = $this->html_text_bold (lang('Command sucessfully run'),1); - if ($result != 1 && strlen ($result) > 0) - { - $messages .= $this->html_break (2, NULL, 1) . $result; - } - } - else - { - $messages = $GLOBALS['phpgw']->common->error_list (array (lang('Error running command'))); - } + $GLOBALS['phpgw_info']['flags'] = array + ( + 'currentapp' => 'filemanager', + 'noheader' => $noheader, + 'nonavbar' => $nonavbar, + 'nofooter' => $nofooter, + 'noappheader' => $noappheader, + 'enable_browser_class' => True + ); + + $GLOBALS['phpgw']->common->phpgw_header(); + } - ### + //var_dump($GLOBALS[HTTP_POST_VARS]); + + # Page to process users # Code is fairly hackish at the beginning, but it gets better # Highly suggest turning wrapping off due to long SQL queries - ### ### # Some hacks to set and display directory paths correctly ### - if ($go) + if ($this->goto) { - $path = $todir; + $this->path = $this->todir; } - - // var_dump($GLOBALS['phpgw_info']); - // var_dump($GLOBALS['phpgw']); - // die(); - - if (!$path) + + if (!$this->path) { - $path = $this->bo->vfs->pwd (); + $this->path = $this->bo->vfs->pwd (); - if (!$path || $this->bo->vfs->pwd (array ('full' => False)) == '') + if (!$this->path || $this->bo->vfs->pwd (array ('full' => False)) == '') { - $path = $GLOBALS['homedir']; + $this->path = $GLOBALS['homedir']; } } - - $this->bo->vfs->cd (array ('string' => False, 'relatives' => array (RELATIVE_NONE), 'relative' => False)); - $this->bo->vfs->cd (array ('string' => $path, 'relatives' => array (RELATIVE_NONE), 'relative' => False)); + $this->bo->vfs->cd (array ('string' => $this->path, 'relatives' => array (RELATIVE_NONE), 'relative' => False)); $pwd = $this->bo->vfs->pwd (); - if (!$cwd = substr ($path, strlen ($GLOBALS['homedir']) + 1)) + if (!$this->cwd = substr ($this->path, strlen ($GLOBALS['homedir']) + 1)) { - $cwd = '/'; + $this->cwd = '/'; } else { - $cwd = substr ($pwd, strrpos ($pwd, '/') + 1); + $this->cwd = substr ($pwd, strrpos ($pwd, '/') + 1); } - $disppath = $path; + $this->disppath = $this->path; /* This just prevents // in some cases */ - if ($path == '/') - $dispsep = ''; + if ($this->path == '/') + $this->dispsep = ''; else - $dispsep = '/'; + $this->dispsep = '/'; - if (!($lesspath = substr ($path, 0, strrpos ($path, '/')))) - $lesspath = '/'; + if (!($this->lesspath = substr ($this->path, 0, strrpos ($this->path, '/')))) + $this->lesspath = '/'; - $now = date ('Y-m-d'); - - if ($phpwh_debug) - { - echo "PHPWebHosting debug:
- path: $path
- disppath: $disppath
- cwd: $cwd
- lesspath: $lesspath -

- phpGW debug:
- real getabsolutepath: " . $this->bo->vfs->getabsolutepath (array ('target' => False, 'mask' => False, 'fake' => False)) . "
- fake getabsolutepath: " . $this->bo->vfs->getabsolutepath (array ('target' => False)) . "
- appsession: " . $GLOBALS['phpgw']->session->appsession ('vfs','') . "
- pwd: " . $this->bo->vfs->pwd () . "
"; - } - - ### # Get their readable groups to be used throughout the script - ### - - $groups = array (); + $groups = array(); $groups = $GLOBALS['phpgw']->accounts->get_list ('groups'); - $readable_groups = array (); + $this->readable_groups = array(); while (list ($num, $account) = each ($groups)) { - if ($this->bo->vfs->acl_check (array ( - 'owner_id' => $account['account_id'], - 'operation' => PHPGW_ACL_READ - )) - ) - { - $readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); - } - } - - $groups_applications = array (); - - while (list ($num, $group_array) = each ($readable_groups)) - { - $group_id = $GLOBALS['phpgw']->accounts->name2id ($group_array['account_name']); - - $applications = CreateObject('phpgwapi.applications', $group_id); - $groups_applications[$group_array['account_name']] = $applications->read_account_specific (); - } - - ### - # We determine if they're in their home directory or a group's directory, - # and set the VFS working_id appropriately - ### - - if ((preg_match ('+^'.$GLOBALS['fakebase'].'\/(.*)(\/|$)+U', $path, $matches)) && $matches[1] != $GLOBALS['userinfo']['account_lid']) - { - $this->bo->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id ($matches[1]); - } - else - { - $this->bo->vfs->working_id = $GLOBALS['userinfo']['username']; - } - - if ($path != $GLOBALS['homedir'] - && $path != $GLOBALS['fakebase'] - && $path != '/' - && !$this->bo->vfs->acl_check (array ( - 'string' => $path, - 'relatives' => array (RELATIVE_NONE), - 'operation' => PHPGW_ACL_READ - )) - ) - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('You do not have access to %1', $path))); - $this->html_break (2); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$GLOBALS['homedir'], lang('Go to your home directory')); - $this->html_page_close (); - } - - $GLOBALS['userinfo']['working_id'] = $this->bo->vfs->working_id; - $GLOBALS['userinfo']['working_lid'] = $GLOBALS['phpgw']->accounts->id2name ($GLOBALS['userinfo']['working_id']); - - ### - # If their home directory doesn't exist, we create it - # Same for group directories - ### - - if (($path == $GLOBALS['homedir']) - && !$this->bo->vfs->file_exists (array ( - 'string' => $GLOBALS['homedir'], - 'relatives' => array (RELATIVE_NONE) - )) -) -{ - $this->bo->vfs->override_acl = 1; - - if (!$this->bo->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)))) - { - // FIXME (pim) ?? - $p = $this->bo->vfs->path_parts (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))); - echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not create directory %1', $GLOBALS['homedir'] . ' (' . $p->real_full_path . ')'))); - } - - $this->bo->vfs->override_acl = 0; -} - -### -# Verify path is real -### - -if ($path != $GLOBALS['homedir'] && $path != '/' && $path != $GLOBALS['fakebase']) -{ - if (!$this->bo->vfs->file_exists (array ('string' => $path, 'relatives' => array (RELATIVE_NONE)))) - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 does not exist', $path))); - $this->html_break (2); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$GLOBALS['homedir'], lang('Go to your home directory')); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); - } -} - -/* Update if they request it, or one out of 20 page loads */ -srand ((double) microtime() * 1000000); -if ($update || rand (0, 19) == 4) -{ - $this->bo->vfs->update_real (array ('string' => $path, 'relatives' => array (RELATIVE_NONE))); -} - -### -# Check available permissions for $path, so we can disable unusable operations in user interface -### - -if ($this->bo->vfs->acl_check (array ( - 'string' => $path, - 'relatives' => array (RELATIVE_NONE), - 'operation' => PHPGW_ACL_ADD -)) - ) - { - $can_add = True; - } - - ### - # Default is to sort by name - ### - - if (!$sortby) - { - $sortby = 'name'; - } - - ### - # Decide how many upload boxes to show - ### - //var_dump($show_upload_boxes); - //die(); - - if (!$show_upload_boxes || $show_upload_boxes <= 0) - { - if (!$show_upload_boxes = $GLOBALS['settings']['show_upload_boxes']) + if ($this->bo->vfs->acl_check (array ('owner_id' => $account['account_id'], 'operation' => PHPGW_ACL_READ))) { - $show_upload_boxes = 5; + $this->readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); } } - ### - # Read in file info from database to use in the rest of the script - # $fakebase is a special directory. In that directory, we list the user's - # home directory and the directories for the groups they're in - ### + $groups_applications = array (); - $numoffiles = 0; - if ($path == $GLOBALS['fakebase']) + while (list ($num, $group_array) = each ($this->readable_groups)) { - if (!$this->bo->vfs->file_exists (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)))) - { - $this->bo->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))); - } + $group_id = $GLOBALS['phpgw']->accounts->name2id ($group_array['account_name']); - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $GLOBALS['homedir'], - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => False, - 'nofiles' => True - ) - ); - $files_array[] = $ls_array[0]; - $numoffiles++; - // $files_array = $ls_array; - // $numoffiles = count($ls_array); + $applications = CreateObject('phpgwapi.applications', $group_id); + $groups_applications[$group_array['account_name']] = $applications->read_account_specific (); + } - reset ($readable_groups); - while (list ($num, $group_array) = each ($readable_groups)) + # We determine if they're in their home directory or a group's directory, + # and set the VFS working_id appropriately + if ((preg_match ('+^'.$GLOBALS['fakebase'].'\/(.*)(\/|$)+U', $this->path, $matches)) && $matches[1] != $GLOBALS['userinfo']['account_lid']) { - ### - # If the group doesn't have access to this app, we don't show it - ### - - if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) - { - continue; - } - - if (!$this->bo->vfs->file_exists (array ( - 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], - 'relatives' => array (RELATIVE_NONE) - )) - ) - { - $this->bo->vfs->override_acl = 1; - $this->bo->vfs->mkdir (array ( - 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], - 'relatives' => array (RELATIVE_NONE) - ) - ); - $this->bo->vfs->override_acl = 0; - - $this->bo->vfs->set_attributes (array ( - 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], - 'relatives' => array (RELATIVE_NONE), - 'attributes' => array ( - 'owner_id' => $group_array['account_id'], - 'createdby_id' => $group_array['account_id'] - ) - ) - ); - } - - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => False, - 'nofiles' => True - ) -); - -$files_array[] = $ls_array[0]; - -$numoffiles++; - } + $this->bo->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id ($matches[1]); } else { - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $path, - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => False, - 'nofiles' => False, - 'orderby' => $sortby - ) - ); - - if ($phpwh_debug) - { - echo '# of files found in "'.$path.'" : '.count($ls_array).'
'."\n"; + $this->bo->vfs->working_id = $GLOBALS['userinfo']['username']; } - - while (list ($num, $file_array) = each ($ls_array)) + + + # FIXME # comment waht happens here + if ($this->path != $GLOBALS['homedir'] && $this->path != $GLOBALS['fakebase'] && $this->path != '/' && !$this->bo->vfs->acl_check (array ( 'string' => $this->path, 'relatives' => array (RELATIVE_NONE),'operation' => PHPGW_ACL_READ ))) { - $numoffiles++; - $files_array[] = $file_array; - if ($phpwh_debug) - { - echo 'Filename: '.$file_array['name'].'
'."\n"; - } - } - } + $this->messages.= $GLOBALS['phpgw']->common->error_list (array (lang('You do not have access to %1', $this->path))); + $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','path='.$GLOBALS['homedir'], lang('Go to your home directory')); - if (!is_array ($files_array)) - { - $files_array = array (); - } - - if ($download) - { - for ($i = 0; $i != $numoffiles; $i++) - { - if (!$fileman[$i]) - { - continue; - } - - $download_browser = CreateObject ('phpgwapi.browser'); - $download_browser->content_header ($fileman[$i]); - echo $this->bo->vfs->read (array ('string' => $fileman[$i])); + $GLOBALS['phpgw']->common->phpgw_footer (); $GLOBALS['phpgw']->common->phpgw_exit (); } - } - if ($op == 'view' && $file) - { - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $path.'/'.$file, - 'relatives' => array (RELATIVE_ALL), - 'checksubdirs' => False, - 'nofiles' => True - ) - ); + $GLOBALS['userinfo']['working_id'] = $this->bo->vfs->working_id; + $GLOBALS['userinfo']['working_lid'] = $GLOBALS['phpgw']->accounts->id2name ($GLOBALS['userinfo']['working_id']); - if ($ls_array[0]['mime_type']) - { - $mime_type = $ls_array[0]['mime_type']; - } - elseif ($GLOBALS['settings']['viewtextplain']) - { - $mime_type = 'text/plain'; - } - - header('Content-type: ' . $mime_type); - echo $this->bo->vfs->read (array ( - 'string' => $path.'/'.$file, - 'relatives' => array (RELATIVE_NONE) - ) - ); - $GLOBALS['phpgw']->common->phpgw_exit (); -} - -if ($op == 'history' && $file) -{ - $journal_array = $this->bo->vfs->get_journal (array ( - 'string' => $file, - 'relatives' => array (RELATIVE_ALL) - ) -); - -if (is_array ($journal_array)) -{ - $this->html_table_begin (); - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->html_text_bold (lang('Date')); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->html_text_bold (lang('Version')); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->html_text_bold (lang('Who')); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->html_text_bold (lang('Operation')); - $this->html_table_col_end (); - $this->html_table_row_end (); - - while (list ($num, $journal_entry) = each ($journal_array)) - { - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->bo->html_text ($journal_entry['created'] . $this->html_nbsp (3, 1)); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->bo->html_text ($journal_entry['version'] . $this->html_nbsp (3, 1)); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->bo->html_text ($GLOBALS['phpgw']->accounts->id2name ($journal_entry['owner_id']) . $this->html_nbsp (3, 1)); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->bo->html_text ($journal_entry['comment']); - $this->html_table_col_end (); - } - - $this->html_table_end (); - $this->html_page_close (); -} -else -{ - $this->html_text_bold (lang('No version history for this file/directory')); -} - - } - - if ($newfile && $createfile) + # If their home directory doesn't exist, we try to create it + # Same for group directories + if (($this->path == $GLOBALS['homedir']) && !$this->bo->vfs->file_exists ($pim_tmp_arr)) { - if ($badchar = $this->bo->bad_chars ($createfile, True, True)) + $this->bo->vfs->override_acl = 1; + + if (!$this->bo->vfs->mkdir (array ( + 'string' => $GLOBALS['homedir'], + 'relatives' => array (RELATIVE_NONE) + ))) { - echo $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('File names cannot contain "%1"',$badchar), 1))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); + $p = $this->bo->vfs->path_parts ($pim_tmp_arr); + + $this->messages= $GLOBALS['phpgw']->common->error_list (array ( + lang('Could not create directory %1', + $GLOBALS['homedir'] . ' (' . $p->real_full_path . ')' + ))); } - if ($this->bo->vfs->file_exists (array ( - 'string' => $createfile, - 'relatives' => array (RELATIVE_ALL) - )) - ) - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('File %1 already exists. Please edit it or delete it first.', $createfile))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); + $this->bo->vfs->override_acl = 0; } - if ($this->bo->vfs->touch (array ( - 'string' => $createfile, - 'relatives' => array (RELATIVE_ALL) - )) - ) - { - $fileman = array (); - $fileman[0] = $createfile; - $edit = 1; - $numoffiles++; - } - else - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('File %1 could not be created.', $createfile))); - } - } - - if ($op == 'help' && $help_name) - { - while (list ($num, $help_array) = each ($help_info)) - { - if ($help_array[0] != $help_name) - continue; - - $help_array[1] = preg_replace ("/\[(.*)\|(.*)\]/Ue", "html_help_link ('\\1', '\\2', False, True)", $help_array[1]); - $help_array[1] = preg_replace ("/\[(.*)\]/Ue", "html_help_link ('\\1', '\\1', False, True)", $help_array[1]); - - $this->html_font_set ('4'); - $title = ereg_replace ('_', ' ', $help_array[0]); - $title = ucwords ($title); - $this->bo->html_text ($title); - $this->html_font_end (); - - $this->html_break (2); - - $this->html_font_set ('2'); - $this->bo->html_text ($help_array[1]); - $this->html_font_end (); - } - - $GLOBALS['phpgw']->common->phpgw_exit (); - } - - ### - # Start Main Page - ### - - $this->html_page_begin (lang('Users').' :: '.$GLOBALS['userinfo']['username']); - $this->html_page_body_begin (HTML_PAGE_BODY_COLOR); - - if ($messages) - { - $this->bo->html_text ($messages); - } - - if (!count ($GLOBALS['settings'])) - { - $GLOBALS[pref] = CreateObject ('phpgwapi.preferences', $GLOBALS['userinfo']['username']); - $GLOBALS[pref]->read_repository (); - $GLOBALS['phpgw']->hooks->single ('add_def_pref', $GLOBALS['appname']); - $GLOBALS[pref]->save_repository (True); - $pref_array = $GLOBALS[pref]->read_repository (); - $GLOBALS['settings'] = $pref_array[$GLOBALS['appname']]; - } - - ### - # Start Main Table - ### - - if (!$op && !$delete && !$createdir && !$renamefiles && !$move && !$copy && !$edit && !$comment_files) - { - $this->html_table_begin ('100%'); - $this->html_table_row_begin (); - $this->html_table_col_begin ('center', NULL, 'top'); - $this->html_align ('center'); - $this->html_form_begin ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$path); - if ($numoffiles || $cwd) - { - while (list ($num, $name) = each ($GLOBALS['settings'])) + # Verify path is real + if ($this->path != $GLOBALS['homedir'] && $this->path != '/' && $this->path != $GLOBALS['fakebase']) { - if ($name) + if (!$this->bo->vfs->file_exists (array ( + 'string' => $this->path, + 'relatives' => array (RELATIVE_NONE) + ))) { - $columns++; + $this->messages = $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 does not exist', $this->path))); + $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','path='.$GLOBALS['homedir'], lang('Go to your home directory')); + + $GLOBALS['phpgw']->common->phpgw_footer (); + $GLOBALS['phpgw']->common->phpgw_exit (); } } - $columns++; - $this->html_table_begin (); - $this->html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_HEADER_BG_COLOR); - $this->html_table_col_begin ('center', NULL, NULL, NULL, $columns); - $this->html_table_begin ('100%'); - $this->html_table_row_begin (); - $this->html_table_col_begin ('left'); - if ($path != '/') + /* Update if they request it, or one out of 20 page loads */ + srand ((double) microtime() * 1000000); + if ($update || rand (0, 19) == 4) { - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$lesspath, $this->html_image ($this->imgroot.'images/folder-up.png', lang('Up'), 'left', 0, NULL, 1)); - $this->html_help_link ('up'); + $this->bo->vfs->update_real (array ( + 'string' => $this->path, + 'relatives' => array (RELATIVE_NONE) + )); } - $this->html_table_col_end (); - $this->html_table_col_begin ('center'); - - if ($cwd) + # Check available permissions for $this->path, so we can disable unusable operations in user interface + if ($this->bo->vfs->acl_check (array( + 'string' => $this->path, + 'relatives' => array (RELATIVE_NONE), + 'operation' => PHPGW_ACL_ADD + ))) { - if ($path == $GLOBALS['homedir']) - { - $this->html_image ($this->imgroot.'images/folder-home.png', lang('Folder'), 'center'); - } - else - { - $this->html_image ($this->imgroot.'images/folder.png', lang('Folder'), 'center'); - } + $this->can_add = True; + } + + + # Default is to sort by name + if (!$this->sortby) + { + $this->sortby = 'name'; + } + + if($this->debug) $this->debug_filemanager(); + + # main action switch + // FIXME this will become a switch + if($this->newfile && $this->newfile_or_dir) // create new textfile + { + $this->createfile(); + } + elseif($this->newfile_or_dir && $this->newdir) + { + $this->createdir(); + } + elseif ($this->uploadprocess) + { + $this->fileUpload(); + } + elseif ($this->upload || $this->show_upload_boxes) + { + $this->showUploadboxes(); + } + elseif ($this->copy_to) + { + $this->copyTo(); + } + elseif ($this->move_to) + { + $this->moveTo(); + } + elseif ($this->download) + { + $this->download(); + } + elseif ($this->renamefiles) + { + $this->rename(); + } + elseif ($this->comment_files) + { + $this->editComment(); + } + elseif ($this->edit_cancel) + { + $this->readFilesInfo(); + $this->fileListing(); + } + elseif ($this->edit || $this->edit_preview || $this->edit_save) + { + $this->edit(); + } + elseif ($this->delete) + { + $this->delete(); } else { - $this->html_image ($this->imgroot.'images/folder-home.png', lang('Home')); + $this->readFilesInfo(); + $this->fileListing(); } - $this->html_font_set (4, HTML_TABLE_FILES_HEADER_TEXT_COLOR); - $this->html_text_bold ($disppath); - $this->html_font_end (); - $this->html_help_link ('directory_name'); - $this->html_table_col_end (); - $this->html_table_col_begin ('right'); + } - if ($path != $GLOBALS['homedir']) + function fileListing() + { + $this->t->set_file(array('filemanager_list_t' => 'filelisting.tpl')); + $this->t->set_block('filemanager_list_t','filemanager_header','filemanager_header'); + $this->t->set_block('filemanager_list_t','column','column'); + $this->t->set_block('filemanager_list_t','row','row'); + $this->t->set_block('filemanager_list_t','filemanager_footer','filemanager_footer'); + + $vars['form_action']=$this->encode_href ('/index.php', 'menuaction=filemanager.uifilemanager.index','path='.$this->path); + if ($this->numoffiles || $this->cwd) { - $this->html_link ('/index.php'.'menuaction=filemanager.uifilemanager.index&path='.$GLOBALS['homedir'], $this->html_image ($this->imgroot.'images/folder-home.png', lang('Home'), 'right', 0, NULL, 1)); - $this->html_help_link ('home'); - } - - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_table_end (); - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR); - - ### - # Start File Table Column Headers - # Reads values from $file_attributes array and preferences - ### - - $this->html_table_col_begin (); - $this->bo->html_text (lang('Sort by:') . $this->html_nbsp (1, 1), NULL, NULL, 0); - $this->html_help_link ('sort_by'); - $this->html_table_col_end (); - - reset ($this->bo->file_attributes); - while (list ($internal, $displayed) = each ($this->bo->file_attributes)) - { - if ($GLOBALS['settings'][$internal]) + while (list ($num, $name) = each ($this->prefs)) { - $this->html_table_col_begin (); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$path.'&sortby='.$internal, $this->html_text_bold ($displayed, 1, 0)); - $this->html_help_link (strtolower (ereg_replace (' ', '_', $displayed))); - $this->html_table_col_end (); - } - } - - $this->html_table_col_begin (); - $this->html_table_col_end (); - $this->html_table_row_end (); - - if ($GLOBALS['settings']['dotdot'] && $GLOBALS['settings']['name'] && $path != '/') - { - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->html_table_col_end (); - - /* We can assume the next column is the name */ - $this->html_table_col_begin (); - $this->html_image ($this->imgroot.'images/folder.png', lang('Folder')); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$lesspath, '..'); - $this->html_table_col_end (); - - if ($GLOBALS['settings']['mime_type']) - { - $this->html_table_col_begin (); - $this->bo->html_text (lang('Directory')); - $this->html_table_col_end (); - } - - $this->html_table_row_end (); - } - - ### - # List all of the files, with their attributes - ### - - reset ($files_array); - for ($i = 0; $i != $numoffiles; $i++) - { - $files = $files_array[$i]; - - if ($rename || $edit_comments) - { - unset ($this_selected); - unset ($renamethis); - unset ($edit_this_comment); - - for ($j = 0; $j != $numoffiles; $j++) + if ($name) { - if ($fileman[$j] == $files['name']) + $columns++; + } + } + $columns++; + + $vars[toolbar0]=$this->toolbar('location'); + $vars[toolbar1]=$this->toolbar('list_nav'); + $vars[messages]=$this->messages; + + $this->t->set_var($vars); + $this->t->pparse('out','filemanager_header'); + + + ### + # Start File Table Column Headers + # Reads values from $file_attributes array and preferences + ### + $this->t->set_var('actions',lang('select')); + + reset ($this->bo->file_attributes); + + if($this->numoffiles>0) + { + while (list ($internal, $displayed) = each ($this->bo->file_attributes)) + { + if ($this->prefs[$internal]) { - $this_selected = 1; - break; + $col_data=''.$displayed.''; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); } } - if ($rename && $this_selected) - { - $renamethis = 1; - } - elseif ($edit_comments && $this_selected) - { - $edit_this_comment = 1; - } - } - - if (!$GLOBALS['settings']['dotfiles'] && ereg ("^\.", $files['name'])) - { - continue; - } - - $this->html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_BG_COLOR); - - ### - # Checkboxes - ### - - $this->html_table_col_begin ('right'); - - if (!$rename && !$edit_comments && $path != $GLOBALS['fakebase'] && $path != '/') - { - $this->html_form_input ('checkbox', 'fileman['.$i.']', base64_encode ($files['name'])); - } - elseif ($renamethis) - { - $this->html_form_input ('hidden', 'fileman[' . base64_encode ($files['name']) . ']', $files['name'], NULL, NULL, 'checked'); + $this->t->set_var('row_tr_color','#cbcbcb'); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); } else { - $this->html_nbsp(); + $lang_nofiles=lang('No files in this directory.'); } + $vars[lang_no_files]=$lang_nofiles; + - $this->html_table_col_end (); - - ### - # File name and icon - ### - - if ($GLOBALS['settings']['name']) + if ($this->prefs['dotdot'] && $this->prefs['name'] && $this->path != '/') { - if ($phpwh_debug) + $this->t->set_var('actions',''); + + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->lesspath); + + $col_data=''.lang('Folder').''; + $col_data.=' ..'; + + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column'); + + if ($this->prefs['mime_type']) { - echo 'Setting file name: '.$files['name'].'
'."\n"; + $col_data=lang('Directory'); + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); } - $this->html_table_col_begin (); + $this->t->set_var('row_tr_color',$tr_color); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); + } + + # List all of the files, with their attributes + reset ($this->files_array); + for ($i = 0; $i != $this->numoffiles; $i++) + { + $files = $this->files_array[$i]; + + if ($this->rename || $this->edit_comments) + { + unset ($this_selected); + unset ($renamethis); + unset ($edit_this_comment); + + for ($j = 0; $j != $this->numoffiles; $j++) + { + if ($this->fileman[$j] == $files['name']) + { + $this_selected = 1; + break; + } + } + + if ($this->rename && $this_selected) + { + $renamethis = 1; + } + elseif ($this->edit_comments && $this_selected) + { + $edit_this_comment = 1; + } + } + + if (!$this->prefs['dotfiles'] && ereg ("^\.", $files['name'])) + { + continue; + } + + # Checkboxes + if (!$this->rename && !$this->edit_comments && $this->path != $GLOBALS['fakebase'] && $this->path != '/') + { + $cbox=''; + $this->t->set_var('actions',$cbox); + } + elseif ($renamethis) + { + $cbox=$this->html_form_input ('hidden', 'fileman[' . base64_encode ($files['name']) . ']', $files['name'], NULL, NULL, 'checked'); + $this->t->set_var('actions',$cbox); + } + else + { + $this->t->set_var('actions',''); + } + + # File name and icon if ($renamethis) { - if ($files['mime_type'] == 'Directory') - { - $this->html_image ($this->imgroot.'images/folder.png', lang('Folder')); - } - $this->html_form_input ('text', 'renamefiles[' . base64_encode ($files['name']) . ']', $files['name'], 255); + $col_data=$this->mime_icon($files['mime_type']); + $col_data.=''; } else { if ($files['mime_type'] == 'Directory') { - $this->html_image ($this->imgroot.'images/folder.png', lang('Folder')); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$path.$dispsep.$files['name'], $files['name']); + $link=$this->encode_href ('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->path.$this->dispsep.$files['name']); + + $icon=$this->mime_icon($files['mime_type']); + + $col_data=''.$icon.' '; + $col_data.=''.$files['name'].' '; } else { - if ($GLOBALS['settings']['viewinnewwin']) - { - $target = '_new'; - } - if ($GLOBALS['settings']['viewonserver'] && isset ($GLOBALS['filesdir']) && !$files['link_directory']) + if ($this->prefs['viewonserver'] && isset ($GLOBALS['filesdir']) && !$files['link_directory']) { #FIXME $clickview = $GLOBALS['filesdir'].$pwd.'/'.$files['name']; @@ -899,974 +587,1094 @@ else if ($phpwh_debug) { echo 'Setting clickview = '.$clickview.'
'."\n"; - $this->html_link ($clickview, '',$files['name'], 0, 1, 0, ''); + $this->html_link ($clickview,'', '',$files['name'], 0, 1, 0, ''); } } else { - #FIXME?? - // $clickview = $GLOBALS['appname'].'/index.php?op=view&file='.$files['name'].'&path='.$path; - $this->html_link ('index.php','menuaction=filemanager.uifilemanager.index&op=view&file='.$files['name'].'&path='.$path, $files['name'], 0, 1, 0, $target); + $icon=$this->mime_icon($files['mime_type']); + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.view','file='.$files['name'].'&path='.$this->path); + + $col_data=''.$icon.' '.$files['name'].''; } - - - #FIXME - //$this->html_link ($clickview, $files['name'], 0, 1, 0, $target); } } - $this->html_table_col_end (); + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column'); + + # MIME type + if ($this->prefs['mime_type']) + { + $col_data=$files['mime_type']; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # File size + if ($this->prefs['size']) + { + $tmp_arr=array( + 'string' => $files['directory'] . '/' . $files['name'], + 'relatives' => array (RELATIVE_NONE) + ); + + $size = $this->bo->vfs->get_size($tmp_arr); + + $col_data=$this->bo->borkb ($size); + + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Date created + if ($this->prefs['created']) + { + $col_data=$files['created']; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Date modified + if ($this->prefs['modified']) + { + if ($files['modified'] != '0000-00-00') $col_data=$files['modified']; + else $col_data=''; + + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Owner name + if ($this->prefs['owner']) + { + $this->t->set_var('col_data',$GLOBALS['phpgw']->accounts->id2name ($files['owner_id'])); + $this->t->parse('columns','column',True); + } + + # Creator name + if ($this->prefs['createdby_id']) + { + $this->html_table_col_begin (); + if ($files['createdby_id']) + { + $col_data=$GLOBALS['phpgw']->accounts->id2name ($files['createdby_id']); + } + else $col_data=''; + + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Modified by name + if ($this->prefs['modifiedby_id']) + { + if ($files['modifiedby_id']) + { + $col_data=$GLOBALS['phpgw']->accounts->id2name ($files['modifiedby_id']); + } + else $col_data=''; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Application + if ($this->prefs['app']) + { + $col_data=$files['app']; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Comment + if ($this->prefs['comment']) + { + if ($edit_this_comment) + { + $col_data='' ; + } + else + { + $col_data=$files['comment']; + } + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + # Version + if ($this->prefs['version']) + { + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.history','file='.$files['name'].'&path='.$this->path); + $col_data=''.$files['version'].''; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column',True); + } + + + + if ($files['mime_type'] == 'Directory') + { + $usedspace += $fileinfo[0]; + } + else + { + $usedspace += $files['size']; + } + + $this->t->set_var('row_tr_color',''); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); } - ### - # MIME type - ### - - if ($GLOBALS['settings']['mime_type']) + // when renaming or changing comments render extra sumbmit button + if ($this->rename || $this->edit_comments) { - $this->html_table_col_begin (); - $this->bo->html_text ($files['mime_type']); - $this->html_table_col_end (); + $col_data='
'; + $this->t->set_var('col_data',$col_data); + $this->t->parse('columns','column'); + $this->t->set_var('row_tr_color',''); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); } - ### - # File size - ### - if ($GLOBALS['settings']['size']) - { - $this->html_table_col_begin (); + } - $size = $this->bo->vfs->get_size (array ( - 'string' => $files['directory'] . '/' . $files['name'], - 'relatives' => array (RELATIVE_NONE) - ) + + + // The file and directory information + $vars[lang_files_in_this_dir]=lang('Files is this directory'); + $vars[files_in_this_dir]=$this->numoffiles; + + $vars[lang_used_space]=lang('Used space'); + $vars[used_space]=$this->bo->borkb ($usedspace, NULL, 1); + + if ($this->path == $GLOBALS['homedir'] || $this->path == $GLOBALS['fakebase']) + { + $vars[lang_unused_space]=lang('Unused space'); + $vars[unused_space]=$this->bo->borkb ($GLOBALS['userinfo']['hdspace'] - $usedspace, NULL, 1); + + $tmp_arr=array ( + 'string' => $this->path, + 'relatives' => array (RELATIVE_NONE) ); - $this->bo->borkb ($size); + $ls_array = $this->bo->vfs->ls ($tmp_arr); + + + $vars[lang_total_files]=lang('Total Files'); + $vars[total_files]= count ($ls_array); - $this->html_table_col_end (); } - ### - # Date created - ### - if ($GLOBALS['settings']['created']) - { - $this->html_table_col_begin (); - $this->bo->html_text ($files['created']); - $this->html_table_col_end (); - } + $this->t->set_var($vars); + $this->t->pparse('out','filemanager_footer'); - ### - # Date modified - ### + $GLOBALS['phpgw']->common->phpgw_footer (); + $GLOBALS['phpgw']->common->phpgw_exit (); - if ($GLOBALS['settings']['modified']) + } + + function readFilesInfo() + { + // start files info + + # Read in file info from database to use in the rest of the script + # $fakebase is a special directory. In that directory, we list the user's + # home directory and the directories for the groups they're in + $this->numoffiles = 0; + if ($this->path == $GLOBALS['fakebase']) { - $this->html_table_col_begin (); - if ($files['modified'] != '0000-00-00') + if (!$this->bo->vfs->file_exists (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)))) { - $this->bo->html_text ($files['modified']); + $this->bo->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))); } - $this->html_table_col_end (); - } - ### - # Owner name - ### + $ls_array = $this->bo->vfs->ls (array ( 'string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE), 'checksubdirs' => False, 'nofiles' => True ) ); + $this->files_array[] = $ls_array[0]; + $this->numoffiles++; - if ($GLOBALS['settings']['owner']) - { - $this->html_table_col_begin (); - $this->bo->html_text ($GLOBALS['phpgw']->accounts->id2name ($files['owner_id'])); - $this->html_table_col_end (); - } - - ### - # Creator name - ### - - if ($GLOBALS['settings']['createdby_id']) - { - $this->html_table_col_begin (); - if ($files['createdby_id']) + reset ($this->readable_groups); + while (list ($num, $group_array) = each ($this->readable_groups)) { - $this->bo->html_text ($GLOBALS['phpgw']->accounts->id2name ($files['createdby_id'])); + # If the group doesn't have access to this app, we don't show it + if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) + { + continue; + } + + + if (!$this->bo->vfs->file_exists (array ('string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'],'relatives' => array (RELATIVE_NONE) )) ) + { + $this->bo->vfs->override_acl = 1; + $this->bo->vfs->mkdir (array ( 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], 'relatives' => array (RELATIVE_NONE) ) ); + + $this->bo->vfs->override_acl = 0; + + $this->bo->vfs->set_attributes (array ( 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], 'relatives' => array (RELATIVE_NONE), 'attributes' => array ( 'owner_id' => $group_array['account_id'], 'createdby_id' => $group_array['account_id'] ) ) ); + } + + $ls_array = $this->bo->vfs->ls (array ( 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], 'relatives' => array (RELATIVE_NONE), 'checksubdirs' => False, 'nofiles' => True ) ); + + $this->files_array[] = $ls_array[0]; + + $this->numoffiles++; } - $this->html_table_col_end (); - } - - ### - # Modified by name - ### - - if ($GLOBALS['settings']['modifiedby_id']) - { - $this->html_table_col_begin (); - if ($files['modifiedby_id']) - { - $this->bo->html_text ($GLOBALS['phpgw']->accounts->id2name ($files['modifiedby_id'])); - } - $this->html_table_col_end (); - } - - ### - # Application - ### - - if ($GLOBALS['settings']['app']) - { - $this->html_table_col_begin (); - $this->bo->html_text ($files['app']); - $this->html_table_col_end (); - } - - ### - # Comment - ### - - if ($GLOBALS['settings']['comment']) - { - $this->html_table_col_begin (); - if ($edit_this_comment) - { - $this->html_form_input ('text', 'comment_files[' . base64_encode ($files['name']) . ']', $this->bo->html_encode ($files['comment'], 1), 255); - } - else - { - $this->bo->html_text ($files['comment']); - } - $this->html_table_col_end (); - } - - ### - # Version - ### - - if ($GLOBALS['settings']['version']) - { - $this->html_table_col_begin (); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&op=history&file='.$files['name'].'&path='.$path, $files['version'], NULL, True, NULL, '_new'); - $this->html_table_col_end (); - } - - ### - # Deleteable (currently not used) - ### - - if ($GLOBALS['settings']['deleteable']) - { - if ($files['deleteable'] == 'N') - { - $this->html_table_col_begin (); - $this->html_image ($this->imgroot.'images/locked.png', lang('Locked')); - $this->html_table_col_end (); - } - else - { - $this->html_table_col_begin (); - $this->html_table_col_end (); - } - } - - $this->html_table_row_end (); - - if ($files['mime_type'] == 'Directory') - { - $usedspace += $fileinfo[0]; } else { - $usedspace += $files['size']; + $ls_array = $this->bo->vfs->ls (array ( 'string' => $this->path, 'relatives' => array (RELATIVE_NONE), 'checksubdirs' => False, 'nofiles' => False, 'orderby' => $this->sortby ) ); + + if ($phpwh_debug) + { + echo '# of files found in "'.$this->path.'" : '.count($ls_array).'
'."\n"; + } + + while (list ($num, $file_array) = each ($ls_array)) + { + $this->numoffiles++; + $this->files_array[] = $file_array; + if ($phpwh_debug) + { + echo 'Filename: '.$file_array['name'].'
'."\n"; + } + } } + + if (!is_array ($this->files_array)) + { + $this->files_array = array (); + } + // end file count } - - $this->html_table_end (); - $this->html_break (2); - - if ($path != '/' && $path != $GLOBALS['fakebase']) + function toolbar($type) { - if (!$rename && !$edit_comments) + switch($type) { - $this->html_form_input ('submit', 'edit', lang('Edit')); - $this->html_help_link ('edit'); - $this->html_nbsp (3); - } + case 'location': + $toolbar=' +

+ '.lang('location').':  +
'; + break; + case 'list_nav': + $toolbar=' + + + '; - if (!$edit_comments) - { - $this->html_form_input ('submit', 'rename', lang('Rename')); - $this->html_help_link ('rename'); - $this->html_nbsp (3); - } - - if (!$rename && !$edit_comments) - { - $this->html_form_input ('submit', 'delete', lang('Delete')); - $this->html_help_link ('delete'); - $this->html_nbsp (3); - } - - if (!$rename) - { - $this->html_form_input ('submit', 'edit_comments', lang('Edit comments')); - $this->html_help_link ('edit_comments'); - } - } - } - - ### - # Display some inputs and info, but not when renaming or editing comments - ### - - if (!$rename && !$edit_comments) - { - ### - # Begin Copy to/Move to selection - ### - - $this->html_break (1); - $this->html_form_input ('submit', 'go', lang('Go to:')); - $this->html_help_link ('go_to'); - - if ($path != '/' && $path != $GLOBALS['fakebase']) - { - $this->html_form_input ('submit', 'copy', lang('Copy to:')); - $this->html_help_link ('copy_to'); - $this->html_form_input ('submit', 'move', lang('Move to:')); - $this->html_help_link ('move_to'); - } - - $this->html_form_select_begin ('todir'); - - $this->html_break (1); - - ### - # First we get the directories in their home directory - ### - - $dirs = array (); - $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $GLOBALS['userinfo']['account_lid']); - - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $GLOBALS['homedir'], - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => True, - 'mime_type' => 'Directory' - ) - ); - - while (list ($num, $dir) = each ($ls_array)) - { - $dirs[] = $dir; - } - - - ### - # Then we get the directories in their readable groups' home directories - ### - - reset ($readable_groups); - while (list ($num, $group_array) = each ($readable_groups)) - { - ### - # Don't list directories for groups that don't have access - ### - - if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) - { - continue; - } - - $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $group_array['account_name']); - - // FIXME?? (pim) - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => True, - 'mime_type' => 'Directory' - ) - ); - while (list ($num, $dir) = each ($ls_array)) - { - $dirs[] = $dir; - } -} - -reset ($dirs); -while (list ($num, $dir) = each ($dirs)) -{ - if (!$dir['directory']) - { - continue; - } - - ### - # So we don't display // - ### - - if ($dir['directory'] != '/') - { - $dir['directory'] .= '/'; - } - - ### - # No point in displaying the current directory, or a directory that doesn't exist - ### - - if ((($dir['directory'] . $dir['name']) != $path) - && $this->bo->vfs->file_exists (array ( - 'string' => $dir['directory'] . $dir['name'], - 'relatives' => array (RELATIVE_NONE) - )) -) -{ - $this->html_form_option ($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']); -} + // go up icon when we're not at the top + if ($this->path != '/') + { + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->lesspath); + $toolbar.=$this->buttonImage($link,'up',lang('go up')); } - $this->html_form_select_end (); - $this->html_help_link ('directory_list'); - - if ($path != '/' && $path != $GLOBALS['fakebase']) + // go home icon when we're not home already + if ($this->path == $GLOBALS['homedir']) { - $this->html_break (1); + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$GLOBALS['homedir']); + $toolbar.=$this->buttonImage($link,'home',lang('go home')); + } - $this->html_form_input ('submit', 'download', lang('Download')); - $this->html_help_link ('download'); - $this->html_nbsp (3); + // reload button with this url + $link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->path); + $toolbar.=$this->buttonImage($link,'reload',lang('reload')); - if ($can_add) + // selectbox for change/move/and copy to + $dirs_options=$this->all_other_directories_options(); + $toolbar.=''; + + $toolbar.=$this->inputImage('goto','goto','Quick jump to'); + + if (!$this->rename && !$this->edit_comments) + { + // copy and move buttons + if ($this->path != '/' && $this->path != $GLOBALS['fakebase']) { - $this->html_form_input ('text', 'createdir', NULL, 255, 15); - $this->html_form_input ('submit', 'newdir', lang('Create Folder')); - $this->html_help_link ('create_folder'); + $toolbar.=$this->inputImage('copy_to','copy_to',lang('Copy to')); + $toolbar.=$this->inputImage('move_to','move_to',lang('Move to')); } + + + // submit buttons for + if ($this->path != '/' && $this->path != $GLOBALS['fakebase']) + { + if (!$this->rename && !$this->edit_comments) + { + // edit text file button + $toolbar.=$this->inputImage('edit','edit',lang('edit')); + } + + if (!$this->edit_comments) + { + $toolbar.=$this->inputImage('rename','rename',lang('Rename')); + } + + if (!$this->rename && !$this->edit_comments) + { + $toolbar.=$this->inputImage('delete','delete',lang('Delete')); + } + + if (!$this->rename) + { + $toolbar.=$this->inputImage('edit_comments','edit_comments',lang('Edit comments')); + } + } + + // create dir and file button + if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add) + { + $toolbar.=''; + $toolbar.=$this->inputImage('newdir','createdir',lang('Create Folder')); + $toolbar.=$this->inputImage('newfile','createfile',lang('Create File')); + } + + $toolbar.=''; + + // download button + if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add) + { + $toolbar.=$this->inputImage('download','download',lang('Download')); + } + // upload button + $toolbar.=$this->inputImage('upload','upload',lang('Upload')); + } - - $this->html_break (1); - $this->html_form_input ('submit', 'update', lang('Update')); - $this->html_help_link ('update'); - - if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add) - { - $this->html_nbsp (3); - $this->html_form_input ('text', 'createfile', NULL, 255, 15); - $this->html_form_input ('submit', 'newfile', lang('Create File')); - $this->html_help_link ('create_file'); - } - - if ($GLOBALS['settings']['show_command_line']) - { - $this->html_break (2); - $this->html_form_input ('text', 'command_line', NULL, NULL, 50); - $this->html_help_link ('command_line'); - - $this->html_break (1); - $this->html_form_input ('submit', 'execute', lang('Execute')); - $this->html_help_link ('execute'); - } - - $this->html_form_end (); - - $this->html_help_link ('file_stats'); - $this->html_break (1); - $this->html_text_bold (lang('Files').': '); - $this->bo->html_text ($numoffiles); - $this->html_nbsp (3); - - $this->html_text_bold (lang('Used space').': '); - $this->bo->html_text ($this->bo->borkb ($usedspace, NULL, 1)); - $this->html_nbsp (3); - - if ($path == $GLOBALS['homedir'] || $path == $GLOBALS['fakebase']) - { - $this->html_text_bold (lang('Unused space').': '); - $this->bo->html_text ($this->bo->borkb ($GLOBALS['userinfo']['hdspace'] - $usedspace, NULL, 1)); - - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $path, - 'relatives' => array (RELATIVE_NONE) - ) - ); - - $i = count ($ls_array); - - $this->html_break (2); - $this->html_text_bold (lang('Total Files').': '); - $this->bo->html_text ($i); + + $toolbar.='
spacerspacer
'; + break; + default:$x=''; } - ### - # Show file upload boxes. Note the last argument to html (). Repeats $show_upload_boxes times - ### - if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add) - { - $this->html_break (2); - $this->html_form_begin ('/index.php','menuaction=filemanager.uifilemanager.index&op=upload&path='.$path, 'post', 'multipart/form-data'); - $this->html_table_begin (); - $this->html_table_row_begin ('center'); - $this->html_table_col_begin (); - $this->html_text_bold (lang('File')); - $this->html_help_link ('upload_file'); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->html_text_bold (lang('Comment')); - $this->html_help_link ('upload_comment'); - $this->html_table_col_end (); - $this->html_table_row_end (); - - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->html_form_input ('hidden', 'show_upload_boxes', base64_encode ($show_upload_boxes)); - $this->html ($this->html_form_input ('file', 'upload_file[]', NULL, 255, NULL, NULL, NULL, 1) . $this->html_break (1, NULL, 1), $show_upload_boxes); - $this->html_table_col_end (); - $this->html_table_col_begin (); - $this->html ($this->html_form_input ('text', 'upload_comment[]', NULL, NULL, NULL, NULL, NULL, 1) . $this->html_break (1, NULL, 1), $show_upload_boxes); - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_table_end (); - $this->html_form_input ('submit', 'upload_files', lang('Upload files')); - $this->html_help_link ('upload_files'); - $this->html_break (2); - $this->bo->html_text (lang('Show') . $this->html_nbsp (1, True)); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&show_upload_boxes=5', '5'); - $this->html_nbsp (); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&show_upload_boxes=10', '10'); - $this->html_nbsp (); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&show_upload_boxes=20', '20'); - $this->html_nbsp (); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&show_upload_boxes=50', '50'); - $this->html_nbsp (); - $this->bo->html_text (lang('upload fields')); - $this->html_nbsp (); - $this->html_help_link ('show_upload_fields'); - $this->html_form_end (); - } + if($toolbar) + { + return $toolbar; } - - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_table_end (); - $this->html_page_close (); } + - ### - # Handle Editing files - ### - - if ($edit) + // move to bo + # Handle File Uploads + function fileUpload() { - ### - # If $edit is "Edit", we do nothing, and let the for loop take over - ### - - if ($edit_file) + if ($this->path != '/' && $this->path != $GLOBALS['fakebase']) { - $edit_file_content = stripslashes ($edit_file_content); - } - - if ($edit_preview) - { - $content = $edit_file_content; - - $this->html_break (1); - $this->html_text_bold (lang('Preview of %1', $path.'/'.$edit_file)); - $this->html_break (2); - - $this->html_table_begin ('90%'); - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->bo->html_text (nl2br ($content)); - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_table_end (); - } - elseif ($edit_save) - { - $content = $edit_file_content; - - if ($this->bo->vfs->write (array ( - 'string' => $edit_file, - 'relatives' => array (RELATIVE_ALL), - 'content' => $content - )) - ) - { - $this->html_text_bold (lang('Saved %1', $path.'/'.$edit_file)); - $this->html_break (2); - $this->html_link_back (); - } - else - { - $this->html_text_error (lang('Could not save %1', $path.'/'.$edit_file)); - $this->html_break (2); - $this->html_link_back (); - } - } - - /* This doesn't work just yet - elseif ($edit_save_all) - { - for ($j = 0; $j != $numoffiles; $j++) - { - $fileman[$j]; - - $content = $fileman[$j]; - echo 'fileman['.$j.']: '.$fileman[$j].'
'.$content.'
'; - continue; - - if ($this->bo->vfs->write (array ( - 'string' => $fileman[$j], - 'relatives' => array (RELATIVE_ALL), - 'content' => $content - )) - ) - { - $this->html_text_bold (lang('Saved %1', $path.'/'.$fileman[$j])); - $this->html_break (1); - } - else - { - $this->html_text_error (lang('Could not save %1', $path.'/'.$fileman[$j])); - $this->html_break (1); - } - } - - $this->html_break (1); - } - */ - - ### - # Now we display the edit boxes and forms - ### - - for ($j = 0; $j != $numoffiles; $j++) - { - ### - # If we're in preview or save mode, we only show the file - # being previewed or saved - ### - - if ($edit_file && ($fileman[$j] != $edit_file)) - { - continue; - } - - if ($fileman[$j] && $this->bo->vfs->file_exists (array ( - 'string' => $fileman[$j], - 'relatives' => array (RELATIVE_ALL) - )) - ) - { - if ($edit_file) - { - $content = stripslashes ($edit_file_content); - } - else - { - $content = $this->bo->vfs->read (array ('string' => $fileman[$j])); - } - - $this->html_table_begin ('100%'); - $this->html_form_begin ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$path); - $this->html_form_input ('hidden', 'edit', True); - $this->html_form_input ('hidden', 'edit_file', $fileman[$j]); - - ### - # We need to include all of the fileman entries for each file's form, - # so we loop through again - ### - - for ($i = 0; $i != $numoffiles; $i++) - { - $this->html_form_input ('hidden', 'fileman['.$i.']', base64_encode ($fileman[$i])); - } - - $this->html_table_row_begin (); - $this->html_table_col_begin (); - $this->html_form_textarea ('edit_file_content', 35, 75, $content); - $this->html_table_col_end (); - $this->html_table_col_begin ('center'); - $this->html_form_input ('submit', 'edit_preview', lang('Preview %1', $this->bo->html_encode ($fileman[$j], 1))); - $this->html_break (1); - $this->html_form_input ('submit', 'edit_save', lang('Save %1', $this->bo->html_encode ($fileman[$j], 1))); - // $this->html_break (1); - // $this->html_form_input ('submit', 'edit_save_all', lang('Save all')); - $this->html_table_col_end (); - $this->html_table_row_end (); - $this->html_break (2); - $this->html_form_end (); - $this->html_table_end (); - } -} - } - - ### - # Handle File Uploads - ### - - elseif ($op == 'upload' && $path != '/' && $path != $GLOBALS['fakebase']) - { - for ($i = 0; $i != $show_upload_boxes; $i++) + for ($i = 0; $i != $this->show_upload_boxes; $i++) { if ($badchar = $this->bo->bad_chars ($_FILES['upload_file']['name'][$i], True, True)) { - echo $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('File names cannot contain "%1"', $badchar), 1))); + $this->messages.= $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('File names cannot contain "%1"', $badchar), 1))); continue; } - ### # Check to see if the file exists in the database, and get its info at the same time - ### - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $path . '/' . $_FILES['upload_file']['name'][$i], + 'string'=> $this->path . '/' . $_FILES['upload_file']['name'][$i], 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => False, - 'nofiles' => True - ) - ); + 'checksubdirs' => False, + 'nofiles' => True + )); + + $fileinfo = $ls_array[0]; + + if ($fileinfo['name']) + { + if ($fileinfo['mime_type'] == 'Directory') + { + $this->messages.= $GLOBALS['phpgw']->common->error_list (array (lang('Cannot replace %1 because it is a directory', $fileinfo['name']))); + continue; + } + } + + if ($_FILES['upload_file']['size'][$i] > 0) + { + if ($fileinfo['name'] && $fileinfo['deleteable'] != 'N') + { + $tmp_arr=array( + 'string'=> $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes' => array ( + 'owner_id' => $GLOBALS['userinfo']['username'], + 'modifiedby_id' => $GLOBALS['userinfo']['username'], + 'modified' => $this->now, + 'size' => $_FILES['upload_file']['size'][$i], + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'deleteable' => 'Y', + 'comment' => stripslashes ($upload_comment[$i]) + ) + ); + $this->bo->vfs->set_attributes($tmp_arr); + + $tmp_arr=array ( + 'from' => $_FILES['upload_file']['tmp_name'][$i], + 'to' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) + ); + $this->bo->vfs->cp($tmp_arr); + + $this->messages.=lang('Replaced %1', $this->disppath.'/'.$_FILES['upload_file']['name'][$i]); + } + else + { + + $this->bo->vfs->cp (array ( + 'from'=> $_FILES['upload_file']['tmp_name'][$i], + 'to'=> $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) + )); + + $this->bo->vfs->set_attributes (array ( + 'string'=> $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes'=> array ( + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'comment' => stripslashes ($upload_comment[$i]) + ) + )); + + $this->messages.=lang('Created %1,%2', $this->disppath.'/'.$_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i]); + } + } + elseif ($_FILES['upload_file']['name'][$i]) + { + $this->bo->vfs->touch (array ( + 'string'=> $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL) + )); + + $this->bo->vfs->set_attributes (array ( + 'string'=> $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes'=> array ( + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'comment' => $upload_comment[$i] + ) + )); + + $this->messages.=lang('Created %1,%2', $this->disppath.'/'.$_FILES['upload_file']['name'][$i], $file_size[$i]); + } + } + + $this->readFilesInfo(); + $this->filelisting(); + } + + } + + # Handle Editing comments + function editComment() + { + while (list ($file) = each ($this->comment_files)) + { + if ($badchar = $this->bo->bad_chars ($this->comment_files[$file], False, True)) + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array ($file . $this->bo->html_encode (': ' . lang('Comments cannot contain "%1"', $badchar), 1))); + continue; + } + + $this->bo->vfs->set_attributes (array ( 'string' => $file, 'relatives' => array (RELATIVE_ALL), 'attributes' => array ( 'comment' => stripslashes ($this->comment_files[$file]) ) ) ); + + $this->messages=lang('Updated comment for %1', $this->path.'/'.$file); + } + + $this->readFilesInfo(); + $this->filelisting(); + } + + # Handle Renaming Files and Directories + function rename() + { + while (list ($from, $to) = each ($this->renamefiles)) + { + if ($badchar = $this->bo->bad_chars ($to, True, True)) + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('File names cannot contain "%1"', $badchar), 1))); + continue; + } + + if (ereg ("/", $to) || ereg ("\\\\", $to)) + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array (lang("File names cannot contain \\ or /"))); + } + elseif (!$this->bo->vfs->mv (array ( 'from' => $from, 'to' => $to )) ) + { + $this->messages= $GLOBALS['phpgw']->common->error_list (array (lang('Could not rename %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to))); + } + else + { + $this->messages=lang('Renamed %1 to %2', $this->disppath.'/'.$from, $this->disppath.'/'.$to); + } + } + $this->readFilesInfo(); + $this->filelisting(); + } + + # Handle Moving Files and Directories + function moveTo() + { + while (list ($num, $file) = each ($this->fileman)) + { + if ($this->bo->vfs->mv (array ( + 'from' => $file, + 'to' => $this->todir . '/' . $file, + 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) + ))) + { + $moved++; + $this->messages=lang('Moved %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); + } + else + { + $this->messages = $GLOBALS['phpgw']->common->error_list (array (lang('Could not move %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file))); + } + } + + if ($moved) + { + $x=0; + } + + $this->readFilesInfo(); + $this->filelisting(); + } + + // Handle Copying of Files and Directories + function copyTo() + { + while (list ($num, $file) = each ($this->fileman)) + { + if ($this->bo->vfs->cp (array ( 'from' => $file, 'to' => $this->todir . '/' . $file, 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) )) ) + { + $copied++; + $this->message .= lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); + } + else + { + $this->message .= $GLOBALS['phpgw']->common->error_list (array (lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file))); + } + } + + if ($copied) + { + $x=0; + } + + $this->readFilesInfo(); + $this->filelisting(); + + } + + function createdir() + { + if ($this->newdir && $this->newfile_or_dir) + { + if ($this->bo->badchar = $this->bo->bad_chars ($this->newfile_or_dir, True, True)) + { + $this->messages= $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('Directory names cannot contain "%1"', $badchar), 1))); + } + + if ($$this->newfile_or_dir[strlen($this->newfile_or_dir)-1] == ' ' || $this->newfile_or_dir[0] == ' ') + { + $this->messages= $GLOBALS['phpgw']->common->error_list (array (lang('Cannot create directory because it begins or ends in a space'))); + } + + $ls_array = $this->bo->vfs->ls (array ( + 'string' => $this->path . '/' . $this->newfile_or_dir, + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => True + )); $fileinfo = $ls_array[0]; if ($fileinfo['name']) { - if ($fileinfo['mime_type'] == 'Directory') + if ($fileinfo['mime_type'] != 'Directory') { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Cannot replace %1 because it is a directory', $fileinfo['name']))); - continue; + $this->messages= $GLOBALS['phpgw']->common->error_list (array ( + lang('%1 already exists as a file', + $fileinfo['name']) + )); + } + else + { + $this->messages= $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 already exists', $fileinfo['name']))); + } + } + else + { + if ($this->bo->vfs->mkdir (array ('string' => $this->newfile_or_dir))) + { + $this->messages=lang('Created directory %1', $this->disppath.'/'.$this->newfile_or_dir); + } + else + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('Could not create %1', $this->disppath.'/'.$this->newfile_or_dir))); } } - if ($_FILES['upload_file']['size'][$i] > 0) - { - if ($fileinfo['name'] && $fileinfo['deleteable'] != 'N') - { - $this->bo->vfs->set_attributes (array ( - 'string' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_ALL), - 'attributes' => array ( - 'owner_id' => $GLOBALS['userinfo']['username'], - 'modifiedby_id' => $GLOBALS['userinfo']['username'], - 'modified' => $now, - 'size' => $_FILES['upload_file']['size'][$i], - 'mime_type' => $_FILES['upload_file']['type'][$i], - 'deleteable' => 'Y', - 'comment' => stripslashes ($upload_comment[$i]) - ) - ) - ); - - $this->bo->vfs->cp(array ( - 'from' => $_FILES['upload_file']['tmp_name'][$i], - 'to' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) - ) - ); - - $this->html_text_summary(lang('Replaced %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $_FILES['upload_file']['size'][$i]); - } - else - { - $this->bo->vfs->cp (array ( - 'from' => $_FILES['upload_file']['tmp_name'][$i], - 'to' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) - ) - ); - - $this->bo->vfs->set_attributes (array ( - 'string' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_ALL), - 'attributes' => array ( - 'mime_type' => $_FILES['upload_file']['type'][$i], - 'comment' => stripslashes ($upload_comment[$i]) - ) - ) - ); - - $this->html_text_summary(lang('Created %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $_FILES['upload_file']['size'][$i]); - } -} -elseif ($_FILES['upload_file']['name'][$i]) -{ - $this->bo->vfs->touch (array ( - 'string' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_ALL) - ) -); - -$this->bo->vfs->set_attributes (array ( - 'string' => $_FILES['upload_file']['name'][$i], - 'relatives' => array (RELATIVE_ALL), - 'attributes' => array ( - 'mime_type' => $_FILES['upload_file']['type'][$i], - 'comment' => $upload_comment[$i] - ) -) - ); - - $this->html_text_summary(lang('Created %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $file_size[$i]); - } - } - - $this->html_break (2); - $this->html_link_back (); + $this->readFilesInfo(); + $this->filelisting(); } - ### - # Handle Editing comments - ### - - elseif ($comment_files) - { - while (list ($file) = each ($comment_files)) - { - if ($badchar = $this->bo->bad_chars ($comment_files[$file], False, True)) - { - echo $GLOBALS['phpgw']->common->error_list (array ($this->html_text_italic ($file, 1) . $this->bo->html_encode (': ' . lang('Comments cannot contain "%1"', $badchar), 1))); - continue; - } - - $this->bo->vfs->set_attributes (array ( - 'string' => $file, - 'relatives' => array (RELATIVE_ALL), - 'attributes' => array ( - 'comment' => stripslashes ($comment_files[$file]) - ) - ) - ); - - $this->html_text_summary (lang('Updated comment for %1', $path.'/'.$file)); - } - - $this->html_break (2); - $this->html_link_back (); } - ### - # Handle Renaming Files and Directories - ### - - elseif ($renamefiles) + function delete() { - while (list ($from, $to) = each ($renamefiles)) + for ($i = 0; $i != $this->numoffiles; $i++) { - if ($badchar = $this->bo->bad_chars ($to, True, True)) + if ($this->fileman[$i]) { - echo $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('File names cannot contain "%1"', $badchar), 1))); - continue; + if ($this->bo->vfs->delete (array ('string' => $this->fileman[$i]))) + { + $this->messages .= lang('Deleted %1', $this->disppath.'/'.$this->fileman[$i]).'
'; + } + else + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('Could not delete %1', $this->disppath.'/'.$this->fileman[$i]))); + } + } + } + $this->readFilesInfo(); + $this->filelisting(); + } + + + function debug_filemanager() + { + error_reporting (8); + + echo "Filemanager debug:
+ path: {$this->path}
+ disppath: {$this->disppath}
+ cwd: {$this->cwd}
+ lesspath: {$this->lesspath} +

+ eGroupware debug:
+ real getabsolutepath: " . $this->bo->vfs->getabsolutepath (array ('target' => False, 'mask' => False, 'fake' => False)) . "
+ fake getabsolutepath: " . $this->bo->vfs->getabsolutepath (array ('target' => False)) . "
+ appsession: " . $GLOBALS['phpgw']->session->appsession ('vfs','') . "
+ pwd: " . $this->bo->vfs->pwd () . "
"; + + echo '

'; + var_dump($this); + + + } + + function showUploadboxes() + { + $this->t->set_file(array('upload' => 'upload.tpl')); + $this->t->set_block('upload','upload_header','upload_header'); + $this->t->set_block('upload','row','row'); + $this->t->set_block('upload','upload_footer','upload_footer'); + + # Decide how many upload boxes to show + if (!$this->show_upload_boxes || $this->show_upload_boxes <= 0) + { + if (!$this->show_upload_boxes = $this->prefs['show_upload_boxes']) + { + $this->show_upload_boxes = 1; + } + } + + # Show file upload boxes. Note the last argument to html (). Repeats $this->show_upload_boxes times + if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add) + { + $vars[form_action]=$GLOBALS[phpgw]->link('/index.php','menuaction=filemanager.uifilemanager.index'); + $vars[path]=$this->path; + $vars[lang_file]=lang('File'); + $vars[lang_comment]=lang('Comment'); + $vars[num_upload_boxes]=$this->show_upload_boxes; + $this->t->set_var($vars); + $this->t->pparse('out','upload_header'); + + for($i=0;$i<$this->show_upload_boxes;$i++) + { + $this->t->set_var('row_tr_color',$tr_color); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); } - if (ereg ("/", $to) || ereg ("\\\\", $to)) + $vars[lang_upload]=lang('Upload files'); + $vars[change_upload_boxes].=lang('Show') . ' '; + $links.= $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','show_upload_boxes=5', '5'); + $links.=' '; + $links.= $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','show_upload_boxes=10', '10'); + $links.=' '; + $links.= $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','show_upload_boxes=20', '20'); + $links.=' '; + $links.= $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index','show_upload_boxes=50', '50'); + $links.=' '; + $links.= lang('upload fields'); + $vars[change_upload_boxes].=$links; + $this->t->set_var($vars); + $this->t->pparse('out','upload_footer'); + } + } + + /* create textfile */ + function createfile() + { + $this->createfile=$this->newfile_or_dir; + if ($this->createfile) + { + if ($badchar = $this->bo->bad_chars ($this->createfile, True, True)) { - echo $GLOBALS['phpgw']->common->error_list (array (lang("File names cannot contain \\ or /"))); + $this->messages = $GLOBALS['phpgw']->common->error_list (array ( + lang('File names cannot contain "%1"',$badchar), + 1) + ); + + $this->fileListing(); } - elseif (!$this->bo->vfs->mv (array ( - 'from' => $from, - 'to' => $to + + if ($this->bo->vfs->file_exists (array ( + 'string'=> $this->createfile, + 'relatives' => array (RELATIVE_ALL) + ))) + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('File %1 already exists. Please edit it or delete it first.', $this->createfile))); + $this->fileListing(); + } + + + if ($this->bo->vfs->touch (array ( 'string' => $this->createfile, 'relatives' => array (RELATIVE_ALL) )) ) + { + $this->fileman = array (); + $this->fileman[0] = $this->createfile; + $this->edit = 1; + $this->numoffiles++; + $this->edit(); + } + else + { + $this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('File %1 could not be created.', $this->createfile))); + $this->fileListing(); + } + } + } + + # Handle Editing files + function edit() + { + $this->readFilesInfo(); + + $this->t->set_file(array('filemanager_edit' => 'edit_file.tpl')); + $this->t->set_block('filemanager_edit','row','row'); + + $vars[preview_content]=''; + if ($this->edit_file) + { + $this->edit_file_content = stripslashes ($this->edit_file_content); + } + + if ($this->edit_preview) + { + $content = $this->edit_file_content; + + $vars[lang_preview_of]=lang('Preview of %1', $this->path.'/'.$edit_file); + + $vars[preview_content]=nl2br($content); + } + elseif ($this->edit_save || $this->edit_save_done) + { + $content = $this->edit_file_content; + + if ($this->bo->vfs->write (array ( + 'string' => $this->edit_file, + 'relatives' => array (RELATIVE_ALL), + 'content' => $content )) ) { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not rename %1 to %2', $disppath.'/'.$from, $disppath.'/'.$to))); - } - else - { - $this->html_text_summary (lang('Renamed %1 to %2', $disppath.'/'.$from, $disppath.'/'.$to)); - } - } + $this->messages=lang('Saved %1', $this->path.'/'.$this->edit_file); - $this->html_break (2); - $this->html_link_back (); - } - - ### - # Handle Moving Files and Directories - ### - - elseif ($move) - { - while (list ($num, $file) = each ($fileman)) - { - if ($this->bo->vfs->mv (array ( - 'from' => $file, - 'to' => $todir . '/' . $file, - 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) - )) - ) - { - $moved++; - $this->html_text_summary (lang('Moved %1 to %2', $disppath.'/'.$file, $todir.'/'.$file)); - } - else - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not move %1 to %2', $disppath.'/'.$file, $todir.'/'.$file))); - } - } - - if ($moved) - { - $this->html_break (2); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index?path='.$todir, lang('Go to %1', $todir)); - } - - $this->html_break (2); - $this->html_link_back (); -} - -### -# Handle Copying of Files and Directories -### - -elseif ($copy) -{ - while (list ($num, $file) = each ($fileman)) - { - if ($this->bo->vfs->cp (array ( - 'from' => $file, - 'to' => $todir . '/' . $file, - 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) - )) - ) - { - $copied++; - $this->html_text_summary (lang('Copied %1 to %2', $disppath.'/'.$file, $todir.'/'.$file)); - } - else - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not copy %1 to %2', $disppath.'/'.$file, $todir.'/'.$file))); - } -} - -if ($copied) -{ - $this->html_break (2); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$todir, lang('Go to %1', $todir)); -} - -$this->html_break (2); -$this->html_link_back (); - } - - ### - # Handle Deleting Files and Directories - ### - - elseif ($delete) - { - for ($i = 0; $i != $numoffiles; $i++) + if($this->edit_save_done) { - if ($fileman[$i]) - { - if ($this->bo->vfs->delete (array ('string' => $fileman[$i]))) - { - $this->html_text_summary (lang('Deleted %1', $disppath.'/'.$fileman[$i]), $fileinfo['size']); - } - else - { - $GLOBALS['phpgw']->common->error_list (array (lang('Could not delete %1', $disppath.'/'.$fileman[$i]))); - } - } - } - - $this->html_break (2); - $this->html_link_back (); - } - - elseif ($newdir && $createdir) - { - if ($this->bo->badchar = $this->bo->bad_chars ($createdir, True, True)) - { - echo $GLOBALS['phpgw']->common->error_list (array ($this->bo->html_encode (lang('Directory names cannot contain "%1"', $badchar), 1))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); - } - - if ($createdir[strlen($createdir)-1] == ' ' || $createdir[0] == ' ') - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Cannot create directory because it begins or ends in a space'))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); - } - - $ls_array = $this->bo->vfs->ls (array ( - 'string' => $path . '/' . $createdir, - 'relatives' => array (RELATIVE_NONE), - 'checksubdirs' => False, - 'nofiles' => True - ) - ); - - $fileinfo = $ls_array[0]; - - if ($fileinfo['name']) - { - if ($fileinfo['mime_type'] != 'Directory') - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('%1 already exists as a file', $fileinfo['name']))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); - } - else - { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 already exists', $fileinfo['name']))); - $this->html_break (2); - $this->html_link_back (); - $this->html_page_close (); + $this->readFilesInfo(); + $this->fileListing(); + exit; } } else { - if ($this->bo->vfs->mkdir (array ('string' => $createdir))) + $this->messages=lang('Could not save %1', $this->path.'/'.$this->edit_file); + } + } + + # Now we display the edit boxes and forms + for ($j = 0; $j != $this->numoffiles; $j++) + { + # If we're in preview or save mode, we only show the file + # being previewed or saved + if ($this->edit_file && ($this->fileman[$j] != $this->edit_file)) + { + continue; + } + + if ($this->fileman[$j] && $this->bo->vfs->file_exists (array ( 'string' => $this->fileman[$j], 'relatives' => array (RELATIVE_ALL) )) ) + { + if ($this->edit_file) { - $this->html_text_summary (lang('Created directory %1', $disppath.'/'.$createdir)); - $this->html_break (2); - $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$disppath.'/'.$createdir, lang('Go to %1', $disppath.'/'.$createdir)); + $content = stripslashes ($this->edit_file_content); } else { - echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not create %1', $disppath.'/'.$createdir))); + $content = $this->bo->vfs->read (array ('string' => $this->fileman[$j])); } + + $vars[form_action]= $GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->path); + $vars[edit_file]=$this->fileman[$j]; + + # We need to include all of the fileman entries for each file's form, + # so we loop through again + for ($i = 0; $i != $this->numoffiles; $i++) + { + if($this->fileman[$i]) $value='value="'.$this->fileman[$i].'"'; + $vars[filemans_hidden]=''; + + } + + $vars[file_content]=$content; + + + $vars[buttonPreview]=$this->inputImage('edit_preview','edit_preview',lang('Preview %1', $this->bo->html_encode ($this->fileman[$j], 1))); + $vars[buttonSave]=$this->inputImage('edit_save','save',lang('Save %1', $this->bo->html_encode ($this->fileman[$j], 1))); + $vars[buttonDone]=$this->inputImage('edit_save_done','ok',lang('Save %1, and go back to file listing ', $this->bo->html_encode ($this->fileman[$j], 1))); + $vars[buttonCancel]=$this->inputImage('edit_cancel','cancel',lang('Cancel editing %1 without saving', $this->bo->html_encode ($this->fileman[$j], 1))); + $this->t->set_var($vars); + $this->t->parse('rows','row'); + $this->t->pparse('out','row'); + + } + } + } + + + + function history() + { + if ($this->file) + { + $journal_array = $this->bo->vfs->get_journal (array ( + 'string' => $this->file, + 'relatives' => array (RELATIVE_ALL) + )); + + if (is_array ($journal_array)) + { + $this->html_table_begin (); + $this->html_table_row_begin (); + $this->html_table_col_begin (); + echo lang('Date'); + $this->html_table_col_end (); + $this->html_table_col_begin (); + echolang('Version'); + $this->html_table_col_end (); + $this->html_table_col_begin (); + echo lang('Who'); + $this->html_table_col_end (); + $this->html_table_col_begin (); + echo lang('Operation'); + $this->html_table_col_end (); + $this->html_table_row_end (); + + while (list ($num, $journal_entry) = each ($journal_array)) + { + $this->html_table_row_begin (); + $this->html_table_col_begin (); + $this->bo->html_text ($journal_entry['created'] . '   '); + $this->html_table_col_end (); + $this->html_table_col_begin (); + $this->bo->html_text ($journal_entry['version'] . '   ' ); + $this->html_table_col_end (); + $this->html_table_col_begin (); + $this->bo->html_text ($GLOBALS['phpgw']->accounts->id2name ($journal_entry['owner_id']) . '   '); + $this->html_table_col_end (); + $this->html_table_col_begin (); + $this->bo->html_text ($journal_entry['comment']); + $this->html_table_col_end (); + } + + $this->html_table_end (); + $GLOBALS['phpgw']->common->phpgw_footer (); + $GLOBALS['phpgw']->common->phpgw_exit (); + } + else + { + echo lang('No version history for this file/directory'); } - $this->html_break (2); - $this->html_link_back (); } - $this->html_page_close (); } - function html_form_begin ($action,$args, $method = 'post', $enctype = NULL, $string = HTML_FORM_BEGIN_STRING, $return = 0) + function view() { - $action = $this->bo->string_encode ($action, 1); - $action = SEP . $action; - //FIXME - $text = 'action="'.$this->html_link ($action, $args,NULL, 1, 0, 1).'"'; - - if ($method == NULL) + + if ($this->file) { - $method = 'post'; - } - $text .= ' method="'.$method.'"'; + $ls_array = $this->bo->vfs->ls (array ( + 'string' => $this->path.'/'.$this->file, + 'relatives' => array (RELATIVE_ALL), + 'checksubdirs' => False, + 'nofiles' => True + )); - if ($enctype != NULL && $enctype) - { - $text .= ' enctype="'.$enctype.'"'; - } + if ($ls_array[0]['mime_type']) + { + $mime_type = $ls_array[0]['mime_type']; + } + elseif ($this->prefs['viewtextplain']) + { + $mime_type = 'text/plain'; + } - $rstring = '
'; - return ($this->bo->eor ($rstring, $return)); + header('Content-type: ' . $mime_type); + echo $this->bo->vfs->read (array ( + 'string' => $this->path.'/'.$this->file, + 'relatives' => array (RELATIVE_NONE) + )); + $GLOBALS['phpgw']->common->phpgw_exit (); + } } - function html_form_input ($type = NULL, $name = NULL, $value = NULL, $maxlength = NULL, $size = NULL, $checked = NULL, $string = HTML_FORM_INPUT_STRING, $return = 0) + function download() + { + for ($i = 0; $i != $this->numoffiles; $i++) + { + if (!$this->fileman[$i]) + { + continue; + } + + $download_browser = CreateObject ('phpgwapi.browser'); + $download_browser->content_header ($this->fileman[$i]); + echo $this->bo->vfs->read (array ('string' => $this->fileman[$i])); + $GLOBALS['phpgw']->common->phpgw_exit (); + } + } + + //give back an array with all directories except current and dirs that are not accessable + function all_other_directories_options() + { + # First we get the directories in their home directory + $dirs = array (); + $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $GLOBALS['userinfo']['account_lid']); + + $tmp_arr=array ( + 'string' => $GLOBALS['homedir'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => True, + 'mime_type' => 'Directory' + ); + + $ls_array = $this->bo->vfs->ls ($tmp_arr); + + while (list ($num, $dir) = each ($ls_array)) + { + $dirs[] = $dir; + } + + + # Then we get the directories in their readable groups' home directories + reset ($this->readable_groups); + while (list ($num, $group_array) = each ($this->readable_groups)) + { + # Don't list directories for groups that don't have access + if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) + { + continue; + } + + $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $group_array['account_name']); + + $tmp_arr=array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => True, + 'mime_type' => 'Directory' + ); + + $ls_array = $this->bo->vfs->ls ($tmp_arr); + while (list ($num, $dir) = each ($ls_array)) + { + $dirs[] = $dir; + } + } + + reset ($dirs); + while (list ($num, $dir) = each ($dirs)) + { + if (!$dir['directory']) + { + continue; + } + + # So we don't display // + if ($dir['directory'] != '/') + { + $dir['directory'] .= '/'; + } + + # No point in displaying the current directory, or a directory that doesn't exist + if ((($dir['directory'] . $dir['name']) != $this->path) && $this->bo->vfs->file_exists (array ( 'string' => $dir['directory'] . $dir['name'], 'relatives' => array (RELATIVE_NONE) )) ) + { + //FIXME replace the html_form_option function + $options.=$this->html_form_option ($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']); + } + } + + return $options; + } + + + /* seek icon for mimetype else return an unknown icon */ + function mime_icon($mime_type, $size=16) + { + if(!$mime_type) $mime_type='unknown'; + + $mime_type= str_replace ('/','_',$mime_type); + + $img=$GLOBALS['phpgw']->common->image('filemanager','mime'.$size.'_'.strtolower($mime_type)); + if(!$img) $img=$GLOBALS['phpgw']->common->image('filemanager','mime'.$size.'_unknown'); + + $icon=''.lang($mime_type).''; + return $icon; + } + + function buttonImage($link,$img='',$help='') + { + + $image=$GLOBALS['phpgw']->common->image('filemanager','button_'.strtolower($img)); + + if($img) + { + return ' + '.$help.' + '; + } + } + + function inputImage($name,$img='',$help='') + { + $image=$GLOBALS['phpgw']->common->image('filemanager','button_'.strtolower($img)); + + if($img) + { + return ' + + '; + } + + + } + + function html_form_input ($type = NULL, $name = NULL, $value = NULL, $maxlength = NULL, $size = NULL, $checked = NULL, $string = '', $return = 1) { $text = ' '; if ($type != NULL && $type) @@ -1898,44 +1706,7 @@ $this->html_link_back (); $text .= 'checked '; } - $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_form_textarea ($name = NULL, $rows = NULL, $cols = NULL, $value = NULL, $string = HTML_FORM_TEXTAREA_STRING, $return = 0) - { - $text =' '; - if ($name != NULL && $name) - { - $text .= 'name="'.$name.'" '; - } - if (is_int ($rows) && $rows >= 0) - { - $text .= 'rows="'.$rows.'" '; - } - if (is_int ($cols) && $cols >= 0) - { - $text .= 'cols="'.$cols.'" '; - } - $rstring = ''.$value.''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_form_select_begin ($name = NULL, $return = 0) - { - $text = ' '; - if ($name != NULL && $name) - { - $text .= 'name="'.$name.'" '; - } - $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_form_select_end ($return = 0) - { - $rstring = ''; - return ($this->bo->eor ($rstring, $return)); + return ''; } function html_form_option ($value = NULL, $displayed = NULL, $selected = NULL, $return = 0) @@ -1949,270 +1720,47 @@ $this->html_link_back (); { $text .= ' selected'; } - $rstring = ''.$displayed.''; - return ($this->bo->eor ($rstring, $return)); + return ''.$displayed.''; } - function html_form_end ($return = 0) - { - $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - function html_nbsp ($times = 1, $return = 0) - { - if ($times == NULL) + function encode_href($href = NULL, $args = NULL , $extra_args) { - $times = 1; - } - for ($i = 0; $i != $times; $i++) - { - if ($return) - { - $rstring .= ' '; - } - else - { - echo ' '; - } - } - if ($return) - { - return ($rstring); - } - } - - function html ($string, $times = 1, $return = 0) - { - for ($i = 0; $i != $times; $i++) - { - if ($return) - { - $rstring .= $string; - } - else - { - echo $string; - } - } - if ($return) - { - return ($rstring); - } - } - - function html_break ($break, $string = '', $return = 0) - { - switch($break) - { - case 1: - $break_str = '
'; - break; - case 2: - $break_str = '

'; - break; - case 5: - $break_str = '


'; - break; - } - return ($this->bo->eor ($break_str . $string, $return)); - } - - function html_page_begin ($title = NULL, $return = 0) - { - // $rstring = HTML_PAGE_BEGIN_BEFORE_TITLE . $title . HTML_PAGE_BEGIN_AFTER_TITLE; - return ($this->bo->eor ($rstring, $return)); - } - - function html_page_body_begin ($bgcolor = HTML_PAGE_BODY_COLOR, $background = NULL, $text = NULL, $link = NULL, $vlink = NULL, $alink = NULL, $string = HTML_PAGE_BODY_STRING, $return = 0) - { - $text_out = ' '; - if ($bgcolor != NULL && $bgcolor) - { - $text_out .= 'bgcolor="'.$bgcolor.'" '; - } - if ($background != NULL && $background) - { - $text_out .= 'background="'.$background.'" '; - } - if ($text != NULL && $text) - { - $text_out .= 'text="'.$text.'" '; - } - if ($link != NULL && $link) - { - $text_out .= 'link="'.$link.'" '; - } - if ($vlink != NULL && $vlink) - { - $text_out .= 'vlink="'.$vlink.'" '; - } - if ($alink != NULL && $alink) - { - $text_out .= 'alink="'.$alink.'" '; - } - // $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_page_body_end ($return = 0) - { - // $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_page_end ($return = 0) - { - // $rstring = ''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_page_close () - { - // html_page_body_end (); - // html_page_end (); - $GLOBALS['phpgw']->common->phpgw_footer (); - $GLOBALS['phpgw']->common->phpgw_exit (); - } - function html_text_bold ($text = NULL, $return = 0, $lang = 0) - { - if ($lang) - { - $text = $this->bo->translate ($text); - } - $rstring = ''.$text.''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_text_underline ($text = NULL, $return = 0, $lang = 0) - { - if ($lang) - { - $text = $this->bo->translate ($text); - } - $rstring = ''.$text.''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_text_italic ($text = NULL, $return = 0, $lang = 0) - { - if ($lang) - { - $text = $this->bo->translate ($text); - } - $rstring = ''.$text.''; - return ($this->bo->eor ($rstring, $return)); - } - - function html_text_summary ($text = NULL, $size = NULL, $return = 0, $lang = 0) - { - if ($lang) - { - $text = $this->bo->translate ($text); - } - $rstring = $this->html_break (1, NULL, $return); - $rstring .= $this->html_text_bold ($text, $return); - $rstring .= $this->html_nbsp (3, $return); - if ($size != NULL && $size >= 0) - $rstring .= $this->bo->borkb ($size, 1, $return); - - $rstring = $this->bo->html_encode ($rstring, 1); - - if ($return) - { - return ($rstring); - } - } - - function html_text_summary_error ($text = NULL, $text2 = NULL, $size = NULL, $return = 0, $lang = 0) - { - if ($lang) - { - $text = $this->bo->translate ($lang); - } - $rstring = $this->html_text_error ($text, 1, $return); - - if (($text2 != NULL && $text2) || ($size != NULL && $size)) - { - $rstring .= $this->html_nbsp (3, $return); - } - if ($text2 != NULL && $text2) - { - $rstring .= $this->html_text_error ($text2, NULL, $return); - } - if ($size != NULL && $size >= 0) - { - $rstring .= $this->bo->borkb ($size, 1, $return); - } - - if ($return) - { - return ($rstring); - } - } - - function html_font_set ($size = NULL, $color = NULL, $family = NULL, $return = 0) - { - if ($size != NULL && $size) - $size = "size=$size"; - if ($color != NULL && $color) - $color = "color=$color"; - if ($family != NULL && $family) - $family = "family=$family"; - - $rstring = ""; - return ($this->bo->eor ($rstring, $return)); - } - - function html_font_end ($return = 0) - { - $rstring = ""; - return ($this->bo->eor ($rstring, $return)); - } - - function html_text_error ($errorwas = NULL, $break = 1, $return = 0) - { - if ($break) - $rstring .= $this->html_break (1, NULL, 1); - - $rstring .= $this->html_font_set (NULL, HTML_TEXT_ERROR_COLOR, NULL, 1); - $rstring .= $this->html_text_bold ($this->html_text_italic ($errorwas, 1), 1); - $rstring .= $this->html_font_end (1); - return ($this->bo->eor ($rstring, $return)); - } - - function html_page_error ($errorwas = NULL, $title = "Error", $return = 0) - { - $rstring = $this->html_page_begin ($title, $return); - $rstring .= $this->html_page_body_begin (HTML_PAGE_BODY_COLOR, $return); - $rstring .= $this->html_break (2, NULL, $return); - $rstring .= $this->html_text_error ($errorwas, $return); - $rstring .= $this->html_page_body_end ($return); - $rstring .= $this->html_page_end ($return); - if (!$return) - $this->html_page_close (); - else - return ($rstring); - } - - function html_link ($href = NULL, $args = NULL ,$text = NULL, $return = 0, $encode = 1, $linkonly = 0, $target = NULL) - { - if ($encode) $href = $this->bo->string_encode ($href, 1); + $all_args = $args.'&'.$this->bo->string_encode ($extra_args, 1); - //echo $encode; + $address = $GLOBALS['phpgw']->link ($href, $all_args); + return $address; + + } + + function html_link ($href = NULL, $args = NULL , $extra_args, $text = NULL, $return = 1, $encode = 1, $linkonly = 0, $target = NULL) + { + // unset($encode); + if ($encode) + { + $href = $this->bo->string_encode ($href, 1); + $all_args = $args.'&'.$this->bo->string_encode ($extra_args, 1); + } + else + { + // $href = $this->bo->string_encode ($href, 1); + $all_args = $args.'&'.$extra_args; + + } ### - # This decodes / back to normal + # This decodes / back to normal ### - $href = preg_replace ("/%2F/", "/", $href); - $text = trim ($text); + // $all_args = preg_replace ("/%2F/", "/", $all_args); + // $href = preg_replace ("/%2F/", "/", $href); + /* Auto-detect and don't disturb absolute links */ if (!preg_match ("|^http(.{0,1})://|", $href)) { //Only add an extra / if there isn't already one there - + // die(SEP); if (!($href[0] == SEP)) { @@ -2221,7 +1769,8 @@ $this->html_link_back (); /* $phpgw->link requires that the extra vars be passed separately */ // $link_parts = explode ("?", $href); - $address = $GLOBALS['phpgw']->link ($href, $args); + $address = $GLOBALS['phpgw']->link ($href, $all_args); + // $address = $GLOBALS['phpgw']->link ($href); } else { @@ -2240,22 +1789,14 @@ $this->html_link_back (); $target = 'target='.$target; } + $text = trim ($text); $rstring = ''.$text.''; } return ($this->bo->eor ($rstring, $return)); } - function html_link_back ($return = 0) - { - global $path; - - $rstring .= $this->html_link ('/index.php','menuaction=filemanager.uifilemanager.index&path='.$path, HTML_TEXT_NAVIGATION_BACK_TO_USER, 1); - - return ($this->bo->eor ($rstring, $return)); - } - - function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $cellpadding = NULL, $rules = NULL, $string = HTML_TABLE_BEGIN_STRING, $return = 0) + function html_table_begin ($width = NULL, $border = NULL, $cellspacing = NULL, $cellpadding = NULL, $rules = NULL, $string = '', $return = 0) { if ($width != NULL && $width) $width = "width=$width"; @@ -2272,14 +1813,6 @@ $this->html_link_back (); return ($this->bo->eor ($rstring, $return)); } - function html_link_email ($address = NULL, $text = NULL, $return = 0, $encode = 1) - { - if ($encode) - $href = $this->bo->string_encode ($href, 1); - - $rstring = "$text"; - return ($this->bo->eor ($rstring, $return)); - } function html_table_end ($return = 0) { @@ -2287,7 +1820,7 @@ $this->html_link_back (); return ($this->bo->eor ($rstring, $return)); } - function html_table_row_begin ($align = NULL, $halign = NULL, $valign = NULL, $bgcolor = NULL, $string = HTML_TABLE_ROW_BEGIN_STRING, $return = 0) + function html_table_row_begin ($align = NULL, $halign = NULL, $valign = NULL, $bgcolor = NULL, $string = '', $return = 0) { if ($align != NULL && $align) $align = "align=$align"; @@ -2307,7 +1840,7 @@ $this->html_link_back (); return ($this->bo->eor ($rstring, $return)); } - function html_table_col_begin ($align = NULL, $halign = NULL, $valign = NULL, $rowspan = NULL, $colspan = NULL, $string = HTML_TABLE_COL_BEGIN_STRING, $return = 0) + function html_table_col_begin ($align = NULL, $halign = NULL, $valign = NULL, $rowspan = NULL, $colspan = NULL, $string = '', $return = 0) { if ($align != NULL && $align) $align = "align=$align"; @@ -2329,49 +1862,5 @@ $this->html_link_back (); $rstring = ""; return ($this->bo->eor ($rstring, $return)); } - - - function html_text_header ($size = 1, $string = NULL, $return = 0, $lang = 0) - { - $rstring = "$string"; - return ($this->bo->eor ($rstring, $return)); - } - - function html_align ($align = NULL, $string = HTML_ALIGN_MAIN_STRING, $return = 0) - { - $rstring = "

"; - return ($this->bo->eor ($rstring, $return)); - } - - function html_image ($src = NULL, $alt = NULL, $align = NULL, $border = NULL, $string = HTML_IMAGE_MAIN_STRING, $return = 0) - { - if ($src != NULL && $src) - $src = "src=$src"; - if ($alt != NULL && $alt) - $alt = "alt=\"$alt\""; - if ($align != NULL && $align) - $align = "align=$align"; - if (is_int ($border) && $border >= 0) - $border = "border=$border"; - $rstring = ""; - return ($this->bo->eor ($rstring, $return)); - } - - function html_help_link ($help_name = NULL, $text = "[?]", $target = "_new", $return = 0) - { - global $settings; - global $appname; - - if (!$settings["show_help"]) - { - return 0; - } - - $rstring = $this->html_link ('index.php','menuaction=filemanager.uifilemanager.index&op=help&help_name=$help_name', $text, True, 1, 0, $target); - - return ($this->bo->eor ($rstring, $return)); - } - - + } - diff --git a/filemanager/inc/class.uiphpwebhosting.inc.php b/filemanager/inc/class.uiphpwebhosting.inc.php deleted file mode 100755 index ee5669479a..0000000000 --- a/filemanager/inc/class.uiphpwebhosting.inc.php +++ /dev/null @@ -1,1060 +0,0 @@ - * - * This class user interface for the phpwebhosting app * - * Copyright (C) 2002 Mark A Peters * - * -------------------------------------------------------------------------* - * This library is free software; you can redistribute it and/or modify it * - * under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or any later version. * - * This library is distributed in the hope that it will be useful, but * - * WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * - * See the GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License * - * along with this library; if not, write to the Free Software Foundation, * - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - \**************************************************************************/ - - /* $Id$ */ - - class uiphpwebhosting - { - - var $public_functions = array( - 'index' => True, - 'action' => True, - 'help' => True, - 'history' => True, - 'view' => True, - 'view_file' => True, - 'edit' => True - ); - - var $bo; - var $nextmatchs; - var $browser; - var $template_dir; - var $help_info; - - function uiphpwebhosting() - { - $this->bo = CreateObject('filemanager.bophpwebhosting'); - $this->nextmatchs = CreateObject('phpgwapi.nextmatchs'); - $this->browser = CreateObject('phpgwapi.browser'); - $this->template_dir = $GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']); - $this->check_access(); - $this->create_home_dir(); - $this->verify_path(); - $this->update(); - } - - function load_header() - { - unset($GLOBALS['phpgw_info']['flags']['noheader']); - unset($GLOBALS['phpgw_info']['flags']['nonavbar']); - unset($GLOBALS['phpgw_info']['flags']['noappheader']); - unset($GLOBALS['phpgw_info']['flags']['noappfooter']); - $GLOBALS['phpgw']->common->phpgw_header(); - } - - function check_access() - { - if($this->bo->path != $this->bo->homedir && $this->bo->path != $this->bo->fakebase && $this->bo->path != '/' && !$this->bo->vfs->acl_check($this->bo->path,Array(RELATIVE_NONE),PHPGW_ACL_READ)) - { - $this->no_access_exists(lang('You do not have access to %1',$this->bo->path)); - } - $this->bo->userinfo['working_id'] = $this->bo->vfs->working_id; - $this->bo->userinfo['working_lid'] = $GLOBALS['phpgw']->accounts->id2name($this->bo->userinfo['working_id']); - } - - function set_col_headers(&$p,$var,$append=True) - { - $p->set_var($var); - $p->parse('col_headers','column_headers',$append); - } - - function no_access_exists($error_msg) - { - if($this->bo->debug) - { - echo 'DEBUG: ui.no_access_exists: you do not have access to this directory
'."\n"; - } - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_unknowns('remove'); - - $p->set_file( - Array( - '_errors' => 'errors.tpl' - ) - ); - $p->set_block('_errors','error_page','error_page'); - $p->set_block('_errors','ind_error','ind_error'); - - $p->set_var('error',$error_msg); - $p->parse('errors','ind_error',True); - - $p->set_var('error','

Go to your Home directory' - ); - $p->parse('errors','ind_error',True); - $p->pfp('output','error_page'); - $GLOBALS['phpgw']->common->phpgw_exit(); - } - - function create_home_dir() - { - ### - # If their home directory doesn't exist, we create it - # Same for group directories - ### - - if($this->bo->debug) - { - echo 'DEBUG: ui.create_home_dir: PATH = '.$this->bo->path.'
'."\n"; - echo 'DEBUG: ui.create_home_dir: PATH = '.urlencode($this->bo->path).'
'."\n"; - } - - if(($this->bo->path == $this->bo->homedir) && !$this->bo->vfs->file_exists($this->bo->homedir,Array(RELATIVE_NONE))) - { - //$this->bo->vfs->override_acl = 1; - if (!$this->bo->vfs->mkdir($this->bo->homedir,Array(RELATIVE_NONE))) - { - echo lang('failed to create directory') . ' '. $this->bo->homedir . '

'; - } - //$this->bo->vfs->override_acl = 0; - } - elseif(preg_match("|^".$this->bo->fakebase."\/(.*)$|U",$this->bo->path,$this->bo->matches)) - { - if (!$this->bo->vfs->file_exists($this->bo->path,Array(RELATIVE_NONE))) - { - //$this->bo->vfs->override_acl = 1; - if (!$this->bo->vfs->mkdir($this->bo->homedir,Array(RELATIVE_NONE))) - { - echo lang('failed to create directory') . ' '. $this->bo->homedir . '

'; - } - //$this->bo->vfs->override_acl = 0; - - if($this->bo->debug) - { - echo 'DEBUG: ui.create_home_dir: PATH = '.$this->bo->path.'
'."\n"; - echo 'DEBUG: ui.create_home_dir(): matches[1] = '.$this->bo->matches[1].'
'."\n"; - } - - $group_id = $GLOBALS['phpgw']->accounts->name2id($this->bo->matches[1]); - if($group_id) - { - $this->bo->vfs->set_attributes($this->bo->path,Array(RELATIVE_NONE),Array('owner_id' => $group_id, 'createdby_id' => $group_id)); - } - } - } - } - - function verify_path() - { - ### - # Verify path is real - ### - - if($this->bo->debug) - { - echo 'DEBUG: ui.verify_path: PATH = '.$this->bo->path.'
'."\n"; - echo 'DEBUG: ui.verify_path: exists = '.$this->bo->vfs->file_exists($this->bo->path,Array(RELATIVE_NONE)).'
'."\n"; - } - - if($this->bo->path != $this->bo->homedir && - $this->bo->path != '/' && - $this->bo->path != $this->bo->fakebase && - !$this->bo->vfs->file_exists($this->bo->path,Array(RELATIVE_NONE))) - { - $this->no_access_exists(lang('Directory %1 does not exist',$this->bo->path)); - } - } - - function update() - { - /* Update if they request it, or one out of 20 page loads */ - srand((double)microtime() * 1000000); - if($this->bo->update || rand(0,19) == 4) - { - $this->bo->vfs->update_real($this->bo->path,Array(RELATIVE_NONE)); - } - if($this->bo->update) - { - Header('Location: '.$GLOBALS['phpgw']->link( - '/index.php', - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => urlencode($this->bo->path) - ) - ) - ); - } - } - - function action() - { - $actions = Array( - 'rename' => lang('Rename'), - 'delete' => lang('Delete'), - 'go' => lang('Go To'), - 'copy' => lang('Copy To'), - 'move' => lang('Move To'), - 'download' => lang('Download'), - 'newdir' => lang('Create Folder'), - 'newfile' => lang('Create File') - ); - @reset($actions); - while(list($function,$text) = each($actions)) - { - if(isset($this->bo->$function) && !empty($this->bo->$function) && trim(strtolower($this->bo->$function)) == strtolower($text)) - { - $f_function = 'f_'.$function; - $errors = $this->bo->$f_function(); - $var = Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => urlencode($this->bo->path) - ); - if($function == 'newfile') - { - $var = Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.edit', - 'path' => urlencode($this->bo->path), - 'file' => urlencode($this->bo->createfile) - ); - } - elseif(is_array($errors)) - { - $var['errors'] = urlencode(base64_encode(serialize($errors))); - } - Header('Location: '.$GLOBALS['phpgw']->link('/index.php',$var)); - } - } - } - - function help() - { - $this->load_header(); - $this->bo->load_help_info(); - @reset($this->bo->help_info); - while(list($num,$help_array) = each($this->bo->help_info)) - { - if ($help_array[0] != $this->bo->help_name) - { - continue; - } - - $help_array[1] = preg_replace("/\[(.*)\|(.*)\]/Ue","\$this->build_help('\\1','\\2')",$help_array[1]); - $help_array[1] = preg_replace("/\[(.*)\]/Ue","\$this->build_help('\\1','\\1')",$help_array[1]); - - echo ''."\n".ucwords(str_replace('_',' ',$help_array[0]))."\n".'
'."\n"; - echo ''."\n".$help_array[1].''; - } - $GLOBALS['phpgw']->common->phpgw_exit (); - } - - function build_help($help_option,$text='') - { - if($this->bo->settings['show_help']) - { - $help = ($text?'':''."\n"); - $help .= ' '; - $help .= ($text?$text:'[?]'); - $help .= ''; - $help .= ($text?'':"\n".' '); - return $help; - } - else - { - return ''; - } - } - - function image($image,$alt) - { - return ''.$alt.''; - } - - function link($array_params,$text) - { - return ''.$text.''; - } - - function build_upload_choices($number) - { - return $this->link( - Array( - 'menuaction' => $GLOBALS['HTTP_GET_VARS']['menuaction'], - 'path' => $this->bo->path, - 'show_upload_boxes' => $number - ), - $number).'  '; - } - - function column_header(&$p,$internal,$displayed,$link=True) - { - if($link) - { - $header_str = ''.lang($displayed).''; - } - else - { - $header_str = $displayed; - } - $this->set_col_headers( - $p, - Array( - 'td_extras' => '', - 'column_header' => $header_str.$this->build_help($internal) - ) - ); - } - - function display_buttons() - { - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_file( - Array( - '_buttons' => 'small_table.tpl' - ) - ); - $p->set_block('_buttons','table','table'); - $p->set_block('_buttons','column_headers','column_headers'); - $p->set_block('_buttons','column_headers_normal','column_headers_normal'); - $p->set_block('_buttons','column_rows','column_rows'); - - $var = Array( - 'table_extras' => '', - 'tr_extras' => '', - 'td_extras' => ' align="center" width="25%"' - ); - - $var['column_header'] = ''.$this->build_help('edit'); - $this->set_col_headers($p,$var,False); - - $var['column_header'] = ''.$this->build_help('rename'); - $this->set_col_headers($p,$var); - - $var['column_header'] = ''.$this->build_help('delete'); - $this->set_col_headers($p,$var); - - $var['column_header'] = ''.$this->build_help('edit_comments'); - $this->set_col_headers($p,$var); - $p->parse('list','column_rows',True); - - $var['column_header'] = ''.$this->build_help('go_to'); - $this->set_col_headers($p,$var,False); - - $var['column_header'] = ''.$this->build_help('copy_to'); - $this->set_col_headers($p,$var); - - $var['column_header'] = ''.$this->build_help('move_to'); - $this->set_col_headers($p,$var); - - ### - # First we get the directories in their home directory - ### - - $dirs[] = Array( - 'directory' => $this->bo->fakebase, - 'name' => $this->bo->userinfo['account_lid'] - ); - $ls_array = $this->bo->vfs->ls($this->bo->homedir,Array(RELATIVE_NONE),True,'Directory'); - while(list($num,$dir) = each($ls_array)) - { - $dirs[] = $dir; - } - - ### - # Then we get the directories in their membership's home directories - ### - - reset($this->bo->memberships); - while(list($num,$group_array) = each($this->bo->memberships)) - { - ### - # Don't list directories for groups that don't have access - ### - - if(!$this->bo->membership_applications[$group_array['account_name']][$this->bo->appname]['enabled']) - { - continue; - } - - $dirs[] = Array( - 'directory' => $this->bo->fakebase, - 'name' => $group_array['account_name'] - ); - - $ls_array = $this->bo->vfs->ls($this->bo->fakebase.SEP.$group_array['account_name'],Array(RELATIVE_NONE),True,'Directory'); - while(list($num,$dir) = each($ls_array)) - { - $dirs[] = $dir; - } - } - - $dir_list = ''; - reset($dirs); - while(list($num, $dir) = each($dirs)) - { - if(!$dir['directory']) - { - continue; - } - - ### - # So we don't display // - ### - - if($dir['directory'] != '/') - { - $dir['directory'] .= SEP; - } - - $selected = ''; - if($num == 0) - { - $selected = ' selected'; - } - - ### - # No point in displaying the current directory, or a directory that doesn't exist - ### - - if((($dir['directory'].$dir['name']) != $this->bo->path) && $this->bo->vfs->file_exists($dir['directory'].$dir['name'],Array(RELATIVE_NONE))) - { - $dir_list .= ''; - } - } - - $var['column_header'] = ''.$this->build_help('directory_list'); - $this->set_col_headers($p,$var); - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - - $var = Array( - 'tr_extras' => '', - 'td_extras' => ' colspan="2" align="center" width="50%"' - ); - - if($this->bo->path != '/' && $this->bo->path != $this->bo->fakebase) - { - $var['column_header'] = ''.$this->build_help('download'); - $this->set_col_headers($p,$var); - - $var['column_header'] = '    '.$this->build_help('create_folder'); - $this->set_col_headers($p,$var); - $p->parse('list','column_rows',True); - } - - $var['column_header'] = ''.$this->build_help('update'); - $this->set_col_headers($p,$var,False); - - if($this->bo->path != '/' && $this->bo->path != $this->bo->fakebase) - { - $var['column_header'] = '    '.$this->build_help('create_file'); - } - else - { - $var['column_header'] = ' '; - } - $this->set_col_headers($p,$var); - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - - if($this->bo->settings['show_command_line']) - { - $var = Array( - 'tr_extras' => '', - 'td_extras' => ' colspan="4" align="center" width="100%"', - 'column_header' => ''.$this->build_help('command_line').'
'.$this->build_help('execute') - ); - $this->set_col_headers($p,$var); - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - } - return $p->fp('output','table'); - } - - function display_summary_info($numoffiles,$usedspace) - { - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_file( - Array( - '_info' => 'small_table.tpl' - ) - ); - $p->set_block('_info','table','table'); - $p->set_block('_info','column_headers','column_headers'); - $p->set_block('_info','column_headers_normal','column_headers_normal'); - $p->set_block('_info','column_rows','column_rows'); - $this_homedir = ($this->bo->path == $this->bo->homedir || $this->bo->path == $this->bo->fakedir); - $info_columns = 4 + ($this_homedir?2:0); - - $var = Array( - 'table_extras' => ' cols="'.$info_columns.'"', - 'tr_extras' => '', - 'td_extras' => ' colspan="'.$info_columns.'" align="center" width="100%"', - 'column_header' => $this->build_help('file_stats') - ); - $this->set_col_headers($p,$var,False); - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - - $var = Array( - 'tr_extras' => '', - 'td_extras' => ' align="right"' - ); - - $var['column_header'] = ''.lang('Files').':'; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - - $var['td_extras'] = ' align="left"'; - $var['column_header'] = $numoffiles; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $var['td_extras'] = ' align="right"'; - $var['column_header'] = ''.lang('Used Space').':'; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $var['td_extras'] = ' align="left"'; - $var['column_header'] = $this->bo->borkb($usedspace); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - if($this_homedir) - { - $var['td_extras'] = ' align="right"'; - $var['column_header'] = ''.lang('Unused space').':'; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $var['td_extras'] = ' align="left"'; - $var['column_header'] = $this->bo->borkb($this->bo->userinfo['hdspace'] - $usedspace); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - } - - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - - if($this_homedir) - { - $var['td_extras'] = ' colspan="'.($info_columns / 2).'" align="right" width="50%"'; - $var['column_header'] = ''.lang('Total Files').':'; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - - $var['td_extras'] = ' colspan="'.($info_columns / 2).'" align="left" width="50%"'; - $var['column_header'] = count($this->bo->vfs->ls($this->bo->path,Array(RELATIVE_NONE))); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $p->parse('list','column_rows',True); - $p->set_var('col_headers',''); - } - return $p->fp('output','table'); - } - - function display_uploads() - { - - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_file( - Array( - '_uploads' => 'small_table.tpl' - ) - ); - $p->set_block('_uploads','table','table'); - $p->set_block('_uploads','column_headers','column_headers'); - $p->set_block('_uploads','column_headers_normal','column_headers_normal'); - $p->set_block('_uploads','column_rows','column_rows'); - - $var = Array( - 'table_extras' => ' cols="3"', - 'tr_extras' => '' - ); - - $var['td_extras'] = ' align="right" width="45%"'; - $var['column_header'] = ''.lang('File').''.$this->build_help('upload_file'); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - - $var['td_extras'] = ' align="center" width="10%"'; - $var['column_header'] = ' '; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $var['td_extras'] = ' align="left" width="45%"'; - $var['column_header'] = ''.lang('Comment').''.$this->build_help('upload_comment'); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',True); - - $p->parse('list','column_rows',True); - - $input_file = ''; - $input_comment = ''; - - $var['tr_extras'] = ''; - $var['td_extras'] = ' colspan="3" align="center"'; - $var['column_header'] = ''."\n".$input_file.$input_comment; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - $p->parse('list','column_rows',True); - - for($i=1;$i<$this->bo->show_upload_boxes;$i++) - { - $var['column_header'] = $input_file.$input_comment; - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - $p->parse('list','column_rows',True); - } - - $var['column_header'] = ''.$this->build_help('upload_files'); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - $p->parse('list','column_rows',True); - - $var['column_header'] = lang('Show').'  '.$this->build_upload_choices(5).$this->build_upload_choices(10).$this->build_upload_choices(20).$this->build_upload_choices(30).lang('upload fields').$this->build_help('show_upload_fields'); - $p->set_var($var); - $p->parse('col_headers','column_headers_normal',False); - $p->parse('list','column_rows',True); - - return '

'."\n".$p->fp('output','table').'
'."\n"; - } - - function index() - { - $this->load_header(); - $files_array = $this->bo->load_files(); - if(count($files_array) || $this->bo->cwd) - { - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_unknowns('remove'); - - $p->set_file( - Array( - '_index' => 'index.tpl' - ) - ); - $p->set_block('_index','index','index'); - $p->set_block('_index','column_headers','column_headers'); - $p->set_block('_index','column_headers_normal','column_headers_normal'); - $p->set_block('_index','column_rows','column_rows'); - - $GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['row_off']; - $var = Array( - 'error' => (isset($this->bo->errors) && is_array(unserialize(base64_decode($this->bo->errors)))?$GLOBALS['phpgw']->common->error_list(unserialize(base64_decode($this->bo->errors)),'Results'):''), - 'tr_extras' => ' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"', - 'form_action' => $GLOBALS['phpgw']->link('/index.php', - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.action', - 'path' => urlencode($this->bo->path) - ) - ), - 'img_up' => $this->link(Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => urlencode($this->bo->lesspath) - ), - $this->image('folder_up.gif',lang('Up'))), - 'help_up' => $this->build_help('up'), - 'img_home' => $this->image('folder_home.gif',lang('Folder')), - 'dir' => ''."\n" - . ' '.strtoupper($this->bo->path).''."\n" - . ' ', - 'help_home' => $this->build_help('home'), - 'col_headers' => '', - 'column_header' => '' - ); - $p->set_var($var); - - $this->column_header($p,'sort_by','Sort By',False); - - $columns = 1; - @reset($this->bo->file_attributes); - while(list($internal,$displayed) = each($this->bo->file_attributes)) - { - if ($this->bo->settings[$internal]) - { - $this->column_header($p,$internal,$displayed,True); - $columns++; - } - } - $p->parse('col_row','column_rows',True); - $p->set_var('col_headers',''); - -// $var = Array( -// 'tr_extras' => ' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"' -// ); -// $this->set_col_headers($p,$var,True); - - $p->set_var('colspan',$columns); - - if($this->bo->settings['dotdot'] && $this->bo->settings['name'] && $this->bo->path != '/') - { - $this->set_col_headers( - $p, - Array( - 'tr_extras' => ' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"', - 'col_headers' => '', - 'td_extras' => '', - 'column_header' => ' ' - ) - ); - - $this->set_col_headers( - $p, - Array( - 'column_header' => $this->image('folder.gif','folder') - .$this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => $this->bo->lesspath - ), - '..' - ) - ) - ); - - $loop_cntr = 2; - - if($this->bo->settings['mime_type']) - { - $this->set_col_headers( - $p, - Array( - 'column_header' => 'Directory' - ) - ); - $loop_cntr++; - } - - for($i=$loop_cntr;$i<$columns;$i++) - { - $this->set_col_headers( - $p, - Array( - 'column_header' => ' ' - ) - ); - } - $p->parse('col_row','column_rows',True); - $p->set_var('col_headers',''); - } - - $usedspace = 0; - reset($files_array); - $numoffiles = count($files_array); - for($i=0;$i!=$numoffiles;$i++) - { - $files = $files_array[$i]; - $var = Array( - 'tr_extras' => ' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"', - 'td_extras' => '', - 'column_header' => '' - ); - $this->set_col_headers($p,$var,False); -// $p->set_var($var); -// $p->parse('col_headers','column_headers'); - - $usedspace += $files['size']; - - @reset($this->bo->file_attributes); - while(list($internal,$displayed) = each($this->bo->file_attributes)) - { - if($this->bo->settings[$internal]) - { - $var = Array( - 'td_extras' => '' - ); - switch($internal) - { - case 'name': - switch($files['mime_type']) - { - case 'Directory': - $var['column_header'] = $this->image('folder.gif','folder') - .$this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => $this->bo->path.SEP.$files['name'] - ), - ''.$files['name'].'' - ); - break; - default: - $var['column_header'] = $this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.view', - 'path' => urlencode($this->bo->path), - 'file' => urlencode($files['name']) - ), - ''.$files['name'].'' - ); - break; - } - break; - case 'deletable': - if ($files['deleteable'] == 'N') - { - $var['column_header'] = $this->image('locked.gif','locked'); - } - else - { - $var['column_header'] = ' '; - } - break; - case 'size': - $var['column_header'] = $this->bo->borkb($files['size']); - $var['td_extras'] = ' align="right"'; - break; - case 'version': - $var['column_header'] = $this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.history', - 'path' => $this->bo->path, - 'file' => $files['name'] - ), - $files['version'] - ); - break; - case 'modified': - case 'created': - $var['column_header'] = $this->bo->convert_date($files[$internal]); - break; - case 'owner': - case 'createdby_id': - case 'modifiedby_id': - switch($internal) - { - case 'owner': - $ivar = 'owner_id'; - break; - default: - $ivar = $internal; - break; - } - $var['column_header'] = ($files[$ivar]?$GLOBALS['phpgw']->accounts->id2name($files[$ivar]):' '); - break; - default: - $var['column_header'] = ($files[$internal]?$files[$internal]:' '); - break; - } - $this->set_col_headers($p,$var); - } - } - $p->parse('col_row','column_rows',True); - $p->set_var('col_headers',''); - } - - $p->set_var('buttons',$this->display_buttons()); - $p->set_var('info',$this->display_summary_info($numoffiles,$usedspace)); - $p->set_var('uploads',$this->display_uploads()); - - $p->pfp('output','index'); - } - } - - function view() - { - $this->load_header(); - if($this->bo->vfs->file_exists($this->bo->path.'/'.$this->bo->file,Array(RELATIVE_NONE))) - { - $content_type = $this->bo->vfs->file_type($this->bo->path.$this->bo->dispsep.$this->bo->file,Array(RELATIVE_NONE)); - if($content_type) - { - $cont_type = explode('/',$content_type); - $content_type = $cont_type[1]; - } - else - { - } - switch($content_type) - { - case 'jpeg': - case 'gif': - case 'bmp': - case 'png': - $alignment = 'center'; - $file_content = ''."\n"; - break; - default: - $alignment = 'left'; - $file_content = nl2br($this->bo->vfs->read($this->bo->path.$this->bo->dispsep.$this->bo->file,Array(RELATIVE_NONE))); - break; - } - $file = $this->bo->path.$this->bo->dispsep.$this->bo->file; - $GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['row_off']; - - echo ''."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . ' '."\n" - . '
'."\n" - . ' TYPE: '.$this->bo->vfs->file_type($file,Array(RELATIVE_NONE)).'
'."\n" - . '
'."\n" - . ' FILENAME: '.$file."\n" - . '
'."\n" - . ' VERSION: '.$this->bo->vfs->get_version($file,Array(RELATIVE_NONE))."\n" - . '
'."\n" - . $file_content."\n" - . '
'."\n"; - } - } - - function history() - { - $this->load_header(); - $file = $this->bo->path.$this->bo->dispsep.$this->bo->file; - if($this->bo->vfs->file_exists($file,Array(RELATIVE_NONE))) - { - $col_headers = Array( - 'Date' => 'created', - 'Version' => 'version', - 'Action Performed by' => 'owner_id', - 'Operation' => 'comment' - ); - $p = CreateObject('phpgwapi.Template',$this->template_dir); - $p->set_unknowns('remove'); - - $p->set_file( - Array( - '_history' => 'history.tpl' - ) - ); - $p->set_block('_history','history','history'); - $p->set_block('_history','column_headers','column_headers'); - $p->set_block('_history','column_rows','column_rows'); - - $var = Array( - 'path' => $this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', - 'path' => urlencode($this->bo->path) - ), - $this->bo->path - ), - 'filename' => $this->link( - Array( - 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.view', - 'path' => urlencode($this->bo->path), - 'file' => urlencode($this->bo->file) - ), - $this->bo->file - ) - ); - $p->set_var($var); - - $GLOBALS['tr_color'] = $GLOBALS['phpgw_info']['theme']['row_off']; - $var = Array( - 'td_extras' => '' - ); - @reset($col_headers); - while(list($label,$field)= each($col_headers)) - { - $var['column_header'] = ''.$label.''; - $this->set_col_headers($p,$var); - } - $p->set_var('tr_extras',' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"'); - $p->parse('col_row','column_rows',True); - $p->set_var('col_headers',''); - - $journal_array = $this->bo->vfs->get_journal($file,Array(RELATIVE_NONE)); - while(list($num,$journal_entry) = each($journal_array)) - { - @reset($col_headers); - while(list($label,$field)= each($col_headers)) - { - switch($field) - { - case 'owner_id': - $var['column_header'] = ''.$GLOBALS['phpgw']->accounts->id2name($journal_entry[$field]).''; - break; - case 'created': - $var['column_header'] = ''.$this->bo->convert_date($journal_entry[$field]).''; - break; - default: - $var['column_header'] = ''.$journal_entry[$field].''; - break; - } - $this->set_col_headers($p,$var); - } - $p->set_var('tr_extras',' bgcolor="'.$this->nextmatchs->alternate_row_color().'" border="0"'); - $p->parse('col_row','column_rows',True); - $p->set_var('col_headers',''); - } - $p->pfp('output','history'); - } - } - - function view_file($file_array='') - { - if(is_array($file_array)) - { - $this->bo->path = $file_array['path']; - $this->bo->file = $file_array['file']; - } - $file = $this->bo->path.SEP.$this->bo->file; - if($this->bo->vfs->file_exists($file,Array(RELATIVE_NONE))) - { - $browser = CreateObject('phpgwapi.browser'); - $browser->content_header($this->bo->file,$this->bo->vfs->file_type($file,Array(RELATIVE_NONE)),$this->bo->vfs->get_size($file,Array(RELATIVE_NONE)),True); -// $browser->content_header($this->bo->file); - echo $this->bo->vfs->read($file,Array(RELATIVE_NONE)); - flush(); - } - if(!is_array($file_array)) - { - $GLOBALS['phpgw']->common->phpgw_exit (); - } - } - - function edit() - { - $this->load_header(); - } - } diff --git a/filemanager/inc/hook_preferences.inc.php b/filemanager/inc/hook_preferences.inc.php index b56245e026..321bf81933 100644 --- a/filemanager/inc/hook_preferences.inc.php +++ b/filemanager/inc/hook_preferences.inc.php @@ -15,7 +15,8 @@ // Only Modify the $file and $title variables..... $title = $appname; $file = Array( - lang('Preferences') => $GLOBALS['phpgw']->link('/filemanager/preferences.php') + 'Preferences Old' => $GLOBALS['phpgw']->link('/filemanager/preferences.php'), + 'Preferences' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname) ); //Do not modify below this line display_section($appname,$title,$file); diff --git a/filemanager/inc/hook_settings.inc.php b/filemanager/inc/hook_settings.inc.php new file mode 100644 index 0000000000..d5bdd124f7 --- /dev/null +++ b/filemanager/inc/hook_settings.inc.php @@ -0,0 +1,65 @@ + * + * -------------------------------------------- * + * This program is free software; you can redistribute it and/or modify it * + * under the terms of the GNU General Public License as published by the * + * Free Software Foundation; either version 2 of the License, or (at your * + * option) * + \**************************************************************************/ + + //ExecMethod('filemanager.bofilemanager.check_set_default_prefs'); + + /*create_section('TESTING'); + + create_check_box('Use new experimental Filemanager?','experimental_new_code','The future filemanager, now for TESTING PURPOSES ONLY, please send bugreports'); + + */ + create_section('Display attributes'); + + $file_attributes = Array( + 'name' => 'File Name', + 'mime_type' => 'MIME Type', + 'size' => 'Size', + 'created' => 'Created', + 'modified' => 'Modified', + 'owner' => 'Owner', + 'createdby_id' => 'Created by', + 'modifiedby_id' => 'Created by', + 'modifiedby_id' => 'Modified by', + 'app' => 'Application', + 'comment' => 'Comment', + 'version' => 'Version' + ); + + while (list ($key, $value) = each ($file_attributes)) + { + create_check_box($value,$key); + } + + create_section('Other settings'); + + $other_checkboxes = array ( + "viewinnewwin" => "View documents in new window", + "viewonserver" => "View documents on server (if available)", + "viewtextplain" => "Unknown MIME-type defaults to text/plain when viewing", + "dotdot" => "Show ..", + "dotfiles" => "Show .files", + ); + + while (list ($key, $value) = each ($other_checkboxes)) + { + create_check_box($value,$key); + } + + $upload_boxes=array( + "1"=>"1", + "5"=>"5", + "10"=>"10", + "20"=>"20", + "30"=>"30" + ); + + create_select_box('Default number of upload fields to show','show_upload_boxes',$upload_boxes); diff --git a/filemanager/index.php b/filemanager/index.php index 307dd654ac..9e4dbf5dd3 100755 --- a/filemanager/index.php +++ b/filemanager/index.php @@ -1,15 +1,15 @@ 'filemanager', 'noheader' => True, 'nonavbar' => True, @@ -17,23 +17,17 @@ 'noappfooter' => True, 'nofooter' => True ); + + $GLOBALS['phpgw_info']['flags'] = $phpgw_flags; - $GLOBALS['phpgw_info']['flags'] = $phpgw_flags; - - include('../header.inc.php'); + include('../header.inc.php'); + // $GLOBALS['phpgw']->common->phpgw_exit(); Header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.index')); $GLOBALS['phpgw']->common->phpgw_exit(); } - ### - # DEV NOTE: - # - # index.php is depreciated by the inc/class.xxphpwebhosting.inc.php files. - # index.php is still used in the 0.9.14 release, but all future changes should be - # made to the inc/class.xxphpwebhosting.inc.php files (3-tiered). This includes using templates. - ### - + ### # Enable this to display some debugging info ### @@ -104,6 +98,7 @@ } } + if ($noheader || $nofooter || ($download && (count ($fileman) > 0)) || ($op == 'view' && $file) || ($op == 'history' && $file) || ($op == 'help' && $help_name)) { $noheader = True; @@ -122,6 +117,38 @@ include ('../header.inc.php'); + if (!count ($GLOBALS['settings'])) + { + $pref = CreateObject ('phpgwapi.preferences', $GLOBALS['userinfo']['username']); + $pref->read_repository (); +// $GLOBALS['phpgw']->hooks->single ('add_def_pref', $GLOBALS['appname']); +// $pref->save_repository (True); + $pref_array = $pref->read_repository (); + $GLOBALS['settings'] = $pref_array[$GLOBALS['appname']]; + } +//experimental_new_code +//die($GLOBALS[][experimental_new_code]); +/* if($GLOBALS[settings][experimental_new_code]) + { + echo ' + + + '; + + } +*/ + + + if ($execute && $command_line) { if ($result = $GLOBALS['phpgw']->vfs->command_line (array ('command_line' => stripslashes ($command_line)))) @@ -138,6 +165,9 @@ } } + + + ### # Page to process users # Code is fairly hackish at the beginning, but it gets better @@ -635,15 +665,6 @@ if ($messages) html_text ($messages); } -if (!count ($GLOBALS['settings'])) -{ - $pref = CreateObject ('phpgwapi.preferences', $GLOBALS['userinfo']['username']); - $pref->read_repository (); - $GLOBALS['phpgw']->hooks->single ('add_def_pref', $GLOBALS['appname']); - $pref->save_repository (True); - $pref_array = $pref->read_repository (); - $GLOBALS['settings'] = $pref_array[$GLOBALS['appname']]; -} ### # Start Main Table diff --git a/filemanager/indexold.php b/filemanager/indexold.php new file mode 100755 index 0000000000..f01ae50f5d --- /dev/null +++ b/filemanager/indexold.php @@ -0,0 +1,1785 @@ + array ('op' => ''), + 'path' => array ('path' => ''), + 'file' => array ('file' => ''), + 'sortby' => array ('sortby' => ''), + 'fileman' => array ('fileman' => ''), + 'messages' => array ('messages' => ''), + 'help_name' => array ('help_name' => ''), + 'renamefiles' => array ('renamefiles' => ''), + 'comment_files' => array ('comment_files' => ''), + 'show_upload_boxes' => array ('show_upload_boxes' => '') +); + +reset ($to_decode); +while (list ($var, $conditions) = each ($to_decode)) +{ + while (list ($condvar, $condvalue) = each ($conditions)) + { + if (isset ($$condvar) && ($condvar == $var || $$condvar == $condvalue)) + { + if (is_array ($$var)) + { + $temp = array (); + //some fixes in this section were supplied by Michael Totschnig + while (list ($varkey, $varvalue) = each ($$var)) + { + if (is_int ($varkey)) + { + $temp[$varkey] = stripslashes (base64_decode(urldecode(($varvalue)))); + } + else + { + $temp[stripslashes (base64_decode(urldecode(($varkey))))] = $varvalue; + } + } + $$var = $temp; + } + elseif (isset ($$var)) + { + $$var = stripslashes (base64_decode(urldecode ($$var))); + } + } + } +} + +if ($noheader || $nofooter || ($download && (count ($fileman) > 0)) || ($op == 'view' && $file) || ($op == 'history' && $file) || ($op == 'help' && $help_name)) +{ + $noheader = True; + $nofooter = True; +} + +$GLOBALS['phpgw_info']['flags'] = array +( + 'currentapp' => 'filemanager', + 'noheader' => $noheader, + 'nofooter' => $nofooter, + 'noappheader' => False, + 'enable_vfs_class' => True, + 'enable_browser_class' => True +); + +include ('../header.inc.php'); + +if ($execute && $command_line) +{ + if ($result = $GLOBALS['phpgw']->vfs->command_line (array ('command_line' => stripslashes ($command_line)))) + { + $messages = html_text_bold (lang('Command sucessfully run'),1); + if ($result != 1 && strlen ($result) > 0) + { + $messages .= html_break (2, NULL, 1) . $result; + } + } + else + { + $messages = $GLOBALS['phpgw']->common->error_list (array (lang('Error running command'))); + } +} + +### +# Page to process users +# Code is fairly hackish at the beginning, but it gets better +# Highly suggest turning wrapping off due to long SQL queries +### + +### +# Some hacks to set and display directory paths correctly +### + +if ($go) +{ + $path = $todir; +} + +if (!$path) +{ + $path = $GLOBALS['phpgw']->vfs->pwd (); + + if (!$path || $GLOBALS['phpgw']->vfs->pwd (array ('full' => False)) == '') + { + $path = $GLOBALS['homedir']; + } +} + +$GLOBALS['phpgw']->vfs->cd (array ('string' => False, 'relatives' => array (RELATIVE_NONE), 'relative' => False)); +$GLOBALS['phpgw']->vfs->cd (array ('string' => $path, 'relatives' => array (RELATIVE_NONE), 'relative' => False)); + +$pwd = $GLOBALS['phpgw']->vfs->pwd (); + +if (!$cwd = substr ($path, strlen ($GLOBALS['homedir']) + 1)) +{ + $cwd = '/'; +} +else +{ + $cwd = substr ($pwd, strrpos ($pwd, '/') + 1); +} + +$disppath = $path; + +/* This just prevents // in some cases */ +if ($path == '/') + $dispsep = ''; +else + $dispsep = '/'; + +if (!($lesspath = substr ($path, 0, strrpos ($path, '/')))) + $lesspath = '/'; + +$now = date ('Y-m-d'); + +if ($phpwh_debug) +{ + echo "PHPWebHosting debug:
+ path: $path
+ disppath: $disppath
+ cwd: $cwd
+ lesspath: $lesspath +

+ phpGW debug:
+ real getabsolutepath: " . $GLOBALS['phpgw']->vfs->getabsolutepath (array ('target' => False, 'mask' => False, 'fake' => False)) . "
+ fake getabsolutepath: " . $GLOBALS['phpgw']->vfs->getabsolutepath (array ('target' => False)) . "
+ appsession: " . $GLOBALS['phpgw']->session->appsession ('vfs','') . "
+ pwd: " . $GLOBALS['phpgw']->vfs->pwd () . "
"; +} + +### +# Get their readable groups to be used throughout the script +### + +$groups = array (); + +$groups = $GLOBALS['phpgw']->accounts->get_list ('groups'); + +$readable_groups = array (); + +while (list ($num, $account) = each ($groups)) +{ + if ($GLOBALS['phpgw']->vfs->acl_check (array ( + 'owner_id' => $account['account_id'], + 'operation' => PHPGW_ACL_READ + )) + ) + { + $readable_groups[$account['account_lid']] = Array('account_id' => $account['account_id'], 'account_name' => $account['account_lid']); + } +} + +$groups_applications = array (); + +while (list ($num, $group_array) = each ($readable_groups)) +{ + $group_id = $GLOBALS['phpgw']->accounts->name2id ($group_array['account_name']); + + $applications = CreateObject('phpgwapi.applications', $group_id); + $groups_applications[$group_array['account_name']] = $applications->read_account_specific (); +} + +### +# We determine if they're in their home directory or a group's directory, +# and set the VFS working_id appropriately +### + +if ((preg_match ('+^'.$GLOBALS['fakebase'].'\/(.*)(\/|$)+U', $path, $matches)) && $matches[1] != $GLOBALS['userinfo']['account_lid']) +{ + $GLOBALS['phpgw']->vfs->working_id = $GLOBALS['phpgw']->accounts->name2id ($matches[1]); +} +else +{ + $GLOBALS['phpgw']->vfs->working_id = $GLOBALS['userinfo']['username']; +} + +if ($path != $GLOBALS['homedir'] + && $path != $GLOBALS['fakebase'] + && $path != '/' + && !$GLOBALS['phpgw']->vfs->acl_check (array ( + 'string' => $path, + 'relatives' => array (RELATIVE_NONE), + 'operation' => PHPGW_ACL_READ + )) +) +{ + echo $GLOBALS['phpgw']->common->error_list (array (lang('You do not have access to %1', $path))); + html_break (2); + html_link ($GLOBALS['appname'].'/index.php?path='.$GLOBALS['homedir'], lang('Go to your home directory')); + html_page_close (); +} + +$GLOBALS['userinfo']['working_id'] = $GLOBALS['phpgw']->vfs->working_id; +$GLOBALS['userinfo']['working_lid'] = $GLOBALS['phpgw']->accounts->id2name ($GLOBALS['userinfo']['working_id']); + +### +# If their home directory doesn't exist, we create it +# Same for group directories +### + +if (($path == $GLOBALS['homedir']) + && !$GLOBALS['phpgw']->vfs->file_exists (array ( + 'string' => $GLOBALS['homedir'], + 'relatives' => array (RELATIVE_NONE) + )) +) +{ + $GLOBALS['phpgw']->vfs->override_acl = 1; + + if (!$GLOBALS['phpgw']->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)))) + { + $p = $phpgw->vfs->path_parts (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))); + echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not create directory %1', $GLOBALS['homedir'] . ' (' . $p->real_full_path . ')'))); + } + + $GLOBALS['phpgw']->vfs->override_acl = 0; +} + +### +# Verify path is real +### + +if ($path != $GLOBALS['homedir'] && $path != '/' && $path != $GLOBALS['fakebase']) +{ + if (!$GLOBALS['phpgw']->vfs->file_exists (array ('string' => $path, 'relatives' => array (RELATIVE_NONE)))) + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 does not exist', $path))); + html_break (2); + html_link ($GLOBALS['appname'].'/index.php?path='.$GLOBALS['homedir'], lang('Go to your home directory')); + html_break (2); + html_link_back (); + html_page_close (); + } +} + +/* Update if they request it, or one out of 20 page loads */ +srand ((double) microtime() * 1000000); +if ($update || rand (0, 19) == 4) +{ + $GLOBALS['phpgw']->vfs->update_real (array ('string' => $path, 'relatives' => array (RELATIVE_NONE))); +} + +### +# Check available permissions for $path, so we can disable unusable operations in user interface +### + +if ($GLOBALS['phpgw']->vfs->acl_check (array ( + 'string' => $path, + 'relatives' => array (RELATIVE_NONE), + 'operation' => PHPGW_ACL_ADD + )) +) +{ + $can_add = True; +} + +### +# Default is to sort by name +### + +if (!$sortby) +{ + $sortby = 'name'; +} + +### +# Decide how many upload boxes to show +### + +if (!$show_upload_boxes || $show_upload_boxes <= 0) +{ + if (!$show_upload_boxes = $GLOBALS['settings']['show_upload_boxes']) + { + $show_upload_boxes = 5; + } +} + + +### +# Read in file info from database to use in the rest of the script +# $fakebase is a special directory. In that directory, we list the user's +# home directory and the directories for the groups they're in +### + +$numoffiles = 0; +if ($path == $GLOBALS['fakebase']) +{ + if (!$GLOBALS['phpgw']->vfs->file_exists (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE)))) + { + $GLOBALS['phpgw']->vfs->mkdir (array ('string' => $GLOBALS['homedir'], 'relatives' => array (RELATIVE_NONE))); + } + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $GLOBALS['homedir'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => True + ) + ); + $files_array[] = $ls_array[0]; + $numoffiles++; +// $files_array = $ls_array; +// $numoffiles = count($ls_array); + + reset ($readable_groups); + while (list ($num, $group_array) = each ($readable_groups)) + { + ### + # If the group doesn't have access to this app, we don't show it + ### + + if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) + { + continue; + } + + if (!$GLOBALS['phpgw']->vfs->file_exists (array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE) + )) + ) + { + $GLOBALS['phpgw']->vfs->override_acl = 1; + $GLOBALS['phpgw']->vfs->mkdir (array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE) + ) + ); + $GLOBALS['phpgw']->vfs->override_acl = 0; + + $GLOBALS['phpgw']->vfs->set_attributes (array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE), + 'attributes' => array ( + 'owner_id' => $group_array['account_id'], + 'createdby_id' => $group_array['account_id'] + ) + ) + ); + } + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => True + ) + ); + + $files_array[] = $ls_array[0]; + + $numoffiles++; + } +} +else +{ + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $path, + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => False, + 'orderby' => $sortby + ) + ); + + if ($phpwh_debug) + { + echo '# of files found in "'.$path.'" : '.count($ls_array).'
'."\n"; + } + + while (list ($num, $file_array) = each ($ls_array)) + { + $numoffiles++; + $files_array[] = $file_array; + if ($phpwh_debug) + { + echo 'Filename: '.$file_array['name'].'
'."\n"; + } + } +} + +if (!is_array ($files_array)) +{ + $files_array = array (); +} + +if ($download) +{ + for ($i = 0; $i != $numoffiles; $i++) + { + if (!$fileman[$i]) + { + continue; + } + + $download_browser = CreateObject ('phpgwapi.browser'); + $download_browser->content_header ($fileman[$i]); + echo $GLOBALS['phpgw']->vfs->read (array ('string' => $fileman[$i])); + $GLOBALS['phpgw']->common->phpgw_exit (); + } +} + +if ($op == 'view' && $file) +{ + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $path.'/'.$file, + 'relatives' => array (RELATIVE_ALL), + 'checksubdirs' => False, + 'nofiles' => True + ) + ); + + if ($ls_array[0]['mime_type']) + { + $mime_type = $ls_array[0]['mime_type']; + } + elseif ($GLOBALS['settings']['viewtextplain']) + { + $mime_type = 'text/plain'; + } + + header('Content-type: ' . $mime_type); + echo $GLOBALS['phpgw']->vfs->read (array ( + 'string' => $path.'/'.$file, + 'relatives' => array (RELATIVE_NONE) + ) + ); + $GLOBALS['phpgw']->common->phpgw_exit (); +} + +if ($op == 'history' && $file) +{ + $journal_array = $GLOBALS['phpgw']->vfs->get_journal (array ( + 'string' => $file, + 'relatives' => array (RELATIVE_ALL) + ) + ); + + if (is_array ($journal_array)) + { + html_table_begin (); + html_table_row_begin (); + html_table_col_begin (); + html_text_bold (lang('Date')); + html_table_col_end (); + html_table_col_begin (); + html_text_bold (lang('Version')); + html_table_col_end (); + html_table_col_begin (); + html_text_bold (lang('Who')); + html_table_col_end (); + html_table_col_begin (); + html_text_bold (lang('Operation')); + html_table_col_end (); + html_table_row_end (); + + while (list ($num, $journal_entry) = each ($journal_array)) + { + html_table_row_begin (); + html_table_col_begin (); + html_text ($journal_entry['created'] . html_nbsp (3, 1)); + html_table_col_end (); + html_table_col_begin (); + html_text ($journal_entry['version'] . html_nbsp (3, 1)); + html_table_col_end (); + html_table_col_begin (); + html_text ($GLOBALS['phpgw']->accounts->id2name ($journal_entry['owner_id']) . html_nbsp (3, 1)); + html_table_col_end (); + html_table_col_begin (); + html_text ($journal_entry['comment']); + html_table_col_end (); + } + + html_table_end (); + html_page_close (); + } + else + { + html_text_bold (lang('No version history for this file/directory')); + } + +} + +if ($newfile && $createfile) +{ + if ($badchar = bad_chars ($createfile, True, True)) + { + echo $GLOBALS['phpgw']->common->error_list (array (html_encode (lang('File names cannot contain "%1"',$badchar), 1))); + html_break (2); + html_link_back (); + html_page_close (); + } + + if ($GLOBALS['phpgw']->vfs->file_exists (array ( + 'string' => $createfile, + 'relatives' => array (RELATIVE_ALL) + )) + ) + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('File %1 already exists. Please edit it or delete it first.', $createfile))); + html_break (2); + html_link_back (); + html_page_close (); + } + + if ($GLOBALS['phpgw']->vfs->touch (array ( + 'string' => $createfile, + 'relatives' => array (RELATIVE_ALL) + )) + ) + { + $fileman = array (); + $fileman[0] = $createfile; + $edit = 1; + $numoffiles++; + } + else + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('File %1 could not be created.', $createfile))); + } +} + +if ($op == 'help' && $help_name) +{ + while (list ($num, $help_array) = each ($help_info)) + { + if ($help_array[0] != $help_name) + continue; + + $help_array[1] = preg_replace ("/\[(.*)\|(.*)\]/Ue", "html_help_link ('\\1', '\\2', False, True)", $help_array[1]); + $help_array[1] = preg_replace ("/\[(.*)\]/Ue", "html_help_link ('\\1', '\\1', False, True)", $help_array[1]); + + html_font_set ('4'); + $title = ereg_replace ('_', ' ', $help_array[0]); + $title = ucwords ($title); + html_text ($title); + html_font_end (); + + html_break (2); + + html_font_set ('2'); + html_text ($help_array[1]); + html_font_end (); + } + + $GLOBALS['phpgw']->common->phpgw_exit (); +} + +### +# Start Main Page +### + +html_page_begin (lang('Users').' :: '.$GLOBALS['userinfo']['username']); +html_page_body_begin (HTML_PAGE_BODY_COLOR); + +if ($messages) +{ + html_text ($messages); +} + +if (!count ($GLOBALS['settings'])) +{ + $pref = CreateObject ('phpgwapi.preferences', $GLOBALS['userinfo']['username']); + $pref->read_repository (); + $GLOBALS['phpgw']->hooks->single ('add_def_pref', $GLOBALS['appname']); + $pref->save_repository (True); + $pref_array = $pref->read_repository (); + $GLOBALS['settings'] = $pref_array[$GLOBALS['appname']]; +} + +### +# Start Main Table +### + +if (!$op && !$delete && !$createdir && !$renamefiles && !$move && !$copy && !$edit && !$comment_files) +{ + html_table_begin ('100%'); + html_table_row_begin (); + html_table_col_begin ('center', NULL, 'top'); + html_align ('center'); + html_form_begin ($GLOBALS['appname'].'/index.php?path='.$path); + if ($numoffiles || $cwd) + { + while (list ($num, $name) = each ($GLOBALS['settings'])) + { + if ($name) + { + $columns++; + } + } + $columns++; + html_table_begin (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_HEADER_BG_COLOR); + html_table_col_begin ('center', NULL, NULL, NULL, $columns); + html_table_begin ('100%'); + html_table_row_begin (); + html_table_col_begin ('left'); + + if ($path != '/') + { + html_link ($GLOBALS['appname'].'/index.php?path='.$lesspath, html_image ('images/folder-up.png', lang('Up'), 'left', 0, NULL, 1)); + html_help_link ('up'); + } + + html_table_col_end (); + html_table_col_begin ('center'); + + if ($cwd) + { + if ($path == $GLOBALS['homedir']) + { + html_image ('images/folder-home.png', lang('Folder'), 'center'); + } + else + { + html_image ('images/folder.png', lang('Folder'), 'center'); + } + } + else + { + html_image ('images/folder-home.png', lang('Home')); + } + + html_font_set (4, HTML_TABLE_FILES_HEADER_TEXT_COLOR); + html_text_bold ($disppath); + html_font_end (); + html_help_link ('directory_name'); + html_table_col_end (); + html_table_col_begin ('right'); + + if ($path != $GLOBALS['homedir']) + { + html_link ($GLOBALS['appname'].'/index.php?path='.$GLOBALS['homedir'], html_image ('images/folder-home.png', lang('Home'), 'right', 0, NULL, 1)); + html_help_link ('home'); + } + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_table_col_end (); + html_table_row_end (); + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_COLUMN_HEADER_BG_COLOR); + + ### + # Start File Table Column Headers + # Reads values from $file_attributes array and preferences + ### + + html_table_col_begin (); + html_text (lang('Sort by:') . html_nbsp (1, 1), NULL, NULL, 0); + html_help_link ('sort_by'); + html_table_col_end (); + + reset ($file_attributes); + while (list ($internal, $displayed) = each ($file_attributes)) + { + if ($GLOBALS['settings'][$internal]) + { + html_table_col_begin (); + html_link ($GLOBALS['appname'].'/index.php?path='.$path.'&sortby='.$internal, html_text_bold ($displayed, 1, 0)); + html_help_link (strtolower (ereg_replace (' ', '_', $displayed))); + html_table_col_end (); + } + } + + html_table_col_begin (); + html_table_col_end (); + html_table_row_end (); + + if ($GLOBALS['settings']['dotdot'] && $GLOBALS['settings']['name'] && $path != '/') + { + html_table_row_begin (); + html_table_col_begin (); + html_table_col_end (); + + /* We can assume the next column is the name */ + html_table_col_begin (); + html_image ('images/folder.png', lang('Folder')); + html_link ($GLOBALS['appname'].'/index.php?path='.$lesspath, '..'); + html_table_col_end (); + + if ($GLOBALS['settings']['mime_type']) + { + html_table_col_begin (); + html_text (lang('Directory')); + html_table_col_end (); + } + + html_table_row_end (); + } + + ### + # List all of the files, with their attributes + ### + + reset ($files_array); + for ($i = 0; $i != $numoffiles; $i++) + { + $files = $files_array[$i]; + + if ($rename || $edit_comments) + { + unset ($this_selected); + unset ($renamethis); + unset ($edit_this_comment); + + for ($j = 0; $j != $numoffiles; $j++) + { + if ($fileman[$j] == $files['name']) + { + $this_selected = 1; + break; + } + } + + if ($rename && $this_selected) + { + $renamethis = 1; + } + elseif ($edit_comments && $this_selected) + { + $edit_this_comment = 1; + } + } + + if (!$GLOBALS['settings']['dotfiles'] && ereg ("^\.", $files['name'])) + { + continue; + } + + html_table_row_begin (NULL, NULL, NULL, HTML_TABLE_FILES_BG_COLOR); + + ### + # Checkboxes + ### + + html_table_col_begin ('right'); + + if (!$rename && !$edit_comments && $path != $GLOBALS['fakebase'] && $path != '/') + { + html_form_input ('checkbox', 'fileman['.$i.']', base64_encode ($files['name'])); + } + elseif ($renamethis) + { + html_form_input ('hidden', 'fileman[' . base64_encode ($files['name']) . ']', $files['name'], NULL, NULL, 'checked'); + } + else + { + html_nbsp(); + } + + html_table_col_end (); + + ### + # File name and icon + ### + + if ($GLOBALS['settings']['name']) + { + if ($phpwh_debug) + { + echo 'Setting file name: '.$files['name'].'
'."\n"; + } + + html_table_col_begin (); + + if ($renamethis) + { + if ($files['mime_type'] == 'Directory') + { + html_image ('images/folder.png', lang('Folder')); + } + html_form_input ('text', 'renamefiles[' . base64_encode ($files['name']) . ']', $files['name'], 255); + } + else + { + if ($files['mime_type'] == 'Directory') + { + html_image ('images/folder.png', lang('Folder')); + html_link ($GLOBALS['appname'].'/index.php?path='.$path.$dispsep.$files['name'], $files['name']); + } + else + { + if ($GLOBALS['settings']['viewonserver'] && isset ($GLOBALS['filesdir']) && !$files['link_directory']) + { + $clickview = $GLOBALS['filesdir'].$pwd.'/'.$files['name']; + + if ($phpwh_debug) + { + echo 'Setting clickview = '.$clickview.'
'."\n"; + } + } + else + { + $clickview = $GLOBALS['appname'].'/index.php?op=view&file='.$files['name'].'&path='.$path; + } + + if ($GLOBALS['settings']['viewinnewwin']) + { + $target = '_new'; + } + + html_link ($clickview, $files['name'], 0, 1, 0, $target); + } + } + + html_table_col_end (); + } + + ### + # MIME type + ### + + if ($GLOBALS['settings']['mime_type']) + { + html_table_col_begin (); + html_text ($files['mime_type']); + html_table_col_end (); + } + + ### + # File size + ### + + if ($GLOBALS['settings']['size']) + { + html_table_col_begin (); + + $size = $GLOBALS['phpgw']->vfs->get_size (array ( + 'string' => $files['directory'] . '/' . $files['name'], + 'relatives' => array (RELATIVE_NONE) + ) + ); + + borkb ($size); + + html_table_col_end (); + } + + ### + # Date created + ### + if ($GLOBALS['settings']['created']) + { + html_table_col_begin (); + html_text ($files['created']); + html_table_col_end (); + } + + ### + # Date modified + ### + + if ($GLOBALS['settings']['modified']) + { + html_table_col_begin (); + if ($files['modified'] != '0000-00-00') + { + html_text ($files['modified']); + } + html_table_col_end (); + } + + ### + # Owner name + ### + + if ($GLOBALS['settings']['owner']) + { + html_table_col_begin (); + html_text ($GLOBALS['phpgw']->accounts->id2name ($files['owner_id'])); + html_table_col_end (); + } + + ### + # Creator name + ### + + if ($GLOBALS['settings']['createdby_id']) + { + html_table_col_begin (); + if ($files['createdby_id']) + { + html_text ($GLOBALS['phpgw']->accounts->id2name ($files['createdby_id'])); + } + html_table_col_end (); + } + + ### + # Modified by name + ### + + if ($GLOBALS['settings']['modifiedby_id']) + { + html_table_col_begin (); + if ($files['modifiedby_id']) + { + html_text ($GLOBALS['phpgw']->accounts->id2name ($files['modifiedby_id'])); + } + html_table_col_end (); + } + + ### + # Application + ### + + if ($GLOBALS['settings']['app']) + { + html_table_col_begin (); + html_text ($files['app']); + html_table_col_end (); + } + + ### + # Comment + ### + + if ($GLOBALS['settings']['comment']) + { + html_table_col_begin (); + if ($edit_this_comment) + { + html_form_input ('text', 'comment_files[' . base64_encode ($files['name']) . ']', html_encode ($files['comment'], 1), 255); + } + else + { + html_text ($files['comment']); + } + html_table_col_end (); + } + + ### + # Version + ### + + if ($GLOBALS['settings']['version']) + { + html_table_col_begin (); + html_link ($GLOBALS['appname'].'/index.php?op=history&file='.$files['name'].'&path='.$path, $files['version'], NULL, True, NULL, '_new'); + html_table_col_end (); + } + + ### + # Deleteable (currently not used) + ### + + if ($GLOBALS['settings']['deleteable']) + { + if ($files['deleteable'] == 'N') + { + html_table_col_begin (); + html_image ('images/locked.png', lang('Locked')); + html_table_col_end (); + } + else + { + html_table_col_begin (); + html_table_col_end (); + } + } + + html_table_row_end (); + + if ($files['mime_type'] == 'Directory') + { + $usedspace += $fileinfo[0]; + } + else + { + $usedspace += $files['size']; + } + } + + html_table_end (); + html_break (2); + + if ($path != '/' && $path != $GLOBALS['fakebase']) + { + if (!$rename && !$edit_comments) + { + html_form_input ('submit', 'edit', lang('Edit')); + html_help_link ('edit'); + html_nbsp (3); + } + + if (!$edit_comments) + { + html_form_input ('submit', 'rename', lang('Rename')); + html_help_link ('rename'); + html_nbsp (3); + } + + if (!$rename && !$edit_comments) + { + html_form_input ('submit', 'delete', lang('Delete')); + html_help_link ('delete'); + html_nbsp (3); + } + + if (!$rename) + { + html_form_input ('submit', 'edit_comments', lang('Edit comments')); + html_help_link ('edit_comments'); + } + } + } + + ### + # Display some inputs and info, but not when renaming or editing comments + ### + + if (!$rename && !$edit_comments) + { + ### + # Begin Copy to/Move to selection + ### + + html_break (1); + html_form_input ('submit', 'go', lang('Go to:')); + html_help_link ('go_to'); + + if ($path != '/' && $path != $GLOBALS['fakebase']) + { + html_form_input ('submit', 'copy', lang('Copy to:')); + html_help_link ('copy_to'); + html_form_input ('submit', 'move', lang('Move to:')); + html_help_link ('move_to'); + } + + html_form_select_begin ('todir'); + + html_break (1); + + ### + # First we get the directories in their home directory + ### + + $dirs = array (); + $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $GLOBALS['userinfo']['account_lid']); + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $GLOBALS['homedir'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => True, + 'mime_type' => 'Directory' + ) + ); + + while (list ($num, $dir) = each ($ls_array)) + { + $dirs[] = $dir; + } + + + ### + # Then we get the directories in their readable groups' home directories + ### + + reset ($readable_groups); + while (list ($num, $group_array) = each ($readable_groups)) + { + ### + # Don't list directories for groups that don't have access + ### + + if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled']) + { + continue; + } + + $dirs[] = array ('directory' => $GLOBALS['fakebase'], 'name' => $group_array['account_name']); + + $ls_array = $phpgw->vfs->ls (array ( + 'string' => $GLOBALS['fakebase'].'/'.$group_array['account_name'], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => True, + 'mime_type' => 'Directory' + ) + ); + while (list ($num, $dir) = each ($ls_array)) + { + $dirs[] = $dir; + } + } + + reset ($dirs); + while (list ($num, $dir) = each ($dirs)) + { + if (!$dir['directory']) + { + continue; + } + + ### + # So we don't display // + ### + + if ($dir['directory'] != '/') + { + $dir['directory'] .= '/'; + } + + ### + # No point in displaying the current directory, or a directory that doesn't exist + ### + + if ((($dir['directory'] . $dir['name']) != $path) + && $GLOBALS['phpgw']->vfs->file_exists (array ( + 'string' => $dir['directory'] . $dir['name'], + 'relatives' => array (RELATIVE_NONE) + )) + ) + { + html_form_option ($dir['directory'] . $dir['name'], $dir['directory'] . $dir['name']); + } + } + + html_form_select_end (); + html_help_link ('directory_list'); + + if ($path != '/' && $path != $GLOBALS['fakebase']) + { + html_break (1); + + html_form_input ('submit', 'download', lang('Download')); + html_help_link ('download'); + html_nbsp (3); + + if ($can_add) + { + html_form_input ('text', 'createdir', NULL, 255, 15); + html_form_input ('submit', 'newdir', lang('Create Folder')); + html_help_link ('create_folder'); + } + } + + html_break (1); + html_form_input ('submit', 'update', lang('Update')); + html_help_link ('update'); + + if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add) + { + html_nbsp (3); + html_form_input ('text', 'createfile', NULL, 255, 15); + html_form_input ('submit', 'newfile', lang('Create File')); + html_help_link ('create_file'); + } + + if ($GLOBALS['settings']['show_command_line']) + { + html_break (2); + html_form_input ('text', 'command_line', NULL, NULL, 50); + html_help_link ('command_line'); + + html_break (1); + html_form_input ('submit', 'execute', lang('Execute')); + html_help_link ('execute'); + } + + html_form_end (); + + html_help_link ('file_stats'); + html_break (1); + html_text_bold (lang('Files').': '); + html_text ($numoffiles); + html_nbsp (3); + + html_text_bold (lang('Used space').': '); + html_text (borkb ($usedspace, NULL, 1)); + html_nbsp (3); + + if ($path == $GLOBALS['homedir'] || $path == $GLOBALS['fakebase']) + { + html_text_bold (lang('Unused space').': '); + html_text (borkb ($GLOBALS['userinfo']['hdspace'] - $usedspace, NULL, 1)); + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $path, + 'relatives' => array (RELATIVE_NONE) + ) + ); + + $i = count ($ls_array); + + html_break (2); + html_text_bold (lang('Total Files').': '); + html_text ($i); + } + + ### + # Show file upload boxes. Note the last argument to html (). Repeats $show_upload_boxes times + ### + + if ($path != '/' && $path != $GLOBALS['fakebase'] && $can_add) + { + html_break (2); + html_form_begin ($GLOBALS['appname'].'/index.php?op=upload&path='.$path, 'post', 'multipart/form-data'); + html_table_begin (); + html_table_row_begin ('center'); + html_table_col_begin (); + html_text_bold (lang('File')); + html_help_link ('upload_file'); + html_table_col_end (); + html_table_col_begin (); + html_text_bold (lang('Comment')); + html_help_link ('upload_comment'); + html_table_col_end (); + html_table_row_end (); + + html_table_row_begin (); + html_table_col_begin (); + html_form_input ('hidden', 'show_upload_boxes', base64_encode ($show_upload_boxes)); + html (html_form_input ('file', 'upload_file[]', NULL, 255, NULL, NULL, NULL, 1) . html_break (1, NULL, 1), $show_upload_boxes); + html_table_col_end (); + html_table_col_begin (); + html (html_form_input ('text', 'upload_comment[]', NULL, NULL, NULL, NULL, NULL, 1) . html_break (1, NULL, 1), $show_upload_boxes); + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_form_input ('submit', 'upload_files', lang('Upload files')); + html_help_link ('upload_files'); + html_break (2); + html_text (lang('Show') . html_nbsp (1, True)); + html_link ($GLOBALS['appname'].'/index.php?show_upload_boxes=5', '5'); + html_nbsp (); + html_link ($GLOBALS['appname'].'/index.php?show_upload_boxes=10', '10'); + html_nbsp (); + html_link ($GLOBALS['appname'].'/index.php?show_upload_boxes=20', '20'); + html_nbsp (); + html_link ($GLOBALS['appname'].'/index.php?show_upload_boxes=50', '50'); + html_nbsp (); + html_text (lang('upload fields')); + html_nbsp (); + html_help_link ('show_upload_fields'); + html_form_end (); + } + } + + html_table_col_end (); + html_table_row_end (); + html_table_end (); + html_page_close (); +} + +### +# Handle Editing files +### + +if ($edit) +{ + ### + # If $edit is "Edit", we do nothing, and let the for loop take over + ### + + if ($edit_file) + { + $edit_file_content = stripslashes ($edit_file_content); + } + + if ($edit_preview) + { + $content = $edit_file_content; + + html_break (1); + html_text_bold (lang('Preview of %1', $path.'/'.$edit_file)); + html_break (2); + + html_table_begin ('90%'); + html_table_row_begin (); + html_table_col_begin (); + html_text (nl2br ($content)); + html_table_col_end (); + html_table_row_end (); + html_table_end (); + } + elseif ($edit_save) + { + $content = $edit_file_content; + + if ($GLOBALS['phpgw']->vfs->write (array ( + 'string' => $edit_file, + 'relatives' => array (RELATIVE_ALL), + 'content' => $content + )) + ) + { + html_text_bold (lang('Saved %1', $path.'/'.$edit_file)); + html_break (2); + html_link_back (); + } + else + { + html_text_error (lang('Could not save %1', $path.'/'.$edit_file)); + html_break (2); + html_link_back (); + } + } + +/* This doesn't work just yet + elseif ($edit_save_all) + { + for ($j = 0; $j != $numoffiles; $j++) + { + $fileman[$j]; + + $content = $fileman[$j]; + echo 'fileman['.$j.']: '.$fileman[$j].'
'.$content.'
'; + continue; + + if ($GLOBALS['phpgw']->vfs->write (array ( + 'string' => $fileman[$j], + 'relatives' => array (RELATIVE_ALL), + 'content' => $content + )) + ) + { + html_text_bold (lang('Saved %1', $path.'/'.$fileman[$j])); + html_break (1); + } + else + { + html_text_error (lang('Could not save %1', $path.'/'.$fileman[$j])); + html_break (1); + } + } + + html_break (1); + } +*/ + + ### + # Now we display the edit boxes and forms + ### + + for ($j = 0; $j != $numoffiles; $j++) + { + ### + # If we're in preview or save mode, we only show the file + # being previewed or saved + ### + + if ($edit_file && ($fileman[$j] != $edit_file)) + { + continue; + } + + if ($fileman[$j] && $GLOBALS['phpgw']->vfs->file_exists (array ( + 'string' => $fileman[$j], + 'relatives' => array (RELATIVE_ALL) + )) + ) + { + if ($edit_file) + { + $content = stripslashes ($edit_file_content); + } + else + { + $content = $GLOBALS['phpgw']->vfs->read (array ('string' => $fileman[$j])); + } + + html_table_begin ('100%'); + html_form_begin ($GLOBALS['appname'].'/index.php?path='.$path); + html_form_input ('hidden', 'edit', True); + html_form_input ('hidden', 'edit_file', $fileman[$j]); + + ### + # We need to include all of the fileman entries for each file's form, + # so we loop through again + ### + + for ($i = 0; $i != $numoffiles; $i++) + { + html_form_input ('hidden', 'fileman['.$i.']', base64_encode ($fileman[$i])); + } + + html_table_row_begin (); + html_table_col_begin (); + html_form_textarea ('edit_file_content', 35, 75, $content); + html_table_col_end (); + html_table_col_begin ('center'); + html_form_input ('submit', 'edit_preview', lang('Preview %1', html_encode ($fileman[$j], 1))); + html_break (1); + html_form_input ('submit', 'edit_save', lang('Save %1', html_encode ($fileman[$j], 1))); +// html_break (1); +// html_form_input ('submit', 'edit_save_all', lang('Save all')); + html_table_col_end (); + html_table_row_end (); + html_break (2); + html_form_end (); + html_table_end (); + } + } +} + +### +# Handle File Uploads +### + +elseif ($op == 'upload' && $path != '/' && $path != $GLOBALS['fakebase']) +{ + for ($i = 0; $i != $show_upload_boxes; $i++) + { + if ($badchar = bad_chars ($_FILES['upload_file']['name'][$i], True, True)) + { + echo $GLOBALS['phpgw']->common->error_list (array (html_encode (lang('File names cannot contain "%1"', $badchar), 1))); + + continue; + } + + ### + # Check to see if the file exists in the database, and get its info at the same time + ### + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $path . '/' . $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => True + ) + ); + + $fileinfo = $ls_array[0]; + + if ($fileinfo['name']) + { + if ($fileinfo['mime_type'] == 'Directory') + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Cannot replace %1 because it is a directory', $fileinfo['name']))); + continue; + } + } + + if ($_FILES['upload_file']['size'][$i] > 0) + { + if ($fileinfo['name'] && $fileinfo['deleteable'] != 'N') + { + $GLOBALS['phpgw']->vfs->set_attributes (array ( + 'string' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes' => array ( + 'owner_id' => $GLOBALS['userinfo']['username'], + 'modifiedby_id' => $GLOBALS['userinfo']['username'], + 'modified' => $now, + 'size' => $_FILES['upload_file']['size'][$i], + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'deleteable' => 'Y', + 'comment' => stripslashes ($upload_comment[$i]) + ) + ) + ); + + $GLOBALS['phpgw']->vfs->cp(array ( + 'from' => $_FILES['upload_file']['tmp_name'][$i], + 'to' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) + ) + ); + + html_text_summary(lang('Replaced %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $_FILES['upload_file']['size'][$i]); + } + else + { + $GLOBALS['phpgw']->vfs->cp (array ( + 'from' => $_FILES['upload_file']['tmp_name'][$i], + 'to' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL) + ) + ); + + $GLOBALS['phpgw']->vfs->set_attributes (array ( + 'string' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes' => array ( + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'comment' => stripslashes ($upload_comment[$i]) + ) + ) + ); + + html_text_summary(lang('Created %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $_FILES['upload_file']['size'][$i]); + } + } + elseif ($_FILES['upload_file']['name'][$i]) + { + $GLOBALS['phpgw']->vfs->touch (array ( + 'string' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL) + ) + ); + + $GLOBALS['phpgw']->vfs->set_attributes (array ( + 'string' => $_FILES['upload_file']['name'][$i], + 'relatives' => array (RELATIVE_ALL), + 'attributes' => array ( + 'mime_type' => $_FILES['upload_file']['type'][$i], + 'comment' => $upload_comment[$i] + ) + ) + ); + + html_text_summary(lang('Created %1', $disppath.'/'.$_FILES['upload_file']['name'][$i]), $file_size[$i]); + } + } + + html_break (2); + html_link_back (); +} + +### +# Handle Editing comments +### + +elseif ($comment_files) +{ + while (list ($file) = each ($comment_files)) + { + if ($badchar = bad_chars ($comment_files[$file], False, True)) + { + echo $GLOBALS['phpgw']->common->error_list (array (html_text_italic ($file, 1) . html_encode (': ' . lang('Comments cannot contain "%1"', $badchar), 1))); + continue; + } + + $GLOBALS['phpgw']->vfs->set_attributes (array ( + 'string' => $file, + 'relatives' => array (RELATIVE_ALL), + 'attributes' => array ( + 'comment' => stripslashes ($comment_files[$file]) + ) + ) + ); + + html_text_summary (lang('Updated comment for %1', $path.'/'.$file)); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Renaming Files and Directories +### + +elseif ($renamefiles) +{ + while (list ($from, $to) = each ($renamefiles)) + { + if ($badchar = bad_chars ($to, True, True)) + { + echo $GLOBALS['phpgw']->common->error_list (array (html_encode (lang('File names cannot contain "%1"', $badchar), 1))); + continue; + } + + if (ereg ("/", $to) || ereg ("\\\\", $to)) + { + echo $GLOBALS['phpgw']->common->error_list (array (lang("File names cannot contain \\ or /"))); + } + elseif (!$GLOBALS['phpgw']->vfs->mv (array ( + 'from' => $from, + 'to' => $to + )) + ) + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not rename %1 to %2', $disppath.'/'.$from, $disppath.'/'.$to))); + } + else + { + html_text_summary (lang('Renamed %1 to %2', $disppath.'/'.$from, $disppath.'/'.$to)); + } + } + + html_break (2); + html_link_back (); +} + +### +# Handle Moving Files and Directories +### + +elseif ($move) +{ + while (list ($num, $file) = each ($fileman)) + { + if ($GLOBALS['phpgw']->vfs->mv (array ( + 'from' => $file, + 'to' => $todir . '/' . $file, + 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) + )) + ) + { + $moved++; + html_text_summary (lang('Moved %1 to %2', $disppath.'/'.$file, $todir.'/'.$file)); + } + else + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not move %1 to %2', $disppath.'/'.$file, $todir.'/'.$file))); + } + } + + if ($moved) + { + html_break (2); + html_link ($GLOBALS['appname'].'/index.php?path='.$todir, lang('Go to %1', $todir)); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Copying of Files and Directories +### + +elseif ($copy) +{ + while (list ($num, $file) = each ($fileman)) + { + if ($GLOBALS['phpgw']->vfs->cp (array ( + 'from' => $file, + 'to' => $todir . '/' . $file, + 'relatives' => array (RELATIVE_ALL, RELATIVE_NONE) + )) + ) + { + $copied++; + html_text_summary (lang('Copied %1 to %2', $disppath.'/'.$file, $todir.'/'.$file)); + } + else + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not copy %1 to %2', $disppath.'/'.$file, $todir.'/'.$file))); + } + } + + if ($copied) + { + html_break (2); + html_link ($GLOBALS['appname'].'/index.php?path='.$todir, lang('Go to %1', $todir)); + } + + html_break (2); + html_link_back (); +} + +### +# Handle Deleting Files and Directories +### + +elseif ($delete) +{ + for ($i = 0; $i != $numoffiles; $i++) + { + if ($fileman[$i]) + { + if ($GLOBALS['phpgw']->vfs->delete (array ('string' => $fileman[$i]))) + { + html_text_summary (lang('Deleted %1', $disppath.'/'.$fileman[$i]), $fileinfo['size']); + } + else + { + $GLOBALS['phpgw']->common->error_list (array (lang('Could not delete %1', $disppath.'/'.$fileman[$i]))); + } + } + } + + html_break (2); + html_link_back (); +} + +elseif ($newdir && $createdir) +{ + if ($badchar = bad_chars ($createdir, True, True)) + { + echo $GLOBALS['phpgw']->common->error_list (array (html_encode (lang('Directory names cannot contain "%1"', $badchar), 1))); + html_break (2); + html_link_back (); + html_page_close (); + } + + if ($createdir[strlen($createdir)-1] == ' ' || $createdir[0] == ' ') + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Cannot create directory because it begins or ends in a space'))); + html_break (2); + html_link_back (); + html_page_close (); + } + + $ls_array = $GLOBALS['phpgw']->vfs->ls (array ( + 'string' => $path . '/' . $createdir, + 'relatives' => array (RELATIVE_NONE), + 'checksubdirs' => False, + 'nofiles' => True + ) + ); + + $fileinfo = $ls_array[0]; + + if ($fileinfo['name']) + { + if ($fileinfo['mime_type'] != 'Directory') + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('%1 already exists as a file', $fileinfo['name']))); + html_break (2); + html_link_back (); + html_page_close (); + } + else + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Directory %1 already exists', $fileinfo['name']))); + html_break (2); + html_link_back (); + html_page_close (); + } + } + else + { + if ($GLOBALS['phpgw']->vfs->mkdir (array ('string' => $createdir))) + { + html_text_summary (lang('Created directory %1', $disppath.'/'.$createdir)); + html_break (2); + html_link ($GLOBALS['appname'].'/index.php?path='.$disppath.'/'.$createdir, lang('Go to %1', $disppath.'/'.$createdir)); + } + else + { + echo $GLOBALS['phpgw']->common->error_list (array (lang('Could not create %1', $disppath.'/'.$createdir))); + } + } + + html_break (2); + html_link_back (); +} + +html_page_close (); + +?> diff --git a/filemanager/preferences.php b/filemanager/preferences.php index d8abfaf240..86c9d9f5eb 100644 --- a/filemanager/preferences.php +++ b/filemanager/preferences.php @@ -19,8 +19,8 @@ "nonavbar" => True ); + var_dump($file_attributes); include("../header.inc.php"); - /* To add an on/off preference, just add it here. Key is internal name, value is displayed name */ @@ -36,12 +36,6 @@ { $phpgw->preferences->read_repository (); - reset ($file_attributes); - while (list ($internal, $displayed) = each ($file_attributes)) - { - $phpgw->preferences->add ($phpgw_info["flags"]["currentapp"], $internal, $$internal); - } - reset ($other_checkboxes); while (list ($internal, $displayed) = each ($other_checkboxes)) { @@ -54,6 +48,13 @@ $phpgw->preferences->add ($phpgw_info["flags"]["currentapp"], $internal, $$internal); } + reset ($file_attributes); + while (list ($internal, $displayed) = each ($file_attributes)) + { + $phpgw->preferences->add ($phpgw_info["flags"]["currentapp"], $internal, $$internal); + } + + $phpgw->preferences->save_repository (True); Header('Location: '.$phpgw->link('/preferences/index.php')); @@ -101,6 +102,7 @@ echo '

' . $phpgw->common->error_list($errors) . '
'; } + while (list ($internal, $displayed) = each ($file_attributes)) { unset ($checked); diff --git a/filemanager/setup/phpgw_nl.lang b/filemanager/setup/phpgw_nl.lang index e205a5841b..f2c6b6e707 100644 --- a/filemanager/setup/phpgw_nl.lang +++ b/filemanager/setup/phpgw_nl.lang @@ -1,6 +1,94 @@ +%1 already exists as a file filemanager nl %1 bestaat reeds als een bestand. +application filemanager nl Toepassing +back to file manager filemanager nl Terug naar de Filemanager +cannot create directory because it begins or ends in a space filemanager nl Can de directory niet aanmaken omdat deze begint of eindigt met een spatie +cannot replace %1 because it is a directory filemanager nl Kan %1 niet vevangen omdat het een directory is. +command sucessfully run filemanager nl Commando met succes uitgevoerd. +comment filemanager nl Opmerking +comments cannot contain "%1" filemanager nl Opmerkingen kunnen geen "%1" bevatten. +copied %1 to %2 filemanager nl %1 gekopieerd naar %2. +copy to filemanager nl Kopiëren naar +copy to: filemanager nl Kopiëren naar: +could not copy %1 to %2 filemanager nl Kon %1 niet naar %2 kopiëren. +could not create %1 filemanager nl Kon %1 niet aanmaken. +could not create directory %1 filemanager nl Kon directory %1 niet aanmaken. +could not delete %1 filemanager nl Kon %1 niet verwijderen. +could not move %1 to %2 filemanager nl Kon %1 niet verplaatsen naar %2. +could not rename %1 to %2 filemanager nl Kon %1 niet hernoemen naar %2. +could not save %1 filemanager nl Kon %1 niet opslaan. +create file filemanager nl Bestand aanmaken +create folder filemanager nl Directory aanmaken +created filemanager nl Aangemaakt +created %1 filemanager nl %1 aangemaakt. +created by filemanager nl Aangemaakt door +created directory %1 filemanager nl Directory %1 aangemaakt. +date filemanager nl Datum +default number of upload fields to show filemanager nl Standaard aantal uploadvelden in beeld +delete filemanager nl Verwijderen +deleted %1 filemanager nl %1 verwijderd +directory filemanager nl Directory +directory %1 already exists filemanager nl Directory %1 bestaat reeds. +directory %1 does not exist filemanager nl Directory %1 bestaat niet. +directory names cannot contain "%1" filemanager nl Directorynamen kunnen geen "%1" bevatten. +display attributes filemanager nl Attributen weergeven +download filemanager nl Downloaden +edit filemanager nl Bewerken +edit comments filemanager nl Opmerkingen bewerken +error running command filemanager nl Fout bij het uitvoeren van commando +execute filemanager nl Uitvoeren +failed to create directory filemanager nl Het aanmaken van de directory is niet gelukt. +file filemanager nl Bestand +file %1 already exists. please edit it or delete it first. filemanager nl Bestand %1 bestaat reeds. +file %1 could not be created. filemanager nl Bestand %1 kon niet worden aangemaakt. +file name filemanager nl Bestandsnaam +file names cannot contain "%1" filemanager nl Bestanden kunnen geen "%1" bevatten. +file names cannot contain \ or / filemanager nl Bestanden kunnen geen "\" of "/" bevatten. filemanager common nl Filemanager -filemanager preferences nl Filemanager voorkeuren -users filemanager nl gebruikers +filemanager preferences filemanager nl Filemanager voorkeuren +files filemanager nl Bestanden +folder filemanager nl Directory +go to filemanager nl Ga naar +go to %1 filemanager nl Ga naar %1 +go to your home directory filemanager nl Ga naar uw homedirectory +go to: filemanager nl Ga naar: +home filemanager nl Home +locked filemanager nl Gesloten +mime type filemanager nl MIME-type +modified filemanager nl Gewijzigd +modified by filemanager nl Gewijzigd door +move to filemanager nl Verplaatsen naar +move to: filemanager nl Verplaatsen naar: +moved %1 to %2 filemanager nl %1 verplaatst naar %2 +no version history for this file/directory filemanager nl Geen versiegeschiedenis voor dit bestand of deze directory +operation filemanager nl Actie +owner filemanager nl Eigenaar +preview %1 filemanager nl Preview %1 +preview of %1 filemanager nl Preview van %1 +rename filemanager nl Hernoemen +renamed %1 to %2 filemanager nl %1 hernoemd naar %2 +replaced %1 filemanager nl %1 vervangen +save %1 filemanager nl %1 opslaan +save all filemanager nl Alles opslaan +saved %1 filemanager nl %1 opgeslagen +show filemanager nl Weergeven +show .. filemanager nl .. weergeven +show .files filemanager nl Verborgen bestanden weergeven +show command line (experimental. dangerous.) filemanager nl Commandoinvoer weergeven (EXPERIMENTEEL EN GEVAARLIJK) +show help filemanager nl Help weergeven +size filemanager nl Grootte +sort by: filemanager nl Sorteren op: +total files filemanager nl Totaal aantal bestanden +unknown mime-type defaults to text/plain when viewing filemanager nl Onbekend MIME-type standaard als text/plain weergeven +unused space filemanager nl Ongebruikte schijfruimte +up filemanager nl Naar boven +update filemanager nl Bijgewerkt +updated comment for %1 filemanager nl Opmerking voor %1 bijgewerkt +upload fields filemanager nl uploadvelden +upload files filemanager nl Bestanden uploaden +used space filemanager nl Gebruikte schijfruimte +users filemanager nl Gebruikers version filemanager nl Versie +view documents in new window filemanager nl Documenten in een nieuw venster weergeven +view documents on server (if available) filemanager nl Documenten op server weergeven (als dit mogelijk is) who filemanager nl Wie you do not have access to %1 filemanager nl U heeft geen toedang tot %1 diff --git a/filemanager/setup/setup.inc.php b/filemanager/setup/setup.inc.php index c110a88b4b..18a3925509 100755 --- a/filemanager/setup/setup.inc.php +++ b/filemanager/setup/setup.inc.php @@ -23,6 +23,7 @@ 'add_def_pref', 'admin', 'deleteaccount', + 'settings', 'preferences' ); diff --git a/filemanager/templates/default/edit_file.tpl b/filemanager/templates/default/edit_file.tpl new file mode 100644 index 0000000000..a9807cc021 --- /dev/null +++ b/filemanager/templates/default/edit_file.tpl @@ -0,0 +1,33 @@ + + + + + + + + +{preview_content}
+
+ + + {filemans_hidden} + + + + + + +{buttonSave} {buttonPreview} {buttonDone} {buttonCancel} + + +
+ +
+ + + + + diff --git a/filemanager/templates/default/filelisting.tpl b/filemanager/templates/default/filelisting.tpl new file mode 100644 index 0000000000..145bbfcb89 --- /dev/null +++ b/filemanager/templates/default/filelisting.tpl @@ -0,0 +1,34 @@ + +
+
+{messages} +
+ +{toolbar0} +
+{toolbar1} +
+
+ + + + + + + + + + + + {columns} + + + + +{lang_no_files} +
{col_data} 
{actions}
+
+ +
{lang_files_in_this_dir}: {files_in_this_dir} {lang_used_space}: {used_space}
+
+ diff --git a/filemanager/templates/default/images/button_bookmark.png b/filemanager/templates/default/images/button_bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..ced954c97fbae732d451c59e20c300eb13f86a7f GIT binary patch literal 996 zcmV;jY-^v&S82&T7|MQ1|;qPAtLBUB39|-9I2p}dR9Z6cD2UAb^N6_}@Q-U00a<0ga7?!$mg`N1hTFG@g4>qCs&4lzZvog=>rHLyas^5Hs5}D$J1@{xd<;y|`V0*6KNuKTrl30KXBESrJHHsd-MYx|`|~G; z-yc6Se7^G#sQ(|syQ|+pmM{PW5aa)Lh6Dx{V8RbAVPKHE2Xy{%XyCp8`GvTwz$5{T zWe$d~`+hK7o$;LE*EfblfB*sq#lJ>|1Yi)%XYmkVV9@x$KoS7?@-s8T`yGE7uCHbQ zrSn9a!wd@m0*DdGcL~5S?dNb85MWdw(r{o-Wca|r@c#G@hMOCK;ro}N(B=@s0+19y z05PJaSp%Tq`*|GM1(@W1;y3gcNCPLs`*YtJZf|4w@aI2+qxAuX3ovPb0KzCM-sLhF z`~w;;XvF|D9FM_3dp}=fV7R`M;lsbb433uj5r%>QKmcK+W1-35WV7M-8&E>VgTDhy zyqCcE0jfne6a)YQhy_P(Ghk%}MGF4V;Nk$6BL>*y00IcR!G9SHn2-(r2E@OCm4283V)POAHJT4+GhcpyHn)!NJYRz;M8l z!2#VIfB<5_=2}*et3WC43j@RZj|>d2-UAcCABG8kfNA#qS%v~JAz(&@mK5ATpS_2; z`T(*y00D&IVqmVcX9c?C*HZ?Ddq9^yf6s8?&p!r7y)6udM%x(*ffhJEc*=0$3^0R! zeh3U_pd)~($R6DsfB?csZuest?y~?3r0;*g$*56d9m51{VR+Drp#YeA>bY4M1m1sT zc;In?K@nLVAb^;#)D{Zgfk_BhN+{wo6a?&#F--XXpTY3sH--%$J?QcP0R{j#nm^q5 S09BO$0000;jY-^v&S82&T7|MQ1|;qPAtLBUB39|-9I2p}dR9Z6cD2UAb^N6_}@Q-U00a<0ga7?!$mg`N1hTFG@g4>qCs&4lzZvog=>rHLyas^5Hs5}D$J1@{xd<;y|`V0*6KNuKTrl30KXBESrJHHsd-MYx|`|~G; z-yc6Se7^G#sQ(|syQ|+pmM{PW5aa)Lh6Dx{V8RbAVPKHE2Xy{%XyCp8`GvTwz$5{T zWe$d~`+hK7o$;LE*EfblfB*sq#lJ>|1Yi)%XYmkVV9@x$KoS7?@-s8T`yGE7uCHbQ zrSn9a!wd@m0*DdGcL~5S?dNb85MWdw(r{o-Wca|r@c#G@hMOCK;ro}N(B=@s0+19y z05PJaSp%Tq`*|GM1(@W1;y3gcNCPLs`*YtJZf|4w@aI2+qt*WZ7huu=0fbRjyvt=U z_y;sx(24lbz%GE@vFqC} zFkFE6nBl;~1wex_)c^z#3y$1oz{(1W6zm3r3@8`Tqf6S}HUMWc;5n!5&4=#*T*=sRAH?Fbw_=jJWqegTMb__yBZ$ zqxJ@d2@FV?`@;JFj3C1uGUVZg&iKH95rY5$#Db-^Q273rVFS>hM2&UW>o$<#urQtV jkzvE1f0zY7K!5=NPt`YEgw-$D00000NkvXXu0mjf6sV@} literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_cancel.png b/filemanager/templates/default/images/button_cancel.png new file mode 100644 index 0000000000000000000000000000000000000000..96919575afdbc31e7f3539f8ad1cb709f813a7ee GIT binary patch literal 883 zcmV-(1C0EMP) zA_&6)0*DFSP!7Ey22LGc2Ehndfqy`k+}6i59NAC-8CeEF32_E_Q&9tu%TMt`3QO-fLy5X|L*x}gl;e}M7--+vkY{R77h z*kFJFVgv;=BO@aNC`>`#2e}kvD9CVzUq2W=o!`swY~|?>Knom!Vb6fg(6{%VG2B1# z?gP+)j%J@2E`ZDg2q3t@AOH$ekoQ3@8t||i!|HrUj&Ra`>S3(-a&<~GZGTb@x8mpl& zg8>4F1y?$SMikil$c8d}2L;V21P{DMd`;hlc5XWhMpz(eDVaBN=XJ{r~?1fB<5G zI2|bPm*K(x-~R}vQ>&jq_CE$kkoR9>#@Pb~h~W$X0R%7TLFMULafb76d_@1hb{F~& zET!I`;=^5R9%W`QIKsg2{w2^|APi)mKLRa)KxP625K82M%Tr(&f=ekJi60pN4FU%X z)TN;C{QxrEcCQx|_#6(w3K*JSaE=A6H00G2EtI8B0zyJ_{_}Csa6@>r*002ov JPDHLkV1jeQWgY+k literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_copy_to.png b/filemanager/templates/default/images/button_copy_to.png new file mode 100644 index 0000000000000000000000000000000000000000..eac4d8c93b175b18dac347b6be58035619b2b757 GIT binary patch literal 590 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fEa{HEjtmUzPnffIy#(?lOI#yL zg7ec#$`gxH85~pclTsBta}(23gHjVyDhp4h+AuIMKJavL45_%4^ymM7`@=`O`TrR| zU`#(3lkVa7EhR;Pk%2{kyJzA0^$g;FzP`3UJm3Dm#J-xJ#||7h!Xh@?y8L&25Dz8*HJcOB%*fQiIh{pWnfXpaK)@WEO3`;kNjz*E3Su#BO}VV> zhwa()^|jmj<@X!a{Q5HW;isq8E;}U@8fFyio+jvF-1JgEexGs8|9{M9)Wm>ph!byq zvA_Pman0{<%x|g$%nUCc@o>En#OuJ2D8b`X%d@}!aM026HlXt+OwD2dT75S_fNkfe z=jZ1qm}zSpN3LW88hxSp!TI_B9mM}ORkXKCx*BVOL<5>0-M0@g_`~Qf#dCO%SJo;< z4h50e`u|N$O$A1(YFB}lcO3*;?Rx1ipuohS&~TyYk-iDj|K^YT z>u0PxJ}v9U&B(?_Iu73d4qjyhhFg)rff&Xj-6I7)&V@^*CMZit3fi#%Lm*;JlYt(? zDG>v2$91lLrvLvr#&CXO6c#>|(7?bX?X$w7<*7-`O139a0W}Siw0M9n5Y}upUl+p6 zZTDmW1Bb#S9yPP84Gazp6H^Szopr0CV=>Q~&?~ literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_createdir.png b/filemanager/templates/default/images/button_createdir.png new file mode 100644 index 0000000000000000000000000000000000000000..1277281fcc2667bb7ddc1189a78738ac96074bd8 GIT binary patch literal 1278 zcmVy^*KUEo|NhTsV`C2Z^7Xf2Tdl_hbTu%C0t65fv4*zv z?hfGKWW66AXcUkfW6ALQ&%gQj)B^+%LDV^MuR>e@p8Z>Q-uVCd%kTg1-u?Xl;lr>0 zdk@|JUr@QZ0Go?J7$AVaVQf`-5hI|Fwd*tXOg>P+$Insk<)R}XBE-$``}bdlKY#v# zF$*gb!=zb9KD>DK#c)Qi{{!@(00 z@U)O&FgHDBy<|vCHe(RrXJY`V`~4fDsbc_?z3nRm=JInzLHkQP;8H7Io1y4VQxbi1Z?$gKL43957VmPYn z$e_i(3g{9BhLrsE4nVC3Kn4Q@5DO@*K!ySx!SMDkBg30FzZkfIVf*?M1H+4V3=Gd+ z0}cKBpW*GtKS2DK;p68&4A1U=V0e4~6~lGU00xe1QHE;_VGNwpdO+so!wd!pASRHP zL5>GHih)^>jp6R|UkukDF)&=c&%ki|;eUol&wer7d-$E<&b@C8w{Cr5SjDcza74q3 z0UTanU;;}H43ky!0)9-D1BV4b0I`6=%J)k_$aDV_}`3p1<7|9HeKS06~ z7#a*e{xLE9{`iaG*Ka0pc!Du7yiBg0VK_6@1ZX%gDE0J#y0m~;3~1O)ApaVWeGzEr z0igUNMt}eUrbJ-E2Rd1Vje&s|=m{a9!NL-(3?JTnX8;9~2=i}-4=g~;{+rKP`m=W7DRLC0TYDYMR53nTn!LFEDSixd1hutAO;!61h#~U=^um4 zPE%;)0aMiB1JKB-2J&0M!2srGLn03#fSCUO!)`Lj)gVLv|Nje*abe|%-QWw#fo zi5YCjKIJ74!x+wiY0io5U>YP3axp*vvFuyDlYtS4i3gcb`Y6NqVi0`>!u|6I9&sQ5 o5J2#PnOyvRitK-E;s5~#0E-7j`^StZ%>V!Z07*qoM6N<$f<E#6C(pQ@bmXyhChEm_&>wP&p*Lp=~0F}KSC?H z@b}+8ApXzr=l4H`e?W_W0}cE3<2S?aUw;{X{rSi6=;=oWem)L{naj?90UE9-BrN;l z-P^}Mkj(-JASSHN`;S5~FakZn0<@F~h*_8*S~%F48O-#hK!)E38Y+Qq1V8{`7|aMX zg%M}~GZ-_0`Jm8YW@chwV`XMwVSxk{Hy0a&geW(IwyG%DaG;O^5VM1f0LcRc5LOq% z!u>zg&0xzIAueZx#sN1c3xk+27lW)cAA`Ap6wGi*AZ7!}0|XEYri-Crz=#M7kQm4= zu20z#* zjF8|36955(FgTU*KO}q^7`SrT7`Qmt700M{!Zs=?V29G7m49FP<;`)CK{6!oLAbH7ZUP#&o1rsdo1D(qX z3?>#JM$TFQ0R#!-+5Z_~hO^9MW?(3V$^vPD<(yzc8B!S-u9m%K`1k7%*xRfu%wR)7 zK>`Z7e}7RO1Q0-opa2;@6O>PZ_yb7b7K8@zf#NqR-$K(gBg58Gchy5lOhNJ z1P}{y_<~(}3W&{aL1aPnDK!QLM+OFsc44s4^@=xOm;M8~^gqxBmj6uP2t)?}0mK3e z0t5gV`VxqxfcP2I5;X>x8qHJ@hHK?-fUbrZ2sZN{1K7pL03d)^;Nc5%@dq`iVSj;G z9O7aDQ0j+hxLx&*f$`rzxPh)i0Fd-$6z^%-5&!@I07*qoM6N<$g5TA+WB>pF literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_cut.png b/filemanager/templates/default/images/button_cut.png new file mode 100644 index 0000000000000000000000000000000000000000..192b5757a70d19fab7d10492c2a1a1f22b1d172d GIT binary patch literal 1196 zcmV;d1XKHoP)(}oXa$B|>P2k{QuLm*}L41G!BFSJTCWr^Wd_gsM{`{>8l9HnHffmEX z00M}lp!o9T8^f<(e;Gc1{t6fC=~f&cK?)c;|UkTtGBF)p1n^N-0qWekTzi2&#BGE zz`zN_Ul{(x>UKmfs0g{;u`1lB*l7|vW}nE)~r zB=-8l{|nzg{RPI_ABKOAe=^+N@tHx=k)1(8pM^o)m#bgJopV0B0Mq@`O|k~)E(Zu8 zxWU5gKN;S=`Oom-^Z$o1v5#N>_j7aoVfg*zH^a#_KQ3^K00n>lW?&cl&%pBcF9SQz ze+E@IRsj}H#`Wk10|XE}@<5qMoc9-ltl*FOE`KR`DG>$(ea-I<48NEd4(wsRzyOT> zKi~eoXZZ4u;n{J94?o^B6#o6k;4g2?5Fn@dUtxEtOn__mlMOKQ00IbZ@Y%;a2aF`X zIz(E$6JX$EC}7}ZWw`T{hvC#E_62|bFcgMNd-CDlTq%aXkN-0~xXaRL-2_g83oiG` z+}AexqwxJF3n)0?1_J~T+~ChYm;)ysmFhQ;`5M5*!65MRJI94@zgQ-wEqMyh|6f1; zW%&N?55w#C%oku{ckeSi&@uW6G?*DBC;$QoZgA7?XP}r(gkn$#W2DX3uNWR^O8roH z^PVFf$UQJMTv|YY=cmE9$A1{U|3p;_5I`iA6*nKU9Qgm`H-owIr-W8-sr9T(f6g1p zd=j{Qhl%0)FGMha06+jSl2YgO2TLi4^Zhy>Y4S#Zfdy9LF*3|KCb^+#-LpXCbPNzc zBpD0>ZN5?lf*ils>x+L@c>kT1;lfMa1D4F(wqN;#llNs12vi~arkm*L6N zSKt%_l3TN84Te5|0AeE6#o&l!W&|7hk{J^~HD zcb$Q2aSH?2kxdM|^E<$Xg7AmzW`^%pF2IOo0*5m;01!Y-=vnw5pD@Eer*MYA?4L1;k zza>{N{PGF~=0YZjp^Qvm3$Ouz075aC5eYIqxXHly{5itlk6#(smn~pm{PYo+R1i7x z-+%0p2M|D5{lR>ECj;AzX1JmM{{a)vhi?qbr_M46_<1rgefk7W+u$6@h&?C(0*DEl zp{z)T{w(fb_%?Ml!+%CD28M4y`OB9W`29T@7(af*o2dW-2-DzgE8vFyD(PhS?H$JO zS5uGS+nSvW|M~eLi63Y<+p)uV4F(7x41<4HOk(&aBE#^jw3FeFPZ(VMubw``r_B(< zzf76I@WaC!ufYHT#DbpO7`S*C{?6G7j-Y?Q90$UXybUy5SC8TCy{AAXkORz#kgSe9 z@&Ez|#b7p8MACs72+Femp_Z@!BkKQuCNLXV9Dyxh{DZxQ0tg@$NU6odP+Hl>KurJ; ZU;r@5PZawLhx`Bl002ovPDHLkV1f)SrDgyC literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_download.png b/filemanager/templates/default/images/button_download.png new file mode 100644 index 0000000000000000000000000000000000000000..4cfd6dd66112de55783736f1e8828c5904dc6973 GIT binary patch literal 663 zcmV;I0%-k-P)%UT=HU*e&O-%-Fx@>{eItf?>WX8zJ5EQtC%s0B25%UXl?k@Yyt3SWziY8 z9%BsEqgtgmL3Eh^t4n_~d6Je*57tHpXCUE)zd*L<~&K&o!Nx4|gOcY+``_PU` zp@Z^s64!ORo0<(I0QQz@&dTns_`&+abfUf;rck8}zAsQJMr)0ff+*@+(}P<*u0JzQ zVb_gk*Yni3Lr$M}GQOr+b^~0bOsKu3S_aOi@VcB-)-MJ9(?2&PCsd&k>lXk3002ovPDHLkV1g=tF&F>< literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_edit.png b/filemanager/templates/default/images/button_edit.png new file mode 100644 index 0000000000000000000000000000000000000000..ce8b226710bc4bdd74059a5d46487cdf6743f3ef GIT binary patch literal 1076 zcmV-41k3x0P)`K`fBk0o`}ZHi$4_4wbT36RFbLQ)JUM;k!HwN#8dDzpU%-F^ z00a=j`OEkIV*`Kx{rms*`>+2WKmYju_Wig2*VlCY|8pn=RxK-(D@{@p*oARuvqf#C^I;tvqN`pxj{(k+H3Pkt=Kr5_-Gm>38Ep!p2{ z?@eZ4lLT^JfRqCT-f%L!6E>A09Gr2y6x##taG^28K`U3|~I| zW7yANz;NrWp4loG5urU1k#mey8F^hp68228P=pmH&VS^Dtb0@SQ<4J`$Mj7{JL27XSz#oCbqk^L`!!gBUjh z!_U7!TR@@4&G1PpfI)(p864cew2sqYfB?d2@SiJ-7}#_L85rJzRQ+aP_{zg@@BSAC z*^F!kCU!QkYe6{@H3bO)BZA@Y|NrlP0|XEYZr9FaU=#%g!?$lh5q2QvXL!!0&Y;XE z$ng8mU!Wn7VgO_T&_HgmcfkH&_y^>_0|+1%6vLq4$K`bl9I`wN3?G5gAQhjv7#>`H zz#tvj4>phm7!<$%{AT#_U~KirY`7a)MJW{^KWfv#i?VqoC)Vfgh=gW=k>{|ub! z2HHM;6wSm_mVkW<3h2*3 z1OLLr0RjlC!TV1WiE&p&W#`1c=o&I1S_xWR0!%y2;!?_h}c|NVm$^gx3_7{+E~_{#v~ uF);pN#Az@<0I`5-iPFk825JL<00RKz*@!b6gg3tc0000~8XcDxD}Dd~1KLSM zK~#9!t<_&lTU8tf@bA4XEo-T}Y!oOcE4IKCp|s425Y(AqwseD;s8Luf{8+ zaa2b~2Wf3>)e%B20#Ky|>vX!f&1QqmW`oIO0!`D&$)27b+UN68EiEn80M4cZD>#mO z-fp*>6$%9{2m%6u0C=8HE*KjdLt9%LJw85uAQ%j~0k~3v7Zw&4gTY`$Q&UqxEEc1p z(J1_WKO{*40EnVUdD(e#;&^4|nfFX@jf}IZ2jN)Xj&LH8$Xi-k`io(hhPt}CEKwA} z^E^0?gDlIi7_~U}`A5{-CmN}t!M{n@?{__0F}Zt37(js}NztjPsipe*`a?xUMM^;s z5Df?LPOS>xecz7a%9qf7wjGy#{B=GQk&jCWNU6X%02HDqE<2shtmfwCaz$i`e#3kd zC*R+XU?`4LC%?kxniq9OXkROnq7D~^Qh_%BFaQ*xP-r6ToqqN7sn_=ut8Zg)cm`j7 zJ%eMlg)kTF#*-$a(z0KwEmcRBug&0}RGOFxzzU$+px0fPo46#O|M->IK_fkR>*9-v z<<8dAM_c>t;b9L!WHKLhYVwgxpnd}?(k;xR%5Cn0ec zArHEUJZYDE&M186?67Qi6c4irfCu1>C*+#|R>c^yG%+7rV$46B|8y0NxF5(gfKqBH zlb+QqdwdNQIp`jkM|e9J03-nMM>fj1kv}QyG61T*pp`1BRPWk7 zGZ%TeA{RdodmwHH|2JU(T1ep)vtDj0G8q*R7a(iQaQrcflCmPYEXSpvoQ^&FTrPgP z#Xj;@>;Mx09)}Cl*So%P2%?H$?K-xCQ|SHWD%PYDWSb6U)Kx2vNC{M>Q!xO@05)lP zD^hAuzPV4oPGumB!|%4jea{1fxe5^2_>Ez|^Y$txQmr`I*giLg1|3&N1jX{BE_<&wKxOSIq_~Y;&@y@Gz1-`*dq45p zd;J58(*4ER{K^+t47ribvqKKr^! To6&0J00000NkvXXu0mjfKVa%9 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_edit_preview.png b/filemanager/templates/default/images/button_edit_preview.png new file mode 100644 index 0000000000000000000000000000000000000000..54db9af36b7e0558ff488ac2585035ac3602e9cd GIT binary patch literal 1230 zcmV;<1Tp)GP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ=L`g(JRCwBA{Qv(y11@mx(!KvoOpI9Ne*ON#@cY+q zhQELRF?{^=6)fiKVUD2~Ab?mH@BonE20Dru;{Sk-`tkD*!=FF@!1&RV7YqXYybPOn zocxb&2|xfbF^~zEftG_Dz{~_Of}M?(!PH0-YzeYDfB+)P0wzYF!OTnyEI`c60&y@G z7YBogFb{*4h9Zh300Bg{4?utsDKI$LnZXuHNeZI)1R#J|D6;?(Ondho1!7G3-dnf- z0|XG+7Jv)}r9e<{CB=t;#s2>N%kbpsD{u+}$*ozlh5;aem?-rDIKr73!G?eN`W>9Y zK=H%G3^5uYfXMd2|9}6%t^^tQ?b}aavi${2vVR#kIM{%43=FXR1rR`FSpYKh4={uM z1zG~i2mgRH%r`8|%s?*zgX`ZvFdra*$o9d{pMN1?4TPZhU}a$e2Ms7^gIo`yK>#3t zSjcfbC>MiV&jie5|DY}fS;F|A3B@-c01!YZ7DPlu%n1nz2^JL<75M)B`=6V)ZZk0c zwPVoL(}Sx48UF7d#MQuPh8V)afN(J|i2i{hfdLZ9009KIpt!jB_UzfSRd{)M;g)-N zcrfhUyO&}6_MHq)&dw+~85GVJFJ5906BT0+77>L+JP24}0t67)n#|11 z0}Txg$cDp#Gtl5)Kfg1)difIQUPgw?moG9bTrij6?CIkSqQZO(pFh1}IDhsS!`wO3 z!D?VR9O4TG27mx!Ff}!m-?L{AFlcduU%!6;@9XRTzh&!=|3I}k)lHo`_5YbQFK8iS0CG=rd^0Klm(Fxx!FdT8g3eH!!(=`}Tw3 zD=;T3DJh}I0R#}%q5_m7zkmP9@b>LHhAmsRFdRI15G)RK448fH+&Q=pfByUpHyngH zIeAdb0tg@`paI8`g9I4fV8cOJLPCb&!GlK(&!0bMkd%~S0H!hqdwY8ZBO@cQ4}bjl z2{#yme=xiRMl_@dfkZMu0D+R}3}8|$cXV`O1R4GlSf>2=@eAxSCMFh!`uaAo*!Jxk z8F+a)8S?Y355Q|@c#XKhNsV-FtD&PGcf*vL@Pi5F+Y9!^kY|7m!rA4 zr2;4e!4!iuLNxyZhW#amt2b{myng$U;q%A03LEr`h!~UlR-2cDL%=rKN)T;k~ zZXNmmSefBJKmf6jYv@^^p}&BJO8Cea2o=>ZF!G5pFtGD5{Qv%$;oBDm27mw}%iyC> zL*>%k4EQ6%8UAt!GBExA#lXbyh2ih*V+^0(GkgFDAd(H;12l9$1H<{pv*-N({Q2Ae zw{JiGfByW<|F6f_{{OXa=Kq^EV*d{?Ff;%J5J@iH0(GfoUa*0nCJ)1(i(44}F>^6| z6Ek4o{_&OJ>!t+^_l~@Jz|6of0U&^I8oY*qApuA!AdCHEVDLAXJ;y*WG@Rknx1S6@ ze*9!$e0`VU%a`vAf48n;xH;|khrbLAfdLE*9{>V~5u2e)85rivs&XX=>FF|vD)2J= z=M-T0&%w*UaAqk3ueve=BNsn7qV9N3V_dF zj0|kTtPCe!OEEleYyR*bXlN>up&$SdK=7dG1{$hsE|=gQs>#6c>nj7p@9zu@EUdtQ z1+w2iW%%>?E5n7&KN*<#m>E<&1c8?PVwk`3-v>sZp+#thf&f4Ofemh9U@!nu{m2qP zcRIMaOEH)k^DzAS^o8NT%9jl6y#E=@>=+nWc?20AN%}J^tDe_b3rt$r;t3#tz+qei zvC$DG2;}!0nMygB*()&o{PdY&-Rg%7Jc4Wt_AVR@?2N#8w@YSVc*o7~3s2Gn2p}eO zflDb20%DR32LBnE7=HX^W0<$_9>YIjP6oFC83uN4V9L;N0{e&Y(@Ss+-~s>vgktdd zB!&V;4*vUL)5{zfG#wdw+m14Di*hrBL})O4|HaDigH4!$;V&>Xe}2Wl@Z~k$%mffX zaD&gpGxQ5+DfeqOZ4ltMieh+i;Q|APxD`T8Dc@N0%2 z_pjhJ7$AVa2A_ywaNv^UEKo?SU|?qZ#qj>#6$S-6V}|1EhZvqcz0ELx#<>qae*D=0 zlw@G|^NZofvj+_8SKs^q)Vcwe!2kgSHuΟhrA2?hp6U=sWLmO)ZSl){73>&_G`)vqRc9DUVgW<;?R)+bD?|=CIX@dk?D z0@Lp!hKF0{fGpkE0*}2yj99J_efGJ+L^a8_=@4rEYZXi?=0t67tzkdt`@=p8=e_rfm`26rQ z!{_G=49|h_^5qTKz(VAz4Ql8DVv1OR0Ak$k&+wj+5$sh^WLyAd#fP9sao+&(KDhuO ZzyPZjou<%|e$xN|002ovPDHLkV1l1lPALEY literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_home.png b/filemanager/templates/default/images/button_home.png new file mode 100644 index 0000000000000000000000000000000000000000..3afa8033793bf26a827c15aa228b88a23a902ff2 GIT binary patch literal 1617 zcmV-X2Cn&uP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ>$4Nv%RCwBA{Qv(y10y3N0|+EYF)*m}F)&DRFfiCtz%bvQ!S?zahRn#*3{_tk7#=VX0005RgijJ^C&Rzr3=Gk_3}Nza zK5O08xFWaeF>KRfWUwS;FhBs|H25FTP(CIGR$VpD#`MgH$>0tmxk87>ABYbl1^=CVv~4Bvk;F#P<+!0;DH|NF_n1~iTZ=sqTpE}#Wp z{xLA*s4!$M*JN1728?TDa{vMe#b9Y}2G<0AhJCE;47v<&fpP!g2?N+|e?BmL*?)-P z;W?nwfI%TFz`(!{Of9@X4780QT!q2&h&980NnoOanFSC)C5UAb=QQ z=@_U^=v9%-6*f*5NrrzwKe7S+`r!}5wIkmcm@;}9G*S}58oq!3&2YW3hC%#rAA__G z&^P}WAefbb;mCc4Q?|Pp?0~$V00G1TvmwlY-oP%#@T!@nnA7;d}}Vi20p z${=B522F#%88|sv8T2|j8Lm%}WB9gp5`(JdccAZp;q&)Dg9XQ5U9ml{bYA^qI13O! zaD#(vb^RD5lo=R)GcvqA^OE5?lL3QRT?)hJx3?LNufD_}t)|Vu!OG0=?fE?hroZ1A z6yn1fp6ci`oSWOjpe6Z%fkT0nfra5OXR_7*koF_5&jJJx*kB$O1|cU0YdePjEDZM! zKVbN88o{6w7t3&e_Y#I<6Y?2O0WA^Hv}90H)nE|)`<&s&p$QDCK#wVVB{DphlVP|x ze-4Av-5U&|Hqs1!&Kxf7N47Tr1Q6I@cY6~{Hb!x&+ov8f2&7doi0bNqeZj#iz#yZg z&%p4FiQ&(W8w?DW?lb&h{ly@wsR;~LW`^Iu@D>siVPMJ0W4N_$J;RqHry0zwt#zb? z4{87e5OYIA1H+AFOB0`-zHOk}(!(O6ssc|b%b;AAHN-+IPb$Jc8-St0R&DJ?2L?t8rs@&7q47d z22E%TfB*hv_|M1$#EcA|-+yHI^&6P;m>3y;eEq_}$;HLM$jl6k%U=v2{eS-aVc_84 zU^sa6=>5>Zz&N1GJ_7_0I4FKGFr2@B>(=8BA3ppP5D?%3Df|aaa{vDQW%%~>GsB_Y zd|=wW%fQ9>hvEB&Hw?mV=?o?jISjvldiY-~K=4%Y`}gmk zpMZd$pI;Ej1{(}2jD7;W`uD|k2Ek7c7$gL_8UAp7VtD%HGuWVCzkWd-0KqR_ym$-L z@(pAjKmZ}84~KYsiKQUG%?s7(I*_aB3l5C??V0rnSnTvsyjg8^= zFNne5xB!MT2ty491AqWRHu&GSZ{Oat0X2al0;B@2s0ytILmK_ zk3ymhtgI{yjO^@?ase2@>_9d!Bwxb}0|+2wgBg}BTXqg8X$rL9D>#gS4gu<7_7KvQ z|Mp*iiHVhi;Ty0hz5V3%r=!c3ykz?Sj|plpsM2ITfByVUm{|Y;#E4v(0s$uw3n7>L zEKE#dtqo1fc({24d3bsM@bU6+t=qVM%i7Ac|Sl5fB*vkh~y@@65K`O P00000NkvXXu0mjf7SPcf literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_info.png b/filemanager/templates/default/images/button_info.png new file mode 100644 index 0000000000000000000000000000000000000000..3626ba7ee6c9b77bac35febfa9503cc85f48114f GIT binary patch literal 1195 zcmV;c1XTNpP)YF`^5o zChb)K8aN+_9e%KKGkoO{WiZneVqo|WME}7A!}aSg7`{Jv$iVdWHOP_!K+6-~UC4ZZ zYz{yGp%|=|v@hWQzkl<8uy6~g8L2VE+X^xGs9^We;l~UNb9X&wIJo901Jj$AAAmkd z{CFdO156$ufZztJC4&t8zy2eSI76zxIzzl63s{_)iGe|ihk=0u$bI_u2g9px3=BNn z9B>OxKKRK{(t3#D`{gU3U<&+lzZ7gZKmajA4Bf8)G<5qX9&wJ8AZ-R8H715{zZt+- z5NL)lC&UmwE*6INDZ3ezwN>HrLfkA2M&`;4doO-u`2GC32P==$%HN;&egFs{CXfcO z_gT3Fd|lKT%%m8=u7cqYKTw0RhPhyc*l^FitW0*F~PVXpzu z;0``*U4}q?U}OPZfsCJgW?=XSjI;YUA23vOZD-(=R%DP=QN&Qk#>T?%icOf|+0pX~ z%xrcW0Ro8S|G&TaKUjGfOqB!~UVgzIQ9Hrn3JhAo3Sd4qbq_x=F#M2`XZR;9%JBc$ zvwVO6VgV(quY#fsLO}1l_=>7HRFi>0h7ZCP;)H~E!SwSCe-sVDV();#bm=t%!=3jG z3_t%u)G;ZmGcZ1S>;MozAcGZnLLbHLs9s?tk5pD<{J1_$r-p6ou<6~fX@)H!mVDYbyS2M72`ZI7U z7{k>*U9*wl&$DMAfXqY?A0U9>#io$K^Z;PeThFVe#vtKf$H2_NPE;!S^X)ss{S_M- z-W)#-;syd;3obSR0tls`7tov(04kk0MT7(t-5nSNl;rRl`u6%=h8s&aFnoRlb7>#E zpa%#bjH-!OsTWwk{h1F;Ee<^5A`IfdvR6b+9-Q{T$qz`px_X!4>FLW1A0L7v>HySG zl&T3JfEaPPhEu%70BAuzu);*COo2r#IGsWboCq`!Yh?-$U;w6N`1tF4c>DkW002ov JPDHLkV1ml?7-s+g literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_mail.png b/filemanager/templates/default/images/button_mail.png new file mode 100644 index 0000000000000000000000000000000000000000..384cbf34e9cd645b145f529eadefdc589854529c GIT binary patch literal 1066 zcmV+_1l9YAP)>uM^9cb2=MbVY~FG5KPiR-1P~K8L1v(3APbq9Akyq?tPG|`nqb3;H5ed( zFbrm51RBW9#J~c?%q$QGa&d7mhzRpAXlW=CZ8$&xG2xP6MDjETJ2TiKDM>-1T@DaH zEVvDZ1jp5DcflAPEM2wde{`4&&M*fEAgl(14Ezs_L{PAJx!Zun{{H>T@Z{+$aEbxR z9XfmxuZsZ!hzXyI!4b*K2sZS~*YDsI0}6j8AZBF5pFjWt2&;?#|N9Si7094(-+ls< z-!EX&`^&(=!3LCL0Lu{q00D$yFvze!z>M)1XgDYx{{zx6*Re1&1HAwYmVf^k2soGl zAb_yCxPQWCA`%ogLr2$ooK6P_AQp7jf^r=QRFnlWkP80&g(TC2*eV8q0AfKm6y$Xf z`1<(=I0d|Y^PWLLSr!-!3=H3a@;`t41&1>zLjV2&1{WyIf%wMt`{20Yz7axlDq{D$G-{Z|a{-hE|IR+VL72Swh0NaTSuGqbQTynOPS;r6XZ z3@=~2VGtD)Vc_EC21P#uKmfs$8zTcFi~$GYQbG)7RyquSfBj{+arGg?z1vS1czD^t z5eqUDWcY)7&lsLReaWDvp~N7kD9ymf&jXHZfB<5`$i_&~@%Q(C1~zsU24f2?pcgq9 zZr^;w@Z|9;23}rHhQ|+IGVIuL5UkwX%7{TgPykq1u`#d$3oH--2q4Ttw*d!otQNs{l&F%nahQEAqtLE5C8}uxWQ~dm%&m53_N-8hT+nMTMUlwCSaHR{P~-KUx0^!hervVNg&CK ziNVRknqkMLgTNp$WRR2*2kQk0AQn*GpS@rs*xTsf-05o!Za$X490*J`KmP(PW(50+ z5ma6e|>PO0SF)#T}^pLAVx8;yLZ$7UqAmb=;~=O zynX$R;rH)<(4hJctPB5w*&yHj1G*ZVmj6PsxUs1ogOIQQI8^`y5Y{XW3a8Yh8V3Aj k&3^>>AGK5j=?4ff0AoaiT!yBmu>b%707*qoM6N<$f}!ltLjV8( literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_move_to.png b/filemanager/templates/default/images/button_move_to.png new file mode 100644 index 0000000000000000000000000000000000000000..ba4fa6aecff5a8a3cab8806dcc3aa6bc29419db8 GIT binary patch literal 998 zcmX9-ZA?>V6n^hVZwr=DXsx%@!7HFc2MZq^l1#m~tZ12xFp-H)puK6O(>OK)k!?S2 z3tFKPZM6>ET@$5 zt*mrkTx?P-03fbduR9<_dfg?&J2rB8f(o5%tq7u@AaE^0YEer>$C@({@}t0F+@(~@$W)BMNt@>hHu782vQ~| zTvnIMrER)4{vj;K0s@}Gf`pUU_(i^5ioc@sUgBa{;4*2yH%W;HHJ+{NwjW7oZM_+s zM7*>eU7eg6DcNmwk>0v|}S8VTKEU;w(RS2FKT9}!vvHRG_%zR3=dJt{sL3DJD2>IAwd0ItVpM3twfGV+q zQz@&ehG9WPboJ@n*~%KE zuQ9yPE;_O>AD_|5YSMang9)J_ztf`}>RNbI?-}V--QReBjQqH5oh91?pvZ(Bh)jye zEm&ZI@u9-FHF3T~5%nmZ#Lp3)DW2s@q~~7p8uX(MO8lw5BWdqdftYc;tP`y)i~s%r zQlgO*eKyweyaf^kdX|cwJ%Z=9&&KBw_Za=v%%6X9Y$<&KA5@+gE9@48fJ%@ie|X#} z66UU~iD?b8YDSlM+u>vrHn_wd%8S_hh>Sg~Jr|$dI&-Kci*J0a4(Q`7-913YW;)?& z%rX{eMktyW5m6(EL7!=FOY%?0^of&tz~J2ywneK+Yo}JH$Fe+A=aLVm?#pGt?ec_- zFRiJxA{|+8P)0lB>=J*SEJG=I>7D*X5R+WCh{e9vHL%6bfRLJvV5WQ)bi-5?oz6oo zUZ3;V65NE0ryV((ato28G=HN(+r zE%A-nA2i_G_B*}R6RYR%y(GI-fbFfhWO!D1S7{CX zv$4(I0)*wAAwfP@nevTisjWQ0b$L(5neD8c{2y^~m{@ap4gR*iQ#Pnpyj}ID`^5?2 OQ9*H0sqRLhq4_^R&Xu14 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_ok.png b/filemanager/templates/default/images/button_ok.png new file mode 100644 index 0000000000000000000000000000000000000000..31c064ba9221ee125c0e45fd78c5c5aee61df26e GIT binary patch literal 769 zcmV+c1OEJpP)cHeO`Ol5zyLImnGt9T1H%VqW(G%q0AggA&F~&9`H#VoA)Q3SX95jmWT@xj;7a)R z^BV(@{Q!sq8Il<;00a;d!!L#n;(X!)41XB*GfZYMAj-f=Km(^R%;#X{xbI--kf0)> z!T>bq0>f_xLy(~$B>({gGI%4<76vm1GXbE)euf@AhW7vs>}8nG%FKFS(^xaXBh-W8 z%8e@wmu_A<0CbomLngxqm{NcMVqoZE5MbzF_^Sy{dctr5O#t#j!dhU7L{~0=gA&dn81P~-iG%@UF4rO*=QfFfLbMX(u|4sitF#HF) z;6Km>z%XRs1V)NE0|Sd03j-quP|FJjhChpe>VE!Tz);7Kh|OSt0Ac}?KN&Xuz4X`N zul!#I26Z6c4d{z4z+hnq(q=$D2y*}p144#}K=u-_oP$4LH|iN6a)YQh#7^a2TZY_83Gt?0om_>hAsuh{$++A z6c+{vAjWGGwFQ_M8R{7s84M1-u@m^nV{K4U63y`K+Yb~AfBg8#FmK)_2ENb7E;xuD z{s8iUdhV4%Tn+>XAeL`G{_mHubu{3Sm1Fq0VCAb?mH_=F6^%oM4y)W;|!`_e}6J?NpdrAiK#O@ zId{VVmpXs|V)^x-h2j4%h_{{X|1s=6un}(@xH$ZWsQ>w!;nyD~oaz7qh;etX?SF@4 zd%T8SeUOY-{>+){49Ur!jL2dD0mSm{+dqbXzkd)+E&BQjh~W73pW)A+e+*x~d}Cl@ zg1CC_-0lC74F?Dyrf=W>g1v?hqXTAUMj&PaV;C?u*9IF7;{yZ`&|sj8ftvAQtYOH= z05=#E6emw!g}WR?0|XGukDtT^1-hYNSAm1!AA^^d6~o7mUl~4q`pR(m@*S`oKmf7) z|Mw5YyZ^ucW?=XR#DD$*^+0_lip{l*K$;OuzkmOo;rsU=U^WZ@1Q5&r|Dd4w2{z>a zyRQrkzyA^KVi5iJ?|+8hzyC6@urM?H`-cc~fB<3v@)-X8{Lb+IEiiKc6%YcTGUxYi zSgQEW@bl*%26lE=_984NPx_wPSo zm%%V7Wq@1@inu?25M?t!009dMXyg$AfS$uzu!DR8vj_$N0*K|+2PTH^Uw<*Mvl31X zzmXyrmei14i3|V&h^1xQEyfxz)&HWre{dS;U=It5zt9MT)Dr)o=^R__1Q0+hAfjd4 zZAN@9y?F7#|G$4xy$vxOA%<=^Kmf526SknT0E9^a009O7C3&r}L2(;R00000NkvXX Hu0mjfT^5Sw literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_reload.png b/filemanager/templates/default/images/button_reload.png new file mode 100644 index 0000000000000000000000000000000000000000..9b80d879c7dec618c72c16c35fa06bc474f68277 GIT binary patch literal 1157 zcmV;01bX|4P)1uYXZC67Mi-q*rwc6<+FB^K!O~Iz5fTJ042j?k zF)D_bD4LiMBqlBim;i|yh}Og?;f75?DuyK#BibNREK6yi3vFlb%$YgUIdf(?UTC36 zq2;~&-v537H{bVvKRhOO&n5r!X3{1*Crs6Fhn?#E%XFBkOLp<&* zTWV7Ti;M1SkeEoXo2a%4v0 z`P!BqI;NEPoJ69c044|A>E)qdc=P5l?b--;Hku`a)gC3{y?EF$hu=dy&KD za^1{7+^ZeB&$zXo#->I2zbsoa>y6n}X>XgR1#*w}aT?%EoXC?mk_Th4-~xRzS>hUy zw{AF<+*v70YDR%|NscLsK@*W>rJ^(@A35X01OL6_xJFG=ZC2TmO>4_rUVnFnmeTGU z>K+JsepS|VoObOp2;2bJ)WN5JcDPT(4JioSVOFka$j@fQm_`pEiikQ@0{0b0l}h63 zzqgLZW-l^c-Wgx>x#M3Cd7>*FHWL{pjdYv10FvBIoJbK;Vj4tMEMg3^nUaSMbvyzR zHv?fcj$T02i4o!4YM`h+k86l!1`o=gBpc4{{vl5oV>BePgdWH0-W@EMJ8tRh6g_$zZc`NGHH^2H`vD9~d zd6lHLot2RQ)>Se*a7#UKwKuxAKcMatR1P0^G795XdP_dG#(L9lFSgjL1zRo@%pvFt z)A`3=N&DOyp=|X=oia4Q&$~Xn)!pt|^}dVikLv&31-TF*-e6At9vY3kR9YZdb+Q|? z#e$=@PRMpt>gYOzUKylh>4xlZuxIT;Wu(2$&+w$i04LqJ=85rBK52AOPP&k5MS_uD za9#u14}pHf=pD+RU77B5_P^4Y3jK7#i)&J2fRi4a<=*7?&QMr(k0|zNESZ&;Aqu)= z3UngjArBYZFDO1Kc0{Mfj{Pu9=us`15Y=Eiy2^A-`?5j{eo&~LS!WA>+r-|FE2*4J zJK=vkhR@2GUOLm*n~`Qn^$kZ_her5f+f{B&C6xYAWL^WM-5Fc*C@aNwjtcHSo_WSoghF^dFgB|qe&p(FS*G@3Z=`UsY@`sIK%~}(N`qNt( z00M{w6pA35|09|FpW!b96C)#rp}&EK`~n&ZQvdtUUxuH*{xX;_buiew$uX?ld60qQ z#|MVzuU|2|egDS?Ab?mv=Kc8taq%CZD;D%bGl0xw1QN);02vCx-@kuj`1_v~Xy_k? zr$>qztXzc{`1json6jytVL1~!!}l*AN{?K4ycHmTSU@iQ_4_Ya^Qs*e8UFr-xajXc zkU@VK{(-_0Xfeo8kemQNC&TMEpBdB`moYfmzGV=&%*?=Y{SyP@&qoY59&;~za{u;H zkXZl$!~~8!poYJHKn6naKQu%CfDQc%w(QmGPYf!Is~GIfpEC$Q;$UFebAw^m*WU~W zIW-x8hOUA65FmhOuuirq85QBm2-+#as{e`*o9|->k^W~YgGuRv6VG#Q$%)q?q zGQ(kD@GbqW#qjW}E=qg=1Q6K8zknJ*F$_s|(Bucr42VqfpFx7vGaRv!yMFyr7 zXBjR6<6-V68HOK%ei#uA5I`*8Gyrlb&}B)%Ch*(^N>+dWf-L(9bS*PD+`j@NOGem? zfnn-lhTAO6469ib8NLYzGyM7e3y8miv`PT6IuJhx2p}eqA-{kBg{KT;LqS2n#PAVf z=$9`Hiq_r?f2ST{c*@4Y(D$B~LEW*G;q9yY3?JS;V)*s*6UbmeAm#xv00M{wM1Wij z%TbSCyatCS#BgW|`TL6D(fM5rBEa1BlIb5q>%)Hxa*i1cj~_l@`2OuZII8~r{RImJ zFascfpgHe9G-EI@$ViBSUHj)ZD7~@)BNY-%5$#JD&g-x;Ff%@8P;s8Yz{teHz`?=E zz`-R1EL&I^KEC}7GU62wzXUM=0*D2Y`2WDe_TjUa@L&L?5>WR2_x~Tml$o;_zJC7$ zwdg-M`H2V#Gw`2&1J=vV`3^+Ag&NKP5I~T~`vVCIP->8s5Q7*B%4tADK7aki@chkJ z23EGe4BU+Wz?li;Ly%>Eph1WY00a;VtYCqK@k3x3gCg_Wk3S4Qe*(*c-=MVoA4vZJ zyZ#R}2Z9_SEGUT6V1NLEMBX1rmfnB#3Do5f*T7s3GUzurcm9V)EYJ}^$3FV>7Mwdl zfR&XQ#bAH{Vg$L;+_~gGYJtl@GB~xrHxWoZ0OHF)Gv5LP5DTyrn|uBRCNoo0~EFF%6W|B=EP1^@yG5_up=a9Be$gTfBk&_7^9{{jsKTKES- zgA4^(@*k`h(_nxA0!JPwyg*VAgMk{Mt^-*Jaw*8G2t$G43=CVaV?e112>)R*7$AU{ zKtjKO8bGduBs*yGgJuRqCV|i(;y(i;gNP^}gNO((Bp$FB3=lvp;4}aVSD?$1f=%GL z3*?Hw(69!%7!vOP!R+^+{s0{V34+cEn}KREBM%^ez^URlH1c2;<1+LQI92>(c=O>a z*jMcAY(Vk95O1IXfB<3v5g-@Ca@6A&uOTk`&j1c@u%S>Nfh_v;#3t zSRjf24?HLyK6{BU7?dhNS@%E0rC-1Qfm-w*>>CjwVVs2%Kmb7^50cNp;U+5~hT_`K zKvzD0^Ob>>?Jom2<3Dg_0{IYR*`L4va2gB{KrFDxf`#!zU>JiU6BLd=fBpq~_cyrE z`2%+SpFfC9BrGV1(_nxAf<)dQNUGR>^a<4E5ZAz54l)Sj`oDkv!y^_HwvRr&1?Nr> zU}a@SF&H3#7(uQycP>FqFaH@x2B-G-CIYDkKztc!=39UOVgZ(796%1pPn@7c0mNb; z3rRPc;S1DYP(jZC5I`UUn1GlWiaDT|9D{!$*LeT|#E7kAq6Pp6FaW#%!qm-ua=QQk N002ovPDHLkV1i5gn`Zz3 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_search.png b/filemanager/templates/default/images/button_search.png new file mode 100644 index 0000000000000000000000000000000000000000..da3da6d6251f91c7d660b5c3b467a6e7cb5bc899 GIT binary patch literal 1382 zcmV-s1)2JZP)nPbPK-5vETJT>rjaVEOlJVMK(-1O^ye-u;@U=|i;;OAvzU}0fo`2U}Q;n$!446Lu7G4Q>* zb%Ej6&%~6JfD7mbyQa+h|K!nAhU>d(89|l+1Q6KZNt2c*yke7`|69e7K}>{+fs=!g zft3|v=dWM?8MwF@8JL-v7(Rda!SL_g(GUMWzBkOvi+q5~^&m?C0*I--eZIo0fBgNw zlnoiAB$*k+#aI}mC0Q7xfV7ApGXp0lBg2pHKxYH(k&@G%pZyGcx=Jx>iw|l|ev&8SD#2 zCZOS}A`EOY(hl|Y(+yyTW_RxV|LDnUhNn;8Fqj1QgAE4=Ag1@fSOPetCBZJ^0eYDq z7zAQK2}vLZ1}y{kzyAyZ{2)u282EUY7`WIN8DvaU8NPk{5f3x? zFiybcG5`b+%U1?&1qn_jaF{YNGcW)V11k`}`thHE7ibVSFam!AgMkI)3Lpk)ladny z84P#v-Mdd2{`~pF@cZX)hA*E!fyDp81Q65r7xy24k`xP2 z*Rz*@8NLC702D00fQEj68pwg80qc7cLoAwGiv0*L9?uRo2qwygW`4VYH>fXR%7g#jKuiY?%>D4~)w9Iov*t5={q~Q67npt-p-Js8h=$@HKztc!Xm9H* z1_J|i20lJ+1AGPp1Q0VgD7F-Z|fDz40svd-@n6f{W<4?sCmy5k<9`KATX+% zee}O=%=G`zI3fsUL`uGYeY)oVx9i>i->k6wf3i&A|MUn+l=1^0fSAAu{NzoBS1(?H zm_Ks5cKtW-?f#F?;IH2q3XiYf$iOZrz`&*F&!B9i$)F?kEuq~PVK_hlp(7c`gjxU9 z9P9rRa&@hnM8b+<-T!}I&inuETKoSu%gz7q&EflB;Uobz93X%gJC~gP|N8A$hBxm% zF)V2GV`Lx!h_FtCeBGjQqpF=(5qGW=&^O#lcWrmx?A!izixMu>w! zbr-0bAqLDp_j1AUlP?ly)$}v`;S^$+yA7B_4PqDo0*Db5robYQ;U}=PLN1+11@Q*r o^Eo-05?HjN81BFLu>l~!0HFlaGg49nnE(I)07*qoM6N<$f?6+p7ytkO literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_search2.png b/filemanager/templates/default/images/button_search2.png new file mode 100644 index 0000000000000000000000000000000000000000..40762a0250786a107024a8d60a86a903471a2f1e GIT binary patch literal 1393 zcmV-%1&;cOP)4MuYdH3Dd5$2MuAVim>8rve=zVe{J6mU_vbSVuTrd z?b^MBTkl!>um9ja{hf{TCO) z5I|sq&tJUr|LQw7hVSg$3?jV$7=Q)>rT#Pg{ri{U&u<|8?>7SzBO}9G4&m9ncP~0J zefj7b8R_u=pTPhD#B%)jC50zHI2kx4Bp6ghm>4)Ym>Aet85sWk`_J(E_dkZO-~TbZ zd;gh%mzRTq?ZeyDPb%uOf1EivAE?(6pTPhD#Ps9Gul%=+JPZ>2KttJ?7{{RjyRt6TJ zD?u&=n!&&Wl;8t;odJk}<^v67WZ>gvWf0_NXOI#XWDt`Oa{d1OM?5}*0Ro8W<##3p zZZ-x6W+p}kMxddf&}9bVuYdkCumcTb1B$b=Ffeej0(}IO7X${0s){twA*==X3+jD%LnIkMiH-wk5DPQJ)!b}Mz+m{#@be!dgQl_^*cS}{|1o^} z^p)WkFk+dQm>8Ztdydn^00G3r_Vv|+AAgvD$%%pC^Vfe2zyAP(f|-%wFOdHeXa&eX zU??y!0}W;P^#{!V@%bwQA3rb9my9?K1_&Ugzn|Z1c>m@DI4IbFF8&MD|Mx!w*awV2 z5`_Q${>$(mWGFD1a4<75Tsw1}K}S~&Zw3JfAf}%`e>XlqcbefnFl^b`7=c~{8Tucb zj{p9H(BRw&b=;?qpBeV=I?TYs%f*1l!3+Qa#MIQ3`N33MhT-sr-3%Xo`~w>fQvdtU zKZajGm;MHN;XlxXf50U3=HnNJ*;7|BC@IM@d;x|vJ^&Cv;4FRN%KiWUfB#}wyx|ao zb&v;xvWgS~J1|wS0A0=u3J#E(V;33LE#AbSqou+iFE7FH_x()EAprgp}1ySR?w)s5>6Pd{)iaOp=F4iG?0D7L_22uL9n(+B_+6LqR! zxVv{F1G}IA1DBpZgP4XUgE-IEgpFBJ^I=K>0*DDCY#=2jBF3RKC_{kKEeH!61Tipb z7BQS$Fqwf}SPW>mAA^*(27{cy*M#NC5W@iihzWa?;*M=t#UN%F$Z+nP6T{)z6M=?H zfDM<^)nHH&`I;~{MruAl0HGKR3Rg&cLBkix`>-&E8U7Eb@TZ6g!}ZIr68FrQz`!mh z&A_GW#~=etHGi4d5&!}S#b7p8W?=2X1g2Sm`544z0%mUz&C1FGEJuJCSeUSY)G>og z4~C2t&lX%c|0;3YL|}EuEyS?vG$X@j00O6q%hwz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ=x=BPqRCwBA{Qv(y0}L=SGJ@&6+*-4Uh&YqaU%&p` z@JvGb#V;-$J~l?_pTGaGJo)hR*Vi9^@4tU=;mVUc=T7~(z5g`BvwdG-X28q?2p~pe zgY}Fp8Mw{!CBy7gmKR2t*fXGkukXGx?7#7!VfGCkhS%R27`}gIVEFgt!-IDxyQV$a z(>@KP1ZEyU0D*0QVMX&0jafJTKe+SdKUVPRbP5hAlu1u|OQ~|G!4j z|Nr)ddk+B3_hR>gWGkpL3kHN`^mqAnX zHv_{Lpac&CgNGRdg8(0wC`>It0HGNC;l-`5N1toIczxnnTD)!S3t3EKYqc~0t66>!QX!T`2q47C?NKNG`s}{%QqnZ4+F!m zU!WiY(m=^iKNuLEeqdm@2Q=*JGX{nzTLuO%ZIErhf56NF2q090fB*aO4W1x@!3R|K z3~0a;p!1&qE%^-cC@`rr0Wl*`o(YJ})fpJ%fL^=z8YuVk8$2ig0tm(6@85p?0PFn^ zF_?u3f;m|k7`TDK@DC|Y{{h47_iu<#J_FP97f`eSvkpuiAb?O}>D!0r-#}UD*I%&1 zpxF`O14gvS1X=p`4=A@WFueT$Bz^op%9l!$g z2^SwQcz^x|5%8b@2q2W8VEFUr$6KHjJCOP56VQ7={1xcUuRw2n`v!_!h=u<^LG>4s zWSD`Lzxl|(aP8@TpvX^nPyhrFn!*2mz6N?m5SV;8K^U0uxqd+~570sXSRg_2_cxeg zU_HMG!0nfYLO~P*4*3 z547afCs5b{^Eyxo%qV~WLJNxD-^D)u_{S!}$#4;vc0U5cjvM4^pdoBP7c>2YWD;gz z*!~34pMODo<*f#!xqkiX+rsc0W)wgGp%)6je!Tke&jIL)6fIzxAp&&OZ%9`B{1u{_ zodZlUFaZtqP-I}3;LgA>F_3{lUJUHoKQMy;0tnT`!2EUQ`tvtFmV&bCjQsO34(^}rI7fe#p=d_Y~&z$7NlhtPT8$mMsS;s(YC2q2V#9%7YARBG+Xw-;}K z3ikj1{{hSP|9}7E1kc|8{~wsO30Si5MIoC95I~IB>O5d5>hUT@WxKokJK5P-DrzVR zGs{Y|Gw^T$T@7^ovzI>^uH1P3d&kcG_qJ_bedzzY?K6Rz&LY=&00D%&Pv{ABq33|Owcd<2xg1;o#hHNeaR2rvNJ`!Z}v!UKB%000013Q2d>N z;X9E2{vC>u*uVY&G0<&5a~b|KLA}cO2`I2D0mw`Q2p|?tHWr4TK*N6hg5cjE{2Pja zn*RVX&@m8<#Qq1x5RXFvGb=D0*}zPI0Ak@|{m)=6iO>Kt=nvG8KS=mDGW$2g)xUrL z2kQX^E69SsKrbv_2XQ_?0I~41GcY*F5ssa@6}K3CETkFC6u80sfB*gi@jod2A8h!q zpZ^*59f24O5I{`-QT#$=68O)6VJM6Z3mbp{Vq*CBpJYRk4MJu^@L#YxfB<65SoPxn z^iXk}-X{k%pMJ~$5I`)1f}$i?jU+=~euo$g5I{`-i3kclRtAQZ3uc39LKp@B0*Hm2 z$OC~NQ&E!=NA@EWK0p95k!vs^01!Y#1qBSuo;@3ki2(osgfl4qVX-hZHI-;b00a;V zwsZ_n?05irn4$xK0AfLRFml4DB=P_P2pGoyup0XBA7zmW5I`*d{{9D+Qhy+Z{e=`P ze?f+0F&Gwc#Dq0K0I^(u`i&uW`W;{`0IUK2{Dsg!i$H8sT_Lg}4g>%Kh~-p+HY1** z@;@kxf-nY%MT@*os9b;mV#F6ojKzD&4rqV?0{}|1h$L9g#n%7;002ovPDHLkV1jB- B4|f0n literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_up.png b/filemanager/templates/default/images/button_up.png new file mode 100644 index 0000000000000000000000000000000000000000..8ec228df6ba4867cb2d9fc2f0dcd11067cd6b0c2 GIT binary patch literal 1128 zcmV-u1eg1XP)rNc+{54@fiM&V zSQywDOn9Rh{{H_9R|mpgRt5|VtPCIr27uH71P}{Uy+4C21A`ooG{f`XkHG@ZA3SGB zS8ioc7k9@9TNXx624}$nh9xiZ8IHa`%5dY$bB1f*zA%8yV7Lb~i-BPQKmaj8)f%YE zurj>+^Pb`PFQB5kHz9^fy5o#EHbx$XFwquVl+50}ufaKrn+9 z7}yvXp8k3b#^I9ja6`ZUd&e;CQY75KRnLnUZhqMbX7jK}GEC80hOmtlY8DUx1Q5(% zh9AIye)#(x7&8e#guniM&5(1~is90?%W%D~em-SzIp+g6{PUkzSbYQ#K(H`=@Z#HF zg>OHn+3WpI;eVf5{;g0zjYr{mbBT-iN`GR}vTu&lwnC&if0` z@(ch01T*-;?>7tzA7uW6HG;~7Rqq}${QV0~F${nH{zWkun1UFd0#n7BPfs9X%uqQ< z@&=V73;+QHvuh*B9u}Y>EPtUi5VHdfVFzkrWI~iBpv(jk!-g3iLd^mKfB=HIcmu;P zhJKEli~{^xOc>$C@s}0BX5wTJXJ*Dw^YPk0hM&Lwe*l{W1ONd9F$Gfe6@I(rofMvs#ua_|7L3%)Xp(P!-7zGF*)ItbYO0lyuB$#^eG4Keo z6IGypdH<8)^o~yqKYyYYLI44TSsnuo=L8zAq07mjX&{c*(CZgoGTgZQo#8u@p)i91 z0tkCSpARhQfQ1$pJA;6>1~-F*6fXlC8zfwR{rb!B;@M}0t2e$feEW&Jpa%#b+*MOP uyg>1XW>W=NnkS}e0tg^RT2-b10R{kaI-(Rk&-2y*0000 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_upload.png b/filemanager/templates/default/images/button_upload.png new file mode 100644 index 0000000000000000000000000000000000000000..8cd8eb4ef07e49ec11eec5f093dade95b205b4d0 GIT binary patch literal 1571 zcmV+;2Hg3HP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ>nMp)JRCwBA{Qv(y11$hR05Q6|yT?>iRCH8TRW%+z zetfo)k`jZ2gapIu*RL5=R8$yrbaZ&s)z#yG;_eL%4NDIlI*_29TaVfBrDA zva&KZ9jg5^#TU%QMs7DlLu)V!K13NoAR)YZoi0Q+J58I=FVEXjw z&-U%xw`;|U6_G%fid0uu7s|-U@ZG(8m*L^VhYbAu{0y&Nz4{2$^Btto!NGw+L_`Fu zp&$SdKrA2vX!zy_4<7gcy`>GbqouvQ-S_L)uV788s;UfJTwGvpFIu$d98mcq6B82# zphrOZ5Rt{m2v!5q2Lb>A#0Zm6R#uMo@$t!Zad9!Xu&`kG_U#*3F)*wdSXfvX_;`63 zmM&dm!m4)H||9=cjK%Jn3$_%3a{bTs|?>_@G z6B7e3CkunEt!*Aa0I@*5Av|NojAl@pmX?-gc=qfW1Bm_k^JfNL9xkw<@sn;c=o z>)yI`3+!!R@?*Gm?HbS({}@=9nHYGum>4*@xfyh2c^G)PSs7T^Sb*Zp48MOfFdX~* zhvC_~KMe0a{9)i@Vqy6B0TegC{{jRM3osH?^Yil)K^Dl%%QM`(c@vxpKoNK6&Ygdf z65;D;;e*R_PWM>8%&ImN@H-i|*KL%EA28I_;KLg_ioM;#T z0*DEi0m6Xkmk-2w{`@(^n>TO3xel1@ZpX*RM=e^ku%DBYi{aDz?+jnwe`ELwH2mlH zp9~DYelzf~{bvwm{|7YqF9RRLFNP0qzcBpy`v(}bObh@4!~#rapD$j#$ngICdtgMp zWB>-ovsJ5BZ3bq`X+XO!0h5{xJ1Zl@KVZb1yZ4cS|J8Q}CSWj#3bHfEi*ho&|MZjL z+t=Sf1A&pp%FOT=81A6d1Q0+h`}gmkWo>Q!Ok7-C1(*Szefjd`G|<57u+*ZZrRB-O z%E0jL7YD=kbDtUbh1eK4fDtDp^p`>X>wktn|Ckw=*jX9=vHS*xJu5H>|A6%Y1Q00l zegG5ontS)|!4o?tCnvaY0VY9DElq7DkZX7iuQQ1JlV;H1)?r}hW@caqMj$8w|6%+M zG>j4Gi$4s8>cZe;2n-5FfB<5_mK}jvS)`<-WV)}fZ^-XozZe*q{xK}hFk#^QC&(be zB+c;q&o5w#`3p=He}JVLC|z>^F)*5dsfdH|JHz)MKmP#)5LSc3!ou1>hJuR1@4!s* zdPet7GT!>159hb{y@Ba_x7F77cXDB&&JBi{QTwXZ@@BVFF*ic zGnhqRU*8H8nZWP{3xJZ|`=9R_n1PYT$-@VxVWk=<6RBxxu|ItB^gYm*Rlu}=2dL#0 zKmajgG59|Z504qpwMy5oU;hD2%Rhl>`v=GXU{+-j5D)+tq444nm|B2w!3->V6;7Qx zb^rG5+dDww00D#x2?4PY64nPAV4t0xz4qwQqhB9Adh{Qd=E3;!Sj>V- zK6{t}00G2EVpRqz%#0-^C5?rIgd{+GU?uSW$&)9yf$USDAb=?Z2p~pURi*#|1^_Uj VK(cloj~V~~002ovPDHLkV1l-Y+>QVM literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/button_zip.png b/filemanager/templates/default/images/button_zip.png new file mode 100644 index 0000000000000000000000000000000000000000..741b05ffd7ec34c59dff0c23691209e5ef5e77ca GIT binary patch literal 1336 zcmV-81;_e{P)~AtP$U+3f%T1jR{2 zK~#9!m6Ta*RAm^3pR>%I*=O46l&(+;l%+sGKoBIU5fmc91-&rw!o=l9h%v@HP1M9Y zE+7#I2@oZQKq5vW6%-XzN=u7W1WKu;%oIAEb~^h$a~3aJv;`Z&d-COM-~Z&xpZ9+S zrcre_p5^wHM^`ykKdXoeARtWq>quO<+Sb+n;@E2p0LK5Vm!|`V3g9Sj zNmoyDM2U2?mjS{fgN+RI7JE5v9LItM01**@{z8wk!RhkO-J}TnPKS9U@Ug(`6`#58 z%=yU}Lo~#Hrv>ooM(um^nm@ECkvscNhkG6hUVhj%^SYFKeV$2KbX-ri#5JvQI5Rx8 zOMpCO^4Bwkbwj4eQSmUXLQ*)OZ8vT)wQXDj`@ZPUjl zr%y@*ui&k;;`MmhSy6*9CrFIqrFD7g?(pk&g^wvRH82%UM;~z_p<$1JM}k^%?A4u#PIb z8`)w-QmkCQG{9|tL@kz#_^Jj^?S_TE_tt4NEfXniWVvwm*8t$KyYxF%fDY7 zxX{*pw5=y}s>`3~xwprYZEe`B8e-}y@mK}2$;QpLHf(YMwOAmnI;d%^Vc~)XqVXhM z#}5(?hWPH{*eBm!3jdhOt7GG4yzk_dN(P3g;PyF@G6v~f26vf_cw8cx5plY#L`K7m z21AHOlEw8!?#c#2r;$nJ)zGv@x}bt4IuNWroDK_4$$~DJ(F6;6K8c=>qpJl3y?`RS zkcP#R5tNLG|eBvWZa^U5A1#R0MfQBn{k1xz9+0%!%$^5b_khc2k-6R9^@Q@-d1 zmjnLjp4+{lbkVSZ;svDw%pNc~rk3m=Te1>Q%f)OS?S8N{`Q_j*VRcQTy(1AxjF$51 z>hjvzcG+D8vUPky070UZE79K<<ra4vA-WM^>Kxtrl{LdpE#JvTfMoA>L@mKt$> zwQXa=th(J#ZF_0HmL8$~OnbERub~SU`XYzU^^N@jgeOAu0Zj`A_-JdRAYySZi-yime?t!uZ00008*HJcOB%*fQiIh{pWnfXpaK)@WEO3`;kNjz*E3Su#BO}VV> zhwa()^|jmj<@X!a{Q5HW;isq8E;}U@8fFyio+jvF-1JgEexGs8|9{M9)Wm>ph!byq zvA_Pman0{<%x|g$%nUCc@o>En#OuJ2D8b`X%d@}!aM026HlXt+OwD2dT75S_fNkfe z=jZ1qm}zSpN3LW88hxSp!TI_B9mM}ORkXKCx*BVOL<5>0-M0@g_`~Qf#dCO%SJo;< z4h50e`u|N$O$A1(YFB}lcO3*;?Rx1ipuohS&~TyYk-iDj|K^YT z>u0PxJ}v9U&B(?_Iu73d4qjyhhFg)rff&Xj-6I7)&V@^*CMZit3fi#%Lm*;JlYt(? zDG>v2$91lLrvLvr#&CXO6c#>|(7?bX?X$w7<*7-`O139a0W}Siw0M9n5Y}upUl+p6 zZTDmW1Bb#S9yPP84Gazp6H^Szopr0CV=>Q~&?~ literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/editcut.png b/filemanager/templates/default/images/editcut.png new file mode 100644 index 0000000000000000000000000000000000000000..192b5757a70d19fab7d10492c2a1a1f22b1d172d GIT binary patch literal 1196 zcmV;d1XKHoP)(}oXa$B|>P2k{QuLm*}L41G!BFSJTCWr^Wd_gsM{`{>8l9HnHffmEX z00M}lp!o9T8^f<(e;Gc1{t6fC=~f&cK?)c;|UkTtGBF)p1n^N-0qWekTzi2&#BGE zz`zN_Ul{(x>UKmfs0g{;u`1lB*l7|vW}nE)~r zB=-8l{|nzg{RPI_ABKOAe=^+N@tHx=k)1(8pM^o)m#bgJopV0B0Mq@`O|k~)E(Zu8 zxWU5gKN;S=`Oom-^Z$o1v5#N>_j7aoVfg*zH^a#_KQ3^K00n>lW?&cl&%pBcF9SQz ze+E@IRsj}H#`Wk10|XE}@<5qMoc9-ltl*FOE`KR`DG>$(ea-I<48NEd4(wsRzyOT> zKi~eoXZZ4u;n{J94?o^B6#o6k;4g2?5Fn@dUtxEtOn__mlMOKQ00IbZ@Y%;a2aF`X zIz(E$6JX$EC}7}ZWw`T{hvC#E_62|bFcgMNd-CDlTq%aXkN-0~xXaRL-2_g83oiG` z+}AexqwxJF3n)0?1_J~T+~ChYm;)ysmFhQ;`5M5*!65MRJI94@zgQ-wEqMyh|6f1; zW%&N?55w#C%oku{ckeSi&@uW6G?*DBC;$QoZgA7?XP}r(gkn$#W2DX3uNWR^O8roH z^PVFf$UQJMTv|YY=cmE9$A1{U|3p;_5I`iA6*nKU9Qgm`H-owIr-W8-sr9T(f6g1p zd=j{Qhl%0)FGMha06+jSl2YgO2TLi4^Zhy>Y4S#Zfdy9LF*3|KCb^+#-LpXCbPNzc zBpD0>ZN5?lf*ils>x+L@c>kT1;lfMa1 z6c+{vAjWGGwFQ_M8R{7s84M1-u@m^nV{K4U63y`K+Yb~AfBg8#FmK)_2ENb7E;xuD z{s8iUdhV4%Tn+>XAeL`G{_mHubu{3Sm1Fq0VCAb?mH_=F6^%oM4y)W;|!`_e}6J?NpdrAiK#O@ zId{VVmpXs|V)^x-h2j4%h_{{X|1s=6un}(@xH$ZWsQ>w!;nyD~oaz7qh;etX?SF@4 zd%T8SeUOY-{>+){49Ur!jL2dD0mSm{+dqbXzkd)+E&BQjh~W73pW)A+e+*x~d}Cl@ zg1CC_-0lC74F?Dyrf=W>g1v?hqXTAUMj&PaV;C?u*9IF7;{yZ`&|sj8ftvAQtYOH= z05=#E6emw!g}WR?0|XGukDtT^1-hYNSAm1!AA^^d6~o7mUl~4q`pR(m@*S`oKmf7) z|Mw5YyZ^ucW?=XR#DD$*^+0_lip{l*K$;OuzkmOo;rsU=U^WZ@1Q5&r|Dd4w2{z>a zyRQrkzyA^KVi5iJ?|+8hzyC6@urM?H`-cc~fB<3v@)-X8{Lb+IEiiKc6%YcTGUxYi zSgQEW@bl*%26lE=_984NPx_wPSo zm%%V7Wq@1@inu?25M?t!009dMXyg$AfS$uzu!DR8vj_$N0*K|+2PTH^Uw<*Mvl31X zzmXyrmei14i3|V&h^1xQEyfxz)&HWre{dS;U=It5zt9MT)Dr)o=^R__1Q0+hAfjd4 zZAN@9y?F7#|G$4xy$vxOA%<=^Kmf526SknT0E9^a009O7C3&r}L2(;R00000NkvXX Hu0mjfT^5Sw literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/mime16_directory.png b/filemanager/templates/default/images/mime16_directory.png new file mode 100644 index 0000000000000000000000000000000000000000..4b545f3e34fc49e93a4854031c6ef79505f1130d GIT binary patch literal 695 zcmV;o0!aOdP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;ElET{RCwBAWPk#ii8P!Xu*FgNJ)JY-;K zy7m7*BS?&q0qjhu{O&q6Mt}ffVfg!-;p-nvlmCMh0afKC+C%sZ5I%$fp_2bz`wtL6 zEdT!eX88OIj~juC6WVTWWny6V#^M16fB<6o4|KstsPmbC_#ce^51~_=Zd^+V5%*5A z7GU6JV}!fx>T3puvRRK900M~R|G&QspMFAYs+)N07b7DR8_fKFK+`g!B(yTD1Q-^d zWnh5&6le%D(DV@4t@ z1%scz{xW>~{QV6;0I~f4^NZohn_pnXciu8Eq^(BS!pMlC2W}{c`10X5!>?~Y9svXp z*b9%Jd;$8Ih2i-ppfi6W3}9eHvK1*gF#%ok@%2}Rf8W1d0|+2+AijG3nc)Y}fY)Du z{{D%i_&=&yFg7zVl)eBB`19lUU4Q@rhr#Vz?-`n6WEcYM8HfTe9z0=4y?USF?6*Ic z0Ro8W|Gz&B-#&h2P>|$eAQpW60d)229}Itge7_G6KtLD#W%zLS1;f1?cNyM4WroK9 zKETDn#PH_zcZMGyzB~d5Ah6ej^%nnUKn^=_=>G?&eXs~PBcO#Qko)#hEF(YwG5#mU dN<07{zyMz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;n@L1LRCwBA?CLU|H54W z5I}GP1h|=?EGP{$p$&F#P@fli~k=xHblW0Aj)BFHoTT zes_t1@mDVc>jwq~<_C@pKc$TsnEw1{_y@xO{xPs|K-2;R5EE7d{sDUnV5hs_=jR4KmfsA@csJ_py{j( zOrQ2Ju(Aj+{QJnr@SR(Ofm=eE;U6&Me*)71NX?HQzZp0T^k_z3p*pFe*YE?qhc*9c<+1Q5aip#Q%A`p0nl&?N?8 zMLh-vMMnlEV0^N$Faw>;4phMoRu>)~4yHlLxUjHL7$ATU1~4)(uyOJ-2r3&g@M)O? zqYap_fr6Zz>z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-mPtfGRCwBAT(M%se+CKwKmf6T2yW$YhW8&C7{31m z;$Ki2h`&MUpTAHw{R3JlF3P~5&%TlYAb`LI*y}JbeEG(}@E<7g_a7Ah{m<|Rg#Y|w z_y^Ph!vFvO17aW>hUcmAdP?i`~mY} z8W|ZG!8AYsferZe>lee%pFbIxn3!-nA0!9U1ok^rEkFRlT>w%D!sq~`38olk7_tih z0*D3XESS@<0g&Qv-@Y;I+qVxx4j_Qw2Ec5=20(H!*M*0NgT1_d{d$IohzJgV0AfM+ z6D|W_PJaFRHP|IU%^)ZL0|+3v0UR70cyk>eA0L>8YKDg zLpO6Jqfj)`B{QEZ&QH%}vg!P4zM#*EkSJuAQu@O41z{6FQeK)z>C%MK@VfqIK&9p4 zdMa(^vU)PS7s$#aQgVq8IkSY}(<=r|UCw7RMWZwrkg9*D0%p9Fo`*E`lcL-#D@ycz z$RLKBK+kk`FoW8h{FX`$0dWG_$aM}P4pOTo8Z%K?GHivS^Zo@-7GlK7o;Jd)o zE3_CuSQBnI^_LcTDM2_aawG4?xyUm8_D@>Pc++bk@Hp>pAw1+>t;uLSy1580tadu&glHfzho_MQe()ciQqkSXAaDE9|FMWai0 zDa(h*XTIb(<9~&?iwZF}B;ih2`?b~kb|g%Iek z3;lJ@JFG+c>)dv*SDwwQbz8NWtJ)xK`=q0FRNEuC&-NvvT@Sczwk;F4+Zsqw^KD;4 zrhrGH+#mE5jn47!3d)DbW1i$lb#V21h})!}<`(*C9qP9O{r1&o&{#GiU%20}`2((O z;aG&{hR*HuTjQhtCRH&CbYLR1!2Z`MA9)Kzp9P}~ro}0bz8L4Cuj%(j#2#}{qY7sR n3ZEn?eUdif|MeS;K3URY;d2h>gti!c&d4Me6Z)YIyEpV-$jrtu literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/images/spacer.gif b/filemanager/templates/default/images/spacer.gif new file mode 100755 index 0000000000000000000000000000000000000000..5bfd67a2d6f72ac3a55cbfcea5866e841d22f5d9 GIT binary patch literal 43 mcmZ?wbhEHbWMp7uXkdT>#h)yUAf^t80Ld^gF}W}@SOWlZ0R#L1 literal 0 HcmV?d00001 diff --git a/filemanager/templates/default/pref.tpl b/filemanager/templates/default/pref.tpl index 34b48b1c9d..8aaac4eb1d 100755 --- a/filemanager/templates/default/pref.tpl +++ b/filemanager/templates/default/pref.tpl @@ -1,6 +1,6 @@

{title}:


- +
{row}
diff --git a/filemanager/templates/default/pref_list.tpl b/filemanager/templates/default/pref_list.tpl index e8542cfbd1..ab84162c0e 100755 --- a/filemanager/templates/default/pref_list.tpl +++ b/filemanager/templates/default/pref_list.tpl @@ -1,5 +1,5 @@ {field} - {data} + {data} diff --git a/filemanager/templates/default/upload.tpl b/filemanager/templates/default/upload.tpl new file mode 100644 index 0000000000..deb3d65a3f --- /dev/null +++ b/filemanager/templates/default/upload.tpl @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + + + + + + +
{lang_file}{lang_comment}
+ + + + +
+{change_upload_boxes} +
+
+ diff --git a/filemanager/todo b/filemanager/todo index d8a098f4ef..5c94c19bd5 100644 --- a/filemanager/todo +++ b/filemanager/todo @@ -1,23 +1,13 @@ -architectuur -- let filemanager use templates -- drop the f...g html_functions_file!!! -- port it to egroupware for real!!! Someone forgot to finish his job - display -- clean file display table -- header in separate color -- icons for filetypes - practical out of the box userconfiguration -- replace all icons with crystal - seperate colors for row off an on -- make one statusrow with all main info like free space -- make alignments cleaner -- clean up conf screen -- upload section separated and in a clean table design -- per row buttons with edit/delete..etc - sort by with sort arrows so we know whats sorted - sidebox with basic featurelinks +- sort by up and down +- nicer colheads +- toolbar cleanup +- toolbar prefs extra funtionality - sharing file with others @@ -26,9 +16,14 @@ extra funtionality - not just presume a file is treated like a ascii file - cut/copy/paste - sidebox with explorerstyle (Reiner loves this) +- other views (with image preview mode?!!) +- download +- new popup +- zip remove functionaliteit -- execute command - some conf options - +bugs +- errors with errorreporting 8 +- errors with uploading thouh it works