ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Spreadsheet_Excel_Writer_Validator Class Reference
+ Collaboration diagram for Spreadsheet_Excel_Writer_Validator:

Public Member Functions

 Spreadsheet_Excel_Writer_Validator (&$parser)
 
 setPrompt ($promptTitle="\0", $promptDescription="\0", $showPrompt=true)
 
 setError ($errorTitle="\0", $errorDescription="\0", $showError=true)
 
 allowBlank ()
 
 onInvalidStop ()
 
 onInvalidWarn ()
 
 onInvalidInfo ()
 
 setFormula1 ($formula)
 
 setFormula2 ($formula)
 
 _getOptions ()
 
 _getData ()
 

Data Fields

 $_type
 
 $_style
 
 $_fixedList
 
 $_blank
 
 $_incell
 
 $_showprompt
 
 $_showerror
 
 $_title_prompt
 
 $_descr_prompt
 
 $_title_error
 
 $_descr_error
 
 $_operator
 
 $_formula1
 
 $_formula2
 
 $_parser
 

Detailed Description

Definition at line 48 of file Validator.php.

Member Function Documentation

◆ _getData()

Spreadsheet_Excel_Writer_Validator::_getData ( )

Definition at line 177 of file Validator.php.

References $_descr_error, $_descr_prompt, $_formula1, $_formula2, $_title_error, $_title_prompt, $data, and _getOptions().

178  {
179  $title_prompt_len = strlen($this->_title_prompt);
180  $descr_prompt_len = strlen($this->_descr_prompt);
181  $title_error_len = strlen($this->_title_error);
182  $descr_error_len = strlen($this->_descr_error);
183 
184  $formula1_size = strlen($this->_formula1);
185  $formula2_size = strlen($this->_formula2);
186 
187  $data = pack("V", $this->_getOptions());
188  $data .= pack("vC", $title_prompt_len, 0x00) . $this->_title_prompt;
189  $data .= pack("vC", $title_error_len, 0x00) . $this->_title_error;
190  $data .= pack("vC", $descr_prompt_len, 0x00) . $this->_descr_prompt;
191  $data .= pack("vC", $descr_error_len, 0x00) . $this->_descr_error;
192 
193  $data .= pack("vv", $formula1_size, 0x0000) . $this->_formula1;
194  $data .= pack("vv", $formula2_size, 0x0000) . $this->_formula2;
195 
196  return $data;
197  }
+ Here is the call graph for this function:

◆ _getOptions()

Spreadsheet_Excel_Writer_Validator::_getOptions ( )

Definition at line 153 of file Validator.php.

References $_type, and $options.

Referenced by _getData().

154  {
156  $options |= $this->_style << 3;
157  if ($this->_fixedList) {
158  $options |= 0x80;
159  }
160  if ($this->_blank) {
161  $options |= 0x100;
162  }
163  if (!$this->_incell) {
164  $options |= 0x200;
165  }
166  if ($this->_showprompt) {
167  $options |= 0x40000;
168  }
169  if ($this->_showerror) {
170  $options |= 0x80000;
171  }
172  $options |= $this->_operator << 20;
173 
174  return $options;
175  }
if(!is_array($argv)) $options
+ Here is the caller graph for this function:

◆ allowBlank()

Spreadsheet_Excel_Writer_Validator::allowBlank ( )

Definition at line 103 of file Validator.php.

104  {
105  $this->_blank = true;
106  }

◆ onInvalidInfo()

Spreadsheet_Excel_Writer_Validator::onInvalidInfo ( )

Definition at line 118 of file Validator.php.

119  {
120  $this->_style = 0x02;
121  }

◆ onInvalidStop()

Spreadsheet_Excel_Writer_Validator::onInvalidStop ( )

Definition at line 108 of file Validator.php.

109  {
110  $this->_style = 0x00;
111  }

◆ onInvalidWarn()

Spreadsheet_Excel_Writer_Validator::onInvalidWarn ( )

Definition at line 113 of file Validator.php.

114  {
115  $this->_style = 0x01;
116  }

◆ setError()

Spreadsheet_Excel_Writer_Validator::setError (   $errorTitle = "\x00",
  $errorDescription = "\x00",
  $showError = true 
)

Definition at line 96 of file Validator.php.

97  {
98  $this->_showerror = $showError;
99  $this->_title_error = $errorTitle;
100  $this->_descr_error = $errorDescription;
101  }

◆ setFormula1()

Spreadsheet_Excel_Writer_Validator::setFormula1 (   $formula)

Definition at line 123 of file Validator.php.

