phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] filemanager/inc class.bofilemanager.inc.php, 1.13 hoo


From: ceb
Subject: [Phpgroupware-cvs] filemanager/inc class.bofilemanager.inc.php, 1.13 hook_add_def_pref.inc.php, 1.9 class.uiaction_edit.inc.php, 1.6 class.uifilemanager.inc.php, 1.18
Date: Thu, 24 Feb 2005 15:10:08 -0000

Update of filemanager/inc

Modified Files:
     Branch: MAIN
            class.bofilemanager.inc.php lines: +25 -22
            hook_add_def_pref.inc.php lines: +13 -19
            class.uiaction_edit.inc.php lines: +51 -49
            class.uifilemanager.inc.php lines: +11 -14

Log Message:
update

====================================================
Index: filemanager/inc/class.bofilemanager.inc.php
diff -u filemanager/inc/class.bofilemanager.inc.php:1.12 
filemanager/inc/class.bofilemanager.inc.php:1.13
--- filemanager/inc/class.bofilemanager.inc.php:1.12    Tue Jan 25 18:42:58 2005
+++ filemanager/inc/class.bofilemanager.inc.php Wed Jan 26 01:14:36 2005
@@ -136,11 +136,11 @@
                        {
                                $this->filesdir = '';
                        }
-                       $this->hostname = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->filesdir;
-                       $this->userinfo['username'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
-                       $this->userinfo['account_lid'] = 
$GLOBALS['phpgw']->accounts->id2name($this->userinfo['username']);
-                       $this->userinfo['hdspace'] = 10000000000;
-                       $this->homedir = 
$this->fakebase.SEP.$this->userinfo['account_lid'];
+                       $this->hostname                                 = 
$GLOBALS['phpgw_info']['server']['webserver_url'].$this->filesdir;
+                       $this->userinfo['account_id']   = 
$GLOBALS['phpgw_info']['user']['account_id'];
+                       $this->userinfo['account_lid']  = 
$GLOBALS['phpgw']->accounts->id2name($this->userinfo['account_id']);
+                       $this->userinfo['hdspace']              = 10000000000;
+                       $this->homedir                                  = 
$this->fakebase.SEP.$this->userinfo['account_lid'];

                        if(!defined('NULL'))
                        {
@@ -181,9 +181,7 @@
                        if(!$this->path)
                        {
                                $this->path = $GLOBALS['phpgw']->vfs->pwd();
-                               if (!$this->path || 
$GLOBALS['phpgw']->vfs->pwd(array(
-                                       'full' => False
-                                       )) == '')
+                               if (!$this->path || 
$GLOBALS['phpgw']->vfs->pwd(array('full' => False)) == '')
                                {
                                        $this->path = $this->homedir;
                                }
@@ -251,7 +249,7 @@
                        # Get their memberships to be used throughout the script
                        ###

-                       $groups = 
$GLOBALS['phpgw']->accounts->membership($this->userinfo['username']);
+                       $groups = 
$GLOBALS['phpgw']->accounts->membership($this->userinfo['account_id']);

                        if(!is_array($groups))
                        {
@@ -263,17 +261,23 @@
                        # Don't list directories for groups that don't have 
access
                        ###

-
                        for($i=0;$i<count($groups);++$i)
                        {
-                               $applications = 
CreateObject('phpgwapi.applications',$groups[$i]['account_id']);
-                               $apps = $applications->read_account_specific();
-                               //_debug_array($apps);
-                               if(!$apps[$this->appname])
+                               if 
($GLOBALS['phpgw']->vfs->acl_check(array('owner_id' => 
$groups[$i]['account_id'],'operation' => PHPGW_ACL_READ)))
+                               {
+                                       $applications = 
CreateObject('phpgwapi.applications',$groups[$i]['account_id']);
+                                       $apps = 
$applications->read_account_specific();
+                                       //_debug_array($apps);
+                                       if(!$apps[$this->appname])
+                                       {
+                                               unset($groups[$i]);
+                                       }
+                                       unset($applications);
+                               }
+                               else
                                {
                                        unset($groups[$i]);
                                }
-                               unset($applications);
                        }
                        reset($groups);
                        $this->memberships = $groups;
@@ -289,7 +293,7 @@
                        }
                        else
                        {
-                               $GLOBALS['phpgw']->vfs->working_id = 
$this->userinfo['username'];
+                               $GLOBALS['phpgw']->vfs->working_id = 
$this->userinfo['account_id'];
                        }
                }

@@ -771,7 +775,7 @@
                function f_upload()
                {
                        $result = Array();
-                       for ($i = 0; $i != $this->show_upload_boxes; $i++)
+                       for ($i = 0;$i<$this->show_upload_boxes;++$i)
                        {
                                if ($badchar = $this->bad_chars 
($this->upload_file['name'][$i], True, True))
                                {
@@ -819,8 +823,8 @@
                                                                        
'string'        => $this->upload_file['name'][$i],
                                                                        
'relatives'     => array (RELATIVE_ALL),
                                                                        
'attributes'    => array (
-                                                                               
                'owner_id' => $GLOBALS['userinfo']['username'],
-                                                                               
                'modifiedby_id' => $GLOBALS['userinfo']['username'],
+                                                                               
                '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],
@@ -885,10 +889,9 @@
                                        $result .= ' Created 
'.$this->path.'/'.$this->upload_file['name'][$i].' '. $this->file_size[$i];
                                }
                        }
-
                        return $result;
-
                }
+
                function load_help_info()
                {
                        $this->help_info = Array(

====================================================
Index: filemanager/inc/hook_add_def_pref.inc.php
diff -u filemanager/inc/hook_add_def_pref.inc.php:1.8 
filemanager/inc/hook_add_def_pref.inc.php:1.9
--- filemanager/inc/hook_add_def_pref.inc.php:1.8       Tue Jan 18 16:47:53 2005
+++ filemanager/inc/hook_add_def_pref.inc.php   Wed Jan 26 01:14:36 2005
@@ -1,23 +1,17 @@
 <?php

-global $pref;
-
-$pref->change ('filemanager', 'name', True);
-$pref->change ('filemanager', 'mime_type', False);
-$pref->change ('filemanager', 'size', True);
-$pref->change ('filemanager', 'created', True);
-$pref->change ('filemanager', 'modified', True);
-//$pref->change ('filemanager', 'owner', False);
-$pref->change ('filemanager', 'createdby_id', True);
-$pref->change ('filemanager', 'modifiedby_id', True);
-//$pref->change ('filemanager', 'app', False);
-$pref->change ('filemanager', 'comment', True);
-//$pref->change ('filemanager', 'viewinnewwin', False);
-//$pref->change ('filemanager', 'viewonserver', False);
-$pref->change ('filemanager', 'viewtextplain', True);
-//$pref->change ('filemanager', 'dotdot', False);
-//$pref->change ('filemanager', 'dotfiles', False);
-//$pref->change ('filemanager', 'show_help', False);
-$pref->change ('filemanager', 'show_upload_boxes', '5');
+       $GLOBALS['pref']->change ('filemanager', 'name', True);
+       $GLOBALS['pref']->change ('filemanager', 'mime_type', False);
+       $GLOBALS['pref']->change ('filemanager', 'size', True);
+       $GLOBALS['pref']->change ('filemanager', 'created', True);
+       $GLOBALS['pref']->change ('filemanager', 'modified', True);
+       $GLOBALS['pref']->change ('filemanager', 'createdby_id', True);
+       $GLOBALS['pref']->change ('filemanager', 'modifiedby_id', True);
+       $GLOBALS['pref']->change ('filemanager', 'comment', True);
+       $GLOBALS['pref']->change ('filemanager', 'viewtextplain', True);
+       $GLOBALS['pref']->change ('filemanager', 'dotdot', False);
+       $GLOBALS['pref']->change ('filemanager', 'dotfiles', False);
+       $GLOBALS['pref']->change ('filemanager', 'show_help', False);
+       $GLOBALS['pref']->change ('filemanager', 'show_upload_boxes','5');

 ?>

====================================================
Index: filemanager/inc/class.uiaction_edit.inc.php
diff -u filemanager/inc/class.uiaction_edit.inc.php:1.5 
filemanager/inc/class.uiaction_edit.inc.php:1.6
--- filemanager/inc/class.uiaction_edit.inc.php:1.5     Thu Jan 20 01:13:30 2005
+++ filemanager/inc/class.uiaction_edit.inc.php Wed Jan 26 01:14:36 2005
@@ -5,98 +5,91 @@
        class uiaction_edit extends uiaction_base
        {
                //Lists the suported actions (human readable) indexed by their 
function name
-               var $actions=array(
-                       'edit' => 'Edit',
-                       'edit_save' => false,
-                       'edit_preview' => false,
-                       'edit_cancel' => false
+               var $public_functions = array
+               (
+                       'edit' => True
                );
-
+
                function uiaction_edit()
-               {
-                                       $this->bo = 
CreateObject('filemanager.bofilemanager');
+               {
+                                       $this->bofilemanager = 
CreateObject('filemanager.bofilemanager');

                                        
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));

                                        $var = Array(
                                        'img_up' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'up'),
+                                                                               
        '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)
                                                                                
                ))
                                                                                
        )),

                                        '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,
+                                       'dir' => $this->bofilemanager->path,
                                        'img_dir' => array('widget' => 
array('type' => 'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'folder_large'),
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'folder_large'),
                                                                                
        'alt' => lang('folder')
                                                                                
        )),
                                );
-                               //$GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('filemanager_nav' => $var));
-
-                       $this->template_dir = 
$GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']);
+                               $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('filemanager_nav' => $var));
+                       //$this->template_dir = 
$GLOBALS['phpgw']->common->get_tpl_dir($GLOBALS['phpgw_info']['flags']['currentapp']);
                }

