phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] filemanager/inc hook_sidebox_menu.inc.php, 1.1 class.


From: ceb
Subject: [Phpgroupware-cvs] filemanager/inc hook_sidebox_menu.inc.php, 1.1 class.bofilemanager.inc.php, 1.18 class.uifilemanager.inc.php, 1.24
Date: Thu, 24 Feb 2005 15:29:14 -0000

Update of filemanager/inc

Added Files:
     Branch: MAIN
            hook_sidebox_menu.inc.php 
Modified Files:
     Branch: MAIN
            class.bofilemanager.inc.php lines: +124 -111
            class.uifilemanager.inc.php lines: +75 -18

Log Message:
update

====================================================
Index: hook_sidebox_menu.inc.php
<?php
        
/**************************************************************************\
        * phpGroupWare - projects's Sidebox-Menu for idots-template             
   *
        * http://www.phpgroupware.org                                           
   *
        * Written by Pim Snel <address@hidden>                                  
 *
        * --------------------------------------------                          
   *
        *  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: hook_sidebox_menu.inc.php,v 1.1 2005/02/08 00:06:31 ceb Exp $ */

         /*
                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
        */

        {
                        $appname = 'filemanager';
                        $menu_title = 
$GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu');

                        $file[] = array('text'  => 'Preferences',
                                                        'url'   => 
$GLOBALS['phpgw']->link('/index.php','menuaction=filemanager.uifilemanager.preferences'));

                        display_sidebox($appname,$menu_title,$file);
        }
?>