References $_formula1, and PEAR\isError().

124  {
125  // Parse the formula using the parser in Parser.php
126  $error = $this->_parser->parse($formula);
127  if (PEAR::isError($error)) {
128  return $this->_formula1;
129  }
130 
131  $this->_formula1 = $this->_parser->toReversePolish();
132  if (PEAR::isError($this->_formula1)) {
133  return $this->_formula1;
134  }
135  return true;
136  }
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:279
+ Here is the call graph for this function:

◆ setFormula2()

Spreadsheet_Excel_Writer_Validator::setFormula2 (   $formula)

Definition at line 138 of file Validator.php.

References $_formula2, and PEAR\isError().

139  {
140  // Parse the formula using the parser in Parser.php
141  $error = $this->_parser->parse($formula);
142  if (PEAR::isError($error)) {
143  return $this->_formula2;
144  }
145 
146  $this->_formula2 = $this->_parser->toReversePolish();
147  if (PEAR::isError($this->_formula2)) {
148  return $this->_formula2;
149  }
150  return true;
151  }
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:279
+ Here is the call graph for this function:

◆ setPrompt()

Spreadsheet_Excel_Writer_Validator::setPrompt (   $promptTitle = "\x00",
  $promptDescription = "\x00",
  $showPrompt = true 
)

Definition at line 89 of file Validator.php.

90  {
91  $this->_showprompt = $showPrompt;
92  $this->_title_prompt = $promptTitle;
93  $this->_descr_prompt = $promptDescription;
94  }

◆ Spreadsheet_Excel_Writer_Validator()

Spreadsheet_Excel_Writer_Validator::Spreadsheet_Excel_Writer_Validator ( $parser)

Definition at line 70 of file Validator.php.

71  {
72  $this->_parser = $parser;
73  $this->_type = 0x01; // FIXME: add method for setting datatype
74  $this->_style = 0x00;
75  $this->_fixedList = false;
76  $this->_blank = false;
77  $this->_incell = false;
78  $this->_showprompt = false;
79  $this->_showerror = true;
80  $this->_title_prompt = "\x00";
81  $this->_descr_prompt = "\x00";
82  $this->_title_error = "\x00";
83  $this->_descr_error = "\x00";
84  $this->_operator = 0x00; // default is equal
85  $this->_formula1 = '';
86  $this->_formula2 = '';
87  }

Field Documentation

◆ $_blank

Spreadsheet_Excel_Writer_Validator::$_blank

Definition at line 53 of file Validator.php.

◆ $_descr_error

Spreadsheet_Excel_Writer_Validator::$_descr_error

Definition at line 60 of file Validator.php.

Referenced by _getData().

◆ $_descr_prompt

Spreadsheet_Excel_Writer_Validator::$_descr_prompt

Definition at line 58 of file Validator.php.

Referenced by _getData().

◆ $_fixedList

Spreadsheet_Excel_Writer_Validator::$_fixedList

Definition at line 52 of file Validator.php.

◆ $_formula1

Spreadsheet_Excel_Writer_Validator::$_formula1

Definition at line 62 of file Validator.php.

Referenced by _getData(), and setFormula1().

◆ $_formula2

Spreadsheet_Excel_Writer_Validator::$_formula2

Definition at line 63 of file Validator.php.

Referenced by _getData(), and setFormula2().

◆ $_incell

Spreadsheet_Excel_Writer_Validator::$_incell

Definition at line 54 of file Validator.php.

◆ $_operator

Spreadsheet_Excel_Writer_Validator::$_operator

Definition at line 61 of file Validator.php.

◆ $_parser

Spreadsheet_Excel_Writer_Validator::$_parser

Definition at line 68 of file Validator.php.

◆ $_showerror

Spreadsheet_Excel_Writer_Validator::$_showerror

Definition at line 56 of file Validator.php.

◆ $_showprompt

Spreadsheet_Excel_Writer_Validator::$_showprompt

Definition at line 55 of file Validator.php.

◆ $_style

Spreadsheet_Excel_Writer_Validator::$_style

Definition at line 51 of file Validator.php.

◆ $_title_error

Spreadsheet_Excel_Writer_Validator::$_title_error

Definition at line 59 of file Validator.php.

Referenced by _getData().

◆ $_title_prompt

Spreadsheet_Excel_Writer_Validator::$_title_prompt

Definition at line 57 of file Validator.php.

Referenced by _getData().

◆ $_type

Spreadsheet_Excel_Writer_Validator::$_type

Definition at line 50 of file Validator.php.

Referenced by _getOptions().


The documentation for this class was generated from the following file: