- fixed group files (essential for sharing files)

- make all buttons work in IE (for some people quite usefull :)
- some lay-out improvements
- fixed save and done button in file edit mode
- add sidebox menu
- re-arranged toolbars (still not finished)
- new location selectbox
- some speed improvements
This commit is contained in:
Pim Snel 2003-12-08 23:18:34 +00:00
parent f2bc951d3f
commit c1698d2f2b
7 changed files with 947 additions and 858 deletions

View File

@ -44,27 +44,35 @@
var $prefs;//array
var $groups_applications;
//originally post_vars
var $goto;
// var $goto;
var $goto_x;
var $download_x;
var $todir;
var $changedir; // for switching dir.
var $cdtodir; // for switching dir.
var $createdir;
var $newfile_or_dir;
var $newdir;
var $newfile;
var $newdir_x;
var $newfile_x;
var $createfile;
var $delete;
var $delete_x;
var $renamefiles;
var $rename;
var $move_to;
var $copy_to;
var $edit;
var $rename_x;
var $move_to_x;
// var $copy_to;
var $copy_to_x;
var $edit_x;
var $edit_comments_x;
var $edit_file;
var $edit_preview;
var $edit_save;
var $edit_save_done;
var $edit_cancel;
var $edit_preview_x;
var $edit_save_x;
var $edit_save_done_x;
var $edit_cancel_x;
var $comment_files;
var $upload;
var $upload_x;
var $uploadprocess;
// this ones must be checked thorougly;
@ -173,7 +181,7 @@
function index()
{
if ($noheader || $nofooter || ($this->download && (count ($this->fileman) > 0)))
if ($noheader || $nofooter || ($this->download_x && (count ($this->fileman) > 0)))
{
$noheader = True;
$nofooter = True;
@ -197,7 +205,7 @@
}
// var_dump($GLOBALS[HTTP_POST_VARS]);
//var_dump($this->delete_x);
# Page to process users
# Code is fairly hackish at the beginning, but it gets better
@ -206,10 +214,16 @@
###
# Some hacks to set and display directory paths correctly
###
if ($this->goto)
/*
if ($this->goto || $this->goto_x)
{
$this->path = $this->todir;
$this->path = $this->cdtodir;
}
*/
// new method for switching to a new dir.
if($this->changedir=='true' && $this->cdtodir || $this->goto_x)
{
$this->path = $this->cdtodir;
}
if (!$this->path)
@ -262,14 +276,14 @@
}
}
$groups_applications = array ();
$this->groups_applications = array ();
while (list ($num, $group_array) = each ($this->readable_groups))
{
$group_id = $GLOBALS['phpgw']->accounts->name2id ($group_array['account_name']);
$applications = CreateObject('phpgwapi.applications', $group_id);
$groups_applications[$group_array['account_name']] = $applications->read_account_specific ();
$this->groups_applications[$group_array['account_name']] = $applications->read_account_specific ();
}
# We determine if they're in their home directory or a group's directory,
@ -366,11 +380,11 @@
# main action switch
// FIXME this will become a switch
if($this->newfile && $this->newfile_or_dir) // create new textfile
if($this->newfile_x && $this->newfile_or_dir) // create new textfile
{
$this->createfile();
}
elseif($this->newfile_or_dir && $this->newdir)
elseif($this->newfile_or_dir && $this->newdir_x)
{
$this->createdir();
}
@ -378,19 +392,19 @@
{
$this->fileUpload();
}
elseif ($this->upload || $this->show_upload_boxes)
elseif ($this->upload_x || $this->show_upload_boxes)
{
$this->showUploadboxes();
}
elseif ($this->copy_to)
elseif ($this->copy_to_x)
{
$this->copyTo();
}
elseif ($this->move_to)
elseif ($this->move_to_x)
{
$this->moveTo();
}
elseif ($this->download)
elseif ($this->download_x)
{
$this->download();
}
@ -402,16 +416,16 @@
{
$this->editComment();
}
elseif ($this->edit_cancel)
elseif ($this->edit_cancel_x)
{
$this->readFilesInfo();
$this->fileListing();
}
elseif ($this->edit || $this->edit_preview || $this->edit_save)
elseif ($this->edit_x || $this->edit_preview_x || $this->edit_save_x || $this->edit_save_done_x)
{
$this->edit();
}
elseif ($this->delete)
elseif ($this->delete_x)
{
$this->delete();
}
@ -445,6 +459,7 @@
$vars[toolbar0]=$this->toolbar('location');
$vars[toolbar1]=$this->toolbar('list_nav');
if($this->messages) $this->messages='<p>'.$this->messages.'</p>';
$vars[messages]=$this->messages;
$this->t->set_var($vars);
@ -471,7 +486,7 @@
}
}
$this->t->set_var('row_tr_color','#cbcbcb');
$this->t->set_var('row_tr_color','#dedede');
$this->t->parse('rows','row');
$this->t->pparse('out','row');
}
@ -488,7 +503,7 @@
$link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->lesspath);
$col_data='<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('filemanager','folder').' "alt="'.lang('Folder').'" /></a>';
$col_data='<a href="'.$link.'"><img src="'.$GLOBALS['phpgw']->common->image('filemanager','mime16up').' "alt="'.lang('Folder Up').'" /></a>';
$col_data.='&nbsp;<a href="'.$link.'">..</a>';
$this->t->set_var('col_data',$col_data);
@ -508,12 +523,12 @@
}
# List all of the files, with their attributes
reset ($this->files_array);
@reset ($this->files_array);
for ($i = 0; $i != $this->numoffiles; $i++)
{
$files = $this->files_array[$i];
if ($this->rename || $this->edit_comments)
if ($this->rename_x || $this->edit_comments_x)
{
unset ($this_selected);
unset ($renamethis);
@ -528,11 +543,11 @@
}
}
if ($this->rename && $this_selected)
if ($this->rename_x && $this_selected)
{
$renamethis = 1;
}
elseif ($this->edit_comments && $this_selected)
elseif ($this->edit_comments_x && $this_selected)
{
$edit_this_comment = 1;
}
@ -544,7 +559,7 @@
}
# Checkboxes
if (!$this->rename && !$this->edit_comments && $this->path != $GLOBALS['fakebase'] && $this->path != '/')
if (!$this->rename_x && !$this->edit_comments_x && $this->path != $GLOBALS['fakebase'] && $this->path != '/')
{
$cbox='<input type="checkbox" name="fileman['.$i.']" value="'.$files['name'].'">';
$this->t->set_var('actions',$cbox);
@ -727,7 +742,7 @@
}
// when renaming or changing comments render extra sumbmit button
if ($this->rename || $this->edit_comments)
if ($this->rename_x || $this->edit_comments_x)
{
$col_data='<br/><input type="submit" name="save_changes" value="'.lang('Save changes').'">';
$this->t->set_var('col_data',$col_data);
@ -798,7 +813,7 @@
while (list ($num, $group_array) = each ($this->readable_groups))
{
# If the group doesn't have access to this app, we don't show it
if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
if (!$this->groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
{
continue;
}
@ -854,13 +869,11 @@
case 'location':
$toolbar='
<div id="fmLocation">
'.lang('location').':&nbsp;<input id="fmInputLocation" type="text" size="50" name="location" value="'.$this->disppath.'"/>
</div>';
break;
case 'list_nav':
$toolbar='
<table cellspacing="1" cellpadding="0" border="0">
<tr>
';
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';
$toolbar.='
<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
// go up icon when we're not at the top
@ -871,7 +884,7 @@
}
// go home icon when we're not home already
if ($this->path == $GLOBALS['homedir'])
if ($this->path != $GLOBALS['homedir'])
{
$link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$GLOBALS['homedir']);
$toolbar.=$this->buttonImage($link,'home',lang('go home'));
@ -881,68 +894,107 @@
$link=$this->encode_href('/index.php','menuaction=filemanager.uifilemanager.index','path='.$this->path);
$toolbar.=$this->buttonImage($link,'reload',lang('reload'));
$toolbar.='<td>'.lang('Location').':&nbsp;';
//$toolbar.='<input id="fmInputLocation" type="text" size="20" disabled="disabled" name="location" value="'.$this->disppath.'"/>&nbsp;';
$current_option='<option>'.$this->disppath.'</option>';
// selectbox for change/move/and copy to
$dirs_options=$this->all_other_directories_options();
$toolbar.='<td><select name="todir">'.$dirs_options.'</select></td>';
$toolbar.='<select name="cdtodir" onChange="document.formfm.changedir.value=\'true\';document.formfm.submit()">'.$current_option.$dirs_options.'</select>
<input type="hidden" name="changedir" value="false"></td>
';
$toolbar.=$this->inputImage('goto','goto','Quick jump to');
// upload button
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add)
{
if (!$this->rename && !$this->edit_comments)
{
// copy and move buttons
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'])
{
$toolbar.=$this->inputImage('copy_to','copy_to',lang('Copy to'));
$toolbar.=$this->inputImage('move_to','move_to',lang('Move to'));
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
// $toolbar.=$this->inputImage('download','download',lang('Download'));
// upload button
$toolbar.=$this->inputImage('upload','upload',lang('Upload'));
}
$toolbar.='</tr></table>';
$toolbar.='</div>';
break;
case 'list_nav':
$toolbar='
<table cellspacing="1" cellpadding="0" border="0">
<tr>';
// selectbox for change/move/and copy to
// submit buttons for
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'])
{
if (!$this->rename && !$this->edit_comments)
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';
$toolbar.='
<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
if (!$this->rename_x && !$this->edit_comments_x)
{
// edit text file button
$toolbar.=$this->inputImage('edit','edit',lang('edit'));
}
if (!$this->edit_comments)
if (!$this->edit_comments_x)
{
$toolbar.=$this->inputImage('rename','rename',lang('Rename'));
}
if (!$this->rename && !$this->edit_comments)
if (!$this->rename_x && !$this->edit_comments_x)
{
$toolbar.=$this->inputImage('delete','delete',lang('Delete'));
}
if (!$this->rename)
if (!$this->rename_x)
{
$toolbar.=$this->inputImage('edit_comments','edit_comments',lang('Edit comments'));
}
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
}
// $toolbar.='</tr></table>';
if (!$this->rename_x && !$this->edit_comments_x)
{
// copy and move buttons
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'])
{
$toolbar3.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';
$toolbar3.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
$dirs_options=$this->all_other_directories_options();
$toolbar3.='<td><select name="todir">'.$dirs_options.'</select></td>';
$toolbar3.=$this->inputImage('copy_to','copy_to',lang('Copy to'));
$toolbar3.=$this->inputImage('move_to','move_to',lang('Move to'));
$toolbar3.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
}
// create dir and file button
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add)
{
$toolbar.='<td><input type=text size="15" name="newfile_or_dir" value="" /></td>';
$toolbar.=$this->inputImage('newdir','createdir',lang('Create Folder'));
$toolbar.=$this->inputImage('newfile','createfile',lang('Create File'));
$toolbar3.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('phpgwapi','buttonseparator').'" height="27" width="8"></td>';
$toolbar3.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="1"></td>';
$toolbar3.='<td><input type=text size="15" name="newfile_or_dir" value="" /></td>';
$toolbar3.=$this->inputImage('newdir','createdir',lang('Create Folder'));
$toolbar3.=$this->inputImage('newfile','createfile',lang('Create File'));
}
$toolbar.='<td><img alt="spacer" src="'.$GLOBALS['phpgw']->common->image('filemanager','spacer').'" height="27" width="3"></td>';
// download button
if ($this->path != '/' && $this->path != $GLOBALS['fakebase'] && $this->can_add)
if($toolbar3)
{
$toolbar.=$this->inputImage('download','download',lang('Download'));
$toolbar.=$toolbar3;
/* $toolbar.='
<table cellspacing="1" cellpadding="0" border="0">
<tr>'.$toolbar3;*/
}
// upload button
$toolbar.=$this->inputImage('upload','upload',lang('Upload'));
}
$toolbar.='</tr></table>';
break;
default:$x='';
}
@ -1169,7 +1221,7 @@
function createdir()
{
if ($this->newdir && $this->newfile_or_dir)
if ($this->newdir_x && $this->newfile_or_dir)
{
if ($this->bo->badchar = $this->bo->bad_chars ($this->newfile_or_dir, True, True))
{
@ -1224,20 +1276,25 @@
function delete()
{
for ($i = 0; $i != $this->numoffiles; $i++)
if( is_array($this->fileman) && count($this->fileman) >= 1)
{
if ($this->fileman[$i])
foreach($this->fileman as $filename)
{
if ($this->bo->vfs->delete (array ('string' => $this->fileman[$i])))
if ($this->bo->vfs->delete (array ('string' => $filename)))
{
$this->messages .= lang('Deleted %1', $this->disppath.'/'.$this->fileman[$i]).'<br/>';
$this->messages .= lang('Deleted %1', $this->disppath.'/'.$filename).'<br/>';
}
else
{
$this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('Could not delete %1', $this->disppath.'/'.$this->fileman[$i])));
$this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('Could not delete %1', $this->disppath.'/'.$filename)));
}
}
}
else
{
// make this a javascript func for quicker respons
$this->messages=$GLOBALS['phpgw']->common->error_list (array (lang('Please select a file to delete.')));
}
$this->readFilesInfo();
$this->filelisting();
}
@ -1372,7 +1429,7 @@
$this->edit_file_content = stripslashes ($this->edit_file_content);
}
if ($this->edit_preview)
if ($this->edit_preview_x)
{
$content = $this->edit_file_content;
@ -1380,20 +1437,20 @@
$vars[preview_content]=nl2br($content);
}
elseif ($this->edit_save || $this->edit_save_done)
elseif ($this->edit_save_x || $this->edit_save_done_x)
{
$content = $this->edit_file_content;
$content = $this->edit_file_content;
//die( $content);
if ($this->bo->vfs->write (array (
'string' => $this->edit_file,
'relatives' => array (RELATIVE_ALL),
'content' => $content
))
)
)))
{
$this->messages=lang('Saved %1', $this->path.'/'.$this->edit_file);
if($this->edit_save_done)
if($this->edit_save_done_x)
{
$this->readFilesInfo();
$this->fileListing();
@ -1586,7 +1643,7 @@
while (list ($num, $group_array) = each ($this->readable_groups))
{
# Don't list directories for groups that don't have access
if (!$groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
if (!$this->groups_applications[$group_array['account_name']][$GLOBALS['appname']]['enabled'])
{
continue;
}

View File

@ -0,0 +1,33 @@
<?php
/**************************************************************************\
* phpGroupWare - Calendar's Sidebox-Menu for idots-template *
* http://www.phpgroupware.org *
* Written by Pim Snel <pim@lingewoud.nl> *
* -------------------------------------------- *
* 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) any later version. *
\**************************************************************************/
/* $Id$ */
{
/*
This hookfile is for generating an app-specific side menu used in the idots
template set.
$menu_title speaks for itself
$file is the array with link to app functions
display_sidebox can be called as much as you like
*/
$menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu');
$file = Array(
array('','text'=>'Filemanager Preferences','link'=>$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=filemanager')),
);
display_sidebox($appname,$menu_title,$file);
}
?>

View File

@ -24,6 +24,7 @@
'admin',
'deleteaccount',
'settings',
'sidebox_menu',
'preferences'
);

View File

@ -1,25 +1,23 @@
<!-- BEGIN filemanager_header -->
<form method="post" action="{form_action}">
<br/>
{messages}
<br/>
<form name="formfm" method="post" action="{form_action}">
{toolbar0}
<div id="fmMenu">
{toolbar1}
</div>
<div id="fmFileWindow">
<table>
{messages} <table cellspacing="0" cellpadding="2">
<tbody>
<!-- END filemanager_header -->
<!-- BEGIN column -->
<td valign="top">{col_data}&nbsp;</td>
<td valign="top" style="padding-left:2px;padding-right:2px;">{col_data}&nbsp;</td>
<!-- END column -->
<!-- BEGIN row -->
<tr bgcolor="{row_tr_color}">
<td>{actions}</td>
<td style="padding-left:2px;padding-right:2px;">{actions}</td>
{columns}
</tr>
<!-- END row -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -1,11 +1,11 @@
<!-- BEGIN index -->
<table width="100%" border="1" cols="{colspan}">
<tr>
<!--<tr>
<td align="center" colspan="{colspan}">{error}
</td>
</tr>
</tr>-->
<tr>
<td align="center" colspan="{colspan}">
<td align="center" colspan="{colspan}">{error}
<form action="{form_action}" method="post">
<table width="100%" border="1">
<tr{tr_extras}>

View File

@ -1,16 +1,16 @@
<!-- BEGIN upload_header -->
<form method="post" action="{form_action}" enctype="multipart/form-data">
<div>
<table>
<table cellspacing="0" cellpadding="2">
<tbody>
<tr bgcolor="{row_tr_color}">
<tr bgcolor="#dedede">
<td><strong>{lang_file}</strong></td>
<td><strong>{lang_comment}</strong></td>
</tr>
<!-- END upload_header -->
<!-- BEGIN row -->
<tr bgcolor="{row_tr_color}">
<tr >
<td><input maxlength="255" name="upload_file[]" type="file"></td>
<td><input name="upload_comment[]" type="text"></td>
</tr>