private function addCellFormat($cell_format)
{
//for backwards compatibility, to handle older versions
if ($cell_format == 'string') {
$cell_format = 'GENERAL';
} else {
if ($cell_format == 'integer') {
$cell_format = '0';
} else {
if ($cell_format == 'date') {
$cell_format = 'YYYY-MM-DD';
} else {
if ($cell_format == 'datetime') {
$cell_format = 'YYYY-MM-DD HH:MM:SS';
} else {
if ($cell_format == 'dollar') {
$cell_format = '[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00';
} else {
if ($cell_format == 'money') {
$cell_format = '[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00';
} else {
if ($cell_format == 'euro') {
$cell_format = '#,##0.00 [$€-407];[RED]-#,##0.00 [$€-407]';
} else {
if ($cell_format == 'NN') {
$cell_format = 'DDD';
} else {
if ($cell_format == 'NNN') {
$cell_format = 'DDDD';
} else {
if ($cell_format == 'NNNN') {
$cell_format = 'DDDD", "';
}
}
}
}
}
}
}
}
}
}
$cell_format = strtoupper($cell_format);
$position = array_search($cell_format, $this->cell_formats, $strict = true);
if ($position === false) {
$position = count($this->cell_formats);
$this->cell_formats[] = $this->escapeCellFormat($cell_format);
$this->cell_types[] = $this->determineCellType($cell_format);
}
return $position;
}