Source for file Validator.php
Documentation is available at Validator.php
* Module written by Herman Kuiper <herman@ozuzo.net>
* Spreadsheet_Excel_Writer: A library for generating Excel Spreadsheets
* Copyright (c) 2002-2003 Xavier Noguer xnoguer@rezebra.com
* 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
//require_once('PEAR.php');
// Possible operator types
define("OP_NOTBETWEEN", 0x01 );
* Baseclass for generating Excel DV records (validations)
* @package Spreadsheet_Excel_Writer
* The parser from the workbook. Used to parse validation formulas also
* @var Spreadsheet_Excel_Writer_Parser
$this->_parser = $parser;
$this->_type = 0x01; // FIXME: add method for setting datatype
$this->_fixedList = false;
$this->_showprompt = false;
$this->_showerror = true;
$this->_title_prompt = "\x00";
$this->_descr_prompt = "\x00";
$this->_title_error = "\x00";
$this->_descr_error = "\x00";
$this->_operator = 0x00; // default is equal
function setPrompt($promptTitle = "\x00", $promptDescription = "\x00", $showPrompt = true )
$this->_showprompt = $showPrompt;
$this->_title_prompt = $promptTitle;
$this->_descr_prompt = $promptDescription;
function setError($errorTitle = "\x00", $errorDescription = "\x00", $showError = true )
$this->_showerror = $showError;
$this->_title_error = $errorTitle;
$this->_descr_error = $errorDescription;
// Parse the formula using the parser in Parser.php
$error = $this->_parser->parse($formula);
if (PEAR ::isError ($error)) {
if (PEAR ::isError ($this->_formula1)) {
// Parse the formula using the parser in Parser.php
$error = $this->_parser->parse($formula);
if (PEAR ::isError ($error)) {
if (PEAR ::isError ($this->_formula2)) {
$options |= $this->_style << 3;
$options |= $this->_operator << 20;
$title_prompt_len = strlen($this->_title_prompt);
$descr_prompt_len = strlen($this->_descr_prompt);
$title_error_len = strlen($this->_title_error);
$descr_error_len = strlen($this->_descr_error);
$formula1_size = strlen($this->_formula1);
$formula2_size = strlen($this->_formula2);
$data = pack("V", $this->_getOptions ());
$data .= pack("vC", $title_prompt_len, 0x00 ) . $this->_title_prompt;
$data .= pack("vC", $title_error_len, 0x00 ) . $this->_title_error;
$data .= pack("vC", $descr_prompt_len, 0x00 ) . $this->_descr_prompt;
$data .= pack("vC", $descr_error_len, 0x00 ) . $this->_descr_error;
$data .= pack("vv", $formula1_size, 0x0000 ) . $this->_formula1;
$data .= pack("vv", $formula2_size, 0x0000 ) . $this->_formula2;
/*class Spreadsheet_Excel_Writer_Validation_List extends Spreadsheet_Excel_Writer_Validation
function Spreadsheet_Excel_Writer_Validation_list()
parent::Spreadsheet_Excel_Writer_Validation();
function setList($source, $incell = true)
$this->_incell = $incell;
$this->_fixedList = true;
$source = implode("\x00", $source);
$this->_formula1 = pack("CCC", 0x17, strlen($source), 0x0c) . $source;
function setRow($row, $col1, $col2, $incell = true)
$this->_incell = $incell;
//$this->_formula1 = ...;
function setCol($col, $row1, $row2, $incell = true)
$this->_incell = $incell;
//$this->_formula1 = ...;
Documentation generated on Mon, 11 Mar 2019 13:51:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|