phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] filemanager/inc class.uifilemanager.inc.php, 1.8 clas


From: ceb
Subject: [Phpgroupware-cvs] filemanager/inc class.uifilemanager.inc.php, 1.8 class.uiaction_edit.inc.php, 1.4
Date: Thu, 24 Feb 2005 14:54:25 -0000

Update of filemanager/inc

Modified Files:
     Branch: MAIN
            class.uifilemanager.inc.php lines: +192 -210
            class.uiaction_edit.inc.php lines: +2 -2

Log Message:
update for xslt

====================================================
Index: filemanager/inc/class.uifilemanager.inc.php
diff -u filemanager/inc/class.uifilemanager.inc.php:1.7 
filemanager/inc/class.uifilemanager.inc.php:1.8
--- filemanager/inc/class.uifilemanager.inc.php:1.7     Tue Jan 18 16:47:52 2005
+++ filemanager/inc/class.uifilemanager.inc.php Tue Jan 18 23:54:13 2005
@@ -69,10 +69,10 @@
                {
                        $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
                        //$this->no_header();
-                       $this->actions = CreateObject('filemanager.uiactions');
-                       $this->bo = CreateObject('filemanager.bofilemanager');
-                       $this->nextmatchs = CreateObject('phpgwapi.nextmatchs');
-                       $this->browser = CreateObject('phpgwapi.browser');
+                       $this->actions                  = 
CreateObject('filemanager.uiactions');
+                       $this->bofilemanager    = 
CreateObject('filemanager.bofilemanager');
+                       $this->nextmatchs               = 
CreateObject('phpgwapi.nextmatchs');
+                       $this->browser                  = 
CreateObject('phpgwapi.browser');
                        //$this->template_dir = 
$GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']);
                        $this->check_access();
                        $this->create_home_dir();
@@ -105,21 +105,21 @@

                function check_access()
                {
-                       if($this->bo->path != $this->bo->homedir && 
$this->bo->path != $this->bo->fakebase && $this->bo->path != '/' && 
!$this->bo->vfs->acl_check(array(
-                               'string'=>$this->bo->path,
+                       if($this->bofilemanager->path != 
$this->bofilemanager->homedir && $this->bofilemanager->path != 
$this->bofilemanager->fakebase && $this->bofilemanager->path != '/' && 
!$this->bofilemanager->vfs->acl_check(array(
+                               'string'=>$this->bofilemanager->path,
                                'relatives' => Array(RELATIVE_NONE),
                                'operation' => PHPGW_ACL_READ)))
                        {
-                               $this->no_access_exists(lang('you do not have 
access to %1',$this->bo->path));
+                               $this->no_access_exists(lang('you do not have 
access to %1',$this->bofilemanager->path));
                        }
-                       $this->bo->userinfo['working_id'] = 
$this->bo->vfs->working_id;
-                       $this->bo->userinfo['working_lid'] = 
$GLOBALS['phpgw']->accounts->id2name($this->bo->userinfo['working_id']);
+                       $this->bofilemanager->userinfo['working_id'] = 
$this->bofilemanager->vfs->working_id;
+                       $this->bofilemanager->userinfo['working_lid'] = 
$GLOBALS['phpgw']->accounts->id2name($this->bofilemanager->userinfo['working_id']);
                }

                /**TODO: xslt-ise this (and get rid of the hard-coded html)*/
                function no_access_exists($error_msg)
                {
-                       if($this->bo->debug)
+                       if($this->bofilemanager->debug)
                        {
                                echo 'DEBUG: ui.no_access_exists: you do not 
have access to this directory<br>'."\n";
                        }
@@ -139,8 +139,8 @@

                        $p->set_var('error','<br><br>Go to your <a 
href="'.$GLOBALS['phpgw']->link('/index.php',
                                        Array(
-                                               'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                               'path'  => 
urlencode($this->bo->homedir)
+                                               'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                               'path'  => 
urlencode($this->bofilemanager->homedir)
                                        )
                                ).'">Home</a> directory'
                        );
@@ -156,55 +156,55 @@
                        # Same for group directories
                        ###

-                       if($this->bo->debug)
+                       if($this->bofilemanager->debug)
                        {
-                               echo 'DEBUG: ui.create_home_dir: PATH = 
'.$this->bo->path.'<br>'."\n";
-                               echo 'DEBUG: ui.create_home_dir: PATH = 
'.urlencode($this->bo->path).'<br>'."\n";
+                               echo 'DEBUG: ui.create_home_dir: PATH = 
'.$this->bofilemanager->path.'<br>'."\n";
+                               echo 'DEBUG: ui.create_home_dir: PATH = 
'.urlencode($this->bofilemanager->path).'<br>'."\n";
                        }

-                       if(($this->bo->path == $this->bo->homedir) && 
!$this->bo->vfs->file_exists(array(
-                                       'string' => $this->bo->homedir,
+                       if(($this->bofilemanager->path == 
$this->bofilemanager->homedir) && !$this->bofilemanager->vfs->file_exists(array(
+                                       'string' => 
$this->bofilemanager->homedir,
                                        'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
-                               $this->bo->vfs->override_acl = 1;
-                               if (!$this->bo->vfs->mkdir(array(
-                                       'string' => $this->bo->homedir,
+                               $this->bofilemanager->vfs->override_acl = 1;
+                               if (!$this->bofilemanager->vfs->mkdir(array(
+                                       'string' => 
$this->bofilemanager->homedir,
                                        'relatives' => Array(RELATIVE_NONE)
                                        )))
                                {
-//TODO: xsltise                                        echo lang('failed to 
create directory') . ' :'. $this->bo->homedir . "\n";
+//TODO: xsltise                                        echo lang('failed to 
create directory') . ' :'. $this->bofilemanager->homedir . "\n";
                                }
-                               $this->bo->vfs->override_acl = 0;
+                               $this->bofilemanager->vfs->override_acl = 0;
                        }
-                       
elseif(preg_match("|^".$this->bo->fakebase."\/(.*)$|U",$this->bo->path,$this->bo->matches))
+                       
elseif(preg_match("|^".$this->bofilemanager->fakebase."\/(.*)$|U",$this->bofilemanager->path,$this->bofilemanager->matches))
                        {
-                               if (!$this->bo->vfs->file_exists(array(
-                                       'string' => $this->bo->path,
+                               if 
(!$this->bofilemanager->vfs->file_exists(array(
+                                       'string' => $this->bofilemanager->path,
                                        'relatives' => Array(RELATIVE_NONE)
                                        )))
                                {
-                                       //$this->bo->vfs->override_acl = 1;
-                                       if (!$this->bo->vfs->mkdir(array(
-                                               'string' => $this->bo->homedir,
+                                       
//$this->bofilemanager->vfs->override_acl = 1;
+                                       if 
(!$this->bofilemanager->vfs->mkdir(array(
+                                               'string' => 
$this->bofilemanager->homedir,
                                                'relatives' => 
Array(RELATIVE_NONE)
                                                )))
                                        {
-//TODO: xsltise                                echo lang('failed to create 
directory') . ' <b>'. $this->bo->homedir . '</b><br><br>';
+//TODO: xsltise                                echo lang('failed to create 
directory') . ' <b>'. $this->bofilemanager->homedir . '</b><br><br>';
                                        }
-                                       //$this->bo->vfs->override_acl = 0;
+                                       
//$this->bofilemanager->vfs->override_acl = 0;

-                                       if($this->bo->debug)
+                                       if($this->bofilemanager->debug)
                                        {
-                                               echo 'DEBUG: 
ui.create_home_dir: PATH = '.$this->bo->path.'<br>'."\n";
-                                               echo 'DEBUG: 
ui.create_home_dir(): matches[1] = '.$this->bo->matches[1].'<br>'."\n";
+                                               echo 'DEBUG: 
ui.create_home_dir: PATH = '.$this->bofilemanager->path.'<br>'."\n";
+                                               echo 'DEBUG: 
ui.create_home_dir(): matches[1] = 
'.$this->bofilemanager->matches[1].'<br>'."\n";
                                        }

-                                       $group_id = 
$GLOBALS['phpgw']->accounts->name2id($this->bo->matches[1]);
+                                       $group_id = 
$GLOBALS['phpgw']->accounts->name2id($this->bofilemanager->matches[1]);
                                        if($group_id)
                                        {
-                                               
$this->bo->vfs->set_attributes(array(
-                                                       'string' => 
$this->bo->path,
+                                               
$this->bofilemanager->vfs->set_attributes(array(
+                                                       'string' => 
$this->bofilemanager->path,
                                                        'relatives' => 
Array(RELATIVE_NONE),
                                                        'attributes' => 
Array('owner_id' => $group_id, 'createdby_id' => $group_id)
                                                        ));
@@ -219,23 +219,23 @@
                        # Verify path is real
                        ###

-                       if($this->bo->debug)
+                       if($this->bofilemanager->debug)
                        {
-                               echo 'DEBUG: ui.verify_path: PATH = 
'.$this->bo->path.'<br>'."\n";
-                               echo 'DEBUG: ui.verify_path: exists = 
'.$this->bo->vfs->file_exists(array(
-                                       'string' => $this->bo->path,
+                               echo 'DEBUG: ui.verify_path: PATH = 
'.$this->bofilemanager->path.'<br>'."\n";
+                               echo 'DEBUG: ui.verify_path: exists = 
'.$this->bofilemanager->vfs->file_exists(array(
+                                       'string' => $this->bofilemanager->path,
                                        'relatives' => 
Array(RELATIVE_NONE))).'<br>'."\n";
                        }

-                       if($this->bo->path != $this->bo->homedir &&
-                               $this->bo->path != '/' &&
-                               $this->bo->path != $this->bo->fakebase &&
-                               !$this->bo->vfs->file_exists(array(
-                                       'string' => $this->bo->path,
+                       if($this->bofilemanager->path != 
$this->bofilemanager->homedir &&
+                               $this->bofilemanager->path != '/' &&
+                               $this->bofilemanager->path != 
$this->bofilemanager->fakebase &&
+                               !$this->bofilemanager->vfs->file_exists(array(
+                                       'string' => $this->bofilemanager->path,
                                        '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->bofilemanager->path));
                        }
                }

@@ -243,20 +243,20 @@
                {
                        /* Update if they request it, or one out of 20 page 
loads */
                        srand((double)microtime() * 1000000);
-                       if($this->bo->update || rand(0,19) == 4)
+                       if($this->bofilemanager->update || rand(0,19) == 4)
                        {
-                               $this->bo->vfs->update_real( array(
-                                       'string' => $this->bo->path,
+                               $this->bofilemanager->vfs->update_real( array(
+                                       'string' => $this->bofilemanager->path,
                                        'relatives' =>Array(RELATIVE_NONE)
                                        ));
                        }
-                       if($this->bo->update)
+                       if($this->bofilemanager->update)
                        {
                                Header('Location: '.$GLOBALS['phpgw']->link(
                                                '/index.php',
                                                Array(
-                                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                       'path'  => 
urlencode($this->bo->path)
+                                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                       'path'  => 
urlencode($this->bofilemanager->path)
                                                )
                                        )
                                );
@@ -268,7 +268,7 @@
                        if (UI_DEBUG)
                        {
                                echo " Debug mode <br>";
-                               echo "function : ".$this->bo->$function;
+                               echo "function : 
".$this->bofilemanager->$function;
                                print_r($_POST);
                                die();

@@ -306,7 +306,7 @@
                                'upload',
                                'download'
                        );
-                       if (trim(strtolower($this->bo->cancel)) == 
strtolower(lang('cancel'))) {
+                       if (trim(strtolower($this->bofilemanager->cancel)) == 
strtolower(lang('cancel'))) {
                                $this->cancel();
                                exit();
                        }
@@ -315,7 +315,7 @@
                        @reset($actions);
                        while(list($function,$text) = each($actions))
                        {
-                               if(isset($this->bo->$function) && 
!empty($this->bo->$function) && trim(strtolower($this->bo->$function)) == 
strtolower($text))
+                               if(isset($this->bofilemanager->$function) && 
!empty($this->bofilemanager->$function) && 
trim(strtolower($this->bofilemanager->$function)) == strtolower($text))
                                {
                                        //If the action is provided by this 
class, this'l do it
                                        if (in_array($function, 
$local_functions))
@@ -329,18 +329,18 @@
                                        {
                                                //echo " bofunction $function ";
                                                $f_function = 'f_'.$function;
-                                               $errors = implode("\n", 
$this->bo->$f_function());
+                                               $errors = implode("\n", 
$this->bofilemanager->$f_function());
                                                $var = Array(
-                                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                       'path'  => 
urlencode($this->bo->path)
+                                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                       'path'  => 
urlencode($this->bofilemanager->path)
                                                );
                                                if($function == 'newfile')
                                                {
                                                        $var = Array(
-                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.action',
+                                                               'menuaction'    
=> $this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
                                                                'uiaction' => 
'edit',
-                                                               'path'  => 
urlencode($this->bo->path),
-                                                               'file'  => 
urlencode($this->bo->createfile)
+                                                               'path'  => 
urlencode($this->bofilemanager->path),
+                                                               'file'  => 
urlencode($this->bofilemanager->createfile)
                                                        );
                                                }
                                                elseif(strlen($errors))
@@ -354,8 +354,8 @@

                        }
                        Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php',Array(
-                                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                       'path'  => 
urlencode($this->bo->path),
+                                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                       'path'  => 
urlencode($this->bofilemanager->path),
                                                        'errors' => 
lang('unknown action!')
                                                )));
                }
@@ -364,11 +364,11 @@
                function help()
                {
                        $this->load_header();
-                       $this->bo->load_help_info();
-                       @reset($this->bo->help_info);
-                       while(list($num,$help_array) = 
each($this->bo->help_info))
+                       $this->bofilemanager->load_help_info();
+                       @reset($this->bofilemanager->help_info);
+                       while(list($num,$help_array) = 
each($this->bofilemanager->help_info))
                        {
-                               if ($help_array[0] != $this->bo->help_name)
+                               if ($help_array[0] != 
$this->bofilemanager->help_name)
                                {
                                        continue;
                                }
@@ -384,13 +384,13 @@
                /**TODO : xslt-ise this */
                function build_help($help_option,$text='')
                {
-                       if($this->bo->settings['show_help'])
+                       if($this->bofilemanager->settings['show_help'])
                        {
                                $help = ($text?'':'<font size="-2" 
color="maroon" >'."\n");
                                $help .= '      <a href="'
                                        . $GLOBALS['phpgw']->link('/index.php',
                                                Array(
-                                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.help',
+                                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.help',
                                                        'help_name'     => 
urlencode($help_option),
                                                        'op'    => 'help'
                                                )
@@ -455,11 +455,11 @@
                        ###

                        $dirs[] = Array(
-                               'directory' => $this->bo->fakebase,
-                               'name' => $this->bo->userinfo['account_lid']
+                               'directory' => $this->bofilemanager->fakebase,
+                               'name' => 
$this->bofilemanager->userinfo['account_lid']
                        );
-                       $ls_array = $this->bo->vfs->ls(array(
-                               'string' => $this->bo->homedir,
+                       $ls_array = $this->bofilemanager->vfs->ls(array(
+                               'string' => $this->bofilemanager->homedir,
                                'relatives' => Array(RELATIVE_NONE),
                                'nofiles' => True,
                                'mime_type' => 'Directory'));
@@ -472,25 +472,25 @@
                        # Then we get the directories in their membership's 
home directories
                        ###

-                       reset($this->bo->memberships);
-                       while(list($num,$group_array) = 
each($this->bo->memberships))
+                       reset($this->bofilemanager->memberships);
+                       while(list($num,$group_array) = 
each($this->bofilemanager->memberships))
                        {
                                ###
                                # Don't list directories for groups that don't 
have access
                                ###

-                               
if(!$this->bo->membership_applications[$group_array['account_name']][$this->bo->appname]['enabled'])
+                               
if(!$this->bofilemanager->membership_applications[$group_array['account_name']][$this->bofilemanager->appname]['enabled'])
                                {
                                        continue;
                                }

                                $dirs[] = Array(
-                                       'directory' => $this->bo->fakebase,
+                                       'directory' => 
$this->bofilemanager->fakebase,
                                        'name' => $group_array['account_name']
                                );

-                               $ls_array = $this->bo->vfs->ls(array(
-                                       'string' => 
$this->bo->fakebase.SEP.$group_array['account_name'],
+                               $ls_array = $this->bofilemanager->vfs->ls(array(
+                                       'string' => 
$this->bofilemanager->fakebase.SEP.$group_array['account_name'],
                                        'relatives' => Array(RELATIVE_NONE),
                                        'nofiles' => True,
                                        'mime_type' => 'Directory'
@@ -529,7 +529,7 @@
                                # No point in displaying the current directory, 
or a directory that doesn't exist
                                ###

-                               if((($dir['directory'].$dir['name']) != 
$this->bo->path) && $this->bo->vfs->file_exists(array(
+                               if((($dir['directory'].$dir['name']) != 
$this->bofilemanager->path) && $this->bofilemanager->vfs->file_exists(array(
                                        'string' => 
$dir['directory'].$dir['name'],
                                        'relatives' => Array(RELATIVE_NONE)
                                        )))
@@ -547,7 +547,7 @@
                                                                        
'caption' => $this->build_help('directory_list')
                                                                        ));

-                       if($this->bo->path != '/' && $this->bo->path != 
$this->bo->fakebase)
+                       if($this->bofilemanager->path != '/' && 
$this->bofilemanager->path != $this->bofilemanager->fakebase)
                        {
                                $var[]  = array('widget' => 
array('type'=>'submit',
                                                                                
        'name'=> 'download',
@@ -573,7 +573,7 @@
                                                                                
        'caption' => $this->build_help('update')
                                                                                
));
 */
-                       if($this->bo->path != '/' && $this->bo->path != 
$this->bo->fakebase)
+                       if($this->bofilemanager->path != '/' && 
$this->bofilemanager->path != $this->bofilemanager->fakebase)
                        {
                                $var[] = array('widget' => array( 'type' => 
'text',
                                                                                
                'name' => 'createfile',
@@ -588,7 +588,7 @@
                                $var[] = array('widget' => array( 'type' => 
'seperator' ));
                        }

-                       if($this->bo->settings['show_command_line'])
+                       if($this->bofilemanager->settings['show_command_line'])
                        {

                                $var[] = array('widget' => array( 'type' => 
'text' ,
@@ -618,7 +618,7 @@
                        $p->parse('col_headers','column_headers_normal',True);

                        $var['td_extras']       = ' align="left"';
-                       $var['column_header'] = $this->bo->borkb($usedspace);
+                       $var['column_header'] = 
$this->bofilemanager->borkb($usedspace);
                        $p->set_var($var);
                        $p->parse('col_headers','column_headers_normal',True);

@@ -630,7 +630,7 @@
                                
$p->parse('col_headers','column_headers_normal',True);

                                $var['td_extras']       = ' align="left"';
-                               $var['column_header'] = 
$this->bo->borkb($this->bo->userinfo['hdspace'] - $usedspace);
+                               $var['column_header'] = 
$this->bofilemanager->borkb($this->bofilemanager->userinfo['hdspace'] - 
$usedspace);
                                $p->set_var($var);
                                
$p->parse('col_headers','column_headers_normal',True);
                        }
@@ -646,8 +646,8 @@
                                
$p->parse('col_headers','column_headers_normal',False);

                                $var['td_extras']       = ' 
colspan="'.($info_columns / 2).'" align="left" width="50%"';
-                               $var['column_header'] = 
count($this->bo->vfs->ls(array(
-                                       'string' => $this->bo->path,
+                               $var['column_header'] = 
count($this->bofilemanager->vfs->ls(array(
+                                       'string' => $this->bofilemanager->path,
                                        'relatives' => Array(RELATIVE_NONE)
                                        )));
                                $p->set_var($var);
@@ -672,7 +672,7 @@
                                ));
                        $table_head [] =array('table_col' => $var_head);
                //      $var[] = array('widget' => array('type' => 
'seperator'));
-                       for($i=0;$i<$this->bo->show_upload_boxes;$i++)
+                       
for($i=0;$i<$this->bofilemanager->show_upload_boxes;$i++)
                        {
                                        $var = array();
                                        $var[] = array('widget' => array('type' 
=> 'file',
@@ -698,7 +698,7 @@

                        $var[] = array('widget' => array('type' => 'hidden',
                                                         'name' => 
'show_upload_boxes',
-                                                        'value' => 
$this->bo->show_upload_boxes
+                                                        'value' => 
$this->bofilemanager->show_upload_boxes
                                                         ));

                        $table_rows [] = array('table_col' => $var);
@@ -732,21 +732,11 @@

                function index( $edit=array())
                {
-                       //This lets you use an alternate xslt by appending 
&template=<name> to the url
-                       if (!($template = get_var('template', array('GET', 
'POST'))) )
-                       {
-                               
$GLOBALS['phpgw']->xslttpl->add_file(array('index',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','base')
 . SEP . 'app_header'));
-                       }
-                       else
-                       {
-                               $GLOBALS['phpgw']->xslttpl->add_file($template);
-                       }
-
-                       $files_array = $this->bo->load_files();
+                       $files_array = $this->bofilemanager->load_files();

                        $usage = 0;
                        $files_array = $this->dirs_first($files_array);
-                       if(count($files_array) || $this->bo->cwd)
+                       if(count($files_array) || $this->bofilemanager->cwd)
                        {
                                $file_output = array();
                                for($i=0;$i!=count($files_array);$i++)
@@ -756,15 +746,15 @@
                                                if (!count($edit) )
                                                {
                                                        
$file_attributes['checkbox'] = '';
-                                                       
$file_output[$i]['checkbox'] =array('widget' => array( 'type' => 'checkbox',
+                                                       
$file_output[$i]['checkbox'] = array('widget' => array( 'type' => 'checkbox',
                                                                        'name' 
=> 'fileman[]',
                                                                        'value' 
=> $file['name']
                                                                ));
                                        }
-                                       @reset($this->bo->file_attributes);
-                                       while(list($internal,$displayed) = 
each($this->bo->file_attributes))
+                                       
@reset($this->bofilemanager->file_attributes);
+                                       while(list($internal,$displayed) = 
each($this->bofilemanager->file_attributes))
                                        {
-                                               if 
(!is_array($this->bo->settings)||$this->bo->settings[$internal])
+                                               if 
(!is_array($this->bofilemanager->settings)||$this->bofilemanager->settings[$internal])
                                                {
                                                        if 
($internal==$edit[$file['name']])
                                                        {
@@ -787,7 +777,7 @@
                                                                        case 
'created':
                                                                        case 
'modified':
                                                                                
//Convert ISO 8601 date format used by DAV into something people can read
-                                                                               
$file_output[$i][$internal] =  $this->bo->convert_date($file[$internal]);
+                                                                               
$file_output[$i][$internal] =  
$this->bofilemanager->convert_date($file[$internal]);
                                                                                
break;
                                                                        case 
'name':
                                                                                
$mime_parts = explode('/',$file['mime_type']);
@@ -799,19 +789,19 @@

                                                                                
        $file_output[$i]['name']['icon'] = array(
                                                                                
                'widget' => array( 'type' => 'img',
-                                                                               
                'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,$file_icon)
+                                                                               
                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,$file_icon)
                                                                                
                        ));

                                                                                
if ($file['mime_type']=='Directory')
                                                                                
{
-                                                                               
        $href = array('menuaction'      => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                                               
                        'path'          => $this->bo->path.SEP.$file['name']
+                                                                               
        $href = array('menuaction'      => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path'          => 
$this->bofilemanager->path.SEP.$file['name']
                                                                                
                        );
                                                                                
}
                                                                                
else
                                                                                
{
-                                                                               
        $href = Array( 'menuaction'     => 
$this->bo->appname.'.ui'.$this->bo->appname.'.view',
-                                                                               
                                        'path'          => 
urlencode($this->bo->path),
+                                                                               
        $href = Array( 'menuaction'     => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.view',
+                                                                               
                                        'path'          => 
urlencode($this->bofilemanager->path),
                                                                                
                                        'file'          => 
urlencode($file['name'])
                                                                                
                                );

@@ -824,10 +814,10 @@
                                                                                
                ));
                                                                                
if ($mime_parts[0] == 'text')
                                                                                
        {
-                                                                               
                $href['menuaction'] = 
$this->bo->appname.'.ui'.$this->bo->appname.'.action';
+                                                                               
                $href['menuaction'] = 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action';
                                                                                
                $href['uiaction'] = 'edit';
                                                                                
                $file_output[$i]['name']['edit'] = array('widget' => array( 
'type' => 'img',
-                                                                               
                                'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'pencil'),
+                                                                               
                                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'pencil'),
                                                                                
                                'link' =>  
$GLOBALS['phpgw']->link('/index.php', $href)
                                                                                
                                ));
                                                                                
        }
@@ -841,8 +831,8 @@
                                                                        'type' 
=> 'link',
                                                                        
'caption' => $displayed,
                                                                        'href' 
=>  $GLOBALS['phpgw']->link('/index.php', array(
-                                                                               
'menuaction'    => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                                               
'path'=>$this->bo->path,
+                                                                               
'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
'path'=>$this->bofilemanager->path,
                                                                                
'sortby' => $internal
                                                                        ))
                                                                ));
@@ -850,144 +840,136 @@
                                        }
                                }

-
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('summary' =>  array(
+                               $data = array
+                               (
+                                       'summary' =>  array
+                                       (
                                                'file_count' => 
count($files_array),
-                                               'usage' => $usage
-                               )));
-
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('file_attributes' => $file_attributes));
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array(
-                                       'files' => array(
-                                               'file' => $file_output
-                                               )
-                                       )
-                               );
-
-
-                               $GLOBALS['tr_color'] = 
$GLOBALS['phpgw_info']['theme']['row_off'];
-                               $var = Array(
-
-                                       'form_action'   => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       Array(
-                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.action',
-                                                               'path'          
=> urlencode($this->bo->path)
-                                                       )
-                                                       ),
-                                       'error' => (isset($this->bo->errors) && 
is_array(unserialize(base64_decode($this->bo->errors)))?$GLOBALS['phpgw']->common->error_list(unserialize(base64_decode($this->bo->errors)),'Results'):''),
-                                       'img_up' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
+                                               'usage' => $usage
+                                       ),
+                                       'files' => array
+                                       (
+                                               'file_attributes'       => 
$file_attributes,
+                                               'file'                          
=> $file_output
+                                       ),
+                                       'form_action'   => 
$GLOBALS['phpgw']->link('/index.php',array
+                                                                               
(
+                                                                               
        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
+                                                                               
        'path'                  => urlencode($this->bofilemanager->path)
+                                                                               
)),
+                                       'error'         => 
(isset($this->bofilemanager->errors) && 
is_array(unserialize(base64_decode($this->bofilemanager->errors)))?$GLOBALS['phpgw']->common->error_list(unserialize(base64_decode($this->bofilemanager->errors)),'Results'):''),
+                                       'img_up'        => array('widget' => 
array('type' => 'img',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'up'),
                                                                                
        'alt' => lang('up'),
                                                                                
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                                               
                        'path'          => urlencode($this->bo->lesspath)
+                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path'          => 
urlencode($this->bofilemanager->lesspath)
                                                                                
                ))
                                                                                
        )),
                                        'help_up'       => 
$this->build_help('up'),
                                        'img_home'      => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'folder_home'),
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_home'),
                                                                                
        'alt' => lang('folder'),
                                                                                
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                                               
                        'path' => urlencode($this->bo->homedir)
+                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                        'path' => urlencode($this->bofilemanager->homedir)
                                                                                
                ))
                                                                                
        )),
-                                       'dir' => $this->bo->path,
-                                       'img_dir' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'),
+                                       'dir'           => 
$this->bofilemanager->path,
+                                       'img_dir'       => array('widget' => 
array('type' => 'img',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
                                                                                
        'alt' => lang('folder'),                                                
'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
        'menuaction'    => $this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                                               
        'path' => urlencode($this->bo->path)
+                                                                               
        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
        'path' => urlencode($this->bofilemanager->path)
                                                                                
                ))
                                                                                
        )),
                                        'help_home'     => 
$this->build_help('home'),
-                               );
-                               if (strlen($this->bo->errors))
+                                       'add_moz_sidebar' => array
+                                       (
+                                               'url'                   => 
$GLOBALS['phpgw']->link('/index.php',array(
+                                                                               
                                                                                
                'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                                               
                                                                                
                'path'                  => urlencode($this->bofilemanager->path)
+                                                                               
                                                                                
        )),
+                                               'label'                 => 
lang('phpgroupware files'),
+                                               'link_label'    => lang('add 
mozilla/netscape sidebar tab')
+                                       )
+                               );
+
+                               if (strlen($this->bofilemanager->errors))
                                {
-                                       $var['errors'] = $this->bo->errors;
+                                       $data['errors'] = 
$this->bofilemanager->errors;
                                }

                                if (count($edit))
                                {
-                                       $var['img_cancel'] = array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'),
+                                       $data['img_cancel'] = array('widget' => 
array('type' => 'img',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'button_cancel'),
                                                                                
        'alt' => lang('folder')
                                                ));
-                                       $var['button_cancel'] = array('widget' 
=> array('type' => 'submit',
+                                       $data['button_cancel'] = array('widget' 
=> array('type' => 'submit',
                                                                                
'name' => 'cancel',
                                                                                
'value' => lang('cancel')
                                                ));
-                                       $var['img_ok'] = array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'button_ok'),
+                                       $data['img_ok'] = array('widget' => 
array('type' => 'img',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'button_ok'),
                                                                                
        'alt' => lang('folder')
                                                ));
-                                       $var['button_ok'] = array('widget' => 
array('type' => 'submit',
+                                       $data['button_ok'] = array('widget' => 
array('type' => 'submit',
                                                                                
'name' => 'submit',
                                                                                
'value' => lang('ok')
                                                ));
                                        @reset($edit);
                                        while( list($file,$prop) = each($edit))
                                        {
-                                               $var['fileman'][] = 
array('widget' => array('type'=>'hidden',
+                                               $data['fileman'][] = 
array('widget' => array('type'=>'hidden',
                                                                                
'name' => 'fileman[]',
                                                                                
'value' => $file
                                                        ));
                                        }
                                        @reset($edit); list($file,$prop) = 
each($edit);
-                                       $var['action'] = array('widget' => 
array('type'=>'hidden',
+                                       $data['action'] = array('widget' => 
array('type'=>'hidden',
                                                                                
'name' => 'apply_edit_'.$prop,
                                                                                
'value' => 1
                                                        ));
                                }
-
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('index' => $var));
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('sidebar' => array(
-                                       'url' => 
$GLOBALS['phpgw']->link('/index.php',
-                                                       Array(
-                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                               'path'          
=> urlencode($this->bo->path)
-                                                       ), 1
-                                                       ),
-                                       'label' => lang('phpgroupware files'),
-                                       'link_label' => lang('add 
mozilla/netscape sidebar tab')
-                                               )
-                                               ));
-                               @reset($this->bo->file_attributes);
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('settings' => $this->bo->settings));
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('display_settings' => $GLOBALS['phpgw_info']['theme']));
-
+
+                               @reset($this->bofilemanager->file_attributes);
+                               $data['settings'] = 
$this->bofilemanager->settings;
+                               $data['display_settings'] = 
$GLOBALS['phpgw_info']['theme'];
+
                                if(!count($edit))
                                {
-                                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('buttons'=> array('button' 
=> $this->display_buttons()) ));
-                                       
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('uploads' =>  
$this->display_uploads() ));
+                                       $data['buttons'] = array('button' => 
$this->display_buttons());
+                                       $data['uploads'] = 
$this->display_uploads();
                                }
-                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('index' => $var));
+
+                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('index' => $data));
                        }

                }
                function cancel()
                {
                        $var = Array(
-                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                       'path'  => urlencode($this->bo->path)
+                                       'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                       'path'  => 
urlencode($this->bofilemanager->path)
                                );
                        Header('Location: 
'.$GLOBALS['phpgw']->link('/index.php',$var));
                }
                function rename()
                {
                        $edit=array();
-                       for ($i=0; $i!=count($this->bo->fileman);$i++)
+                       for ($i=0; 
$i!=count($this->bofilemanager->fileman);$i++)
                        {
-                               $edit[$this->bo->fileman[$i]] = 'name';
+                               $edit[$this->bofilemanager->fileman[$i]] = 
'name';
                        }
                        $this->index($edit);
                }
                function edit_comments()
                {
                        $edit=array();
-                       for ($i=0; $i!=count($this->bo->fileman);$i++)
+                       for ($i=0; 
$i!=count($this->bofilemanager->fileman);$i++)
                        {
-                               $edit[$this->bo->fileman[$i]] = 'comment';
+                               $edit[$this->bofilemanager->fileman[$i]] = 
'comment';
                        }
                        $this->index($edit);
                }
@@ -995,8 +977,8 @@
                {
                        Header('Location: '.$GLOBALS['phpgw']->link(
                                                'view.php',
-                                               Array('path' => 
urlencode($this->bo->path),
-                                               'file'  => 
urlencode($this->bo->file))
+                                               Array('path' => 
urlencode($this->bofilemanager->path),
+                                               'file'  => 
urlencode($this->bofilemanager->file))
                                        )
                                );

@@ -1005,8 +987,8 @@
                function history()
                {
                        $this->load_header();
-                       $file = 
$this->bo->path.$this->bo->dispsep.$this->bo->file;
-                       if($this->bo->vfs->file_exists(array(
+                       $file = 
$this->bofilemanager->path.$this->bofilemanager->dispsep.$this->bofilemanager->file;
+                       if($this->bofilemanager->vfs->file_exists(array(
                                'string' => $file,
                                'relatives' => Array(RELATIVE_NONE)
                                )))
@@ -1032,18 +1014,18 @@
                                $var = Array(
                                        'path'  => $this->link(
                                                        Array(
-                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.index',
-                                                               'path'          
=> urlencode($this->bo->path)
+                                                               'menuaction'    
=> $this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
+                                                               'path'          
=> urlencode($this->bofilemanager->path)
                                                        ),
-                                                       $this->bo->path
+                                                       
$this->bofilemanager->path
                                                ),
                                        'filename'      => $this->link(
                                                        Array(
-                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.view',
-                                                               'path'          
=> urlencode($this->bo->path),
-                                                               'file'          
=> urlencode($this->bo->file)
+                                                               'menuaction'    
=> $this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.view',
+                                                               'path'          
=> urlencode($this->bofilemanager->path),
+                                                               'file'          
=> urlencode($this->bofilemanager->file)
                                                        ),
-                                                       $this->bo->file
+                                                       
$this->bofilemanager->file
                                                )
                                );
                                $p->set_var($var);
@@ -1062,7 +1044,7 @@
                                $p->parse('col_row','column_rows',True);
                                $p->set_var('col_headers','');

-                               $journal_array = 
$this->bo->vfs->get_journal(array(
+                               $journal_array = 
$this->bofilemanager->vfs->get_journal(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)
                                        ));
@@ -1077,7 +1059,7 @@
                                                                
$var['column_header'] = '<font 
size="-2">'.$GLOBALS['phpgw']->accounts->id2name($journal_entry[$field]).'</font>';
                                                                break;
                                                        case 'created':
-                                                               
$var['column_header'] = '<font 
size="-2">'.$this->bo->convert_date($journal_entry[$field]).'</font>';
+                                                               
$var['column_header'] = '<font 
size="-2">'.$this->bofilemanager->convert_date($journal_entry[$field]).'</font>';
                                                                break;
                                                        default:
                                                                
$var['column_header'] = '<font size="-2">'.$journal_entry[$field].'</font>';
@@ -1097,26 +1079,26 @@
                {
                        if(is_array($file_array))
                        {
-                               $this->bo->path = $file_array['path'];
-                               $this->bo->file = $file_array['file'];
+                               $this->bofilemanager->path = 
$file_array['path'];
+                               $this->bofilemanager->file = 
$file_array['file'];
                        }
-                       $file = $this->bo->path.SEP.$this->bo->file;
-                       if($this->bo->vfs->file_exists(array(
+                       $file = 
$this->bofilemanager->path.SEP.$this->bofilemanager->file;
+                       if($this->bofilemanager->vfs->file_exists(array(
                                'string' => $file,
                                'relatives' => Array(RELATIVE_NONE)
                                )))
                        {
                                $browser = CreateObject('phpgwapi.browser');
-                               
$browser->content_header($this->bo->file,$this->bo->vfs->file_type(array(
+                               
$browser->content_header($this->bofilemanager->file,$this->bofilemanager->vfs->file_type(array(
                                                'string' => $file,
                                                'relatives' => 
Array(RELATIVE_NONE))),
-                                       $this->bo->vfs->get_size(array(
+                                       
$this->bofilemanager->vfs->get_size(array(
                                                'string' => $file,
                                                'relatives' => 
Array(RELATIVE_NONE),
                                                'checksubdirs' => True
                                                )));
-//                             $browser->content_header($this->bo->file);
-                               echo $this->bo->vfs->read(array(
+//                             
$browser->content_header($this->bofilemanager->file);
+                               echo $this->bofilemanager->vfs->read(array(
                                        'string' => $file,
                                        'relatives' => Array(RELATIVE_NONE)
                                        ));

====================================================
Index: filemanager/inc/class.uiaction_edit.inc.php
diff -u filemanager/inc/class.uiaction_edit.inc.php:1.3 
filemanager/inc/class.uiaction_edit.inc.php:1.4
--- filemanager/inc/class.uiaction_edit.inc.php:1.3     Mon May 26 21:35:46 2003
+++ filemanager/inc/class.uiaction_edit.inc.php Tue Jan 18 23:54:13 2005
@@ -16,7 +16,7 @@
                {
                                        $this->bo = 
CreateObject('filemanager.bofilemanager');

-                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
+                                       
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));

                                        $var = Array(
                                        'img_up' => array('widget' => 
array('type' => 'img',
@@ -50,7 +50,7 @@
                function edit($parent, $param=false)
                {

-                       
$GLOBALS['phpgw']->xslttpl->add_file(array('edit',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
+                       $GLOBALS['phpgw']->xslttpl->add_file(array('edit'));
                        
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',array('form_action' 
=>$GLOBALS['phpgw']->link('/index.php',
                                                                                
Array(
                                                                                
        'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.action',






reply via email to

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