$docx = new DOCXTemplate($fullPath); $docx->set($templateData); $docx->saveAs($saveFullPath); //registering generated document $documents->registerDocument($documents->getLogin(), $docId, $saveFileName); //output zb_DownloadFile($saveFullPath, 'docx'); } } else { //template downloading if (wf_CheckGet(array('download'))) { zb_DownloadFile($documents::TEMPLATES_PATH . $_GET['download'], 'docx'); } //template deletion if (wf_CheckGet(array('deletetemplate'))) { $documents->deleteTemplate($_GET['deletetemplate']); rcms_redirect('?module=pl_documents&username='******'Available document templates'), $documents->renderTemplatesList()); //uploading new templates $uploadControl = wf_modal(__('Upload template'), __('Upload template'), $documents->uploadForm(), 'ubButton', '600', '300'); show_window(__('Settings'), $uploadControl); //template upload subroutine if (wf_CheckPost(array('uploadtemplate'))) { $documents->doUpload(); rcms_redirect('?module=pl_documents&username='******'Previously generated documents for this user'), $documents->renderUserDocuments());