예제 #1
0
            $validation['processed'] = true;
            $inputValidated = false;
        }
    }
    if ($inputValidated) {
        $pdfExport->store();
    }
}
$setWarning = false;
// used to set missing options during export
if ($Module->isCurrentAction('BrowseSource')) {
    eZContentBrowse::browse(array('action_name' => 'ExportSourceBrowse', 'description_template' => 'design:content/browse_export.tpl', 'from_page' => '/pdf/edit/' . $pdfExport->attribute('id')), $Module);
} else {
    if ($Module->isCurrentAction('Export') && $inputValidated) {
        // remove the old file ( user may changed the filename )
        $originalPdfExport = eZPDFExport::fetch($Params['PDFExportID']);
        if ($originalPdfExport && $originalPdfExport->attribute('status') == eZPDFExport::CREATE_ONCE) {
            $filename = $originalPdfExport->attribute('filepath');
            if (file_exists($filename)) {
                unlink($filename);
            }
        }
        if ($pdfExport->attribute('status') == eZPDFExport::CREATE_ONCE) {
            generatePDF($pdfExport, $pdfExport->attribute('filepath'));
            $pdfExport->store(true);
            return $Module->redirect('pdf', 'list');
        } else {
            $pdfExport->store(true);
            return $Module->redirect('pdf', 'list');
        }
    } else {
예제 #2
0
파일: list.php 프로젝트: legende91/ez
 */
$Module = $Params['Module'];
// Create new PDF Export
if ($Module->isCurrentAction('NewExport')) {
    return $Module->redirect('pdf', 'edit');
} else {
    if ($Module->isCurrentAction('RemoveExport') && $Module->hasActionParameter('DeleteIDArray')) {
        $deleteArray = $Module->actionParameter('DeleteIDArray');
        foreach ($deleteArray as $deleteID) {
            // remove draft if it exists:
            $pdfExport = eZPDFExport::fetch($deleteID, true, eZPDFExport::VERSION_DRAFT);
            if ($pdfExport) {
                $pdfExport->remove();
            }
            // remove default version:
            $pdfExport = eZPDFExport::fetch($deleteID);
            if ($pdfExport) {
                $pdfExport->remove();
            }
        }
    }
}
$exportArray = eZPDFExport::fetchList();
$exportList = array();
foreach ($exportArray as $export) {
    $exportList[$export->attribute('id')] = $export;
}
$tpl = eZTemplate::factory();
$tpl->setVariable('pdfexport_list', $exportList);
$Result = array();
$Result['content'] = $tpl->fetch("design:pdf/list.tpl");