Make sure everything gets translated

This commit is contained in:
sim 2003-03-04 03:03:00 +00:00
parent fc74ba453e
commit 48520640c3
3 changed files with 216 additions and 251 deletions

View File

@ -420,7 +420,7 @@
} }
else else
{ {
$data = ' '; $data = '';
} }
return $data; return $data;
} }
@ -431,7 +431,7 @@
} }
function f_apply_edit_comment() function f_apply_edit_comment()
{ {
$result=''; $result=Array();
for ($i=0; $i<count($this->fileman) ; $i++) for ($i=0; $i<count($this->fileman) ; $i++)
{ {
$file = $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() function f_apply_edit_name()
{ {
$result=''; $result = Array();
while (list ($from, $to) = each ($this->changes)) while (list ($from, $to) = each ($this->changes))
{ {
if ($badchar = $this->bad_chars ($to, True, True)) if ($badchar = $this->bad_chars ($to, True, True))
{ {
$result .= 'File names cannot contain "'.$badchar.'"'; $result[] = lang('file names cannot contain %1', $badchar);
continue; continue;
} }
if (ereg ("/", $to) || ereg ("\\\\", $to)) if (ereg ("/", $to) || ereg ("\\\\", $to))
{ {
//echo $GLOBALS['phpgw']->common->error_list (array ("File names cannot contain \\ or /")); //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 ( elseif (!$this->vfs->mv (array (
'from' => $from, 'from' => $from,
@ -475,44 +475,19 @@
) )
{ {
//echo $GLOBALS['phpgw']->common->error_list (array ('Could not rename '.$disppath.'/'.$from.' to '.$disppath.'/'.$to)); //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 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; return $result;
} }
function f_delete() function f_delete()
{ {
$result = Array();
$numoffiles = count($this->fileman); $numoffiles = count($this->fileman);
for($i=0;$i!=$numoffiles;$i++) for($i=0;$i!=$numoffiles;$i++)
{ {
@ -540,24 +515,25 @@
'relatives' => Array(RELATIVE_USER_NONE) '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 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 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() function f_copy()
{ {
$result = Array();
$numoffiles = count($this->fileman); $numoffiles = count($this->fileman);
for($i=0;$i!=$numoffiles;$i++) for($i=0;$i!=$numoffiles;$i++)
{ {
@ -569,19 +545,20 @@
'relatives' => Array(RELATIVE_NONE,RELATIVE_NONE) '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 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() function f_move()
{ {
$result = Array();
$numoffiles = count($this->fileman); $numoffiles = count($this->fileman);
for($i=0;$i!=$numoffiles;$i++) for($i=0;$i!=$numoffiles;$i++)
{ {
@ -593,19 +570,20 @@
'relatives' => Array(RELATIVE_NONE,RELATIVE_NONE) '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 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() function f_download()
{ {
$result = Array();
$numoffiles = count($this->fileman); $numoffiles = count($this->fileman);
for($i=0;$i!=$numoffiles;$i++) for($i=0;$i!=$numoffiles;$i++)
{ {
@ -620,30 +598,31 @@
'file' => $this->fileman[$i] '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 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() function f_newdir()
{ {
$result = Array();
if ($this->newdir && $this->createdir) if ($this->newdir && $this->createdir)
{ {
if ($badchar = $this->bad_chars($this->createdir,True,True)) if ($badchar = $this->bad_chars($this->createdir,True,True))
{ {
$errors[] = '<font color="#FF0000">Directory names cannot contain "'.$badchar.'"</font>'; $result[] = lang('directory names cannot contain "%1"', $badchar);
return $errors; return $result;
} }
if (substr($this->createdir,strlen($this->createdir)-1,1) == ' ' || substr($this->createdir,0,1) == ' ') 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>'; $result[] = lang('cannot create directory because it begins or ends in a space');
return $errors; return $result;
} }
$ls_array = $this->vfs->ls(array( $ls_array = $this->vfs->ls(array(
@ -658,11 +637,11 @@
{ {
if ($fileinfo['mime_type'] != 'Directory') 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 else
{ {
$errors[] = '<font color="#FF0000">Directory '.$fileinfo['name'].' already exists.</font>'; $result[] = lang('directory %1 already exists', $fileinfo['name']);
} }
} }
else else
@ -672,64 +651,59 @@
'relatives' => Array(RELATIVE_NONE) 'relatives' => Array(RELATIVE_NONE)
))) )))
{ {
$errors[] = '<font color="#0000FF">Created directory '.$this->path.SEP.$this->createdir.'</font>'; $result[] = lang('created directory %1', $this->path.SEP.$this->createdir);
// $this->path = $this->path.SEP.$this->createdir; $this->path = $this->path.SEP.$this->createdir;
} }
else 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() function f_newfile()
{ {
$result = Array();
if ($this->newfile && $this->createfile) if ($this->newfile && $this->createfile)
{ {
if($badchar = $this->bad_chars($this->createfile,True,True)) if($badchar = $this->bad_chars($this->createfile,True,True))
{ {
$errors[] = '<font color="#FF0000">Filenames cannot contain "'.$badchar.'"</font>'; $result[] = lang('filenames cannot contain "%1"', $badchar);
return $errors; return $result;
} }
if($this->vfs->file_exists(array( if($this->vfs->file_exists(array(
'string' => $this->path.SEP.$this->createfile, 'string' => $this->path.SEP.$this->createfile,
'relatives' => Array(RELATIVE_NONE) 'relatives' => Array(RELATIVE_NONE)
))) )))
{ {
$errors[] = '<font color="#FF0000">File '.$this->path.SEP.$this->createfile.' already exists. Please edit it or delete it first.</font>'; $result[] = lang('file %1 already exists. Please edit it or delete it first', $this->path.SEP.$this->createfile);
return $errors; return $result;
} }
if(!$this->vfs->touch(array( if(!$this->vfs->touch(array(
'string' => $this->path.SEP.$this->createfile, 'string' => $this->path.SEP.$this->createfile,
'relatives' => Array(RELATIVE_NONE) '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 else
{ {
$errors[] = '<font color="#FF0000">Filename not provided!</font>'; $result[] = lang('filename not provided!');
} }
return $errors; return $result;
} }
function f_upload() function f_upload()
{ {
/* echo 'sub:'.$this->show_upload_boxes .' uf: '; $result = Array();
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);
for ($i = 0; $i != $this->show_upload_boxes; $i++) for ($i = 0; $i != $this->show_upload_boxes; $i++)
{ {
if ($badchar = $this->bad_chars ($this->upload_file['name'][$i], True, True)) 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))); //echo $GLOBALS['phpgw']->common->error_list (array (html_encode ('Filenames cannot contain "'.$badchar.'"', 1)));
continue; continue;
} }
@ -752,8 +726,7 @@
{ {
if ($fileinfo['mime_type'] == 'Directory') if ($fileinfo['mime_type'] == 'Directory')
{ {
array_push($err_msgs,'Cannot replace '.$fileinfo['name'].' because it is a directory'); $result[] = lang('cannot replace %1 because it is a directory', $fileinfo['name']);
//echo $GLOBALS['phpgw']->common->error_list (array ('Cannot replace '.$fileinfo['name'].' because it is a directory'));
continue; continue;
} }
} }
@ -786,11 +759,11 @@
); );
} else { } else {
array_push($err_msgs,'Failed to upload file: '.$this->upload_file['name'][$i]); $result[] = lang( 'failed to upload file: %1',$this->upload_file['name'][$i]);
continue; continue;
} }
$result .=' Replaced '.$disppath.'/'.$this->upload_file['name'][$i].' '.$this->upload_file['size'][$i]; $result[] = lang('replaced %1 (%2 bytes)',$this->path.'/'.$this->upload_file['name'][$i],$this->upload_file['size'][$i]);
} }
else else
{ {
@ -807,16 +780,16 @@
'string' => $this->upload_file['name'][$i], 'string' => $this->upload_file['name'][$i],
'relatives' => array (RELATIVE_ALL), 'relatives' => array (RELATIVE_ALL),
'attributes' => array ( 'attributes' => array (
'mime_type' => $this->upload_file_['type'][$i], 'mime_type' => $this->upload_file['type'][$i],
'comment' => stripslashes ($this->upload_comment[$i]) 'comment' => stripslashes ($this->upload_comment[$i])
) )
) )
); );
} else { } else {
array_push($err_msgs,'Failed to upload file: '.$this->upload_file['name'][$i]); $result[] = lang('failed to upload file: %1',$this->upload_file['name'][$i]);
continue; continue;
} }
$result .= 'Created '.$this->path.'/'.$this->upload_file['name'][$i] .' '. $this->upload_file['size'][$i]; $result[] = lang('created %1 (%2 bytes)',$this->path.'/'.$this->upload_file['name'][$i] , $this->upload_file['size'][$i]);
} }
} }
elseif ($this->upload_file['name'][$i]) elseif ($this->upload_file['name'][$i])
@ -841,16 +814,7 @@
} }
} }
//output any error messages return $result;
// $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;
} }
function load_help_info() function load_help_info()
@ -1020,9 +984,9 @@
return($this->eor(htmlspecialchars($string),$return)); return($this->eor(htmlspecialchars($string),$return));
} }
function translate ($text) /* function translate ($text)
{ {
return($GLOBALS['phpgw']->lang($text)); return($GLOBALS['phpgw']->lang($text));
} }*/
} }
?> ?>

View File

@ -21,7 +21,7 @@ define('UIEDIT_DEBUG',0);
$var = Array( $var = Array(
'img_up' => array('widget' => array('type' => 'img', 'img_up' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
'alt' => lang('Up'), 'alt' => lang('up'),
'link' => $GLOBALS['phpgw']->link('/index.php',Array( 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->lesspath) 'path' => urlencode($this->bo->lesspath)
@ -30,7 +30,7 @@ define('UIEDIT_DEBUG',0);
'img_home' => array('widget' => array('type' => 'img', 'img_home' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'),
'alt' => lang('Folder'), 'alt' => lang('folder'),
'link' => $GLOBALS['phpgw']->link('/index.php',Array( 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->homedir) 'path' => urlencode($this->bo->homedir)
@ -40,7 +40,7 @@ define('UIEDIT_DEBUG',0);
'dir' => $this->bo->path, 'dir' => $this->bo->path,
'img_dir' => array('widget' => array('type' => 'img', 'img_dir' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'), '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)); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('filemanager_nav' => $var));
@ -60,14 +60,11 @@ define('UIEDIT_DEBUG',0);
$this->load_header(); $this->load_header();
$this->bo = &$parent->bo; $this->bo = &$parent->bo;
if (UIEDIT_DEBUG) echo ' action::edit '; if (UIEDIT_DEBUG) echo ' action::edit ';
// $this->load_header();
$edit_file = get_var('file', array('GET', 'POST')); $edit_file = get_var('file', array('GET', 'POST'));
if (!strlen($edit_file)) if (!strlen($edit_file))
{ {
$edit_file = $this->bo->fileman[0]; $edit_file = $this->bo->fileman[0];
} }
/* $this->bo->vfs->cd(array( /* $this->bo->vfs->cd(array(
'string' => $this->bo->path, 'string' => $this->bo->path,
'relatives' => array(RELATIVE_NONE) 'relatives' => array(RELATIVE_NONE)
@ -81,15 +78,14 @@ define('UIEDIT_DEBUG',0);
)); ));
$vars['action1'][] = array('widget' => array('type' => 'submit', $vars['action1'][] = array('widget' => array('type' => 'submit',
'name' => "uiaction_edit_preview", 'name' => "uiaction_edit_preview",
'value'=>lang('Preview') 'value'=>lang('preview')
)); ));
//$this->action_link('edit_preview');
$vars['action2'][] = array('widget' => array('type' => 'img', $vars['action2'][] = array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'filesave'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'filesave'),
)); ));
$vars['action2'][] = array('widget' => array('type' => 'submit', $vars['action2'][] = array('widget' => array('type' => 'submit',
'name' => 'uiaction_edit_save', 'name' => 'uiaction_edit_save',
'value'=>lang('Save') 'value'=>lang('save')
)); ));
$vars['action3'][] = array('widget' => array('type' => 'img', $vars['action3'][] = array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'), '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', $vars['action3'][] = array('widget' => array('type' => 'submit',
'name' => 'uiaction_edit_cancel', 'name' => 'uiaction_edit_cancel',
'value'=>lang('Close') 'value'=>lang('close')
)); ));
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('nav_data' => $vars)); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('nav_data' => $vars));
$vars = array('filename' => $edit_file); $vars = array('filename' => $edit_file);
@ -105,6 +101,10 @@ define('UIEDIT_DEBUG',0);
if (get_var('edited', array('GET', 'POST'))) if (get_var('edited', array('GET', 'POST')))
{ {
$content = get_var('edit_file_content', array('GET', 'POST')); $content = get_var('edit_file_content', array('GET', 'POST'));
if (get_magic_quotes_gpc()) //a thousand curses!
{
$content = stripslashes($content);
}
} }
else else
{ {

View File

@ -99,7 +99,7 @@
'relatives' => Array(RELATIVE_NONE), 'relatives' => Array(RELATIVE_NONE),
'operation' => PHPGW_ACL_READ))) '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_id'] = $this->bo->vfs->working_id;
$this->bo->userinfo['working_lid'] = $GLOBALS['phpgw']->accounts->id2name($this->bo->userinfo['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); // $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) function no_access_exists($error_msg)
{ {
if($this->bo->debug) if($this->bo->debug)
@ -167,7 +168,7 @@
'relatives' => Array(RELATIVE_NONE) '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; $this->bo->vfs->override_acl = 0;
} }
@ -229,7 +230,7 @@
'relatives' => Array(RELATIVE_NONE) '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( $actions = Array(
'rename' => lang('Rename'), 'rename' => lang('rename'),
'delete' => lang('Delete'), 'delete' => lang('delete'),
'go' => lang('Go To'), 'go' => lang('go to'),
'copy' => lang('Copy To'), 'copy' => lang('copy to'),
'move' => lang('Move To'), 'move' => lang('move to'),
'download' => lang('Download'), 'download' => lang('download'),
'newdir' => lang('Create Folder'), 'newdir' => lang('create folder'),
'newfile' => lang('Create File'), 'newfile' => lang('create file'),
'edit' => lang('Edit'), 'edit' => lang('edit'),
'edit_comments' => lang('Edit Comments'), 'edit_comments' => lang('edit comments'),
'apply_edit_comment' => '1', 'apply_edit_comment' => '1',
'apply_edit_name' => '1', 'apply_edit_name' => '1',
'cancel' => lang('Cancel'), 'cancel' => lang('cancel'),
'upload' => lang('Upload Files') 'upload' => lang('upload files')
); );
$local_functions = array( $local_functions = array(
@ -300,7 +301,7 @@
'upload', 'upload',
'download' 'download'
); );
if (trim(strtolower($this->bo->cancel)) == strtolower(lang('Cancel'))) { if (trim(strtolower($this->bo->cancel)) == strtolower(lang('cancel'))) {
$this->cancel(); $this->cancel();
exit(); exit();
} }
@ -323,7 +324,7 @@
{ {
echo " bofunction $function "; echo " bofunction $function ";
$f_function = 'f_'.$function; $f_function = 'f_'.$function;
$errors = $this->bo->$f_function(); $errors = implode("\n", $this->bo->$f_function());
$var = Array( $var = Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->path) 'path' => urlencode($this->bo->path)
@ -349,10 +350,11 @@
Header('Location: '.$GLOBALS['phpgw']->link('/index.php',Array( Header('Location: '.$GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->path), 'path' => urlencode($this->bo->path),
'errors' => lang('Unknown Action!') 'errors' => lang('unknown action!')
))); )));
} }
/**TODO : xslt-ise this */
function help() function help()
{ {
$this->load_header(); $this->load_header();
@ -373,7 +375,7 @@
} }
exit(); exit();
} }
/**TODO : xslt-ise this */
function build_help($help_option,$text='') function build_help($help_option,$text='')
{ {
if($this->bo->settings['show_help']) if($this->bo->settings['show_help'])
@ -451,39 +453,39 @@
$button['type'] = 'submit'; $button['type'] = 'submit';
$button['name'] = 'uiaction_edit'; $button['name'] = 'uiaction_edit';
$button['value'] = lang('Edit'); $button['value'] = lang('edit');
$button['caption'] = $this->build_help('edit'); $button['caption'] = $this->build_help('edit');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$button['name'] = "rename"; $button['name'] = "rename";
$button['value'] =lang('Rename'); $button['value'] =lang('rename');
$button['caption'] = $this->build_help('rename'); $button['caption'] = $this->build_help('rename');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$button['name'] = "delete"; $button['name'] = "delete";
$button['value'] =lang('Delete'); $button['value'] =lang('delete');
$button['caption'] = $this->build_help('delete'); $button['caption'] = $this->build_help('delete');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$button['name'] = "edit_comments"; $button['name'] = "edit_comments";
$button['value'] =lang('Edit Comments'); $button['value'] =lang('edit comments');
$button['caption'] = $this->build_help('edit_comments'); $button['caption'] = $this->build_help('edit_comments');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$var[] = array('widget' => array( 'type' => 'seperator' )); $var[] = array('widget' => array( 'type' => 'seperator' ));
$button['name'] = "go"; $button['name'] = "go";
$button['value'] = lang('Go To'); $button['value'] = lang('go to');
$button['caption'] = $this->build_help('go_to'); $button['caption'] = $this->build_help('go_to');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$button['name'] = "copy"; $button['name'] = "copy";
$button['value'] = lang('Copy To'); $button['value'] = lang('copy to');
$button['caption'] = $this->build_help('copy_to'); $button['caption'] = $this->build_help('copy_to');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
$button['name'] = "move"; $button['name'] = "move";
$button['value'] = lang('Move To'); $button['value'] = lang('move to');
$button['caption'] =$this->build_help('move_to'); $button['caption'] =$this->build_help('move_to');
$var[] = array('widget' => $button); $var[] = array('widget' => $button);
@ -589,7 +591,7 @@
{ {
$var[] = array('widget' => array('type'=>'submit', $var[] = array('widget' => array('type'=>'submit',
'name'=> 'download', 'name'=> 'download',
'value' => lang('Download'), 'value' => lang('download'),
'caption' => $this->build_help('download') 'caption' => $this->build_help('download')
)); ));
$var[] = array('widget' => array( 'type' => 'seperator' )); $var[] = array('widget' => array( 'type' => 'seperator' ));
@ -600,14 +602,14 @@
)); ));
$var[] = array('widget' => array('type' => 'submit', $var[] = array('widget' => array('type' => 'submit',
'name' => 'newdir', 'name' => 'newdir',
'value' => lang('Create Folder'), 'value' => lang('create folder'),
'caption' => $this->build_help('create_folder') 'caption' => $this->build_help('create_folder')
)); ));
$var[] = array('widget' => array( 'type' => 'seperator' )); $var[] = array('widget' => array( 'type' => 'seperator' ));
} }
/* $var[] = array('widget' => array('type' => 'submit', /* $var[] = array('widget' => array('type' => 'submit',
'name' => 'update', 'name' => 'update',
'value' => lang('Update'), 'value' => lang('update'),
'caption' => $this->build_help('update') 'caption' => $this->build_help('update')
)); ));
*/ */
@ -620,7 +622,7 @@
)); ));
$var[] = array('widget' => array('type' => 'submit', $var[] = array('widget' => array('type' => 'submit',
'name' => 'newfile', 'name' => 'newfile',
'value' => lang('Create File'), 'value' => lang('create file'),
'caption' => $this->build_help('create_file') 'caption' => $this->build_help('create_file')
)); ));
$var[] = array('widget' => array( 'type' => 'seperator' )); $var[] = array('widget' => array( 'type' => 'seperator' ));
@ -636,7 +638,7 @@
)); ));
$var[] = array('widget' => array( 'type' => 'submit', $var[] = array('widget' => array( 'type' => 'submit',
'name' => 'execute', 'name' => 'execute',
'value' => lang('Execute'), 'value' => lang('execute'),
'caption' => $this->build_help('execute') 'caption' => $this->build_help('execute')
)); ));
$var[] = array('widget' => array( 'type' => 'seperator' )); $var[] = array('widget' => array( 'type' => 'seperator' ));
@ -651,7 +653,7 @@
$p->parse('col_headers','column_headers_normal',True); $p->parse('col_headers','column_headers_normal',True);
$var['td_extras'] = ' align="right"'; $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->set_var($var);
$p->parse('col_headers','column_headers_normal',True); $p->parse('col_headers','column_headers_normal',True);
@ -663,7 +665,7 @@
if($this_homedir) if($this_homedir)
{ {
$var['td_extras'] = ' align="right"'; $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->set_var($var);
$p->parse('col_headers','column_headers_normal',True); $p->parse('col_headers','column_headers_normal',True);
@ -679,7 +681,7 @@
if($this_homedir) if($this_homedir)
{ {
$var['td_extras'] = ' colspan="'.($info_columns / 2).'" align="right" width="50%"'; $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->set_var($var);
$p->parse('col_headers','column_headers_normal',False); $p->parse('col_headers','column_headers_normal',False);
@ -701,12 +703,12 @@
{ {
$var_head[] = array('widget' => array('type' => 'label', $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', $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); $table_head [] =array('table_col' => $var_head);
// $var[] = array('widget' => array('type' => 'seperator')); // $var[] = array('widget' => array('type' => 'seperator'));
@ -730,7 +732,7 @@
$var = array(); $var = array();
$var[] = array('widget' => array('type' =>'submit', $var[] = array('widget' => array('type' =>'submit',
'name' => 'upload', 'name' => 'upload',
'value' => lang('Upload Files'), 'value' => lang('upload Files'),
'caption' => $this->build_help('upload_files') 'caption' => $this->build_help('upload_files')
)); ));
@ -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'):''), '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', 'img_up' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
'alt' => lang('Up'), 'alt' => lang('up'),
'link' => $GLOBALS['phpgw']->link('/index.php',Array( 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->lesspath) 'path' => urlencode($this->bo->lesspath)
@ -913,7 +915,7 @@
'help_up' => $this->build_help('up'), 'help_up' => $this->build_help('up'),
'img_home' => array('widget' => array('type' => 'img', 'img_home' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'),
'alt' => lang('Folder'), 'alt' => lang('folder'),
'link' => $GLOBALS['phpgw']->link('/index.php',Array( 'link' => $GLOBALS['phpgw']->link('/index.php',Array(
'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->homedir) 'path' => urlencode($this->bo->homedir)
@ -922,7 +924,7 @@
'dir' => $this->bo->path, 'dir' => $this->bo->path,
'img_dir' => array('widget' => array('type' => 'img', 'img_dir' => array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'), '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', 'menuaction' => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
'path' => urlencode($this->bo->path) 'path' => urlencode($this->bo->path)
)) ))
@ -938,19 +940,19 @@
{ {
$var['img_cancel'] = array('widget' => array('type' => 'img', $var['img_cancel'] = array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'),
'alt' => lang('Folder') 'alt' => lang('folder')
)); ));
$var['button_cancel'] = array('widget' => array('type' => 'submit', $var['button_cancel'] = array('widget' => array('type' => 'submit',
'name' => 'cancel', 'name' => 'cancel',
'value' => lang('Cancel') 'value' => lang('cancel')
)); ));
$var['img_ok'] = array('widget' => array('type' => 'img', $var['img_ok'] = array('widget' => array('type' => 'img',
'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_ok'), 'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'button_ok'),
'alt' => lang('Folder') 'alt' => lang('folder')
)); ));
$var['button_ok'] = array('widget' => array('type' => 'submit', $var['button_ok'] = array('widget' => array('type' => 'submit',
'name' => 'submit', 'name' => 'submit',
'value' => lang('OK') 'value' => lang('ok')
)); ));
@reset($edit); @reset($edit);
while( list($file,$prop) = each($edit)) while( list($file,$prop) = each($edit))
@ -1179,5 +1181,4 @@
} }
} }
} }