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
0
filemanager/CHANGELOG
Normal file
@ -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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -1,709 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class bophpwebhosting
|
||||
{
|
||||
var $public_functions = array(
|
||||
'delete' => 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.'<br>'."\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 '<b>PHPWebHosting debug:</b><br>'
|
||||
. 'path: '.$this->path.'<br>'
|
||||
. 'disppath: '.$this->disppath.'<br>'
|
||||
. 'cwd: '.$this->cwd.'<br>'
|
||||
. 'lesspath: '.$this->lesspath.'<br>'
|
||||
. 'fakebase: '.$this->fakebase.'<br>'
|
||||
. 'homedir: '.$this->homedir.'<p>'
|
||||
. '<b>phpGW debug:</b><br>'
|
||||
. 'real getabsolutepath: '.$this->vfs->getabsolutepath(False, False, False).'<br>'
|
||||
. 'fake getabsolutepath: '.$this->vfs->getabsolutepath(False).'<br>'
|
||||
. 'appsession: '.$GLOBALS['phpgw']->session->appsession('vfs','').'<br>'
|
||||
. 'pwd: '.$this->vfs->pwd().'<br>';
|
||||
}
|
||||
|
||||
|
||||
###
|
||||
# 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 '<!-- '.$name.' = '.$var.' -->'."\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).'<br>'."\n";
|
||||
}
|
||||
|
||||
while(list($num,$file_array) = each($ls_array))
|
||||
{
|
||||
$this->files_array[] = $file_array;
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'Filename: '.$file_array['name'].'<br>'."\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[] = '<font color="#0000FF">'.$mime_type.' Deleted: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not delete '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">'.$this->path.SEP.$this->fileman[$i].' does not exist!</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
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[] = '<font color="#0000FF">File copied: '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not copy '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
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[] = '<font color="#0000FF">File moved: '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not move '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
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[] = '<font color="#0000FF">File downloaded: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">File does not exist: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function f_newdir()
|
||||
{
|
||||
if ($this->newdir && $this->createdir)
|
||||
{
|
||||
if ($badchar = $this->bad_chars($this->createdir,True,True))
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Directory names cannot contain "'.$badchar.'"</font>';
|
||||
return $errors;
|
||||
}
|
||||
|
||||
if (substr($this->createdir,strlen($this->createdir)-1,1) == ' ' || substr($this->createdir,0,1) == ' ')
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Cannot create directory because it begins or ends in a space</font>';
|
||||
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[] = '<font color="#FF0000">'.$fileinfo['name'].' already exists as a file</font>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Directory '.$fileinfo['name'].' already exists.</font>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->vfs->mkdir($this->path.SEP.$this->createdir,Array(RELATIVE_NONE)))
|
||||
{
|
||||
$errors[] = '<font color="#0000FF">Created directory '.$this->path.SEP.$this->createdir.'</font>';
|
||||
// $this->path = $this->path.SEP.$this->createdir;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not create '.$this->path.SEP.$this->createdir.'</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
function f_newfile()
|
||||
{
|
||||
if ($this->newfile && $this->createfile)
|
||||
{
|
||||
if($badchar = $this->bad_chars($this->createfile,True,True))
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Filenames cannot contain "'.$badchar.'"</font>';
|
||||
return $errors;
|
||||
}
|
||||
if($this->vfs->file_exists($this->path.SEP.$this->createfile,Array(RELATIVE_NONE)))
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">File '.$this->path.SEP.$this->createfile.' already exists. Please edit it or delete it first.</font>';
|
||||
return $errors;
|
||||
}
|
||||
if(!$this->vfs->touch($this->path.SEP.$this->createfile,Array(RELATIVE_NONE)))
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">File '.$this->path.SEP.$this->createfile.' could not be created.</font>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Filename not provided!</font>';
|
||||
}
|
||||
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;$i<strlen($string);$i++)
|
||||
{
|
||||
$character = ord(substr($string,$i,1));
|
||||
|
||||
if ($character == $charnum)
|
||||
{
|
||||
return True;
|
||||
}
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
###
|
||||
# Decide whether to echo or return. Used by HTML functions
|
||||
###
|
||||
|
||||
function eor($rstring,$return)
|
||||
{
|
||||
if($return)
|
||||
{
|
||||
return $rstring;
|
||||
}
|
||||
else
|
||||
{
|
||||
html_text($rstring."\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
###
|
||||
# URL encode a string
|
||||
# First check if its a query string, then if its just a URL, then just encodes it all
|
||||
# Note: this is a hack. It was made to work with form actions, form values, and links only,
|
||||
# but should be able to handle any normal query string or URL
|
||||
###
|
||||
|
||||
function string_encode($string,$return = False)
|
||||
{
|
||||
if (preg_match("/=(.*)(&|$)/U",$string))
|
||||
{
|
||||
$rstring = preg_replace("/=(.*)(&|$)/Ue","'='.rawurlencode(base64_encode ('\\1')).'\\2'",$string);
|
||||
}
|
||||
elseif (ereg('^'.$this->hostname,$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));
|
||||
}
|
||||
}
|
||||
?>
|
60
filemanager/inc/class.sofilemanager.inc.php
Executable file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
class sofilemanager
|
||||
{
|
||||
var $db;
|
||||
// var $phpgw;
|
||||
// var $phpgw_info;
|
||||
|
||||
function sofilemanager()
|
||||
{
|
||||
$this->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 ();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
class sophpwebhosting
|
||||
{
|
||||
|
||||
/* Any initializations that need to be done */
|
||||
function sophpwebhosting()
|
||||
{
|
||||
$GLOBALS['phpgw']->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();
|
||||
}
|
||||
}
|
||||
?>
|
@ -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);
|
||||
|
65
filemanager/inc/hook_settings.inc.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* eGroupWare - Filemanager Preferences *
|
||||
* http://egroupware.org *
|
||||
* Modified by Pim Snel <pim@egroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* 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);
|
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
eGroupWare - http://www.egroupware.org
|
||||
/
|
||||
|
||||
/* Set this to true to skip the javascrip redirect and
|
||||
use the new filemager no matter what the prefs are set */
|
||||
$experimental_new_code=true;
|
||||
|
||||
*/
|
||||
|
||||
$Experiment_New_Code=false;
|
||||
|
||||
if($Experiment_New_Code)
|
||||
if($experimental_new_code)
|
||||
{
|
||||
$phpgw_flags = Array(
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => '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 '
|
||||
<script language="JavaScript">
|
||||
<!--
|
||||
function redirect() {
|
||||
parent.location = "'.$GLOBALS[phpgw]->link('/index.php','menuaction=filemanager.uifilemanager.index').'"
|
||||
}
|
||||
setTimeout("redirect();", 0)
|
||||
redirect();
|
||||
|
||||
//-->
|
||||
</script>
|
||||
|
||||
';
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
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
|
||||
|
1785
filemanager/indexold.php
Executable file
@ -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 '<p><center>' . $phpgw->common->error_list($errors) . '</center>';
|
||||
}
|
||||
|
||||
|
||||
while (list ($internal, $displayed) = each ($file_attributes))
|
||||
{
|
||||
unset ($checked);
|
||||
|
@ -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
|
||||
|
@ -23,6 +23,7 @@
|
||||
'add_def_pref',
|
||||
'admin',
|
||||
'deleteaccount',
|
||||
'settings',
|
||||
'preferences'
|
||||
);
|
||||
|
||||
|
33
filemanager/templates/default/edit_file.tpl
Normal file
@ -0,0 +1,33 @@
|
||||
<!-- BEGIN file_edit_header -->
|
||||
<!-- END file_edit_header -->
|
||||
|
||||
<!-- BEGIN column -->
|
||||
<!-- END column -->
|
||||
|
||||
<!-- BEGIN row -->
|
||||
|
||||
{preview_content}<br/>
|
||||
<form method="post" action="{form_action}">
|
||||
<input type="hidden" name="edit" value="1" />
|
||||
<input type="hidden" name="edit_file" value="{edit_file}" />
|
||||
{filemans_hidden}
|
||||
<textarea name="edit_file_content" rows="10" cols="50">{file_content}</textarea>
|
||||
<!-- </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>-->
|
||||
<!--<input type="submit" name="edit_preview" value="{lang_preview}" />-->
|
||||
<!--<input type="submit" name="edit_save" value="{lang_save}" />-->
|
||||
<table>
|
||||
<tr>
|
||||
{buttonSave} {buttonPreview} {buttonDone} {buttonCancel}
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<!-- END row -->
|
||||
|
||||
<!-- BEGIN file_edit_footer -->
|
||||
<!-- END file_edit_footer -->
|
||||
|
34
filemanager/templates/default/filelisting.tpl
Normal file
@ -0,0 +1,34 @@
|
||||
<!-- BEGIN filemanager_header -->
|
||||
<form method="post" action="{form_action}">
|
||||
<br/>
|
||||
{messages}
|
||||
<br/>
|
||||
|
||||
{toolbar0}
|
||||
<div id="fmMenu">
|
||||
{toolbar1}
|
||||
</div>
|
||||
<div id="fmFileWindow">
|
||||
<table>
|
||||
<tbody>
|
||||
<!-- END filemanager_header -->
|
||||
|
||||
<!-- BEGIN column -->
|
||||
<td valign="top">{col_data} </td>
|
||||
<!-- END column -->
|
||||
|
||||
<!-- BEGIN row -->
|
||||
<tr bgcolor="{row_tr_color}">
|
||||
<td>{actions}</td>
|
||||
{columns}
|
||||
</tr>
|
||||
<!-- END row -->
|
||||
|
||||
<!-- BEGIN filemanager_footer -->
|
||||
{lang_no_files}
|
||||
</tbody></table>
|
||||
</div>
|
||||
|
||||
<div id="fmStatusBar"><b>{lang_files_in_this_dir}:</b> {files_in_this_dir} <b>{lang_used_space}: </b> {used_space}</div>
|
||||
</form>
|
||||
<!-- END filemanager_footer -->
|
BIN
filemanager/templates/default/images/button_bookmark.png
Normal file
After Width: | Height: | Size: 996 B |
BIN
filemanager/templates/default/images/button_bookmark_add.png
Normal file
After Width: | Height: | Size: 961 B |
BIN
filemanager/templates/default/images/button_cancel.png
Normal file
After Width: | Height: | Size: 883 B |
BIN
filemanager/templates/default/images/button_copy_to.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
filemanager/templates/default/images/button_createdir.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_createfile.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
filemanager/templates/default/images/button_cut.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_delete.png
Normal file
After Width: | Height: | Size: 951 B |
BIN
filemanager/templates/default/images/button_download.png
Normal file
After Width: | Height: | Size: 663 B |
BIN
filemanager/templates/default/images/button_edit.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
filemanager/templates/default/images/button_edit_comments.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
filemanager/templates/default/images/button_edit_preview.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_goto.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_home.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
filemanager/templates/default/images/button_info.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_mail.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
filemanager/templates/default/images/button_move_to.png
Normal file
After Width: | Height: | Size: 998 B |
BIN
filemanager/templates/default/images/button_ok.png
Normal file
After Width: | Height: | Size: 769 B |
BIN
filemanager/templates/default/images/button_paste.png
Normal file
After Width: | Height: | Size: 881 B |
BIN
filemanager/templates/default/images/button_reload.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
filemanager/templates/default/images/button_rename.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/button_save.png
Normal file
After Width: | Height: | Size: 991 B |
BIN
filemanager/templates/default/images/button_search.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
filemanager/templates/default/images/button_search2.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
filemanager/templates/default/images/button_trash.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
filemanager/templates/default/images/button_tree.png
Normal file
After Width: | Height: | Size: 667 B |
BIN
filemanager/templates/default/images/button_up.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
filemanager/templates/default/images/button_upload.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
filemanager/templates/default/images/button_zip.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
filemanager/templates/default/images/editcopy.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
filemanager/templates/default/images/editcut.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
filemanager/templates/default/images/editpaste.png
Normal file
After Width: | Height: | Size: 881 B |
BIN
filemanager/templates/default/images/mime16_directory.png
Normal file
After Width: | Height: | Size: 695 B |
BIN
filemanager/templates/default/images/mime16_text_plain.png
Normal file
After Width: | Height: | Size: 805 B |
BIN
filemanager/templates/default/images/mime16_unknown.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
filemanager/templates/default/images/source/buttonbackground.xcf
Normal file
BIN
filemanager/templates/default/images/spacer.gif
Executable file
After Width: | Height: | Size: 43 B |
@ -1,6 +1,6 @@
|
||||
<p><b>{title}:</b><hr><p>
|
||||
<form action="{action_url}" method="POST">
|
||||
<table border="0" align="center" width="50%">
|
||||
<table border="0" align="center">
|
||||
{row}
|
||||
</table>
|
||||
<center><input type="submit" name="submit" value="{submit_lang}"></center>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<tr bgcolor="{bg_color}">
|
||||
<td align="right">{field}</td>
|
||||
<td align="center">{data}</td>
|
||||
<td align="left">{data}</td>
|
||||
</tr>
|
||||
|
||||
|
30
filemanager/templates/default/upload.tpl
Normal file
@ -0,0 +1,30 @@
|
||||
<!-- BEGIN upload_header -->
|
||||
<form method="post" action="{form_action}" enctype="multipart/form-data">
|
||||
<div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr bgcolor="{row_tr_color}">
|
||||
<td><strong>{lang_file}</strong></td>
|
||||
<td><strong>{lang_comment}</strong></td>
|
||||
</tr>
|
||||
<!-- END upload_header -->
|
||||
|
||||
<!-- BEGIN row -->
|
||||
<tr bgcolor="{row_tr_color}">
|
||||
<td><input maxlength="255" name="upload_file[]" type="file"></td>
|
||||
<td><input name="upload_comment[]" type="text"></td>
|
||||
</tr>
|
||||
<!-- END row -->
|
||||
|
||||
<!-- BEGIN upload_footer -->
|
||||
|
||||
</tbody></table>
|
||||
<input value="true" name="uploadprocess" type="hidden">
|
||||
<input value="{path}" name="path" type="hidden">
|
||||
<input value="{num_upload_boxes}" name="show_upload_boxes" type="hidden">
|
||||
<input value="{lang_upload}" name="upload_files" type="submit">
|
||||
<br/>
|
||||
{change_upload_boxes}
|
||||
</div>
|
||||
</form>
|
||||
<!-- END upload_footer -->
|
@ -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
|
||||
|