====================================================
Index: filemanager/inc/class.bofilemanager.inc.php
diff -u filemanager/inc/class.bofilemanager.inc.php:1.17 
filemanager/inc/class.bofilemanager.inc.php:1.18
--- filemanager/inc/class.bofilemanager.inc.php:1.17    Sat Jan 29 02:34:48 2005
+++ filemanager/inc/class.bofilemanager.inc.php Tue Feb  8 00:06:31 2005
@@ -577,13 +577,17 @@

                function f_apply_edit_comment()
                {
-                       for ($i=0;$i<count($this->fileman);$i++)
+                       for ($i=0;$i<count($this->fileman);++$i)
                        {
                                $file = $this->fileman[$i];
                                if 
(!$GLOBALS['phpgw']->vfs->set_attributes(array('string' => $file,'relatives' => 
array (RELATIVE_ALL),
                                                                                
                        'attributes' => array('comment' => stripslashes 
($this->changes[$file])))))
                                {
-                                       $result[] = lang('error: failed to 
change comment for : %1', $file);
+                                       $result[] = lang('failed to change 
comment for %1', $file);
+                               }
+                               else
+                               {
+                                       $result[] = lang('changed comment for 
%1', $file);
                                }
                        }
                        return is_array($result)?$result:True;
@@ -604,11 +608,7 @@
                                        //echo 
$GLOBALS['phpgw']->common->error_list (array ("File names cannot contain \\ or 
/"));
                                $result[] = lang('file names cannot contain \\ 
or /');
                                }
-                               elseif (!$GLOBALS['phpgw']->vfs->mv (array (
-                                                       'from'  => $from,
-                                                       'to'    => $to
-                                       ))
-                               )
+                               elseif 
(!$GLOBALS['phpgw']->vfs->mv(array('from' => $from,'to' => $to)))
                                {
                                        //echo 
$GLOBALS['phpgw']->common->error_list (array ('Could not rename 
'.$disppath.'/'.$from.' to '.$disppath.'/'.$to));
                                $result[] = lang('could not rename %1 to %2', 
$this->path.'/'.$from, $this->path.'/'.$to);
@@ -618,24 +618,23 @@
                                        $result[] = lang('renamed %1 to %2', 
$this->path.'/'.$this->path.'/'.$from, $to);
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_delete()
                {
-                       $result = Array();
-                       $numoffiles = count($this->fileman);
-                       for($i=0;$i!=$numoffiles;$i++)
+                       for($i=0;$i<count($this->fileman);++$i)
                        {
                                if($this->fileman[$i])
                                {
                                        $ls_array = 
$GLOBALS['phpgw']->vfs->ls(array(
                                                'string' => 
$this->path.SEP.$this->fileman[$i],
-                                               'relatives' => 
Array(RELATIVE_NONE),
+                                               'relatives' => 
array(RELATIVE_NONE),
                                                'checksubdirs' =>False,
-                                               'nofiles' => True
-                                               ));
+                                               'nofiles' => True));
+
                                        $fileinfo = $ls_array[0];
+
                                        if($fileinfo)
                                        {
                                                if($fileinfo['mime_type'] == 
'Directory')
@@ -648,40 +647,36 @@
                                                }
                                                
if($GLOBALS['phpgw']->vfs->delete(array(
                                                        'string' => 
$this->path.SEP.$this->fileman[$i],
-                                                       'relatives' => 
Array(RELATIVE_USER_NONE)
-                                                       )))
+                                                       'relatives' => 
Array(RELATIVE_USER_NONE))))
                                                {
-                                                       $result[] = 
lang('deleted: %1', $this->path.SEP.$this->fileman[$i]);
+                                                       $result[] = 
lang('deleted %1', $this->path.SEP.$this->fileman[$i]);
                                                }
                                                else
                                                {
-                                                       $result[] = lang('could 
not delete: %1',$this->path.SEP.$this->fileman[$i]);
+                                                       $result[] = lang('could 
not delete %1',$this->path.SEP.$this->fileman[$i]);
                                                }
                                        }
                                        else
                                        {
-                                               $result[] = lang('%1 does not 
exist!', $this->path.SEP.$this->fileman[$i]);
+                                               $result[] = lang('%1 does not 
exist', $this->path.SEP.$this->fileman[$i]);
                                        }
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_copy()
                {
-                       $result = Array();
-                       $numoffiles = count($this->fileman);
-                       for($i=0;$i!=$numoffiles;$i++)
+                       for($i=0;$i<count($this->fileman);++$i)
                        {
                                if($this->fileman[$i])
                                {
                                        if($GLOBALS['phpgw']->vfs->cp(array(
                                                'from' => 
$this->path.SEP.$this->fileman[$i],
                                                'to' => 
$this->todir.SEP.$this->fileman[$i],
-                                               'relatives' => 
Array(RELATIVE_NONE,RELATIVE_NONE)
-                                               )))
+                                               'relatives' => 
array(RELATIVE_NONE,RELATIVE_NONE))))
                                        {
-                                               $result[] = lang('file copied: 
%1 to 
%2'.$this->path.SEP.$this->fileman[$i],$this->todir.SEP.$this->fileman[$i]);
+                                               $result[] = lang('file %1 
copied to %2'. 
$this->todir.SEP.$this->fileman[$i],$this->path.SEP.$this->fileman[$i]);
                                        }
                                        else
                                        {
@@ -689,44 +684,38 @@
                                        }
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_move()
                {
-                       $result = Array();
-                       $numoffiles = count($this->fileman);
-                       for($i=0;$i!=$numoffiles;$i++)
+                       for($i=0;$i<count($this->fileman);++$i)
                        {
                                if($this->fileman[$i])
                                {
                                        if($GLOBALS['phpgw']->vfs->mv(array(
                                                'from' => 
$this->path.SEP.$this->fileman[$i],
                                                'to' => 
$this->todir.SEP.$this->fileman[$i],
-                                               'relatives' => 
Array(RELATIVE_NONE,RELATIVE_NONE)
-                                               )))
+                                               'relatives' => 
array(RELATIVE_NONE,RELATIVE_NONE))))
                                        {
-                                               $result[] = lang('file moved: 
%1 to %2',$this->path.SEP.$this->fileman[$i], 
$this->todir.SEP.$this->fileman[$i]);
+                                               $result[] = lang('file %1 moved 
to %2',$this->path.SEP.$this->fileman[$i], $this->todir.SEP.$this->fileman[$i]);
                                        }
                                        else
                                        {
-                                               $result[] = lang('could not 
move: %1 to %2',$this->path.SEP.$this->fileman[$i], 
$this->todir.SEP.$this->fileman[$i]);
+                                               $result[] = lang('could not 
move %1 to %2',$this->path.SEP.$this->fileman[$i], 
$this->todir.SEP.$this->fileman[$i]);
                                        }
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_download()
                {
-                       $result = Array();
-                       $numoffiles = count($this->fileman);
-                       for($i=0;$i!=$numoffiles;$i++)
+                       for($i=0;$i<count($this->fileman);++$i)
                        {
                                if($this->fileman[$i] && 
$GLOBALS['phpgw']->vfs->file_exists(array(
                                        'string' => 
$this->bo->path.SEP.$this->bo->fileman[$i],
-                                       'relatives' => Array(RELATIVE_NONE)
-                                       )))
+                                       'relatives' => Array(RELATIVE_NONE))))
                                {
                                        
execmethod($this->appname.'.ui'.$this->appname.'.view_file',
                                                Array(
@@ -741,12 +730,11 @@
                                        $result[] = lang('file does not exist: 
%1', $this->path.SEP.$this->fileman[$i]);
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_newdir()
                {
-                       $result = Array();
                        if ($this->params['newdir'] && $this->createdir)
                        {
                                if ($badchar = 
$this->bad_chars($this->createdir,True,True))
@@ -763,10 +751,10 @@

                                $ls_array = $GLOBALS['phpgw']->vfs->ls(array(
                                        'string' => 
$this->path.SEP.$this->createdir,
-                                       'relatives' => Array(RELATIVE_NONE),
+                                       'relatives' => array(RELATIVE_NONE),
                                        'checksubdirs' => False,
-                                       'nofiles' => True
-                                       ));
+                                       'nofiles' => True));
+
                                $fileinfo = $ls_array[0];

                                if ($fileinfo['name'])
@@ -784,8 +772,7 @@
                                {
                                        if ($GLOBALS['phpgw']->vfs->mkdir(array(
                                                'string' => 
$this->path.SEP.$this->createdir,
-                                               'relatives' => 
Array(RELATIVE_NONE)
-                                               )))
+                                               'relatives' => 
Array(RELATIVE_NONE))))
                                        {
                                                $result[] = lang('created 
directory %1', $this->path.SEP.$this->createdir);
                                                $this->path = 
$this->path.SEP.$this->createdir;
@@ -796,7 +783,7 @@
                                        }
                                }
                        }
-                       return $result;
+                       return is_array($result)?$result:True;
                }

                function f_newfile()
@@ -812,30 +799,27 @@
                                }
                                if($GLOBALS['phpgw']->vfs->file_exists(array(
                                        'string' => $this->createfile,
-                                       'relatives' => Array(RELATIVE_ALL)
-                                       )))
+                                       'relatives' => array(RELATIVE_ALL))))
                                {
-                                       $result[] = lang('file %1 already 
exists.  Please edit it or delete it first', $this->path.SEP.$this->createfile);
+                                       $result[] = lang('file %1 already 
exists. Please edit it or delete it first', $this->path.SEP.$this->createfile);
                                        return $result;
                                }
                                if(!$GLOBALS['phpgw']->vfs->touch(array(
                                        'string' => $this->createfile,
-                                       'relatives' => Array(RELATIVE_ALL)
-                                       )))
+                                       'relatives' => Array(RELATIVE_ALL))))
                                {
                                        $result[] = lang('file %1 could not be 
created', $this->path.SEP.$this->createfile);
                                }
                        }
                        else
                        {
-                               $result[] = lang('filename not provided!');
+                               $result[] = lang('filename not provided');
                        }
                        return is_array($result)?$result:True;
                }

                function f_upload()
                {
-                       $result = Array();
                        for ($i = 0;$i<$this->show_upload_boxes;++$i)
                        {
                                if ($badchar = $this->bad_chars 
($this->upload_file['name'][$i], True, True))
@@ -872,85 +856,71 @@
                                {
                                        if ($fileinfo['name'] && 
$fileinfo['deleteable'] != 'N')
                                        {
-                                               if (
-                                                               
$GLOBALS['phpgw']->vfs->cp (array (
+                                               
if($GLOBALS['phpgw']->vfs->cp(array(
                                                                        'from'  
=> $this->upload_file['tmp_name'][$i],
                                                                        'to'    
=> $this->upload_file['name'][$i],
-                                                                       
'relatives'     => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
-                                                               )
-                                                       )
-                                               ) {
-                                                       
$GLOBALS['phpgw']->vfs->set_attributes (array (
+                                                                       
'relatives'     => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
+                                               {
+                                                       
$GLOBALS['phpgw']->vfs->set_attributes(array(
                                                                        
'string'        => $this->upload_file['name'][$i],
-                                                                       
'relatives'     => array (RELATIVE_ALL),
-                                                                       
'attributes'    => array (
+                                                                       
'relatives'     => array(RELATIVE_ALL),
+                                                                       
'attributes'    => array(
                                                                                
                'owner_id' => $GLOBALS['userinfo']['account_id'],
                                                                                
                'modifiedby_id' => $GLOBALS['userinfo']['account_id'],
                                                                                
                'modified' => $now,
                                                                                
                'size' => $this->upload_file['size'][$i],
                                                                                
                'mime_type' => $this->upload_file['type'][$i],
                                                                                
                'deleteable' => 'Y',
-                                                                               
                'comment' => stripslashes ($upload_comment[$i])
-                                                                               
        )
-                                                               )
-                                                       );
-
-                                               } else {
+                                                                               
                'comment' => stripslashes ($upload_comment[$i]))));
+                                                       $result[] = 
lang('replaced %1 (%2 
bytes)',$this->path.'/'.$this->upload_file['name'][$i],$this->upload_file['size'][$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 (
-                                                       
$GLOBALS['phpgw']->vfs->cp (array (
+                                               
if($GLOBALS['phpgw']->vfs->cp(array(
                                                                        'from'  
=> $this->upload_file['tmp_name'][$i],
                                                                        'to'    
=> $this->upload_file['name'][$i],
-                                                                       
'relatives'     => array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
-                                                               )
-                                                       )
-                                               ) {
-
-                                                       
$GLOBALS['phpgw']->vfs->set_attributes (array (
+                                                                       
'relatives'     => array(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
+                                               {
+                                                       
$GLOBALS['phpgw']->vfs->set_attributes(array(
                                                                        
'string'        => $this->upload_file['name'][$i],
-                                                                       
'relatives'     => array (RELATIVE_ALL),
+                                                                       
'relatives'     => array(RELATIVE_ALL),
                                                                        
'attributes'    => array (
                                                                                
                'mime_type' => $this->upload_file['type'][$i],
-                                                                               
                'comment' => stripslashes ($this->upload_comment[$i])
-                                                                               
        )
-                                                               )
-                                                       );
-                                               } else {
+                                                                               
                'comment' => stripslashes ($this->upload_comment[$i]))));
+                                                       $result[] = 
lang('created %1 (%2 bytes)',$this->path.'/'.$this->upload_file['name'][$i] , 
$this->upload_file['size'][$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])
                                {
-                                       $GLOBALS['phpgw']->vfs->touch (array (
+                                       $GLOBALS['phpgw']->vfs->touch(array(
                                                        'string'        => 
$this->upload_file['name'][$i],
-                                                       'relatives'     => 
array (RELATIVE_ALL)
-                                               )
-                                       );
+                                                       'relatives'     => 
array(RELATIVE_ALL)));

-                                       $GLOBALS['phpgw']->vfs->set_attributes 
(array (
+                                       
$GLOBALS['phpgw']->vfs->set_attributes(array(
                                                        'string'        => 
$this->upload_file['name'][$i],
-                                                       'relatives'     => 
array (RELATIVE_ALL),
-                                                       'attributes'    => 
array (
+                                                       'relatives'     => 
array(RELATIVE_ALL),
+                                                       'attributes'    => 
array(
                                                                                
'mime_type' => $this->upload_file['type'][$i],
-                                                                               
'comment' => $this->upload_comment[$i]
-                                                                       )
-                                               )
-                                       );
+                                                                               
'comment' => $this->upload_comment[$i])));

-                                       $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];
                                }
                        }
-                       return $result;
+                       if(is_array($result))
+                       {
+                               return $result;
+                       }
+                       return True;
                }

                /**TODO : xslt-ise this */
@@ -966,7 +936,7 @@
                                }
                                else
                                {
-                                       $help = "open_popup('" . $link . 
"','250','150')";
+                                       $help = "open_popup('" . $link . 
"','250','250')";
                                }
                                return $help;
                        }
@@ -1034,11 +1004,11 @@

                        if($size<1024)
                        {
-                               return $left.$size.'&nbsp;B&nbsp;&nbsp;'.$right;
+                               return $left.$size.' B '.$right;
                        }
                        else
                        {
-                               return 
$left.round($size/1024).'&nbsp;KB'.$right;
+                               return $left.round($size/1024).' KB'.$right;
                        }
                }

@@ -1141,14 +1111,57 @@
                # This should be used with anything in an HTML tag that might 
contain < or >
                ###

-               function html_encode($string, $return)
+               function html_encode($string,$return)
                {
                        return($this->eor(htmlspecialchars($string),$return));
                }

-       /*      function translate ($text)
-               {
-                       return($GLOBALS['phpgw']->lang($text));
-               }*/
+               #######
+               # Returns the amount of file(s) in a certain Path
+               # either recursive or non recursive
+               #######
+               function count_files($path,$subdirs)
+               {
+                       $ls_array = $GLOBALS['phpgw']->vfs->ls(array(
+                                       'string'        => $path,
+                                       'relatives'     => array 
(RELATIVE_NONE),
+                                       'checksubdirs'  => $subdirs));
+
+                       $ls_dirs = $GLOBALS['phpgw']->vfs->ls(array(
+                                       'string'        => $path,
+                                       'relatives'     => array 
(RELATIVE_NONE),
+                                       'checksubdirs'  => $subdirs,
+                                       'mime_type' => 'Directory'));
+                       return (count($ls_array)-count($ls_dirs));
+               }
+
+               ########
+               # Return the size of either a File or a Directory
+               ########
+               function get_size($files,$homedir)
+               {
+                       if($homedir)
+                       {
+                               $size = $GLOBALS['phpgw']->vfs->get_size(array(
+                                               'string'        => 
$this->homedir,
+                                               'checksubdirs'  => True,
+                                               'relatives'     => array 
(RELATIVE_NONE)));
+                       }
+                       elseif($files['mime_type']=='Directory')
+                       {
+                               $size = $GLOBALS['phpgw']->vfs->get_size(array(
+                                                       'string'        => 
$files['directory'] . '/' . $files['name'],
+                                                       'checksubdirs'  => True,
+                                                       'relatives'     => 
array (RELATIVE_NONE)));
+                       }
+                       else
+                       {
+                               $size = $GLOBALS['phpgw']->vfs->get_size(array(
+                                                       'string'        => 
$files['directory'] . '/' . $files['name'],
+                                                       'checksubdirs'  => 
False,
+                                                       'relatives'     => 
array(RELATIVE_NONE)));
+                       }
+                       return $size;
+               }
        }
 ?>

====================================================
Index: filemanager/inc/class.uifilemanager.inc.php
diff -u filemanager/inc/class.uifilemanager.inc.php:1.23 
filemanager/inc/class.uifilemanager.inc.php:1.24
--- filemanager/inc/class.uifilemanager.inc.php:1.23    Sat Jan 29 02:34:48 2005
+++ filemanager/inc/class.uifilemanager.inc.php Tue Feb  8 00:06:31 2005
@@ -72,8 +72,8 @@
                        $this->action                   = 
CreateObject('filemanager.uiaction_base');
                        $this->bofilemanager    = $this->action->bofilemanager;
                        $this->fileman                  = 
$this->bofilemanager->fileman;
-                       //$this->nextmatchs             = 
CreateObject('phpgwapi.nextmatchs');
-                       //$this->browser                = 
CreateObject('phpgwapi.browser');
+                       $this->path                             = 
$this->bofilemanager->path;
+                       $this->homedir                  = 
$this->bofilemanager->homedir;

                        $this->check_access();
                        $this->update();
@@ -156,6 +156,8 @@
                {
                        $params = get_var('params',array('POST','GET'));

+
+                       //_debug_array($params);
                        if($_GET['show_upload_boxes'])
                        {
                                
$GLOBALS['phpgw']->preferences->read_repository();
@@ -224,7 +226,7 @@
                        {
                                foreach($params as $true => $action)
                                {
-                                       if(in_array($action,$functions))
+                                       if($action != '' && 
in_array($action,$functions))
                                        {
                                                switch($action)
                                                {
@@ -233,35 +235,51 @@
                                                                $edit = 
$this->bofilemanager->get_fileman();
                                                                
$this->bofilemanager->save_sessiondata($edit,'changes');
                                                                break;
+                                                       case 'edit_comments':
+                                                               
$link_data['edit_comments'] = True;
+                                                               $edit = 
$this->bofilemanager->get_fileman();
+                                                               
$this->bofilemanager->save_sessiondata($edit,'changes');
+
+                                                               
if(!$this->bofilemanager->settings['comment'])
+                                                               {
+                                                                       
$GLOBALS['phpgw']->preferences->read_repository();
+                                                                       
$GLOBALS['phpgw']->preferences->change('filemanager','comment','comment');
+                                                                       
$GLOBALS['phpgw']->preferences->save_repository();
+                                                               }
+                                                               break;
                                                        case 'edit':
                                                                
$link_data['menuaction'] = $this->bofilemanager->appname.'.uiaction_edit.edit';
                                                                break;
+                                                       case 'go':
+                                                               
$link_data['path'] = urlencode($this->bofilemanager->todir);
+                                                               break;
                                                        default:
                                                                
if(in_array($action,$bo_functions))
                                                                {
                                                                        //echo 
' bofunction: f_' . $action;
                                                                        
$f_function = 'f_'.$action;
-                                                                       $error 
= $this->bofilemanager->$f_function();
+                                                                       $msg = 
$this->bofilemanager->$f_function();

-                                                                       
if($action == 'newfile' && !is_array($error))
+                                                                       
if($action == 'newfile' && !is_array($msg))
                                                                        {
                                                                                
$link_data['menuaction']        = 
$this->bofilemanager->appname.'.uiaction_edit.edit';
                                                                                
$link_data['file']                      = 
urlencode($this->bofilemanager->createfile);
                                                                        }
-                                                                       
elseif(is_array($error))
+                                                                       
elseif(is_array($msg))
                                                                        {
-                                                                               
$var['errors'] = implode("\n",$error);
+                                                                               
$var['msg'] = implode("\n",$msg);
                                                                        }
                                                                }
                                                                break;
                                                }
                                        }
-                                       else
+                                       elseif($action != '')
                                        {
-                                               $var['errors'] = lang('unknown 
action!');
+                                               $var['msg'] = lang('unknown 
action');
                                        }
                                }
                        }
+                       $link_data['msg'] = $var['msg'];
                        
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                }

@@ -276,16 +294,16 @@
                                        (
                                                'type'  => 'submit',
                                                'name'  => 'save',
-                                               'value' => lang('save'),
-                                               'caption' => 
$this->bofilemanager->build_help('save')
+                                               'value' => lang('save')
+                                               //'caption' => 
$this->bofilemanager->build_help('save')
                                        );
                                        $var[] = array('height' => 
'50','valign' => 'bottom','widget' => $button);
                                        $button = array
                                        (
                                                'type'  => 'submit',
                                                'name' => 'cancel',
-                                               'value' => lang('cancel'),
-                                               'caption' => 
$this->bofilemanager->build_help('cancel')
+                                               'value' => lang('cancel')
+                                               //'caption' => 
$this->bofilemanager->build_help('cancel')
                                        );
                                        $var[] = array('align' => 
'right','height' => '50','valign' => 'bottom','widget' => $button);
                                        break;
@@ -658,6 +676,21 @@
                                                                                
}
                                                                        }
                                                                        break;
+                                                       case 'comment':
+                                                                       if 
($edit_comments && $this->bofilemanager->changes[$file['name']] == 
$file['name'])
+                                                                       {
+                                                                               
$file_output[$i][$internal] = array('widget' => array('type' => 'text',
+                                                                               
                                                                                
                        'name' => 'changes['.$file['name'].']',
+                                                                               
                                                                                
                        'value' => $file[$internal]));
+                                                                       }
+                                                                       else
+                                                                       {
+                                                                               
$file_output[$i][$internal] = $file[$internal];
+                                                                       }
+                                                                       break;
+                                                       case 'size':
+                                                               
$file_output[$i][$internal] = $this->bofilemanager->borkb($file[$internal]);
+                                                               break;
                                                        default:
                                                                        
$file_output[$i][$internal] = $file[$internal];
                                                }
@@ -665,12 +698,31 @@
                                }
                        }

+                                                               /*      if 
($quota == -1 || $quota == 0)
+                                                                       {
+                                                                               
html_text ('',NULL,1);
+                                                                       }
+                                                                       else
+                                                                       {
+                                                                               
html_text_bold (lang('Unused space').': ');
+                                                                               
html_text (borkb ($quota - get_size($GLOBALS['homedir'],True), NULL, 1));
+                                                                       }
+                                                                               
$i = count_files($GLOBALS['homedir'],True);
+
+                                                                               
html_break (2);
+                                                                               
html_text_bold (lang('Total Files').': '); */
+
                        $data = array
                        (
                                'summary' =>  array
                                (
-                                       'file_count' => count($files_array),
-                                       'usage' => $usage
+                                       'file_count'            => 
$this->bofilemanager->count_files($this->path,False),
+                                       'lang_files'            => 
lang('files'),
+                                       'lang_space'            => lang('used 
space'),
+                                       'lang_unused'           => lang('unused 
space'),
+                                       'usage'                         => 
$this->bofilemanager->borkb($this->bofilemanager->get_size($this->homedir,True)),
+                                       'files_total'           => 
$this->bofilemanager->count_files($this->homedir,True),
+                                       'lang_files_total'      => lang('files 
total')
                                ),
                                'files' => array
                                (
@@ -794,11 +846,16 @@
                                }
                        }

-                       if (strlen($this->bofilemanager->errors))
+                       /*if (strlen($this->bofilemanager->errors))
                        {
                                $data['errors'] = $this->bofilemanager->errors;
+                       }*/
+
+                       if(strlen($_GET['msg']) > 0)
+                       {
+                               $data['msg'] = $_GET['msg'];
                        }
-
+
                        if ($rename_files || $edit_comments)
                        {
                                $data['rename'] = array






reply via email to

[Prev in Thread] Current Thread [Next in Thread]