[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] filemanager/inc class.uiaction_edit.inc.php cla...
From: |
Bettina Gille |
Subject: |
[Phpgroupware-cvs] filemanager/inc class.uiaction_edit.inc.php cla... |
Date: |
Thu, 13 Apr 2006 22:43:37 +0000 |
CVSROOT: /cvsroot/phpgroupware
Module name: filemanager
Branch:
Changes by: Bettina Gille <address@hidden> 06/04/13 22:43:37
Modified files:
inc : class.uiaction_edit.inc.php
class.uiactions.inc.php
Added files:
inc : class.attached_files.inc.php
Log message:
attached_files
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/filemanager/inc/class.attached_files.inc.php?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/filemanager/inc/class.uiaction_edit.inc.php.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/filemanager/inc/class.uiactions.inc.php.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
Patches:
Index: filemanager/inc/class.uiaction_edit.inc.php
diff -u filemanager/inc/class.uiaction_edit.inc.php:1.11
filemanager/inc/class.uiaction_edit.inc.php:1.12
--- filemanager/inc/class.uiaction_edit.inc.php:1.11 Thu Apr 28 20:45:53 2005
+++ filemanager/inc/class.uiaction_edit.inc.php Thu Apr 13 22:43:37 2006
@@ -3,10 +3,10 @@
* phpGroupWare Filemanager
* @author Jonathon Sim <address@hidden>
* @author Bettina Gille <address@hidden>
- * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc
http://www.fsf.org/
+ * @copyright Copyright (C) 2000-2006 Free Software Foundation, Inc
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package filemanager
- * @version $Id: class.uiaction_edit.inc.php,v 1.11 2005/04/28 20:45:53
powerstat Exp $
+ * @version $Id: class.uiaction_edit.inc.php,v 1.12 2006/04/13 22:43:37
ceb Exp $
*/
/**
Index: filemanager/inc/class.uiactions.inc.php
diff -u filemanager/inc/class.uiactions.inc.php:1.4
filemanager/inc/class.uiactions.inc.php:1.5
--- filemanager/inc/class.uiactions.inc.php:1.4 Thu Apr 28 20:45:53 2005
+++ filemanager/inc/class.uiactions.inc.php Thu Apr 13 22:43:37 2006
@@ -2,12 +2,11 @@
/***
* Filemanager - Attached files
*
- * @author Bettina Gille address@hidden
- * @author Lars Piepho <address@hidden>
+ * @author Jonathon Sim <address@hidden>
* @copyright Copyright (C) 2005 Free Software Foundation, Inc.
http://www.fsf.org/
* @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
* @package filemanager
- * @version $Id: class.uiactions.inc.php,v 1.4 2005/04/28 20:45:53
powerstat Exp $
+ * @version $Id: class.uiactions.inc.php,v 1.5 2006/04/13 22:43:37 ceb
Exp $
* @internal $Source:
/cvsroot/phpgroupware/filemanager/inc/class.uiactions.inc.php,v $
*/
@@ -18,167 +17,6 @@
*/
class uiactions
{
- var $public_functions = array
- (
- 'show_file' => True,
- 'save_file' => True,
- 'delete_file' => True,
- 'get_file' => True
- );
- var $file;
- var $action_id;
- var $app;
- var $appdir;
-
- function uiactions()
- {
- $this->app =
$_REQUEST['app']?$_REQUEST['app']:$GLOBALS['phpgw_info']['flags']['currentapp'];
- $this->appdir = $GLOBALS['basedir'] . '/' .
$this->app;
-
- $this->file = $_REQUEST['file'];
- $this->action_id = $_REQUEST['action_id'];
-
- if (@!is_object($GLOBALS['phpgw']->vfs))
- {
- $GLOBALS['phpgw']->vfs = CreateObject
('phpgwapi.vfs');
- }
- $GLOBALS['phpgw']->vfs->override_acl = True;
- }
-
- function show_file()
- {
- $ls_array = $GLOBALS['phpgw']->vfs->ls(array
- (
- 'string' => $this->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 = 'application/octet-stream;';
- }
- $filename = basename($this->file);
- header('Content-type: ' . $mime_type);
- header('Content-Disposition: attachment; filename=' .
$filename);
- echo $GLOBALS['phpgw']->vfs->read(array
- (
- 'string' => $this->file,
- 'relatives' => array(RELATIVE_NONE)
- ));
- $GLOBALS['phpgw']->common->phpgw_exit();
- }
-
- function save_file($action_id, $source = '', $destination = '')
- {
- //Check if home/groupdirectory exists. If not, we
create it
- if (!file_exists($this->appdir))
- {
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->mkdir(array
- (
- 'string' => $this->appdir,
- 'relatives' => array (RELATIVE_ALL)
- ));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
- }
-
- $attdir = $this->appdir . '/' . $action_id;
-
- if (!file_exists($attdir))
- {
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->mkdir(array
- (
- 'string' => $attdir,
- 'relatives' => array (RELATIVE_ALL)
- ));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
- }
-
- if(!$source || !$destination)
- {
- $source = $_FILES['attachment']['tmp_name'];
- $destination = $_FILES['attachment']['name'];
- }
-
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->cp(array
- (
- 'from' => $source,
- 'to' => $attdir . '/' . $destination,
- 'relatives' => array
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL)
- ));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
- }
-
- function delete_file()
- {
- //$this->app = $_GET['app'];
- //$this->appdir = $GLOBALS['basedir'] . '/' .
$this->app;
-
- if(!$this->file && file_exists($this->appdir . '/' .
$this->action_id))
- {
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->delete(array
- (
- 'string' => $this->appdir . '/'
. $this->action_id,
- 'relatives' => array (RELATIVE_ALL)
- ));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
- }
- elseif($this->file)
- {
- $GLOBALS['phpgw']->vfs->override_acl = 1;
- $GLOBALS['phpgw']->vfs->rm(array
- (
- 'string' => $this->appdir . '/'
. $this->action_id . '/' . $this->file,
- 'relatives' => array (RELATIVE_ALL)
- ));
- $GLOBALS['phpgw']->vfs->override_acl = 0;
-
- Header('Location: ' . $_SERVER['HTTP_REFERER']);
- //$GLOBALS['phpgw']->redirect_link($referer);
- }
- }
-
- function get_files($action_id, $delete = False)
- {
- $directory = '/' . $this->app . '/' . $action_id;
-
- $GLOBALS['phpgw']->db->query("SELECT name from
phpgw_vfs where directory like '" . $directory . "' AND size > 0 AND mime_type
NOT like 'journal-deleted'",__LINE__,__FILE__);
-
- while($GLOBALS['phpgw']->db->next_record() != '')
- {
- $attachment = $directory . '/' .
$GLOBALS['phpgw']->db->f('name');
-
- $view_link =
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'filemanager.uiactions.show_file','file' => $attachment,'app' => $this->app));
- if($delete)
- {
- $del_link =
$GLOBALS['phpgw']->link('/index.php',array
-
(
-
'menuaction'
=> 'filemanager.uiactions.delete_file',
-
'action_id'
=> $action_id,
-
'file'
=> basename($attachment),
-
'app'
=> $this->app));
- $del = '<a href="' . $del_link .
'"><img src="' . $GLOBALS['phpgw']->common->image('phpgwapi','delete') . '"
title="' . lang('delete') . '" border="0"></a>';
- }
- $att_link .= '<a href="' . $view_link . '"
target="_blank">' . basename($attachment) . '</a>  ' . $del . '<br />';
- }
- return $att_link;
- }
-
- function file_exists($data)
- {
- return $GLOBALS['phpgw']->vfs->file_exists($data);
- }
-
-
/*var $action_classes = array(
0=>'filemanager.uiaction_edit'
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] filemanager/inc class.uiaction_edit.inc.php cla...,
Bettina Gille <=