mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Fixes a problem with file viewing using vfs_sql - where XSLT gets in the way of outputing binary data. XSLT still gets in the way of outputting binary data (grrr), but now we side-step it by using a seperate non-xslt "view.php"
This commit is contained in:
parent
54036d56b3
commit
90d7d2b3b0
@ -79,7 +79,7 @@
|
||||
$this->create_home_dir();
|
||||
$this->verify_path();
|
||||
$this->update();
|
||||
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));
|
||||
|
||||
}
|
||||
|
||||
function load_header()
|
||||
@ -90,7 +90,9 @@
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['noappfooter']);
|
||||
unset($GLOBALS['phpgw_info']['flags']['headonly']);
|
||||
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));
|
||||
$GLOBALS['phpgw']->xslttpl->add_file(array($GLOBALS['phpgw']->common->get_tpl_dir('phpgwapi','default') . SEP . 'app_header'));
|
||||
|
||||
}
|
||||
function no_header()
|
||||
{
|
||||
@ -99,7 +101,7 @@
|
||||
$GLOBALS['phpgw_info']['flags']['noappheader'] = True;
|
||||
$GLOBALS['phpgw_info']['flags']['noappfooter'] = True;
|
||||
$GLOBALS['phpgw_info']['flags']['headonly'] = True;
|
||||
|
||||
$GLOBALS['phpgw']->xslttpl->add_file(array('widgets'));
|
||||
|
||||
|
||||
}
|
||||
@ -743,6 +745,7 @@
|
||||
}
|
||||
|
||||
$files_array = $this->bo->load_files();
|
||||
|
||||
$usage = 0;
|
||||
$files_array = $this->dirs_first($files_array);
|
||||
if(count($files_array) || $this->bo->cwd)
|
||||
@ -760,11 +763,10 @@
|
||||
'value' => $file['name']
|
||||
));
|
||||
}
|
||||
|
||||
@reset($this->bo->file_attributes);
|
||||
while(list($internal,$displayed) = each($this->bo->file_attributes))
|
||||
{
|
||||
if ($this->bo->settings[$internal])
|
||||
if (!is_array($this->bo->settings)||$this->bo->settings[$internal])
|
||||
{
|
||||
if ($internal==$edit[$file['name']])
|
||||
{
|
||||
@ -849,6 +851,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('summary' => array(
|
||||
'file_count' => count($files_array),
|
||||
@ -991,17 +994,14 @@
|
||||
$this->index($edit);
|
||||
}
|
||||
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();;
|
||||
{
|
||||
Header('Location: '.$GLOBALS['phpgw']->link(
|
||||
'view.php',
|
||||
Array('path' => urlencode($this->bo->path),
|
||||
'file' => urlencode($this->bo->file))
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function history()
|
||||
|
@ -18,8 +18,7 @@
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True,
|
||||
'xslt_app' => True
|
||||
'nofooter' => True
|
||||
);
|
||||
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
|
||||
|
||||
@ -29,7 +28,7 @@
|
||||
'menuaction'=> 'filemanager.uifilemanager.index'
|
||||
);
|
||||
|
||||
Header('Location: '.$GLOBALS['phpgw']->link('/index.php',$parms));
|
||||
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php',$parms));
|
||||
$GLOBALS['phpgw_info']['flags']['nodisplay'] = True;
|
||||
exit;
|
||||
?>
|
||||
|
35
filemanager/view.php
Normal file
35
filemanager/view.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* This file written by Jonathon Sim <sim@zeald.com> for Zeald Ltd *
|
||||
* View interface for the filemanager *
|
||||
* Copyright (C) 2003 Zeald Ltd *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/*Due to incredibly annoying aspects of the XSLT template system, to be able to
|
||||
output binary data you need to bypass XSLT altogether. Hence this file. */
|
||||
|
||||
$phpgw_flags = Array(
|
||||
'currentapp' => 'filemanager',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'noappheader' => True,
|
||||
'noappfooter' => True,
|
||||
'nofooter' => True
|
||||
);
|
||||
$GLOBALS['phpgw_info']['flags'] = $phpgw_flags;
|
||||
|
||||
include('../header.inc.php');
|
||||
|
||||
$ui = CreateObject($phpgw_flags['currentapp'].'.uifilemanager');
|
||||
$ui->bo->vfs->view(array (
|
||||
'string' => $ui->bo->path.'/'.$ui->bo->file,
|
||||
'relatives' => array (RELATIVE_NONE)
|
||||
));
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user