-               function edit($parent, $param=false)
+               function edit($parent = 0,$param = false)
                {
-
                        $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',
-                                                                               
        'path'  => $this->bo->path
-                                                                               
)
-                                                                       )));
+
                        $this->load_header();
-                       $this->bo = &$parent->bo;
+                       //$this->bofilemanager = &$parent->bofilemanager;
                        if (UIEDIT_DEBUG) echo ' action::edit ';
                        $edit_file = get_var('file', array('GET', 'POST'));
                        if (!strlen($edit_file))
                        {
-                               $edit_file = $this->bo->fileman[0];
+                               $edit_file = $this->bofilemanager->fileman[0];
                        }
-/*                     $this->bo->vfs->cd(array(
-                               'string' => $this->bo->path,
+/*                     $GLOBALS['phpgw']->vfs->cd(array(
+                               'string' => $this->bofilemanager->path,
                                'relatives' => array(RELATIVE_NONE)
                                ));

-       //              echo "path ".$this->bo->vfs->pwd()." Editing: 
".$edit_file;
+       //              echo "path ".$GLOBALS['phpgw']->vfs->pwd()." Editing: 
".$edit_file;
 */
                        $vars = array();
-                       $vars['action1'][] = array('widget' => array('type' => 
'img',
-                                                                               
        'src' => $GLOBALS['phpgw']->common->image($this->bo->appname,'preview'),
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'preview'),
                                                                                
        ));
