/** * @access public * @param string $document_name * @param string $path_save * @param string $path_templates * @return object */ public function __construct($document_name, $path_save = '', $path_templates = '') { $docSave = $this->_setTempDirName(); $path_templates = $path_templates == '' ? TEMPLATE_FILE_PATH_CALC : $path_templates; $path_save = $path_save == '' ? SAVE_FILE_PATH_CALC : $path_save; $this->extension = 'ods'; $this->contentType = 'application/vnd.oasis.opendocument.spreadsheet'; $this->keepGeneratedRep = false; $this->pathTemplates = Fonction::removeLastSlash($path_templates); $this->pathSave = Fonction::removeLastSlash($path_save) . '/' . $docSave; $this->documentName = Fonction::checkFileName($document_name, $this->extension); try { $this->manifest = new Manifest($this->pathSave . '/META-INF', $this->pathTemplates . '/META-INF', true, false); $this->meta = new Meta($this->pathSave, $this->pathTemplates, true, false); $this->settings = new Settings($this->pathSave, $this->pathTemplates, true, false); $this->styles = new Styles($this->pathSave, $this->pathTemplates, true, false); $this->content = new Content($this, $this->pathSave, $this->pathTemplates, true, false); } catch (Exception $e) { echo '<br><b>Notice : </b>' . $e->getMessage() . '<br>'; } }