- use start dir from prefs only if no path in session

- more descriptiv labes in sidebox:
  + Your home directory
  + Home directories
  + Base directory
- make some phrases translatable and use placeholders instead of
  concating partial phrases with the variable content
This commit is contained in:
Ralf Becker 2008-09-04 06:44:48 +00:00
parent 33176acbe0
commit 3e7cb195e6
4 changed files with 49 additions and 43 deletions

View File

@ -16,11 +16,17 @@ class filemanager_hooks
{
static $appname = 'filemanager';
static $foldercount = 1;
/**
* Data for Filemanagers sidebox menu
*
* @param array $args
*/
static function sidebox_menu($args)
{
$location = is_array($args) ? $args['location'] : $args;
$basepath = '/';
$rootpath = '/home';
$rootpath = '/';
$basepath = '/home';
$homepath = '/home/'.$GLOBALS['egw_info']['user']['account_lid'];
//echo "<p>admin_prefs_sidebox_hooks::all_hooks(".print_r($args,True).") appname='$appname', location='$location'</p>\n";
$config = config::read(self::$appname);
@ -29,20 +35,25 @@ class filemanager_hooks
if ($location == 'sidebox_menu')
{
$title = $GLOBALS['egw_info']['apps'][self::$appname]['title'] . ' '. lang('Menu');
$file = Array(
'Home' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$homepath)),
'Root' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$rootpath)),
# not sure if we want to offer a link to the base directory for default, this way i do that as preference
#'Base' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath)),
$file = array(
'Your home directory' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$homepath)),
'Home directories' => $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath)),
);
if (!empty($file_prefs['showbase']) && $file_prefs['showbase']=='yes') $file['Base']= $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$basepath));
if (!empty($file_prefs['showbase']) && $file_prefs['showbase']=='yes')
{
$file['Basedirectory'] = $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$rootpath));
}
if (!empty($file_prefs['startfolder'])) $file['Startfolder']= $GLOBALS['egw']->link('/index.php',array('menuaction'=>self::$appname.'.filemanager_ui.index','path'=>$file_prefs['startfolder']));
for ($i=1; $i<=self::$foldercount;$i++) {
if (!empty($file_prefs['folderlink'.$i])) {
$foldername = array_pop(explode("/",$file_prefs['folderlink'.$i]));
$file['Link '.$i.($foldername?": ($foldername)":'(Base)')]= $GLOBALS['egw']->link('/index.php',array(
'menuaction'=>self::$appname.'.filemanager_ui.index',
'path'=>$file_prefs['folderlink'.$i]));
for ($i=1; $i<=self::$foldercount; $i++)
{
if (!empty($file_prefs['folderlink'.$i]))
{
$foldername = array_pop(explode('/',$file_prefs['folderlink'.$i]));
$file[lang('Link %1: %2',$i,$foldername)]= $GLOBALS['egw']->link('/index.php',array(
'menuaction' => self::$appname.'.filemanager_ui.index',
'path' => $file_prefs['folderlink'.$i],
'nolang' => true,
));
}
}
display_sidebox(self::$appname,$title,$file);

View File

@ -56,26 +56,23 @@ class filemanager_ui
//or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type)
'path' => '/home/'.$GLOBALS['egw_info']['user']['account_lid'],
);
// check if user specified a valid startpath in his prefs --> use it
if (($path = $GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder']) &&
$path[0] == '/' && egw_vfs::is_dir($path) && egw_vfs::check_access($path))
{
$content['nm']['path'] = $path;
}
}
if (isset($_GET['msg'])) $msg = $_GET['msg'];
if (isset($_GET['path']) && ($path = $_GET['path'])
&& $path[0] == '/' && egw_vfs::is_dir($path)
&& egw_vfs::check_access($path,egw_vfs::READABLE))
if (isset($_GET['path']) && ($path = $_GET['path']))
{
if ($path[0] == '/' && egw_vfs::is_dir($path) && egw_vfs::check_access($path,egw_vfs::READABLE))
{
$content['nm']['path'] = $path;
}
else
{
if (isset($_GET['path'])) $msg .= lang('The requested path ').$_GET['path'].lang(' is not available.');
if (!empty($GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder'])
&& egw_vfs::is_dir($GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder'])
&& egw_vfs::check_access($GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder'],egw_vfs::READABLE))
{
if (isset($_GET['path'])) $msg .= ' '.lang('You will be redirected to your Start Folder.');
$content['nm']['path'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['startfolder'];
} else {
if (isset($_GET['path'])) $msg .= ' '.lang('You will be redirected to your Home Directory.');
$content['nm']['path'] = '/home/'.$GLOBALS['egw_info']['user']['account_lid'];
$msg .= lang('The requested path %1 is not available.',$path);
}
}
}

View File

@ -17,6 +17,7 @@ actions filemanager de Befehle
all subdirectories filemanager de Alle Unterverzeichnisse
allow a maximum of the above configured folderlinks to be configured in settings admin de erlaube das oben eingestellte Maximum an Konfigurationsoptionen im Setting für Links zu Verzeichnissen
and all it's childeren filemanager de und alle seine Kinder
basedirectory filemanager de Basisverzeichnis
cancel editing %1 without saving filemanager de Beende das Bearbeiten von %1 ohne zu Speichern
cannot create directory because it begins or ends in a space filemanager de Die Erstellung des Verzeichnisses schlug fehl, da es mit einem Leerzeichen beginnt oder endet
check all filemanager de Alle auswählen
@ -83,9 +84,10 @@ go home filemanager de Heimatverzeichnis
go to filemanager de Gehe zu
go to your home directory filemanager de Zu Ihrem Heimverzeichnis wechseln
go up filemanager de in das darüber liegende Verzeichnis wechseln
home directories filemanager de Persönliche Verzeichnisse
id filemanager de Id
inherited filemanager de Geerbt
is not available. filemanager de steht nicht zur Verfügung
link %1: %2 filemanager de %1. Verknüpfung: %2
location filemanager de Ort
max folderlinks admin de maximale Anzahl von Links zu Verzeichnissen
maximum size for uploads filemanager de Maximale Größe beim Hochladen
@ -119,7 +121,6 @@ renamed %1 to %2 filemanager de %1 nach %2 umbenannt
renamed %1 to %2. filemanager de %1 nach %2 umbenannt.
replaced %1 filemanager de %1 ersetzt
rights filemanager de Rechte
root filemanager de root
save %1 filemanager de %1 speichern
save %1, and go back to file listing filemanager de %1 speichern, und zurück zur Verzeichnisansicht
save changes filemanager de Änderungen speichern
@ -133,7 +134,7 @@ show link to filemanagers basedirectory (/) in side box menu? filemanager de Zei
size filemanager de Größe
sort folders always to the top? filemanager de Sortiere Verzeichnisse immer an den Anfang der Verzeichnisansicht
start search filemanager de Suche starten
the requested path filemanager de Der angeforderte Verzeichnispfad
the requested path %1 is not available. filemanager de Der angeforderte Verzeichnispfad %1 steht nicht zur Verfügung.
total files filemanager de Gesamtanzahl Dateien
unused space filemanager de Nicht benutzter Platz
up filemanager de Nach oben
@ -145,3 +146,4 @@ you need to select some files first! filemanager de Sie müssen zuerst die Datei
you will be redirected to your home directory. filemanager de Sie werden zu Ihrem Heimatverzeichnis geleitet
you will be redirected to your start folder. filemanager de Sie werden zu Ihrem Anfangs/Startverzeichnis geleitet
your home dir did not exist, egroupware created a new one. filemanager de Ihr Heimatverzeichnis hat nicht existiert. eGroupware hat ein neues für Sie angelegt
your home directory filemanager de Ihr persönliches Verzeichnis

View File

@ -17,11 +17,10 @@ actions filemanager en Actions
all subdirectories filemanager en All subdirectories
allow a maximum of the above configured folderlinks to be configured in settings admin en allow a maximum of the above configured folderlinks to be configured in settings
and all it's childeren filemanager en and all it's childeren
basedirectory filemanager en Basedirectory
cancel editing %1 without saving filemanager en Cancel editing %1 without saving
cannot create directory because it begins or ends in a space filemanager en Cannot create directory because it begins or ends in a space
check all filemanager en Check all
choosing dates where to-date is smaller than the from-date, will result in a search returning all entries but thoose between the two entered dates filemanager en Choosing dates where to-date is smaller than the from-date, will result in a search returning all entries but thoose between the two entered dates
choosing only one date (from/to) will result in a search returning all entries older/younger than the entered date filemanager en Choosing only one date (from/to) will result in a search returning all entries older/younger than the entered date
clear search filemanager en clear search
comment filemanager en Comment
comments cannot contain "%1" filemanager en Comments cannot contain "%1"
@ -68,7 +67,6 @@ executable filemanager en Executable
extended access control list filemanager en Extended access control list
extended acl filemanager en Extended ACL
failed to create directory! filemanager en Failed to create directory!
fake base dir did not exist, egroupware created a new one. filemanager en Fake Base Dir did not exist, eGroupWare created a new one.
file filemanager en File
file %1 already exists. please edit it or delete it first. filemanager en File %1 already exists. Please edit it or delete it first.
file %1 could not be created. filemanager en File %1 could not be created.
@ -86,9 +84,10 @@ go home filemanager en go home
go to filemanager en Go to
go to your home directory filemanager en Go to your home directory
go up filemanager en go up
home directories filemanager en Home directories
id filemanager en Id
inherited filemanager en Inherited
is not available. filemanager en is not available.
link %1: %2 filemanager en Link %1: %2
location filemanager en Location
max folderlinks admin en max folderlinks
maximum size for uploads filemanager en Maximum size for uploads
@ -122,7 +121,6 @@ renamed %1 to %2 filemanager en Renamed %1 to %2
renamed %1 to %2. filemanager en Renamed %1 to %2.
replaced %1 filemanager en Replaced %1
rights filemanager en Rights
root filemanager en root
save %1 filemanager en Save %1
save %1, and go back to file listing filemanager en Save %1, and go back to file listing
save changes filemanager en Save changes
@ -136,18 +134,16 @@ show link to filemanagers basedirectory (/) in side box menu? filemanager en Sho
size filemanager en Size
sort folders always to the top? filemanager en Sort folders always to the top?
start search filemanager en start search
the requested path filemanager en The requested path
the requested path %1 is not available. filemanager en The requested path %1 is not available.
total files filemanager en Total Files
unused space filemanager en Unused space
up filemanager en Up
updated comment for %1 filemanager en Updated comment for %1
upload fields filemanager en upload fields
upload files filemanager en Upload files
used space filemanager en Used space
who filemanager en Who
you do not have access to %1 filemanager en You do not have access to %1
you need to select an owner! filemanager en You need to select an owner!
you need to select some files first! filemanager en You need to select some files first!
you will be redirected to your home directory. filemanager en You will be redirected to your Home Directory.
you will be redirected to your start folder. filemanager en You will be redirected to your Start Folder.
your home dir did not exist, egroupware created a new one. filemanager en Your Home Dir did not exist, eGroupWare created a new one.
your home directory filemanager en Your home directory