-                       $vars['action1'][] = array('widget' => array('type' => 
'submit',
+                       $vars[] = array('widget' => array('type' => 'submit',
                                                 'name' => 
"uiaction_edit_preview",
                                                 'value'=>lang('preview')
                                                 ));
-                       $vars['action2'][] = array('widget' => array('type' => 
'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'filesave'),
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'filesave'),
                                                                                
        ));
-                       $vars['action2'][]  = array('widget' => array('type' => 
'submit',
+                       $vars[]  = array('widget' => array('type' => 'submit',
                                        'name' => 'uiaction_edit_save',
                                        'value'=>lang('save')
                                        ));
-                       $vars['action3'][] = array('widget' => array('type' => 
'img',
-                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bo->appname,'button_cancel'),
+                       $vars[] = array('widget' => array('type' => 'image',
+                                                                               
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'button_cancel'),
                                                                                
        ));

-                       $vars['action3'][] = array('widget' => array('type' => 
'submit',
+                       $vars[] = array('widget' => array('type' => 'submit',
                                        'name' => 'uiaction_edit_cancel',
                                        'value'=>lang('close')
                                        ));
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('nav_data' => $vars));
+
+                       $data['nav_data'] = $vars;
+
                        $vars = array('filename' => $edit_file);

                        if (get_var('edited', array('GET', 'POST')))
@@ -109,18 +102,18 @@
                        }
                        else
                        {
-                               $content = $this->bo->vfs->read (array 
('string' => $edit_file));
+                               $content = $GLOBALS['phpgw']->vfs->read (array 
('string' => $edit_file));
                        }

                        if ($param == 'edit_preview')
                        {
                                $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('preview'=>$content));
-                       //      $vars['preview'] = nl2br($content);
+                               $vars['preview'] = nl2br($content);
                        }

                        elseif ($param =='edit_save')
                        {
-                               if ($this->bo->vfs->write (array (
+                               if ($GLOBALS['phpgw']->vfs->write (array (
                                                'string'        => 
$parent->bo->path.'/'.$edit_file ,
                                                'relatives' => 
array(RELATIVE_NONE),
                                                'content'       => $content
@@ -135,7 +128,7 @@
                                }
                        }

-                               if ($edit_file && $this->bo->vfs->file_exists 
(array (
+                               if ($edit_file && 
$GLOBALS['phpgw']->vfs->file_exists (array (
                                                                'string'        
=> $edit_file,
                                                                'relatives'     
=> array (RELATIVE_ALL)
                                        ))
@@ -153,14 +146,23 @@

                                        $vars['form_data'][] = array('widget' 
=> array('type'=>"hidden",
                                                                'name'=> 
"fileman[0]",
-                                                               'value' => 
$this->bo->html_encode($edit_file,1)
+                                                               'value' => 
$this->bofilemanager->html_encode($edit_file,1)
                                                                ));
                                        $vars['file_content'] =  $content;
                                }
                        //}
-                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('filemanager_edit' => $vars));
+
+                       $output = array
+                       (
+                               'form_action'           => 
$GLOBALS['phpgw']->link('/index.php',array('menuaction' => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action',
+                                                                               
                                                                                
'path' => $this->bofilemanager->path)),
+                               'filemanager_nav'       => $data,
+                               'filemanager_edit'      => $vars
+                       );
+
+                       $GLOBALS['phpgw']->xslttpl->set_var('phpgw', 
array('edit' => $output));
                }
-
+
                function edit_cancel($parent)
                {
                         $url = $GLOBALS['phpgw']->link('/index.php',

====================================================
Index: filemanager/inc/class.uifilemanager.inc.php
diff -u filemanager/inc/class.uifilemanager.inc.php:1.17 
filemanager/inc/class.uifilemanager.inc.php:1.18
--- filemanager/inc/class.uifilemanager.inc.php:1.17    Tue Jan 25 18:42:58 2005
+++ filemanager/inc/class.uifilemanager.inc.php Wed Jan 26 01:14:36 2005
@@ -220,9 +220,9 @@
                                $this->cancel();
                                exit();
                        }
-                       //If the action is a "uiaction" (ie it has its own 
seperate interface), this will run it
-                       //$this->actions->dispatch($this);
-                       //@reset($actions);
+                       /*If the action is a "uiaction" (ie it has its own 
seperate interface), this will run it
+                       $this->actions->dispatch($this);
+                       @reset($actions);*/

                        if(is_array($params))
                        {
@@ -705,13 +705,13 @@
                                                                                
                ));
                                                                        if 
($mime_parts[0] == 'text')
                                                                        {
-                                                                               
                $href['menuaction'] = 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.action';
-                                                                               
                $href['uiaction'] = 'edit';
-                                                                               
                $file_output[$i]['name']['edit'] = array('widget' => array( 
'type' => 'img',
+                                                                               
                $href['menuaction'] = 
$this->bofilemanager->appname.'.uiaction_edit.edit';
+                                                                               
                //$href['uiaction'] = 'edit';
+                                                                               
                $file_output[$i]['name']['edit'] = array('widget' => array( 
'type' => 'image',
                                                                                
                                'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'pencil'),
                                                                                
                                'link' =>  
$GLOBALS['phpgw']->link('/index.php', $href)
-                                                                               
                                ));
-                                                                       }
+                                                                               
                                ));
+                                                                       }
                                                                        break;
                                                                default:
                                                                        
$file_output[$i][$internal] = $file[$internal];
@@ -765,11 +765,8 @@
                                'img_upload'    => array('widget' => 
array('type' => 'image',
                                                                                
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'1uparrow'),
                                                                                
        'title' => lang('upload files'),
-                                                                               
        'link' => $GLOBALS['phpgw']->link('/index.php',Array(
-                                                                               
                        'menuaction'    => 
$this->bofilemanager->appname.'.ui'.$this->bofilemanager->appname.'.index',
-                                                                               
                        'path'          => urlencode($this->bofilemanager->path)
-                                                                               
                ))
-                                                                               
        )),
+                                                                               
        'name'  => 'params[upload]',
+                                                                               
        'value' => 'upload')),
                                'img_refresh'   => array('widget' => 
array('type' => 'image',
                                                                                
        'src' => 
$GLOBALS['phpgw']->common->image($this->bofilemanager->appname,'reload'),
                                                                                
        'title' => lang('refresh'),






reply via email to

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