mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
Make sure everything gets translated
This commit is contained in:
parent
fc74ba453e
commit
48520640c3
@ -420,7 +420,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = ' ';
|
||||
$data = '';
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
@ -431,7 +431,7 @@
|
||||
}
|
||||
function f_apply_edit_comment()
|
||||
{
|
||||
$result='';
|
||||
$result=Array();
|
||||
for ($i=0; $i<count($this->fileman) ; $i++)
|
||||
{
|
||||
$file = $this->fileman[$i];
|
||||
@ -445,7 +445,7 @@
|
||||
)
|
||||
))
|
||||
{
|
||||
$result .= lang(' Error: failed to change comment for :').$file."\n";
|
||||
$result[] = lang('error: failed to change comment for : %1', $file);
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,19 +454,19 @@
|
||||
|
||||
function f_apply_edit_name()
|
||||
{
|
||||
$result='';
|
||||
$result = Array();
|
||||
while (list ($from, $to) = each ($this->changes))
|
||||
{
|
||||
if ($badchar = $this->bad_chars ($to, True, True))
|
||||
{
|
||||
$result .= 'File names cannot contain "'.$badchar.'"';
|
||||
$result[] = lang('file names cannot contain %1', $badchar);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ereg ("/", $to) || ereg ("\\\\", $to))
|
||||
{
|
||||
//echo $GLOBALS['phpgw']->common->error_list (array ("File names cannot contain \\ or /"));
|
||||
$result .= "File names cannot contain \\ or /";
|
||||
$result[] = lang('file names cannot contain \\ or /');
|
||||
}
|
||||
elseif (!$this->vfs->mv (array (
|
||||
'from' => $from,
|
||||
@ -475,44 +475,19 @@
|
||||
)
|
||||
{
|
||||
//echo $GLOBALS['phpgw']->common->error_list (array ('Could not rename '.$disppath.'/'.$from.' to '.$disppath.'/'.$to));
|
||||
$result .= 'Could not rename '.$this->path.'/'.$from.' to '.$this->path.'/'.$to;
|
||||
$result[] = lang('could not rename %1 to %2', $this->path.'/'.$from, $this->path.'/'.$to);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result .= 'Renamed '.$this->path.'/'.$from.' to '.$this->path.'/'.$to;
|
||||
$result[] = lang('renamed %1 to %2', $this->path.'/'.$this->path.'/'.$from, $to);
|
||||
}
|
||||
}
|
||||
/*html_break (2);
|
||||
html_link_back ();*/
|
||||
|
||||
|
||||
/*echo "f_apply_edit_name()";
|
||||
print_r($this->fileman);
|
||||
echo '<br />';
|
||||
print_r($this->changes);
|
||||
die();
|
||||
|
||||
$result='';
|
||||
for ($i=0; $i<count($this->fileman) ; $i++)
|
||||
{
|
||||
$file = $this->fileman[$i];
|
||||
|
||||
if (!$this->vfs->mv (array (
|
||||
'from' => $file,
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
'to' => $this->changes[$file]
|
||||
)
|
||||
))
|
||||
{
|
||||
$result .= lang(' Error: failed to rename :').$file."\n";
|
||||
}
|
||||
}
|
||||
*/
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_delete()
|
||||
{
|
||||
$result = Array();
|
||||
$numoffiles = count($this->fileman);
|
||||
for($i=0;$i!=$numoffiles;$i++)
|
||||
{
|
||||
@ -540,24 +515,25 @@
|
||||
'relatives' => Array(RELATIVE_USER_NONE)
|
||||
)))
|
||||
{
|
||||
$errors[] = '<font color="#0000FF">'.$mime_type.' Deleted: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('deleted: %1', $this->path.SEP.$this->fileman[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not delete '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('could not delete: %1',$this->path.SEP.$this->fileman[$i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">'.$this->path.SEP.$this->fileman[$i].' does not exist!</font>';
|
||||
$result[] = lang('%1 does not exist!', $this->path.SEP.$this->fileman[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_copy()
|
||||
{
|
||||
$result = Array();
|
||||
$numoffiles = count($this->fileman);
|
||||
for($i=0;$i!=$numoffiles;$i++)
|
||||
{
|
||||
@ -569,19 +545,20 @@
|
||||
'relatives' => 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>';
|
||||
$result[] = lang('file copied: %1 to %2'.$this->path.SEP.$this->fileman[$i],$this->todir.SEP.$this->fileman[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not copy '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('could not copy %1 to %2', $this->path.SEP.$this->fileman[$i],$this->todir.SEP.$this->fileman[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_move()
|
||||
{
|
||||
$result = Array();
|
||||
$numoffiles = count($this->fileman);
|
||||
for($i=0;$i!=$numoffiles;$i++)
|
||||
{
|
||||
@ -593,19 +570,20 @@
|
||||
'relatives' => 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>';
|
||||
$result[] = lang('file moved: %1 to %2',$this->path.SEP.$this->fileman[$i], $this->todir.SEP.$this->fileman[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not move '.$this->path.SEP.$this->fileman[$i].' to '.$this->todir.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('could not move: %1 to %2',$this->path.SEP.$this->fileman[$i], $this->todir.SEP.$this->fileman[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_download()
|
||||
{
|
||||
$result = Array();
|
||||
$numoffiles = count($this->fileman);
|
||||
for($i=0;$i!=$numoffiles;$i++)
|
||||
{
|
||||
@ -620,30 +598,31 @@
|
||||
'file' => $this->fileman[$i]
|
||||
)
|
||||
);
|
||||
$errors[] = '<font color="#0000FF">File downloaded: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('file downloaded: %1', $this->path.SEP.$this->fileman[$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">File does not exist: '.$this->path.SEP.$this->fileman[$i].'</font>';
|
||||
$result[] = lang('file does not exist: %1', $this->path.SEP.$this->fileman[$i]);
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_newdir()
|
||||
{
|
||||
$result = Array();
|
||||
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;
|
||||
$result[] = lang('directory names cannot contain "%1"', $badchar);
|
||||
return $result;
|
||||
}
|
||||
|
||||
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;
|
||||
$result[] = lang('cannot create directory because it begins or ends in a space');
|
||||
return $result;
|
||||
}
|
||||
|
||||
$ls_array = $this->vfs->ls(array(
|
||||
@ -658,11 +637,11 @@
|
||||
{
|
||||
if ($fileinfo['mime_type'] != 'Directory')
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">'.$fileinfo['name'].' already exists as a file</font>';
|
||||
$result[] = lang('%1 already exists as a file', $fileinfo['name']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Directory '.$fileinfo['name'].' already exists.</font>';
|
||||
$result[] = lang('directory %1 already exists', $fileinfo['name']);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -672,64 +651,59 @@
|
||||
'relatives' => Array(RELATIVE_NONE)
|
||||
)))
|
||||
{
|
||||
$errors[] = '<font color="#0000FF">Created directory '.$this->path.SEP.$this->createdir.'</font>';
|
||||
// $this->path = $this->path.SEP.$this->createdir;
|
||||
$result[] = lang('created directory %1', $this->path.SEP.$this->createdir);
|
||||
$this->path = $this->path.SEP.$this->createdir;
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Could not create '.$this->path.SEP.$this->createdir.'</font>';
|
||||
$result[] = lang('could not create ', $this->path.SEP.$this->createdir);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_newfile()
|
||||
{
|
||||
$result = Array();
|
||||
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;
|
||||
$result[] = lang('filenames cannot contain "%1"', $badchar);
|
||||
return $result;
|
||||
}
|
||||
if($this->vfs->file_exists(array(
|
||||
'string' => $this->path.SEP.$this->createfile,
|
||||
'relatives' => 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;
|
||||
$result[] = lang('file %1 already exists. Please edit it or delete it first', $this->path.SEP.$this->createfile);
|
||||
return $result;
|
||||
}
|
||||
if(!$this->vfs->touch(array(
|
||||
'string' => $this->path.SEP.$this->createfile,
|
||||
'relatives' => Array(RELATIVE_NONE)
|
||||
)))
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">File '.$this->path.SEP.$this->createfile.' could not be created.</font>';
|
||||
$result[] = lang('file %1 could not be created', $this->path.SEP.$this->createfile);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors[] = '<font color="#FF0000">Filename not provided!</font>';
|
||||
$result[] = lang('filename not provided!');
|
||||
}
|
||||
return $errors;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function f_upload()
|
||||
{
|
||||
/* echo 'sub:'.$this->show_upload_boxes .' uf: ';
|
||||
|
||||
print_r($this->upload_file);
|
||||
echo ' cf: '; print_r($this->upload_comment);
|
||||
echo ' files: '; print_r($HTTP_POST_FILES);
|
||||
die();*/
|
||||
//echo (($show_upload_boxes > 1) ? $head_pre.$msg_top : $head_top);
|
||||
$result = Array();
|
||||
for ($i = 0; $i != $this->show_upload_boxes; $i++)
|
||||
{
|
||||
if ($badchar = $this->bad_chars ($this->upload_file['name'][$i], True, True))
|
||||
{
|
||||
array_push($err_msgs,$this->html_encode ('Filenames cannot contain "'.$badchar.'"', 1));
|
||||
$result[] = lang('filenames cannot contain %1',$badchar);
|
||||
//echo $GLOBALS['phpgw']->common->error_list (array (html_encode ('Filenames cannot contain "'.$badchar.'"', 1)));
|
||||
continue;
|
||||
}
|
||||
@ -752,8 +726,7 @@
|
||||
{
|
||||
if ($fileinfo['mime_type'] == 'Directory')
|
||||
{
|
||||
array_push($err_msgs,'Cannot replace '.$fileinfo['name'].' because it is a directory');
|
||||
//echo $GLOBALS['phpgw']->common->error_list (array ('Cannot replace '.$fileinfo['name'].' because it is a directory'));
|
||||
$result[] = lang('cannot replace %1 because it is a directory', $fileinfo['name']);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -763,60 +736,60 @@
|
||||
if ($fileinfo['name'] && $fileinfo['deleteable'] != 'N')
|
||||
{
|
||||
if (
|
||||
$this->vfs->cp (array (
|
||||
'from' => $this->upload_file['tmp_name'][$i],
|
||||
'to' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
|
||||
)
|
||||
)
|
||||
) {
|
||||
$this->vfs->set_attributes (array (
|
||||
'string' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
'attributes' => array (
|
||||
'owner_id' => $GLOBALS['userinfo']['username'],
|
||||
'modifiedby_id' => $GLOBALS['userinfo']['username'],
|
||||
'modified' => $now,
|
||||
'size' => $this->upload_file['size'][$i],
|
||||
'mime_type' => $this->upload_file['type'][$i],
|
||||
'deleteable' => 'Y',
|
||||
'comment' => stripslashes ($upload_comment[$i])
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
} else {
|
||||
array_push($err_msgs,'Failed to upload file: '.$this->upload_file['name'][$i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$result .=' Replaced '.$disppath.'/'.$this->upload_file['name'][$i].' '.$this->upload_file['size'][$i];
|
||||
$this->vfs->cp (array (
|
||||
'from' => $this->upload_file['tmp_name'][$i],
|
||||
'to' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
|
||||
)
|
||||
)
|
||||
) {
|
||||
$this->vfs->set_attributes (array (
|
||||
'string' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
'attributes' => array (
|
||||
'owner_id' => $GLOBALS['userinfo']['username'],
|
||||
'modifiedby_id' => $GLOBALS['userinfo']['username'],
|
||||
'modified' => $now,
|
||||
'size' => $this->upload_file['size'][$i],
|
||||
'mime_type' => $this->upload_file['type'][$i],
|
||||
'deleteable' => 'Y',
|
||||
'comment' => stripslashes ($upload_comment[$i])
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
} else {
|
||||
$result[] = lang( 'failed to upload file: %1',$this->upload_file['name'][$i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$result[] = lang('replaced %1 (%2 bytes)',$this->path.'/'.$this->upload_file['name'][$i],$this->upload_file['size'][$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (
|
||||
$this->vfs->cp (array (
|
||||
'from' => $this->upload_file['tmp_name'][$i],
|
||||
'to' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
||||
$this->vfs->set_attributes (array (
|
||||
'string' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
'attributes' => array (
|
||||
'mime_type' => $this->upload_file_['type'][$i],
|
||||
'comment' => stripslashes ($this->upload_comment[$i])
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
array_push($err_msgs,'Failed to upload file: '.$this->upload_file['name'][$i]);
|
||||
continue;
|
||||
}
|
||||
$result .= 'Created '.$this->path.'/'.$this->upload_file['name'][$i] .' '. $this->upload_file['size'][$i];
|
||||
$this->vfs->cp (array (
|
||||
'from' => $this->upload_file['tmp_name'][$i],
|
||||
'to' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
||||
$this->vfs->set_attributes (array (
|
||||
'string' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
'attributes' => array (
|
||||
'mime_type' => $this->upload_file['type'][$i],
|
||||
'comment' => stripslashes ($this->upload_comment[$i])
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$result[] = lang('failed to upload file: %1',$this->upload_file['name'][$i]);
|
||||
continue;
|
||||
}
|
||||
$result[] = lang('created %1 (%2 bytes)',$this->path.'/'.$this->upload_file['name'][$i] , $this->upload_file['size'][$i]);
|
||||
}
|
||||
}
|
||||
elseif ($this->upload_file['name'][$i])
|
||||
@ -826,7 +799,7 @@
|
||||
'relatives' => array (RELATIVE_ALL)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->vfs->set_attributes (array (
|
||||
'string' => $this->upload_file['name'][$i],
|
||||
'relatives' => array (RELATIVE_ALL),
|
||||
@ -836,21 +809,12 @@
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$result .= 'Created '.$this->path.'/'.$this->upload_file['name'][$i].' '. $this->file_size[$i];
|
||||
|
||||
$result .= ' Created '.$this->path.'/'.$this->upload_file['name'][$i].' '. $this->file_size[$i];
|
||||
}
|
||||
}
|
||||
|
||||
//output any error messages
|
||||
// $backlink = ($show_upload_boxes > 1) ? '<a href="javascript:window.close();">Back to file manager</a>' : html_link_back(1);
|
||||
$refreshjs = '
|
||||
<script language="javascript">
|
||||
window.opener.processIt(\'update\');
|
||||
</script>';
|
||||
|
||||
// if (sizeof($err_msgs)) echo $GLOBALS['phpgw']->common->error_list ($err_msgs,'Error',$backlink);
|
||||
|
||||
return $result.$err_msgs;
|
||||
return $result;
|
||||
|
||||
}
|
||||
function load_help_info()
|
||||
@ -1020,9 +984,9 @@
|
||||
return($this->eor(htmlspecialchars($string),$return));
|
||||
}
|
||||
|
||||
function translate ($text)
|
||||
/* function translate ($text)
|
||||
{
|
||||
return($GLOBALS['phpgw']->lang($text));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
?>
|
||||
|
@ -21,7 +21,7 @@ define('UIEDIT_DEBUG',0);
|
||||
$var = Array(
|
||||
'img_up' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
|
||||
'alt' => lang('Up'),
|
||||
'alt' => lang('up'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->lesspath)
|
||||
@ -30,7 +30,7 @@ define('UIEDIT_DEBUG',0);
|
||||
|
||||
'img_home' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'),
|
||||
'alt' => lang('Folder'),
|
||||
'alt' => lang('folder'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->homedir)
|
||||
@ -40,7 +40,7 @@ define('UIEDIT_DEBUG',0);
|
||||
'dir' => $this->bo->path,
|
||||
'img_dir' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'),
|
||||
'alt' => lang('Folder')
|
||||
'alt' => lang('folder')
|
||||
)),
|
||||
);
|
||||
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('filemanager_nav' => $var));
|
||||
@ -60,14 +60,11 @@ define('UIEDIT_DEBUG',0);
|
||||
$this->load_header();
|
||||
$this->bo = &$parent->bo;
|
||||
if (UIEDIT_DEBUG) echo ' action::edit ';
|
||||
// $this->load_header();
|
||||
$edit_file = get_var('file', array('GET', 'POST'));
|
||||
if (!strlen($edit_file))
|
||||
{
|
||||
$edit_file = $this->bo->fileman[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/* $this->bo->vfs->cd(array(
|
||||
'string' => $this->bo->path,
|
||||
'relatives' => array(RELATIVE_NONE)
|
||||
@ -81,15 +78,14 @@ define('UIEDIT_DEBUG',0);
|
||||
));
|
||||
$vars['action1'][] = array('widget' => array('type' => 'submit',
|
||||
'name' => "uiaction_edit_preview",
|
||||
'value'=>lang('Preview')
|
||||
'value'=>lang('preview')
|
||||
));
|
||||
//$this->action_link('edit_preview');
|
||||
$vars['action2'][] = array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'filesave'),
|
||||
));
|
||||
$vars['action2'][] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'uiaction_edit_save',
|
||||
'value'=>lang('Save')
|
||||
'value'=>lang('save')
|
||||
));
|
||||
$vars['action3'][] = array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'),
|
||||
@ -97,7 +93,7 @@ define('UIEDIT_DEBUG',0);
|
||||
|
||||
$vars['action3'][] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'uiaction_edit_cancel',
|
||||
'value'=>lang('Close')
|
||||
'value'=>lang('close')
|
||||
));
|
||||
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('nav_data' => $vars));
|
||||
$vars = array('filename' => $edit_file);
|
||||
@ -105,6 +101,10 @@ define('UIEDIT_DEBUG',0);
|
||||
if (get_var('edited', array('GET', 'POST')))
|
||||
{
|
||||
$content = get_var('edit_file_content', array('GET', 'POST'));
|
||||
if (get_magic_quotes_gpc()) //a thousand curses!
|
||||
{
|
||||
$content = stripslashes($content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -37,34 +37,34 @@
|
||||
var $template_dir;
|
||||
var $help_info;
|
||||
var $mime_ico = array (
|
||||
'application/pdf' => 'pdf',
|
||||
'application/postscript' => 'postscript',
|
||||
'application/msword' => 'word',
|
||||
'application/vnd.ms-excel' => 'excel',
|
||||
'application/vnd.ms-powerpoint' => 'ppt',
|
||||
'application/x-gzip' => 'tgz',
|
||||
'application/x-bzip' => 'tgz',
|
||||
'application/zip' => 'tgz',
|
||||
'application/x-debian-package' => 'deb',
|
||||
'application/x-rpm' => 'rpm',
|
||||
'application' => 'document',
|
||||
'application/octet-stream' => 'unknown',
|
||||
'audio' => 'sound',
|
||||
'audio/mpeg' => 'sound',
|
||||
'Directory' => 'folder',
|
||||
'exe' => 'exe',
|
||||
'image' => 'image',
|
||||
'text' => 'txt',
|
||||
'text/html' => 'html',
|
||||
'text/plain' => 'txt',
|
||||
'text/xml' => 'html',
|
||||
'text/x-vcalendar' => 'vcalendar',
|
||||
'text/calendar' => 'vcalendar',
|
||||
'text/x-vcard' => 'vcard',
|
||||
'text/x-tex' => 'tex',
|
||||
'unknown' => 'unknown',
|
||||
'video' => 'video',
|
||||
'message' => 'message'
|
||||
'application/pdf' => 'pdf',
|
||||
'application/postscript' => 'postscript',
|
||||
'application/msword' => 'word',
|
||||
'application/vnd.ms-excel' => 'excel',
|
||||
'application/vnd.ms-powerpoint' => 'ppt',
|
||||
'application/x-gzip' => 'tgz',
|
||||
'application/x-bzip' => 'tgz',
|
||||
'application/zip' => 'tgz',
|
||||
'application/x-debian-package' => 'deb',
|
||||
'application/x-rpm' => 'rpm',
|
||||
'application' => 'document',
|
||||
'application/octet-stream' => 'unknown',
|
||||
'audio' => 'sound',
|
||||
'audio/mpeg' => 'sound',
|
||||
'Directory' => 'folder',
|
||||
'exe' => 'exe',
|
||||
'image' => 'image',
|
||||
'text' => 'txt',
|
||||
'text/html' => 'html',
|
||||
'text/plain' => 'txt',
|
||||
'text/xml' => 'html',
|
||||
'text/x-vcalendar' => 'vcalendar',
|
||||
'text/calendar' => 'vcalendar',
|
||||
'text/x-vcard' => 'vcard',
|
||||
'text/x-tex' => 'tex',
|
||||
'unknown' => 'unknown',
|
||||
'video' => 'video',
|
||||
'message' => 'message'
|
||||
);
|
||||
|
||||
function uifilemanager()
|
||||
@ -99,7 +99,7 @@
|
||||
'relatives' => Array(RELATIVE_NONE),
|
||||
'operation' => PHPGW_ACL_READ)))
|
||||
{
|
||||
$this->no_access_exists(lang('You do not have access to %1',$this->bo->path));
|
||||
$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']);
|
||||
@ -111,6 +111,7 @@
|
||||
// $p->parse('col_headers','column_headers',$append);
|
||||
}
|
||||
|
||||
/**TODO: xslt-ise this (and get rid of the hard-coded html)*/
|
||||
function no_access_exists($error_msg)
|
||||
{
|
||||
if($this->bo->debug)
|
||||
@ -167,7 +168,7 @@
|
||||
'relatives' => Array(RELATIVE_NONE)
|
||||
)))
|
||||
{
|
||||
echo lang('failed to create directory') . ' <b>'. $this->bo->homedir . '</b><br><br>';
|
||||
echo lang('failed to create directory') . ' :'. $this->bo->homedir . "\n";
|
||||
}
|
||||
$this->bo->vfs->override_acl = 0;
|
||||
}
|
||||
@ -229,7 +230,7 @@
|
||||
'relatives' => Array(RELATIVE_NONE)
|
||||
)))
|
||||
{
|
||||
$this->no_access_exists(lang('Directory %1 does not exist',$this->bo->path));
|
||||
$this->no_access_exists(lang('directory %1 does not exist',$this->bo->path));
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,20 +269,20 @@
|
||||
|
||||
}
|
||||
$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'),
|
||||
'edit' => lang('Edit'),
|
||||
'edit_comments' => lang('Edit Comments'),
|
||||
'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'),
|
||||
'edit' => lang('edit'),
|
||||
'edit_comments' => lang('edit comments'),
|
||||
'apply_edit_comment' => '1',
|
||||
'apply_edit_name' => '1',
|
||||
'cancel' => lang('Cancel'),
|
||||
'upload' => lang('Upload Files')
|
||||
'cancel' => lang('cancel'),
|
||||
'upload' => lang('upload files')
|
||||
);
|
||||
|
||||
$local_functions = array(
|
||||
@ -300,9 +301,9 @@
|
||||
'upload',
|
||||
'download'
|
||||
);
|
||||
if (trim(strtolower($this->bo->cancel)) == strtolower(lang('Cancel'))) {
|
||||
if (trim(strtolower($this->bo->cancel)) == strtolower(lang('cancel'))) {
|
||||
$this->cancel();
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
//If the action is a "uiaction" (ie it has its own seperate interface), this will run it
|
||||
$this->actions->dispatch($this);
|
||||
@ -323,7 +324,7 @@
|
||||
{
|
||||
echo " bofunction $function ";
|
||||
$f_function = 'f_'.$function;
|
||||
$errors = $this->bo->$f_function();
|
||||
$errors = implode("\n", $this->bo->$f_function());
|
||||
$var = Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->path)
|
||||
@ -349,10 +350,11 @@
|
||||
Header('Location: '.$GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->path),
|
||||
'errors' => lang('Unknown Action!')
|
||||
'errors' => lang('unknown action!')
|
||||
)));
|
||||
}
|
||||
|
||||
/**TODO : xslt-ise this */
|
||||
function help()
|
||||
{
|
||||
$this->load_header();
|
||||
@ -373,7 +375,7 @@
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
/**TODO : xslt-ise this */
|
||||
function build_help($help_option,$text='')
|
||||
{
|
||||
if($this->bo->settings['show_help'])
|
||||
@ -451,39 +453,39 @@
|
||||
|
||||
$button['type'] = 'submit';
|
||||
$button['name'] = 'uiaction_edit';
|
||||
$button['value'] = lang('Edit');
|
||||
$button['value'] = lang('edit');
|
||||
$button['caption'] = $this->build_help('edit');
|
||||
|
||||
$var[] = array('widget' => $button);
|
||||
$button['name'] = "rename";
|
||||
$button['value'] =lang('Rename');
|
||||
$button['value'] =lang('rename');
|
||||
$button['caption'] = $this->build_help('rename');
|
||||
|
||||
$var[] = array('widget' => $button);
|
||||
$button['name'] = "delete";
|
||||
$button['value'] =lang('Delete');
|
||||
$button['value'] =lang('delete');
|
||||
$button['caption'] = $this->build_help('delete');
|
||||
$var[] = array('widget' => $button);
|
||||
|
||||
$button['name'] = "edit_comments";
|
||||
$button['value'] =lang('Edit Comments');
|
||||
$button['value'] =lang('edit comments');
|
||||
$button['caption'] = $this->build_help('edit_comments');
|
||||
$var[] = array('widget' => $button);
|
||||
|
||||
$var[] = array('widget' => array( 'type' => 'seperator' ));
|
||||
|
||||
$button['name'] = "go";
|
||||
$button['value'] = lang('Go To');
|
||||
$button['value'] = lang('go to');
|
||||
$button['caption'] = $this->build_help('go_to');
|
||||
$var[] = array('widget' => $button);
|
||||
|
||||
$button['name'] = "copy";
|
||||
$button['value'] = lang('Copy To');
|
||||
$button['value'] = lang('copy to');
|
||||
$button['caption'] = $this->build_help('copy_to');
|
||||
$var[] = array('widget' => $button);
|
||||
|
||||
$button['name'] = "move";
|
||||
$button['value'] = lang('Move To');
|
||||
$button['value'] = lang('move to');
|
||||
$button['caption'] =$this->build_help('move_to');
|
||||
$var[] = array('widget' => $button);
|
||||
|
||||
@ -589,7 +591,7 @@
|
||||
{
|
||||
$var[] = array('widget' => array('type'=>'submit',
|
||||
'name'=> 'download',
|
||||
'value' => lang('Download'),
|
||||
'value' => lang('download'),
|
||||
'caption' => $this->build_help('download')
|
||||
));
|
||||
$var[] = array('widget' => array( 'type' => 'seperator' ));
|
||||
@ -600,14 +602,14 @@
|
||||
));
|
||||
$var[] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'newdir',
|
||||
'value' => lang('Create Folder'),
|
||||
'value' => lang('create folder'),
|
||||
'caption' => $this->build_help('create_folder')
|
||||
));
|
||||
$var[] = array('widget' => array( 'type' => 'seperator' ));
|
||||
}
|
||||
/* $var[] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'update',
|
||||
'value' => lang('Update'),
|
||||
'value' => lang('update'),
|
||||
'caption' => $this->build_help('update')
|
||||
));
|
||||
*/
|
||||
@ -620,7 +622,7 @@
|
||||
));
|
||||
$var[] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'newfile',
|
||||
'value' => lang('Create File'),
|
||||
'value' => lang('create file'),
|
||||
'caption' => $this->build_help('create_file')
|
||||
));
|
||||
$var[] = array('widget' => array( 'type' => 'seperator' ));
|
||||
@ -636,7 +638,7 @@
|
||||
));
|
||||
$var[] = array('widget' => array( 'type' => 'submit',
|
||||
'name' => 'execute',
|
||||
'value' => lang('Execute'),
|
||||
'value' => lang('execute'),
|
||||
'caption' => $this->build_help('execute')
|
||||
));
|
||||
$var[] = array('widget' => array( 'type' => 'seperator' ));
|
||||
@ -651,7 +653,7 @@
|
||||
$p->parse('col_headers','column_headers_normal',True);
|
||||
|
||||
$var['td_extras'] = ' align="right"';
|
||||
$var['column_header'] = '<b>'.lang('Used Space').'</b>:';
|
||||
$var['column_header'] = '<b>'.lang('used space').'</b>:';
|
||||
$p->set_var($var);
|
||||
$p->parse('col_headers','column_headers_normal',True);
|
||||
|
||||
@ -663,7 +665,7 @@
|
||||
if($this_homedir)
|
||||
{
|
||||
$var['td_extras'] = ' align="right"';
|
||||
$var['column_header'] = '<b>'.lang('Unused space').'</b>:';
|
||||
$var['column_header'] = '<b>'.lang('unused space').'</b>:';
|
||||
$p->set_var($var);
|
||||
$p->parse('col_headers','column_headers_normal',True);
|
||||
|
||||
@ -679,7 +681,7 @@
|
||||
if($this_homedir)
|
||||
{
|
||||
$var['td_extras'] = ' colspan="'.($info_columns / 2).'" align="right" width="50%"';
|
||||
$var['column_header'] = '<b>'.lang('Total Files').'</b>:';
|
||||
$var['column_header'] = '<b>'.lang('total files').'</b>:';
|
||||
$p->set_var($var);
|
||||
$p->parse('col_headers','column_headers_normal',False);
|
||||
|
||||
@ -701,12 +703,12 @@
|
||||
{
|
||||
|
||||
$var_head[] = array('widget' => array('type' => 'label',
|
||||
'caption' => lang('File').$this->build_help('upload_file')
|
||||
'caption' => lang('file').$this->build_help('upload_file')
|
||||
));
|
||||
|
||||
|
||||
$var_head[] = array('widget' => array('type' => 'label',
|
||||
'caption' => lang('Comment').$this->build_help('upload_comment')
|
||||
'caption' => lang('comment').$this->build_help('upload_comment')
|
||||
));
|
||||
$table_head [] =array('table_col' => $var_head);
|
||||
// $var[] = array('widget' => array('type' => 'seperator'));
|
||||
@ -730,7 +732,7 @@
|
||||
$var = array();
|
||||
$var[] = array('widget' => array('type' =>'submit',
|
||||
'name' => 'upload',
|
||||
'value' => lang('Upload Files'),
|
||||
'value' => lang('upload Files'),
|
||||
'caption' => $this->build_help('upload_files')
|
||||
));
|
||||
|
||||
@ -781,15 +783,15 @@
|
||||
{
|
||||
$file = $files_array[$i];
|
||||
$usage += $file['size'];
|
||||
if (!count($edit) )
|
||||
{
|
||||
$file_attributes['checkbox'] = '';
|
||||
$file_output[$i]['checkbox'] =array('widget' => array( 'type' => 'checkbox',
|
||||
'name' => 'fileman[]',
|
||||
'value' => $file['name']
|
||||
));
|
||||
if (!count($edit) )
|
||||
{
|
||||
$file_attributes['checkbox'] = '';
|
||||
$file_output[$i]['checkbox'] =array('widget' => array( 'type' => 'checkbox',
|
||||
'name' => 'fileman[]',
|
||||
'value' => $file['name']
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@reset($this->bo->file_attributes);
|
||||
while(list($internal,$displayed) = each($this->bo->file_attributes))
|
||||
{
|
||||
@ -820,17 +822,17 @@
|
||||
break;
|
||||
case 'name':
|
||||
$mime_parts = explode('/',$file['mime_type']);
|
||||
$file_icon = $this->mime_ico[$file['mime_type']];
|
||||
if (!$file_icon) {
|
||||
$file_icon = ( $this->mime_ico[$mime_parts[0]]) ? $this->mime_ico[$mime_parts[0]] : $this->mime_ico['unknown'];
|
||||
if (strpos($file['name'],'.exe') !== false) $file_icon = $this->mime_ico['exe'];
|
||||
}
|
||||
|
||||
$file_output[$i]['name']['icon'] = array(
|
||||
'widget' => array( 'type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,$file_icon)
|
||||
));
|
||||
|
||||
$file_icon = $this->mime_ico[$file['mime_type']];
|
||||
if (!$file_icon) {
|
||||
$file_icon = ( $this->mime_ico[$mime_parts[0]]) ? $this->mime_ico[$mime_parts[0]] : $this->mime_ico['unknown'];
|
||||
if (strpos($file['name'],'.exe') !== false) $file_icon = $this->mime_ico['exe'];
|
||||
}
|
||||
|
||||
$file_output[$i]['name']['icon'] = array(
|
||||
'widget' => array( 'type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,$file_icon)
|
||||
));
|
||||
|
||||
if ($file['mime_type']=='Directory')
|
||||
{
|
||||
$href = array('menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
@ -852,14 +854,14 @@
|
||||
'href' => $GLOBALS['phpgw']->link('/index.php', $href)
|
||||
));
|
||||
if ($mime_parts[0] == 'text')
|
||||
{
|
||||
$href['menuaction'] = $this->bo->appname.'.ui'.$this->bo->appname.'.action';
|
||||
$href['uiaction'] = 'edit';
|
||||
$file_output[$i]['name']['edit'] = array('widget' => array( 'type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'pencil'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php', $href)
|
||||
));
|
||||
}
|
||||
{
|
||||
$href['menuaction'] = $this->bo->appname.'.ui'.$this->bo->appname.'.action';
|
||||
$href['uiaction'] = 'edit';
|
||||
$file_output[$i]['name']['edit'] = array('widget' => array( 'type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'pencil'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php', $href)
|
||||
));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$file_output[$i][$internal] = $file[$internal];
|
||||
@ -904,7 +906,7 @@
|
||||
'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'):''),
|
||||
'img_up' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
|
||||
'alt' => lang('Up'),
|
||||
'alt' => lang('up'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->lesspath)
|
||||
@ -913,7 +915,7 @@
|
||||
'help_up' => $this->build_help('up'),
|
||||
'img_home' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'),
|
||||
'alt' => lang('Folder'),
|
||||
'alt' => lang('folder'),
|
||||
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->homedir)
|
||||
@ -922,7 +924,7 @@
|
||||
'dir' => $this->bo->path,
|
||||
'img_dir' => array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'),
|
||||
'alt' => lang('Folder'), 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'alt' => lang('folder'), 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
|
||||
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
|
||||
'path' => urlencode($this->bo->path)
|
||||
))
|
||||
@ -938,19 +940,19 @@
|
||||
{
|
||||
$var['img_cancel'] = array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'),
|
||||
'alt' => lang('Folder')
|
||||
'alt' => lang('folder')
|
||||
));
|
||||
$var['button_cancel'] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'cancel',
|
||||
'value' => lang('Cancel')
|
||||
'value' => lang('cancel')
|
||||
));
|
||||
$var['img_ok'] = array('widget' => array('type' => 'img',
|
||||
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_ok'),
|
||||
'alt' => lang('Folder')
|
||||
'alt' => lang('folder')
|
||||
));
|
||||
$var['button_ok'] = array('widget' => array('type' => 'submit',
|
||||
'name' => 'submit',
|
||||
'value' => lang('OK')
|
||||
'value' => lang('ok')
|
||||
));
|
||||
@reset($edit);
|
||||
while( list($file,$prop) = each($edit))
|
||||
@ -1179,5 +1181,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user