Commit 47d3150e authored by mose's avatar mose

removed sheet from mods to avoid confusion with integrated version

parent faf25672
......@@ -202,7 +202,6 @@ _mods/Packages/avatars-mcdonald.info.txt -text
_mods/Packages/avatars-xmen.info.txt -text
_mods/Packages/features-cc.info.txt -text
_mods/Packages/features-import-phpwiki.info.txt -text
_mods/Packages/features-tiki-sheet.info.txt -text
_mods/Packages/features-userprefstats.info.txt -text
_mods/Packages/menus-tikiring.info.txt -text
_mods/Packages/services-mailman.info.txt -text
......@@ -885,44 +884,11 @@ _mods/features/phpsource/README -text
_mods/features/phpsource/lib/php/phplib.php -text
_mods/features/phpsource/tiki-phpsource.php -text
_mods/features/tiki-sheet/README -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/conf/config.inc.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/control.js -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/index.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/reader.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/reader_ole.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/biffwriter.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/format.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/index.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/parser.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/validator.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/workbook.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/writer/worksheet.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/formula.js -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/grid.js -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/grid.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/include/core/APIC.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/include/core/APIClass.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/include/core/APIClassRegistry.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/include/core/ErrorManager.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/include/core/Object.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/index.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/ole.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/ole/index.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/ole/pps.php -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/panel.js -text
_mods/features/tiki-sheet/tikiroot/lib/sheet/style.css -text
_mods/features/tiki-sheet/tikiroot/lib/wiki-plugins/wikiplugin_sheet.php -text
_mods/features/tiki-sheet/tikiroot/templates/tiki-export_sheet.php -text
_mods/features/tiki-sheet/tikiroot/templates/tiki-history_sheets.php -text
_mods/features/tiki-sheet/tikiroot/templates/tiki-import_sheet.php -text
_mods/features/tiki-sheet/tikiroot/templates/tiki-sheets.php -text
_mods/features/tiki-sheet/tikiroot/templates/tiki-view_sheets.php -text
_mods/features/tiki-sheet/tikiroot/tiki-export_sheet.php -text
_mods/features/tiki-sheet/tikiroot/tiki-history_sheets.php -text
_mods/features/tiki-sheet/tikiroot/tiki-import_sheet.php -text
_mods/features/tiki-sheet/tikiroot/tiki-sheets.php -text
_mods/features/tiki-sheet/tikiroot/tiki-view_sheets.php -text
_mods/features/userprefstats/stats.php -text
_mods/features/userprefstats/stats.tpl -text
_mods/images/tikiwiki/tikibutton.png -text
......
contributor:
$Author: berryweb $
revision:
$Revision: 1.5 $
lastmodif:
$Date: 2004-10-25 14:49:47 $
files:
features/tiki-sheet/tikiroot/lib/sheet/conf/config.inc.php lib/sheet/conf/config.inc.php
features/tiki-sheet/tikiroot/lib/sheet/control.js lib/sheet/control.js
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/biffwriter.php lib/sheet/excel/writer/biffwriter.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/format.php lib/sheet/excel/writer/format.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/index.php lib/sheet/excel/writer/index.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/parser.php lib/sheet/excel/writer/parser.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/validator.php lib/sheet/excel/writer/validator.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/workbook.php lib/sheet/excel/writer/workbook.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer/worksheet.php lib/sheet/excel/writer/worksheet.php
features/tiki-sheet/tikiroot/lib/sheet/excel/index.php lib/sheet/excel/index.php
features/tiki-sheet/tikiroot/lib/sheet/excel/reader.php lib/sheet/excel/reader.php
features/tiki-sheet/tikiroot/lib/sheet/excel/reader_ole.php lib/sheet/excel/reader_ole.php
features/tiki-sheet/tikiroot/lib/sheet/excel/writer.php lib/sheet/excel/writer.php
features/tiki-sheet/tikiroot/lib/sheet/formula.js lib/sheet/formula.js
features/tiki-sheet/tikiroot/lib/sheet/grid.js lib/sheet/grid.js
features/tiki-sheet/tikiroot/lib/sheet/grid.php lib/sheet/grid.php
features/tiki-sheet/tikiroot/lib/sheet/include/core/APIC.php lib/sheet/include/core/APIC.php
features/tiki-sheet/tikiroot/lib/sheet/include/core/APIClass.php lib/sheet/include/core/APIClass.php
features/tiki-sheet/tikiroot/lib/sheet/include/core/APIClassRegistry.php lib/sheet/include/core/APIClassRegistry.php
features/tiki-sheet/tikiroot/lib/sheet/include/core/ErrorManager.php lib/sheet/include/core/ErrorManager.php
features/tiki-sheet/tikiroot/lib/sheet/include/core/Object.php lib/sheet/include/core/Object.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoCadre.php lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoCadre.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoImg.php lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoImg.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoTable.php lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoTable.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoText.php lib/sheet/include/org/apicnet/io/OOo/objOOo/OOoText.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoCalc.php lib/sheet/include/org/apicnet/io/OOo/OOoCalc.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoDoc.php lib/sheet/include/org/apicnet/io/OOo/OOoDoc.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoManifest.php lib/sheet/include/org/apicnet/io/OOo/OOoManifest.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoMeta.php lib/sheet/include/org/apicnet/io/OOo/OOoMeta.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoMime.php lib/sheet/include/org/apicnet/io/OOo/OOoMime.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoStyle.php lib/sheet/include/org/apicnet/io/OOo/OOoStyle.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoUtil.php lib/sheet/include/org/apicnet/io/OOo/OOoUtil.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/OOoWriter.php lib/sheet/include/org/apicnet/io/OOo/OOoWriter.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/OOo/absOOo.php lib/sheet/include/org/apicnet/io/OOo/absOOo.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/File.php lib/sheet/include/org/apicnet/io/File.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/cdir.php lib/sheet/include/org/apicnet/io/cdir.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/io/archive/CZip.php lib/sheet/include/org/apicnet/io/archive/CZip.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/util/HTTPHeader.php lib/sheet/include/org/apicnet/util/HTTPHeader.php
features/tiki-sheet/tikiroot/lib/sheet/include/org/apicnet/util/StringBuffer.php lib/sheet/include/org/apicnet/util/StringBuffer.php
features/tiki-sheet/tikiroot/lib/sheet/index.php lib/sheet/index.php
features/tiki-sheet/tikiroot/lib/sheet/ole/pps/file.php lib/sheet/ole/pps/file.php
features/tiki-sheet/tikiroot/lib/sheet/ole/pps/index.php lib/sheet/ole/pps/index.php
features/tiki-sheet/tikiroot/lib/sheet/ole/pps/root.php lib/sheet/ole/pps/root.php
features/tiki-sheet/tikiroot/lib/sheet/ole/index.php lib/sheet/ole/index.php
features/tiki-sheet/tikiroot/lib/sheet/ole/pps.php lib/sheet/ole/pps.php
features/tiki-sheet/tikiroot/lib/sheet/ole.php lib/sheet/ole.php
features/tiki-sheet/tikiroot/lib/sheet/panel.js lib/sheet/panel.js
features/tiki-sheet/tikiroot/lib/sheet/style.css lib/sheet/style.css
features/tiki-sheet/tikiroot/lib/wiki-plugins/wikiplugin_sheet.php lib/wiki-plugins/wikiplugin_sheet.php
features/tiki-sheet/tikiroot/templates/tiki-export_sheet.php templates/tiki-export_sheet.php
features/tiki-sheet/tikiroot/templates/tiki-history_sheets.php templates/tiki-history_sheets.php
features/tiki-sheet/tikiroot/templates/tiki-import_sheet.php templates/tiki-import_sheet.php
features/tiki-sheet/tikiroot/templates/tiki-sheets.php templates/tiki-sheets.php
features/tiki-sheet/tikiroot/templates/tiki-view_sheets.php templates/tiki-view_sheets.php
features/tiki-sheet/tikiroot/tiki-export_sheet.php tiki-export_sheet.php
features/tiki-sheet/tikiroot/tiki-history_sheets.php tiki-history_sheets.php
features/tiki-sheet/tikiroot/tiki-import_sheet.php tiki-import_sheet.php
features/tiki-sheet/tikiroot/tiki-sheets.php tiki-sheets.php
features/tiki-sheet/tikiroot/tiki-view_sheets.php tiki-view_sheets.php
sql-install:
INSERT INTO tiki_menu_options (menuId,type,name,url,position,section,perm,groupname) VALUES (42,'s','TikiSheet','tiki-sheets.php',780,'feature_sheet','','');
CREATE TABLE tiki_sheet_layout ( sheetId int(8) NOT NULL default '0', begin int(10) NOT NULL default '0', end int(10) default NULL, headerRow int(4) NOT NULL default '0', footerRow int(4) NOT NULL default '0', className varchar(64) default NULL, UNIQUE KEY sheetId (sheetId,begin)) TYPE=MyISAM;
CREATE TABLE tiki_sheet_values (sheetId int(8) NOT NULL default '0', begin int(10) NOT NULL default '0', end int(10) default NULL, rowIndex int(4) NOT NULL default '0', columnIndex int(4) NOT NULL default '0', value varchar(255) default NULL, calculation varchar(255) default NULL, width int(4) NOT NULL default '1', height int(4) NOT NULL default '1', format varchar(255) default NULL, UNIQUE KEY sheetId (sheetId,begin,rowIndex,columnIndex), KEY sheetId_2 (sheetId,rowIndex,columnIndex)) TYPE=MyISAM;
CREATE TABLE tiki_sheets (sheetId int(8) NOT NULL auto_increment, title varchar(200) NOT NULL default '', description text, author varchar(200) NOT NULL default '', PRIMARY KEY (sheetId)) TYPE=MyISAM;
INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_admin_sheet', 'Can admin sheet', 'admin', 'sheet');
INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_edit_sheet', 'Can create and edit sheets', 'editors', 'sheet');
INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_view_sheet', 'Can view sheet', 'basic', 'sheet');
INSERT INTO users_permissions (permName, permDesc, level, type) VALUES ('tiki_p_view_sheet_history', 'Can view sheet history', 'admin', 'sheet');
INSERT IGNORE INTO tiki_preferences(name,value) VALUES ('feature_sheet','n');
sql-remove:
DELETE FROM tiki_menu_options WHERE section = 'feature_sheet';
DROP TABLE IF EXISTS tiki_sheet_layout;
DROP TABLE IF EXISTS tiki_sheet_values;
DROP TABLE IF EXISTS tiki_sheets;
DELETE FROM users_permissions WHERE permName = 'tiki_p_admin_sheet';
DELETE FROM users_permissions WHERE permName = 'tiki_p_edit_sheet';
DELETE FROM users_permissions WHERE permName = 'tiki_p_view_sheet';
DELETE FROM users_permissions WHERE permName = 'tiki_p_view_sheet_history';
DELETE FROM tiki_preferences WHERE name = 'feature_sheet';
author:
lphuberdeau
licence:
GNU/LGPL
Description:
JavaScript based spreadsheet feature.
<?php
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
/*Information sur la configuration des chemins*/
@define("APATH_ROOT_WIN", str_replace(basename(dirname(__FILE__)), "", dirname(__FILE__)));
@define("APATH_ROOT", ereg_replace("//","/",join('/',preg_split("/[\/\\\]/",APATH_ROOT_WIN))."/"));
@define("APICO_ROOT", "http://".$_SERVER["HTTP_HOST"].str_replace($_SERVER["DOCUMENT_ROOT"], "", APATH_ROOT));
@define("CACHE_PATH", APATH_ROOT."repository");
@define("APIC_LIBRARY_PATH", APATH_ROOT."include/");
@Define("DRVXML", "DOMXML");
/*information sur la configuration de la securité @PICNet FrameWorks*/
@define("SECUR_INCLUDE", "./");
/*Configuration de la gestion des erreurs de moteur de template*/
@define("ERROR_MANAGER_SYSTEM", "on"); //Les erreurs sont remontées pour on, ignorées pour off.
@define("ERROR_MANAGER_LEVEL", "0"); //Précise le niveau d"erreur toléré, plus il est bas, moins les erreurs sont tolérées.
//@define("ERROR_MANAGER_ESCAPE", APATH_ROOT."include/org/apicnet/ui/erreur.html"); //Permet de spécifier une url locale de remplacement en cas de remontée d"erreurs.
@define("ERROR_MANAGER_LOG", APATH_ROOT."cache/erreur.log"); //Permet de définir un fichier de log.
@define("ERROR_MANAGER_ALARME", ""); //Permet de définir une série d"adresse email à laquelle sera envoyé un mail d"alerte.
/*Configuration générale de l'application*/
@define("APIC_VERBOSE_MODE", TRUE);
@define("APIC_ZEND_ENCODER_MODE", FALSE);
/*Inclusion du moteur d'import des class php*/
include_once(APATH_ROOT."include/core/APIClass.php");
?>
<?php
// $Header: /cvsroot/tikiwiki/_mods/features/tiki-sheet/tikiroot/lib/sheet/excel/index.php,v 1.1 2004-10-24 14:57:41 damosoft Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// This redirects to the sites root to prevent directory browsing
header ("location: ../index.php");
die;
?>
<?php
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
define('NUM_BIG_BLOCK_DEPOT_BLOCKS_POS', 0x2c);
define('SMALL_BLOCK_DEPOT_BLOCK_POS', 0x3c);
define('ROOT_START_BLOCK_POS', 0x30);
define('BIG_BLOCK_SIZE', 0x200);
define('SMALL_BLOCK_SIZE', 0x40);
define('EXTENSION_BLOCK_POS', 0x44);
define('NUM_EXTENSION_BLOCK_POS', 0x48);
define('PROPERTY_STORAGE_BLOCK_SIZE', 0x80);
define('BIG_BLOCK_DEPOT_BLOCKS_POS', 0x4c);
define('SMALL_BLOCK_THRESHOLD', 0x1000);
// property storage offsets
define('SIZE_OF_NAME_POS', 0x40);
define('TYPE_POS', 0x42);
define('START_BLOCK_POS', 0x74);
define('SIZE_POS', 0x78);
//echo 'ROOT_START_BLOCK_POS = '.ROOT_START_BLOCK_POS."\n";
//echo bin2hex($data[ROOT_START_BLOCK_POS])."\n";
//echo "a=";
//echo $data[ROOT_START_BLOCK_POS];
//function log
function GetInt4d($data, $pos) {
return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | (ord($data[$pos+3]) << 24);
}
class R_OLE {
var $data = '';
function R_OLE(){
}
function read($sFileName){
$this->data = file_get_contents($sFileName);
$this->numBigBlockDepotBlocks = GetInt4d($this->data, NUM_BIG_BLOCK_DEPOT_BLOCKS_POS);
$this->sbdStartBlock = GetInt4d($this->data, SMALL_BLOCK_DEPOT_BLOCK_POS);
$this->rootStartBlock = GetInt4d($this->data, ROOT_START_BLOCK_POS);
$this->extensionBlock = GetInt4d($this->data, EXTENSION_BLOCK_POS);
$this->numExtensionBlocks = GetInt4d($this->data, NUM_EXTENSION_BLOCK_POS);
//echo "sbdStartBlock = $this->sbdStartBlock\n";
$bigBlockDepotBlocks = array();
$pos = BIG_BLOCK_DEPOT_BLOCKS_POS;
$bbdBlocks = $this->numBigBlockDepotBlocks;
if ($this->numExtensionBlocks != 0) {
$bbdBlocks = (BIG_BLOCK_SIZE - BIG_BLOCK_DEPOT_BLOCKS_POS)/4;
}
for ($i = 0; $i < $bbdBlocks; $i++) {
$bigBlockDepotBlocks[$i] = GetInt4d($this->data, $pos);
$pos += 4;
}
for ($j = 0; $j < $this->numExtensionBlocks; $j++) {
$pos = ($this->extensionBlock + 1) * BIG_BLOCK_SIZE;
$blocksToRead = min($this->numBigBlockDepotBlocks - $bbdBlocks, BIG_BLOCK_SIZE / 4 - 1);
for ($i = $bbdBlocks; $i < $bbdBlocks + $blocksToRead; $i++) {
$bigBlockDepotBlocks[$i] = GetInt4d($this->data, $pos);
$pos += 4;
}
$bbdBlocks += $blocksToRead;
if ($bbdBlocks < $this->numBigBlockDepotBlocks) {
$this->extensionBlock = GetInt4d($this->data, $pos);
}
}
// readBigBlockDepot
$pos = 0;
$index = 0;
$this->bigBlockChain = array();
for ($i = 0; $i < $this->numBigBlockDepotBlocks; $i++) {
$pos = ($bigBlockDepotBlocks[$i] + 1) * BIG_BLOCK_SIZE;
for ($j = 0 ; $j < BIG_BLOCK_SIZE / 4; $j++) {
$this->bigBlockChain[$index] = GetInt4d($this->data, $pos);
$pos += 4 ;
$index++;
}
}
//echo '=====2';
// readSmallBlockDepot();
$pos = 0;
$index = 0;
$sbdBlock = $this->sbdStartBlock;
$this->smallBlockChain = array();
while ($sbdBlock != -2) {
$pos = ($sbdBlock + 1) * BIG_BLOCK_SIZE;
for ($j = 0; $j < BIG_BLOCK_SIZE / 4; $j++) {
$this->smallBlockChain[$index] = GetInt4d($this->data, $pos);
$pos += 4;
$index++;
}
$sbdBlock = $this->bigBlockChain[$sbdBlock];
}
// readData(rootStartBlock)
$block = $this->rootStartBlock;
$pos = 0;
$this->entry = $this->__readData($block);
/*
while ($block != -2) {
$pos = ($block + 1) * BIG_BLOCK_SIZE;
$this->entry = $this->entry.substr($this->data, $pos, BIG_BLOCK_SIZE);
$block = $this->bigBlockChain[$block];
}
*/
//echo '==='.$this->entry."===";
$this->__readPropertySets();
}
function __readData($bl) {
$block = $bl;
$pos = 0;
$data = '';
while ($block != -2) {
$pos = ($block + 1) * BIG_BLOCK_SIZE;
$data = $data.substr($this->data, $pos, BIG_BLOCK_SIZE);
$block = $this->bigBlockChain[$block];
}
return $data;
}
function __readPropertySets(){
$offset = 0;
while ($offset < strlen($this->entry)) {
$d = substr($this->entry, $offset, PROPERTY_STORAGE_BLOCK_SIZE);
$nameSize = ord($d[SIZE_OF_NAME_POS]) | (ord($d[SIZE_OF_NAME_POS+1]) << 8);
$type = ord($d[TYPE_POS]);
//$maxBlock = strlen($d) / BIG_BLOCK_SIZE - 1;
$startBlock = GetInt4d($d, START_BLOCK_POS);
$size = GetInt4d($d, SIZE_POS);
$name = '';
for ($i = 0; $i < $nameSize ; $i++) {
$name .= $d[$i];
}
$name = str_replace("\x00", "", $name);
$this->props[] = array (
'name' => $name,
'type' => $type,
'startBlock' => $startBlock,
'size' => $size);
if (($name == "Workbook") || ($name == "Book")) {
$this->wrkbook = count($this->props) - 1;
}
if ($name == "Root Entry") {
$this->rootentry = count($this->props) - 1;
}
//echo "name ==$name=\n";
$offset += PROPERTY_STORAGE_BLOCK_SIZE;
}
}
function getWorkBook(){
if ($this->props[$this->wrkbook]['size'] < SMALL_BLOCK_THRESHOLD){
// getSmallBlockStream(PropertyStorage ps)
$rootdata = $this->__readData($this->props[$this->rootentry]['startBlock']);
$streamData = '';
$block = $this->props[$this->wrkbook]['startBlock'];
//$count = 0;
$pos = 0;
while ($block != -2) {
$pos = $block * SMALL_BLOCK_SIZE;
$streamData .= substr($rootdata, $pos, SMALL_BLOCK_SIZE);
$block = $this->smallBlockChain[$block];
}
return $streamData;
}else{
$numBlocks = $this->props[$this->wrkbook]['size'] / BIG_BLOCK_SIZE;
if ($this->props[$this->wrkbook]['size'] % BIG_BLOCK_SIZE != 0) {
$numBlocks++;
}
if ($numBlocks == 0) return '';
//echo "numBlocks = $numBlocks\n";
//byte[] streamData = new byte[numBlocks * BIG_BLOCK_SIZE];
//print_r($this->wrkbook);
$streamData = '';
$block = $this->props[$this->wrkbook]['startBlock'];
//$count = 0;
$pos = 0;
while ($block != -2) {
$pos = ($block + 1) * BIG_BLOCK_SIZE;
$streamData .= substr($this->data, $pos, BIG_BLOCK_SIZE);
$block = $this->bigBlockChain[$block];
}
return $streamData;
}
}
}
?>
<?php
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
/*
* Module written/ported by Xavier Noguer <[email protected]>
*
* PERL Spreadsheet::WriteExcel module.
*
* The author of the Spreadsheet::WriteExcel module is John McNamara
* <[email protected]>
*
* I _DO_ maintain this code, and John McNamara has nothing to do with the
* porting of this code to PHP. Any questions directly related to this
* class library should be directed to me.
*
* License Information:
*
* Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets
* Copyright (c) 2002-2003 Xavier Noguer [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Class for writing Excel Spreadsheets. This class should change COMPLETELY.
*
* @author Xavier Noguer <[email protected]>
* @category FileFormats
* @package Spreadsheet_Excel_Writer
*/
class Spreadsheet_Excel_Writer extends Spreadsheet_Excel_Writer_Workbook
{
/**
* The constructor. It just creates a Workbook
*
* @param string $filename The optional filename for the Workbook.
* @return Spreadsheet_Excel_Writer_Workbook The Workbook created
*/
function Spreadsheet_Excel_Writer($filename = '')
{
$this->_filename = $filename;
$this->Spreadsheet_Excel_Writer_Workbook($filename);
}
/**
* Send HTTP headers for the Excel file.
*
* @param string $filename The filename to use for HTTP headers
* @access public
*/
function send($filename)
{
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");
}
/**
* Utility function for writing formulas
* Converts a cell's coordinates to the A1 format.
*
* @access public
* @static
* @param integer $row Row for the cell to convert (0-indexed).
* @param integer $col Column for the cell to convert (0-indexed).
* @return string The cell identifier in A1 format
*/
function rowcolToCell($row, $col)
{
if ($col > 255) { //maximum column value exceeded
return new PEAR_Error("Maximum column value exceeded: $col");
}
$int = (int)($col / 26);
$frac = $col % 26;
$chr1 = '';
if ($int > 0) {
$chr1 = chr(ord('A') + $int - 1);
}
$chr2 = chr(ord('A') + $frac);
$row++;
return $chr1.$chr2.$row;
}
}
?>
<?php
/*
* Module written/ported by Xavier Noguer <[email protected]>
*
* The majority of this is _NOT_ my code. I simply ported it from the
* PERL Spreadsheet::WriteExcel module.
*
* The author of the Spreadsheet::WriteExcel module is John McNamara
* <[email protected]>
*
* I _DO_ maintain this code, and John McNamara has nothing to do with the
* porting of this code to PHP. Any questions directly related to this
* class library should be directed to me.
*
* License Information:
*
* Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets
* Copyright (c) 2002-2003 Xavier Noguer [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Class for writing Excel BIFF records.
*
* From "MICROSOFT EXCEL BINARY FILE FORMAT" by Mark O'Brien (Microsoft Corporation):
*
* BIFF (BInary File Format) is the file format in which Excel documents are
* saved on disk. A BIFF file is a complete description of an Excel document.
* BIFF files consist of sequences of variable-length records. There are many
* different types of BIFF records. For example, one record type describes a
* formula entered into a cell; one describes the size and location of a
* window into a document; another describes a picture format.
*
* @author Xavier Noguer <[email protected]>
* @category FileFormats
* @package Spreadsheet_Excel_Writer
*/
class Spreadsheet_Excel_Writer_BIFFwriter extends PEAR
{
/**
* The BIFF/Excel version (5).
* @var integer
*/
var $_BIFF_version = 0x0500;
/**
* The byte order of this architecture. 0 => little endian, 1 => big endian
* @var integer
*/
var $_byte_order;
/**
* The string containing the data of the BIFF stream
* @var string
*/
var $_data;
/**
* The size of the data in bytes. Should be the same as strlen($this->_data)
* @var integer
*/