phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: filemanager/inc class.bofilemanager.inc.php,1.3


From: Jonathon Sim <address@hidden>
Subject: [Phpgroupware-cvs] CVS: filemanager/inc class.bofilemanager.inc.php,1.3,1.4 class.uifilemanager.inc.php,1.3,1.4
Date: Wed, 05 Mar 2003 20:11:47 -0500

Update of /cvsroot/phpgroupware/filemanager/inc
In directory subversions:/tmp/cvs-serv14899

Modified Files:
        class.bofilemanager.inc.php class.uifilemanager.inc.php 
Log Message:
A few bug fixes and cleanups

Index: class.bofilemanager.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/inc/class.bofilemanager.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.bofilemanager.inc.php 4 Mar 2003 03:03:00 -0000       1.3
--- class.bofilemanager.inc.php 6 Mar 2003 01:11:43 -0000       1.4
***************
*** 61,66 ****
                function bofilemanager()
                {
                        $this->vfs = CreateObject('phpgwapi.vfs');
- 
                        $to_decode = Array(
                                /*
--- 61,66 ----
                function bofilemanager()
                {
+                       
                        $this->vfs = CreateObject('phpgwapi.vfs');
                        $to_decode = Array(
                                /*
***************
*** 667,670 ****
--- 667,672 ----
                {
                        $result = Array();
+                       echo "newfile: ".$this->newfile ." createfile: 
".$this->createfile;
+                       //die();
                        if ($this->newfile && $this->createfile)
                        {
***************
*** 675,680 ****
                                }
                                if($this->vfs->file_exists(array(
!                                       'string' => 
$this->path.SEP.$this->createfile,
!                                       'relatives' => Array(RELATIVE_NONE)
                                        )))
                                {
--- 677,682 ----
                                }
                                if($this->vfs->file_exists(array(
!                                       'string' => $this->createfile,
!                                       'relatives' => Array(RELATIVE_ALL)
                                        )))
                                {
***************
*** 683,688 ****
                                }
                                if(!$this->vfs->touch(array(
!                                       'string' => 
$this->path.SEP.$this->createfile,
!                                       'relatives' => Array(RELATIVE_NONE)
                                        )))
                                {
--- 685,690 ----
                                }
                                if(!$this->vfs->touch(array(
!                                       'string' => $this->createfile,
!                                       'relatives' => Array(RELATIVE_ALL)
                                        )))
                                {
***************
*** 692,695 ****
--- 694,698 ----
                        else
                        {
+ 
                                $result[] = lang('filename not provided!');
                        }
***************
*** 714,719 ****
                
                                $ls_array = $this->vfs->ls (array (
!                                               'string'        => $this->path 
. '/' . $this->upload_file['name'][$i],
!                                               'relatives'     => array 
(RELATIVE_NONE),
                                                'checksubdirs'  => False,
                                                'nofiles'       => True
--- 717,722 ----
                
                                $ls_array = $this->vfs->ls (array (
!                                               'string'        => 
$this->upload_file['name'][$i],
!                                               'relatives'     => array 
(RELATIVE_ALL,
                                                'checksubdirs'  => False,
                                                'nofiles'       => True

Index: class.uifilemanager.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/filemanager/inc/class.uifilemanager.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.uifilemanager.inc.php 4 Mar 2003 03:03:00 -0000       1.3
--- class.uifilemanager.inc.php 6 Mar 2003 01:11:43 -0000       1.4
***************
*** 70,85 ****
                function uifilemanager()
                {
!                       $GLOBALS['phpgw_info']['flags']['xslt_app'] = True;
                        $this->actions = CreateObject('filemanager.uiactions');
                        $this->bo = 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();
                        $this->verify_path();
                        $this->update();
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
!               
                }
  
--- 70,84 ----
                function uifilemanager()
                {
!                       $this->no_header();
                        $this->actions = CreateObject('filemanager.uiactions');
                        $this->bo = 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();
                        $this->verify_path();
                        $this->update();
!                       $GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));
                }
  
***************
*** 90,96 ****
                        unset($GLOBALS['phpgw_info']['flags']['noappheader']);
                        unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
!                       $GLOBALS['phpgw']->common->phpgw_header();
                }
  
                function check_access()
                {
--- 89,105 ----
                        unset($GLOBALS['phpgw_info']['flags']['noappheader']);
                        unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
!                       
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
                }
+               function no_header()
+               {
+                       $GLOBALS['phpgw_info']['flags']['noheader'] = True;
+                       $GLOBALS['phpgw_info']['flags']['nonavbar'] = True;
+                       $GLOBALS['phpgw_info']['flags']['noappheader'] = True;
+                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
+                        $GLOBALS['phpgw_info']['flags']['headonly'] = True;
+  
+ 
  
+               }
                function check_access()
                {
***************
*** 106,115 ****
                }
  
-               function set_col_headers(&$p,$var,$append=True)
-               {
-               //      $p->set_var($var);
-               //      $p->parse('col_headers','column_headers',$append);
-               }
- 
                /**TODO: xslt-ise this (and get rid of the hard-coded html)*/
                function no_access_exists($error_msg)
--- 115,118 ----
***************
*** 333,337 ****
                                                {
                                                        $var = Array(
!                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.edit',
                                                                'path'  => 
urlencode($this->bo->path),
                                                                'file'  => 
urlencode($this->bo->createfile)
--- 336,341 ----
                                                {
                                                        $var = Array(
!                                                               'menuaction'    
=> $this->bo->appname.'.ui'.$this->bo->appname.'.action',
!                                                               'uiaction' => 
'edit',
                                                                'path'  => 
urlencode($this->bo->path),
                                                                'file'  => 
urlencode($this->bo->createfile)
***************
*** 401,451 ****
                        }
                }
! /*
!               function image($image,$alt)
!               {
!                       return '<img 
src="'.$GLOBALS['phpgw']->common->image($this->bo->appname,$image).'" 
alt="'.$alt.'" align="center" border="0">';
!               }
! 
!               function link($array_params,$text)
!               {
!                       return '<a 
href="'.$GLOBALS['phpgw']->link('/index.php',$array_params).'">'.$text.'</a>';
!               }
! 
!               function build_upload_choices($number)
!               {
!                       return $this->link(
!                               Array(
!                                       'menuaction'    => 
get_var('menuaction',Array('GET')),
!                                       'path'  => $this->bo->path,
!                                       'show_upload_boxes'     => $number
!                               ),
!                               $number).'&nbsp;&nbsp;';
!               }
! 
!               function column_header(&$p,$internal,$displayed,$link=True)
!               {
!                       if($link)
!                       {
!                               $header_str = '<a href="'
!                                       . $GLOBALS['phpgw']->link('/index.php',
!                                               Array(
!                                                       'menuaction'    => 
$this->bo->appname.'.ui'.$this->bo->appname.'.index',
!                                                       'sortby'                
=> $internal
!                                               )
!                                       ).'"><b>'.lang($displayed).'</b></a>';
!                       }
!                       else
!                       {
!                               $header_str = $displayed;
!                       }
!                       $this->set_col_headers(
!                               $p,
!                               Array(
!                                       'td_extras'     => '',
!                                       'column_header' => 
$header_str.$this->build_help($internal)
!                               )
!                       );
!               }
! */
                function display_buttons()
                {
--- 405,409 ----
                        }
                }
!               
                function display_buttons()
                {
***************
*** 646,650 ****
                        return $var;
                }
! 
                function display_summary_info($numoffiles,$usedspace)
                {
--- 604,608 ----
                        return $var;
                }
! /*
                function display_summary_info($numoffiles,$usedspace)
                {
***************
*** 699,703 ****
                        return $p->fp('output','table');
                }
! 
                function display_uploads()
                {
--- 657,661 ----
                        return $p->fp('output','table');
                }
! */
                function display_uploads()
                {
***************
*** 773,777 ****
                function index( $edit=array())
                {
!                       $this->load_header();
                        $files_array = $this->bo->load_files();
                        $usage = 0;
--- 731,744 ----
                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','default')
 . SEP . 'app_header'));
!                       }
!                       else
!                       {
!                               $GLOBALS['phpgw']->xslttpl->add_file($template);
!                       }
!                       
                        $files_array = $this->bo->load_files();
                        $usage = 0;
***************
*** 894,901 ****
                                        )
                                );
!                               
$GLOBALS['phpgw']->xslttpl->add_file(array('index',$GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default')
 . SEP . 'app_header'));
                                
                                $GLOBALS['tr_color'] = 
$GLOBALS['phpgw_info']['theme']['row_off'];
                                $var = Array(
                                        'form_action'   => 
$GLOBALS['phpgw']->link('/index.php',
                                                        Array(
--- 861,869 ----
                                        )
                                );
! 
                                
                                $GLOBALS['tr_color'] = 
$GLOBALS['phpgw_info']['theme']['row_off'];
                                $var = Array(
+ 
                                        'form_action'   => 
$GLOBALS['phpgw']->link('/index.php',
                                                        Array(
***************
*** 971,975 ****
                                
                                $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('index' => $var));
! 
                                @reset($this->bo->file_attributes);
                                $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('settings' => $this->bo->settings));
--- 939,953 ----
                                
                                $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));
***************
*** 1013,1056 ****
                function view()
                {       
!                       //Some VFSs (ie WebDAV) are able to provide their own 
more efficent view method
!                       //than just reading the file into memory then dumping 
it back out again
!                       if ($this->bo->vfs->options('VIEW'))
!                       {
!                               $this->bo->vfs->view(array (
!                                       'string'        => 
$this->bo->path.'/'.$this->bo->file,
!                                       'relatives'     => array (RELATIVE_NONE)
!                               ));
!                       } 
!                       else 
!                       {
!                               
!                               $GLOBALS['phpgw_info']['flags']['noheader'] = 
true;
!                               $GLOBALS['phpgw_info']['flags']['nonavbar'] = 
true;
!                               $GLOBALS['phpgw_info']['flags']['noappheader'] 
= true;
!                               $GLOBALS['phpgw_info']['flags']['noappfooter'] 
= true;
!                               $ls_array = $this->bo->vfs->ls (array (
!                                               'string'        =>  
$this->bo->path.'/'.$this->bo->file,
!                                               'relatives'     => array 
(RELATIVE_ALL),
!                                               'checksubdirs'  => False,
!                                               'nofiles'       => True
!                                       )
!                               );
!                       
!                               if ($ls_array[0]['mime_type'])
!                               {
!                                       $mime_type = $ls_array[0]['mime_type'];
!                               }
!                               elseif ($GLOBALS['settings']['viewtextplain'])
!                               {
!                                       $mime_type = 'text/plain';
!                               }
!                       
!                               header('Content-type: ' . $mime_type);
!                               echo $this->bo->vfs->read (array (
!                                               'string'        => 
$this->bo->path.'/'.$this->bo->file,
!                                               'relatives'     => array 
(RELATIVE_NONE)
!                                       )
!                               );
!                       }
                        exit();;
                }
--- 991,1003 ----
                function view()
                {       
!                       $GLOBALS['phpgw_info']['flags']['noheader'] = true;
!                       $GLOBALS['phpgw_info']['flags']['nonavbar'] = true;
!                       $GLOBALS['phpgw_info']['flags']['noappheader'] = true;
!                       $GLOBALS['phpgw_info']['flags']['noappfooter'] = true;
! 
!                       $this->bo->vfs->view(array (
!                               'string'        => 
$this->bo->path.'/'.$this->bo->file,
!                               'relatives'     => array (RELATIVE_NONE)
!                       ));
                        exit();;
                }





reply via email to

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