page1
+page2
+diff --git a/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/bug_report.md b/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dae624d --- /dev/null +++ b/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**October version** +Add October version here. + +**Plugin version** +Add plugin version here. + +**Additional context** +Add any other context about the problem here. diff --git a/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/feature_request.md b/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/plugins/renatio/dynamicpdf/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/plugins/renatio/dynamicpdf/.gitignore b/plugins/renatio/dynamicpdf/.gitignore new file mode 100644 index 0000000..8b7ef35 --- /dev/null +++ b/plugins/renatio/dynamicpdf/.gitignore @@ -0,0 +1,2 @@ +/vendor +composer.lock diff --git a/plugins/renatio/dynamicpdf/LICENSE.md b/plugins/renatio/dynamicpdf/LICENSE.md new file mode 100644 index 0000000..64b24ef --- /dev/null +++ b/plugins/renatio/dynamicpdf/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Renatio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/Plugin.php b/plugins/renatio/dynamicpdf/Plugin.php new file mode 100644 index 0000000..87160af --- /dev/null +++ b/plugins/renatio/dynamicpdf/Plugin.php @@ -0,0 +1,108 @@ + 'renatio.dynamicpdf::lang.plugin.name', + 'description' => 'renatio.dynamicpdf::lang.plugin.description', + 'author' => 'Renatio', + 'icon' => 'octo-icon-file-pdf-o', + 'homepage' => 'https://octobercms.com/plugin/renatio-dynamicpdf', + ]; + } + + public function boot() + { + $this->app->register(ServiceProvider::class); + + $this->app->bind('dynamicpdf', function ($app) { + return new PDFWrapper($app['dompdf'], $app['config'], $app['files'], $app['view']); + }); + + (new SyncTemplates)->handle(); + } + + public function register() + { + $this->registerConsoleCommand('dynamicpdf:demo', Demo::class); + } + + public function registerPermissions() + { + return [ + 'renatio.dynamicpdf.manage_templates' => [ + 'label' => 'renatio.dynamicpdf::lang.permissions.manage_templates', + 'tab' => 'renatio.dynamicpdf::lang.permissions.tab', + ], + 'renatio.dynamicpdf.manage_layouts' => [ + 'label' => 'renatio.dynamicpdf::lang.permissions.manage_layouts', + 'tab' => 'renatio.dynamicpdf::lang.permissions.tab', + ], + ]; + } + + public function registerMarkupTags() + { + if (PluginManager::instance()->exists('RainLab.Translate')) { + return []; + } + + return [ + 'filters' => [ + '_' => ['Lang', 'get'], + '__' => ['Lang', 'choice'], + ], + ]; + } + + public function registerSettings() + { + return [ + 'templates' => [ + 'label' => 'renatio.dynamicpdf::lang.menu.label', + 'category' => 'renatio.dynamicpdf::lang.menu.category', + 'icon' => 'octo-icon-file-pdf-o', + 'url' => Backend::url('renatio/dynamicpdf/templates'), + 'description' => 'renatio.dynamicpdf::lang.menu.description', + 'permissions' => ['renatio.dynamicpdf.manage_templates'], + ], + ]; + } + + public function registerPDFTemplates() + { + if (! Parameter::get('renatio::dynamicpdf.demo')) { + return []; + } + + return [ + 'renatio.dynamicpdf::pdf.invoice', + 'renatio.dynamicpdf::pdf.header_and_footer', + ]; + } + + public function registerPDFLayouts() + { + if (! Parameter::get('renatio::dynamicpdf.demo')) { + return []; + } + + return [ + 'renatio.dynamicpdf::pdf.layouts.default', + 'renatio.dynamicpdf::pdf.layouts.header_and_footer', + ]; + } +} diff --git a/plugins/renatio/dynamicpdf/README.md b/plugins/renatio/dynamicpdf/README.md new file mode 100644 index 0000000..41bf2d4 --- /dev/null +++ b/plugins/renatio/dynamicpdf/README.md @@ -0,0 +1,571 @@ +# Dynamic PDF Plugin + +**Demo URL:** https://october-demo.renatio.com/backend/backend/auth/signin + +**Login:** dynamicpdf + +**Password:** dynamicpdf + +This plugin allows developers to create and edit PDF templates with a simple user interface. + +HTML to PDF converter uses [dompdf](https://github.com/dompdf/dompdf) library. + +Plugin uses dompdf wrapper for Laravel [barryvdh/laravel-dompdf](https://github.com/barryvdh/laravel-dompdf). + +> This plugin is fully compatible with the latest version of OctoberCMS 2.x from version 5.0.1. + +> The latest version that supports OctoberCMS 1.x is version 4.0.8. + +## Like this plugin? + +If you like this plugin, give this plugin a Like or Make donation with [PayPal](https://www.paypal.me/mplodowski). + +## My other plugins + +Please check my other [plugins](https://octobercms.com/author/Renatio). + +## Support + +Please use [GitHub Issues Page](https://github.com/mplodowski/dynamicpdf-plugin/issues) to report any issues with +plugin. + +> Reviews should not be used for getting support or reporting bugs, if you need support please use the Plugin support +> link. + +Icon made by [Darius Dan](https://www.flaticon.com/authors/darius-dan) +from [www.flaticon.com](https://www.flaticon.com/). + +# Documentation + +## Installation + +There are couple ways to install this plugin. + +1. Use `php artisan plugin:install Renatio.DynamicPDF` command. +2. Use `composer require renatio/dynamicpdf-plugin` in project root. When you use this option you must + run `php artisan october:migrate` after installation. + +## PDF content + +PDF can be created in October using either PDF views or PDF templates. A PDF view is supplied by plugin in the file +system in the **/views** directory. Whereas a PDF template is managed using the back-end interface via *Settings > PDF > +PDF Templates*. All PDFs templates support using Twig for markup. + +PDF views must be registered in the Plugin registration file with the `registerPDFTemplates` and `registerPDFLayouts` +method. This will automatically generate a PDF template and layout and allows them to be customized using the back-end +interface. + +## PDF layouts views + +PDF layouts views reside in the file system and the code used represents the path to the view file. For example PDF +layout with the code **author.plugin::pdf.layouts.default** would use the content in following file: + +``` +plugins/ <=== Plugins directory + author/ <=== "author" segment + plugin/ <=== "plugin" segment + views/ <=== View directory + pdf/ <=== "pdf" segment + layouts/ <=== "layouts" segment + default.htm <=== "default" segment +``` + +The content inside a PDF view file can include up to 3 sections: **configuration**, **CSS/LESS**, and **HTML markup**. +Sections are separated with the `==` sequence. For example: + +``` +name = "Default PDF layout" +== +body { + font-size: 16px; +} +== + + +
+ +page1
+page2
++ + = e(trans('renatio.dynamicpdf::lang.layouts.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/controllers/layouts/preview.php b/plugins/renatio/dynamicpdf/controllers/layouts/preview.php new file mode 100644 index 0000000..2411f2a --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/layouts/preview.php @@ -0,0 +1,32 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.layouts.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/controllers/layouts/previewpdf.php b/plugins/renatio/dynamicpdf/controllers/layouts/previewpdf.php new file mode 100644 index 0000000..0648ef1 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/layouts/previewpdf.php @@ -0,0 +1,20 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.layouts.return')) ?> + +
+ \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/layouts/update.php b/plugins/renatio/dynamicpdf/controllers/layouts/update.php new file mode 100644 index 0000000..16d80c9 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/layouts/update.php @@ -0,0 +1,86 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.layouts.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/controllers/templates/_list_layouts_toolbar.php b/plugins/renatio/dynamicpdf/controllers/templates/_list_layouts_toolbar.php new file mode 100644 index 0000000..3233a26 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/_list_layouts_toolbar.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/_list_templates_toolbar.php b/plugins/renatio/dynamicpdf/controllers/templates/_list_templates_toolbar.php new file mode 100644 index 0000000..0c95d6a --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/_list_templates_toolbar.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/config_form.yaml b/plugins/renatio/dynamicpdf/controllers/templates/config_form.yaml new file mode 100644 index 0000000..4b933d6 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/config_form.yaml @@ -0,0 +1,31 @@ +# =================================== +# Form Behavior Config +# =================================== + +# Record name +name: renatio.dynamicpdf::lang.template.menu_label + +# Model Form Field configuration +form: $/renatio/dynamicpdf/models/template/fields.yaml + +# Model Class name +modelClass: Renatio\DynamicPDF\Models\Template + +# Default redirect location +defaultRedirect: renatio/dynamicpdf/templates + +# Create page +create: + title: renatio.dynamicpdf::lang.template.create_template + redirect: renatio/dynamicpdf/templates/update/:id + redirectClose: renatio/dynamicpdf/templates + +# Update page +update: + title: renatio.dynamicpdf::lang.template.edit_template + redirect: renatio/dynamicpdf/templates + redirectClose: renatio/dynamicpdf/templates + +# Preview page +preview: + title: renatio.dynamicpdf::lang.templates.preview_html \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/config_layouts_list.yaml b/plugins/renatio/dynamicpdf/controllers/templates/config_layouts_list.yaml new file mode 100644 index 0000000..1353982 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/config_layouts_list.yaml @@ -0,0 +1,44 @@ +# =================================== +# List Behavior Config +# =================================== + +# Model List Column configuration +list: $/renatio/dynamicpdf/models/layout/columns.yaml + +# Model Class name +modelClass: Renatio\DynamicPDF\Models\Layout + +# List Title +title: renatio.dynamicpdf::lang.layouts.label + +# Link URL for each record +recordUrl: renatio/dynamicpdf/layouts/update/:id + +# Message to display if the list is empty +noRecordsMessage: backend::lang.list.no_records + +# Records to display per page +recordsPerPage: 20 + +# Displays the list column set up button +showSetup: true + +# Displays the sorting link on each column +showSorting: true + +# Default sorting column +defaultSort: + column: created_at + direction: desc + +# Display checkboxes next to each record +showCheckboxes: false + +# Toolbar widget configuration +toolbar: + # Partial for toolbar buttons + buttons: list_layouts_toolbar + + # Search widget configuration + search: + prompt: backend::lang.list.search_prompt \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/config_templates_list.yaml b/plugins/renatio/dynamicpdf/controllers/templates/config_templates_list.yaml new file mode 100644 index 0000000..5f38138 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/config_templates_list.yaml @@ -0,0 +1,44 @@ +# =================================== +# List Behavior Config +# =================================== + +# Model List Column configuration +list: $/renatio/dynamicpdf/models/template/columns.yaml + +# Model Class name +modelClass: Renatio\DynamicPDF\Models\Template + +# List Title +title: renatio.dynamicpdf::lang.templates.label + +# Link URL for each record +recordUrl: renatio/dynamicpdf/templates/update/:id + +# Message to display if the list is empty +noRecordsMessage: backend::lang.list.no_records + +# Records to display per page +recordsPerPage: 20 + +# Displays the list column set up button +showSetup: true + +# Displays the sorting link on each column +showSorting: true + +# Default sorting column +defaultSort: + column: created_at + direction: desc + +# Display checkboxes next to each record +showCheckboxes: false + +# Toolbar widget configuration +toolbar: + # Partial for toolbar buttons + buttons: list_templates_toolbar + + # Search widget configuration + search: + prompt: backend::lang.list.search_prompt \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/create.php b/plugins/renatio/dynamicpdf/controllers/templates/create.php new file mode 100644 index 0000000..63b1615 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/create.php @@ -0,0 +1,58 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.templates.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/controllers/templates/index.php b/plugins/renatio/dynamicpdf/controllers/templates/index.php new file mode 100644 index 0000000..54f3e6a --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/index.php @@ -0,0 +1,25 @@ ++ + = e(trans('renatio.dynamicpdf::lang.templates.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/controllers/templates/previewpdf.php b/plugins/renatio/dynamicpdf/controllers/templates/previewpdf.php new file mode 100644 index 0000000..67a4e51 --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/previewpdf.php @@ -0,0 +1,20 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.templates.return')) ?> + +
+ \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/controllers/templates/update.php b/plugins/renatio/dynamicpdf/controllers/templates/update.php new file mode 100644 index 0000000..2d837ee --- /dev/null +++ b/plugins/renatio/dynamicpdf/controllers/templates/update.php @@ -0,0 +1,86 @@ + ++ + = e(trans('renatio.dynamicpdf::lang.templates.return')) ?> + +
+ diff --git a/plugins/renatio/dynamicpdf/docs/banner.png b/plugins/renatio/dynamicpdf/docs/banner.png new file mode 100644 index 0000000..0bc9437 Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/banner.png differ diff --git a/plugins/renatio/dynamicpdf/docs/logo.png b/plugins/renatio/dynamicpdf/docs/logo.png new file mode 100644 index 0000000..3e619ac Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/logo.png differ diff --git a/plugins/renatio/dynamicpdf/docs/scr_1.png b/plugins/renatio/dynamicpdf/docs/scr_1.png new file mode 100644 index 0000000..8e9acca Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/scr_1.png differ diff --git a/plugins/renatio/dynamicpdf/docs/scr_2.png b/plugins/renatio/dynamicpdf/docs/scr_2.png new file mode 100644 index 0000000..11e4906 Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/scr_2.png differ diff --git a/plugins/renatio/dynamicpdf/docs/scr_3.png b/plugins/renatio/dynamicpdf/docs/scr_3.png new file mode 100644 index 0000000..3bac057 Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/scr_3.png differ diff --git a/plugins/renatio/dynamicpdf/docs/scr_4.png b/plugins/renatio/dynamicpdf/docs/scr_4.png new file mode 100644 index 0000000..f05c487 Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/scr_4.png differ diff --git a/plugins/renatio/dynamicpdf/docs/scr_5.png b/plugins/renatio/dynamicpdf/docs/scr_5.png new file mode 100644 index 0000000..bd48df4 Binary files /dev/null and b/plugins/renatio/dynamicpdf/docs/scr_5.png differ diff --git a/plugins/renatio/dynamicpdf/lang/cs/lang.php b/plugins/renatio/dynamicpdf/lang/cs/lang.php new file mode 100644 index 0000000..38e79b7 --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/cs/lang.php @@ -0,0 +1,54 @@ + [ + 'name' => 'Dynamické PDF', + 'description' => 'Generování dynamických a upravitelných PDF.', + ], + 'templates' => [ + 'label' => 'PDF Šablony', + 'code' => 'Kód', + 'title' => 'Nadpis', + 'description' => 'Popis', + 'layout' => 'Layout', + 'empty_option' => '-- Bez šablony --', + 'code_comment' => 'Unikátní kód patřící pouze této šabloně', + 'content_html' => 'HTML', + 'content_css' => 'CSS', + 'name' => 'Jméno', + 'return' => 'Zpět na seznam šablon', + 'new_template' => 'Nová šablona', + 'new_layout' => 'Nový layout', + 'templates' => 'Šablony', + 'layouts' => 'Layouty', + 'background_img' => 'Obrázek pozadí', + 'preview_pdf' => 'Náhled', + 'created_at' => 'Vytvořeno v', + 'updated_at' => 'Upraveno v', + 'background_img_comment' => 'Pro správné zobrazení použijte obrázek s 96 DPI' + ], + 'template' => [ + 'menu_label' => 'PDF Šablony', + 'create_template' => 'Vytvoření PDF šablony', + 'edit_template' => 'Úprava PDF šablony', + ], + 'layouts' => [ + 'label' => 'PDF Layouty', + 'return' => 'Zpět na seznam PDF layoutů', + ], + 'layout' => [ + 'menu_label' => 'PDF Layouty', + 'create_layout' => 'Vytvoření PDF layoutu', + 'edit_layout' => 'Úprava PDF layoutu', + ], + 'settings' => [ + 'description' => 'Správa PDF šablon a layoutů.', + ], + 'permissions' => [ + 'label' => 'Správa PDF šablon', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF' + ] +]; diff --git a/plugins/renatio/dynamicpdf/lang/de/lang.php b/plugins/renatio/dynamicpdf/lang/de/lang.php new file mode 100644 index 0000000..9c6af86 --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/de/lang.php @@ -0,0 +1,56 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Generiert dynamische und anpassbare PDFs.', + ], + 'templates' => [ + 'label' => 'Vorlagen', + 'code' => 'Code', + 'title' => 'Titel', + 'description' => 'Beschreibung', + 'layout' => 'Layout', + 'empty_option' => '-- Kein Layout --', + 'code_comment' => 'Code wird verwendet um die Vorlage eindeutig zu Identifizieren.', + 'content_html' => 'HTML', + 'content_css' => 'CSS', + 'name' => 'Name', + 'return' => 'Zurück zu den PDF Vorlagen', + 'new_template' => 'Neue Vorlage', + 'new_layout' => 'Neues Layout', + 'templates' => 'Vorlagen', + 'layouts' => 'Layouts', + 'background_img' => 'Hintergrundbild', + 'preview_html' => 'HTML Vorschau', + 'preview_pdf' => 'PDF Vorschau', + 'created_at' => 'Erstellt am', + 'updated_at' => 'Aktualisiert am', + 'background_img_comment' => 'Bilder mit 96 DPI eignen sich am Besten', + ], + 'template' => [ + 'menu_label' => 'Vorlagen', + 'create_template' => 'Erstelle Vorlage', + 'edit_template' => 'Bearbeite Vorlage', + ], + 'layouts' => [ + 'label' => 'Layouts', + 'return' => 'Zurük zu den Layouts', + ], + 'layout' => [ + 'menu_label' => 'Layout', + 'create_layout' => 'Erstelle Layout', + 'edit_layout' => 'Bearbeite Layout', + ], + 'settings' => [ + 'description' => 'Verwaltung von Vorlagen und Layouts.', + ], + 'permissions' => [ + 'manage_templates' => 'Verwalte Vorlagen', + 'manage_layouts' => 'Verwalte Layouts', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF', + ], +]; diff --git a/plugins/renatio/dynamicpdf/lang/en/lang.php b/plugins/renatio/dynamicpdf/lang/en/lang.php new file mode 100644 index 0000000..664009e --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/en/lang.php @@ -0,0 +1,76 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Generate dynamic and customized PDFs.', + ], + 'templates' => [ + 'label' => 'Templates', + 'code' => 'Code', + 'title' => 'Title', + 'description' => 'Description', + 'layout' => 'Layout', + 'empty_option' => '-- No layout --', + 'code_comment' => 'Unique code used to refer to this template', + 'content_html' => 'HTML', + 'content_css' => 'CSS/LESS', + 'name' => 'Name', + 'return' => 'Return to templates list', + 'new_template' => 'New Template', + 'new_layout' => 'New Layout', + 'templates' => 'Templates', + 'layouts' => 'Layouts', + 'background_img' => 'Background Image', + 'preview_html' => 'Preview HTML', + 'preview_pdf' => 'Preview PDF', + 'created_at' => 'Created at', + 'updated_at' => 'Updated at', + 'background_img_comment' => 'Use image with at least 96 DPI for correct display. Recommended 300 DPI.', + 'size' => 'Paper size', + 'orientation' => 'Paper orientation', + ], + 'template' => [ + 'menu_label' => 'Template', + 'create_template' => 'Create Template', + 'edit_template' => 'Edit Template', + 'not_found' => 'Unable to find a registered template with code', + ], + 'layouts' => [ + 'label' => 'Layouts', + 'return' => 'Return to layouts list', + ], + 'layout' => [ + 'menu_label' => 'Layout', + 'create_layout' => 'Create Layout', + 'edit_layout' => 'Edit Layout', + 'not_found' => 'Unable to find a registered layout with code', + ], + 'settings' => [ + 'description' => 'Manage templates and layouts.', + ], + 'permissions' => [ + 'manage_templates' => 'Manage templates', + 'manage_layouts' => 'Manage layouts', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF Templates', + 'category' => 'PDF', + 'description' => 'Modify the PDF templates and manage PDF layouts.', + ], + 'orientation' => [ + 'portrait' => 'Portrait', + 'landscape' => 'Landscape', + ], + 'options' => [ + 'empty' => '-- choose --', + ], + 'tab' => [ + 'options' => 'Options', + ], + 'demo' => [ + 'enabled' => 'Demo is enabled. Please refresh PDF templates list.', + 'disabled' => 'Demo is disabled. Please refresh PDF templates list.', + ], +]; diff --git a/plugins/renatio/dynamicpdf/lang/es-ar/lang.php b/plugins/renatio/dynamicpdf/lang/es-ar/lang.php new file mode 100644 index 0000000..121842d --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/es-ar/lang.php @@ -0,0 +1,54 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Genera PDF dinámicos y personalizados.', + ], + 'templates' => [ + 'label' => 'Plantillas PDF', + 'code' => 'Código', + 'title' => 'Título', + 'description' => 'Descripción', + 'layout' => 'Diseño', + 'empty_option' => '-- Ningúno --', + 'code_comment' => 'Código único para hacer referencia a esta plantilla', + 'content_html' => 'HTML', + 'content_css' => 'CSS', + 'name' => 'Nombre', + 'return' => 'Volver a la lista de plantillas PDF', + 'new_template' => 'Nueva Plantilla', + 'new_layout' => 'Nuevo Diseño', + 'templates' => 'Plantillas', + 'layouts' => 'Diseños', + 'background_img' => 'Imagen de fondo', + 'preview_pdf' => 'Previsualizar', + 'created_at' => 'Creado en', + 'updated_at' => 'Modificado en', + 'background_img_comment' => 'Utilize una imagen de 96 DPI para una correcta visualización' + ], + 'template' => [ + 'menu_label' => 'Plantilla PDF', + 'create_template' => 'Crear Plantilla PDF', + 'edit_template' => 'Editar Plantilla PDF', + ], + 'layouts' => [ + 'label' => 'Diseños PDF', + 'return' => 'Volver la la lista de diseños PDF', + ], + 'layout' => [ + 'menu_label' => 'Diseño PDF', + 'create_layout' => 'Crear Diseño PDF', + 'edit_layout' => 'Editar Diseño PDF', + ], + 'settings' => [ + 'description' => 'Administrar plantillas y diseños PDF.', + ], + 'permissions' => [ + 'label' => 'Administrar plantillas PDF', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF' + ] +]; diff --git a/plugins/renatio/dynamicpdf/lang/es/lang.php b/plugins/renatio/dynamicpdf/lang/es/lang.php new file mode 100644 index 0000000..121842d --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/es/lang.php @@ -0,0 +1,54 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Genera PDF dinámicos y personalizados.', + ], + 'templates' => [ + 'label' => 'Plantillas PDF', + 'code' => 'Código', + 'title' => 'Título', + 'description' => 'Descripción', + 'layout' => 'Diseño', + 'empty_option' => '-- Ningúno --', + 'code_comment' => 'Código único para hacer referencia a esta plantilla', + 'content_html' => 'HTML', + 'content_css' => 'CSS', + 'name' => 'Nombre', + 'return' => 'Volver a la lista de plantillas PDF', + 'new_template' => 'Nueva Plantilla', + 'new_layout' => 'Nuevo Diseño', + 'templates' => 'Plantillas', + 'layouts' => 'Diseños', + 'background_img' => 'Imagen de fondo', + 'preview_pdf' => 'Previsualizar', + 'created_at' => 'Creado en', + 'updated_at' => 'Modificado en', + 'background_img_comment' => 'Utilize una imagen de 96 DPI para una correcta visualización' + ], + 'template' => [ + 'menu_label' => 'Plantilla PDF', + 'create_template' => 'Crear Plantilla PDF', + 'edit_template' => 'Editar Plantilla PDF', + ], + 'layouts' => [ + 'label' => 'Diseños PDF', + 'return' => 'Volver la la lista de diseños PDF', + ], + 'layout' => [ + 'menu_label' => 'Diseño PDF', + 'create_layout' => 'Crear Diseño PDF', + 'edit_layout' => 'Editar Diseño PDF', + ], + 'settings' => [ + 'description' => 'Administrar plantillas y diseños PDF.', + ], + 'permissions' => [ + 'label' => 'Administrar plantillas PDF', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF' + ] +]; diff --git a/plugins/renatio/dynamicpdf/lang/hu/lang.php b/plugins/renatio/dynamicpdf/lang/hu/lang.php new file mode 100644 index 0000000..c6de1ed --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/hu/lang.php @@ -0,0 +1,65 @@ + [ + 'name' => 'Dinamikus PDF', + 'description' => 'Egyedi PDF fájlok generálása.', + ], + 'templates' => [ + 'label' => 'Sablonok', + 'code' => 'Kód', + 'title' => 'Cím', + 'description' => 'Leírás', + 'layout' => 'Elrendezés', + 'empty_option' => '-- nincs --', + 'code_comment' => 'Egyedi kódot adjon meg.', + 'content_html' => 'HTML', + 'content_css' => 'CSS', + 'name' => 'Név', + 'return' => 'Vissza a sablonokhoz', + 'new_template' => 'Új sablon', + 'new_layout' => 'Új elrendezés', + 'templates' => 'Sablonok', + 'layouts' => 'Elrendezések', + 'background_img' => 'Háttérkép', + 'preview_html' => 'HTML előnézet', + 'preview_pdf' => 'PDF előnézet', + 'created_at' => 'Létrehozva', + 'updated_at' => 'Módosítva', + 'background_img_comment' => 'A megfelelő megjelenéshez 96 DPI méretű képet használjon.', + 'size' => 'Papír mérete', + 'orientation' => 'Papír tájolása', + ], + 'template' => [ + 'menu_label' => 'Sablon', + 'create_template' => 'Sablon létrehozása', + 'edit_template' => 'Sablon szerkesztése', + ], + 'layouts' => [ + 'label' => 'Elrendezések', + 'return' => 'Vissza az elrendezésekhez', + ], + 'layout' => [ + 'menu_label' => 'Elrendezés', + 'create_layout' => 'Elrendezés létrehozása', + 'edit_layout' => 'Elrendezés szerkesztése', + ], + 'settings' => [ + 'description' => 'Sablonok és elrendezések kezelése.', + ], + 'permissions' => [ + 'manage_templates' => 'Sablonok kezelése', + 'manage_layouts' => 'Elrendezések kezelése', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'PDF' + ], + 'orientation' => [ + 'portrait' => 'Álló', + 'landscape' => 'Fekvő', + ], + 'options' => [ + 'empty' => '-- válasszon --', + ], +]; diff --git a/plugins/renatio/dynamicpdf/lang/pl/lang.php b/plugins/renatio/dynamicpdf/lang/pl/lang.php new file mode 100644 index 0000000..663ade3 --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/pl/lang.php @@ -0,0 +1,70 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Generuj dynamiczne pliki PDF.', + ], + 'templates' => [ + 'label' => 'Szablony', + 'code' => 'Kod', + 'title' => 'Tytuł', + 'description' => 'Opis', + 'layout' => 'Układ', + 'empty_option' => '-- Brak układu --', + 'code_comment' => 'Unikalny kod powiązany z tym szablonem', + 'content_html' => 'HTML', + 'content_css' => 'CSS/LESS', + 'name' => 'Nazwa', + 'return' => 'Powrót do listy szablonów', + 'new_template' => 'Nowy szablon', + 'new_layout' => 'Nowy układ', + 'templates' => 'Szablony', + 'layouts' => 'Układy', + 'background_img' => 'Obraz w tle', + 'preview_html' => 'Podgląd HTML', + 'preview_pdf' => 'Podgląd PDF', + 'created_at' => 'Data utworzenia', + 'updated_at' => 'Data edycji', + 'background_img_comment' => 'Użyj obrazu o rozdzielczości przynajmniej 96 DPI do poprawnego wyświetlenia. Zalecany obraz 300 DPI.', + 'size' => 'Rozmiar papieru', + 'orientation' => 'Orientacja papieru', + ], + 'template' => [ + 'menu_label' => 'Szablon', + 'create_template' => 'Utwórz szablon', + 'edit_template' => 'Edycja szablonu', + ], + 'layouts' => [ + 'label' => 'Układu', + 'return' => 'Powrót do listy układów', + ], + 'layout' => [ + 'menu_label' => 'Układ', + 'create_layout' => 'Utwórz układ', + 'edit_layout' => 'Edycja układu', + ], + 'settings' => [ + 'description' => 'Zarządzaj szablonami i układami.', + ], + 'permissions' => [ + 'manage_templates' => 'Zarządzaj szablonami', + 'manage_layouts' => 'Zarządzaj układami', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'Szablony PDF', + 'category' => 'PDF', + 'description' => 'Modyfikuj szablony i układy PDF.', + ], + 'orientation' => [ + 'portrait' => 'Pionowy', + 'landscape' => 'Poziomy', + ], + 'options' => [ + 'empty' => '-- wybierz --', + ], + 'tab' => [ + 'options' => 'Opcje', + ], +]; diff --git a/plugins/renatio/dynamicpdf/lang/pt-br/lang.php b/plugins/renatio/dynamicpdf/lang/pt-br/lang.php new file mode 100644 index 0000000..5d64093 --- /dev/null +++ b/plugins/renatio/dynamicpdf/lang/pt-br/lang.php @@ -0,0 +1,76 @@ + [ + 'name' => 'DynamicPDF', + 'description' => 'Gere PDFs dinâmicos e personalizados.', + ], + 'templates' => [ + 'label' => 'Modelos', + 'code' => 'Código', + 'title' => 'Título', + 'description' => 'Descrição', + 'layout' => 'Modelo', + 'empty_option' => '-- Sem modelo --', + 'code_comment' => 'Código exclusivo usado para se referir a este modelo', + 'content_html' => 'HTML', + 'content_css' => 'CSS/LESS', + 'name' => 'Nome', + 'return' => 'Voltar à lista de modelos', + 'new_template' => 'Novo modelo', + 'new_layout' => 'Novo Layout', + 'templates' => 'Modelos', + 'layouts' => 'Layouts', + 'background_img' => 'Imagem de fundo', + 'preview_html' => 'Pré-visualizar HTML', + 'preview_pdf' => 'Pré-visualizar PDF', + 'created_at' => 'Criado em', + 'updated_at' => 'Atualizado em', + 'background_img_comment' => 'Use imagem com pelo menos 96 DPI para exibição correta. Recomendado 300 de DPI.', + 'size' => 'Tamanho do papel', + 'orientation' => 'Orientação do papel', + ], + 'template' => [ + 'menu_label' => 'Modelo', + 'create_template' => 'Criar Modelo', + 'edit_template' => 'Editar Modelo', + 'not_found' => 'Incapaz de encontrar um modelo registrado com código', + ], + 'layouts' => [ + 'label' => 'Layouts', + 'return' => 'Voltar à lista de layouts', + ], + 'layout' => [ + 'menu_label' => 'Layout', + 'create_layout' => 'Criar Layout', + 'edit_layout' => 'Editar Layout', + 'not_found' => 'Incapaz de encontrar um layout registrado com código', + ], + 'settings' => [ + 'description' => 'Gerencie modelos e layouts.', + ], + 'permissions' => [ + 'manage_templates' => 'Gerencie modelos', + 'manage_layouts' => 'Gerencie layouts', + 'tab' => 'PDF', + ], + 'menu' => [ + 'label' => 'Modelos PDF', + 'category' => 'PDF', + 'description' => 'Modifique os modelos de PDF e gerencie layouts de PDF.', + ], + 'orientation' => [ + 'portrait' => 'Retrato', + 'landscape' => 'Paisagem', + ], + 'options' => [ + 'empty' => '-- escolha --', + ], + 'tab' => [ + 'options' => 'Opções', + ], + 'demo' => [ + 'enabled' => 'A demonstração está ativada. Atualize a lista de modelos de PDF.', + 'disabled' => 'A demonstração está desativada. Atualize a lista de modelos de PDF.', + ], +]; diff --git a/plugins/renatio/dynamicpdf/models/Layout.php b/plugins/renatio/dynamicpdf/models/Layout.php new file mode 100644 index 0000000..f26e383 --- /dev/null +++ b/plugins/renatio/dynamicpdf/models/Layout.php @@ -0,0 +1,69 @@ + ['required'], + 'code' => ['required', 'unique:renatio_dynamicpdf_pdf_layouts'], + 'content_html' => ['required'], + ]; + + public $attachOne = [ + 'background_img' => File::class, + ]; + + public function getHtmlAttribute() + { + return PDF::loadLayout($this->code)->getDompdf()->output_html(); + } + + public static function byCode($code) + { + return static::whereCode($code)->firstOrFail(); + } + + public function getCSS() + { + $parser = new Less_Parser; + + return $parser->parse($this->content_css)->getCss(); + } + + public function fillFromCode() + { + if (! ($path = $this->getView())) { + throw new ApplicationException(e(trans('renatio.dynamicpdf::lang.layout.not_found')).': '.$this->code); + } + + $this->fillFromView($path); + } + + public function fillFromView($path) + { + $sections = PDFParser::sections($path); + + $this->name = array_get($sections, 'settings.name', '???'); + $this->content_css = array_get($sections, 'css'); + $this->content_html = array_get($sections, 'html'); + } + + public function getView() + { + return array_get(PDFManager::instance()->listRegisteredLayouts(), $this->code); + } +} diff --git a/plugins/renatio/dynamicpdf/models/Template.php b/plugins/renatio/dynamicpdf/models/Template.php new file mode 100644 index 0000000..fff5b71 --- /dev/null +++ b/plugins/renatio/dynamicpdf/models/Template.php @@ -0,0 +1,87 @@ + Layout::class, + ]; + + public $rules = [ + 'title' => ['required'], + 'code' => ['required', 'unique:renatio_dynamicpdf_pdf_templates'], + 'content_html' => ['required'], + ]; + + public function afterFetch() + { + if (! $this->is_custom) { + $this->fillFromView($this->code); + } + } + + public function fillFromCode() + { + if (! ($path = $this->getView())) { + throw new ApplicationException(e(trans('renatio.dynamicpdf::lang.template.not_found')).': '.$this->code); + } + + $this->fillFromView($path); + } + + public function fillFromView($path) + { + $sections = PDFParser::sections($path); + + $this->title = array_get($sections, 'settings.title', '???'); + $this->code = $path; + $this->layout = Layout::whereCode(array_get($sections, 'settings.layout'))->first(); + $this->size = array_get($sections, 'settings.size'); + $this->orientation = array_get($sections, 'settings.orientation'); + $this->description = array_get($sections, 'settings.description'); + $this->content_html = array_get($sections, 'html'); + } + + public function getHtmlAttribute() + { + return PDF::loadTemplate($this->code)->getDompdf()->output_html(); + } + + public static function byCode($code) + { + return static::whereCode($code)->firstOrFail(); + } + + public static function getSizeOptions() + { + $sizes = array_keys(CPDF::$PAPER_SIZES); + + return array_combine($sizes, $sizes); + } + + public static function getOrientationOptions() + { + return [ + 'portrait' => 'renatio.dynamicpdf::lang.orientation.portrait', + 'landscape' => 'renatio.dynamicpdf::lang.orientation.landscape', + ]; + } + + public function getView() + { + return array_get(PDFManager::instance()->listRegisteredTemplates(), $this->code); + } +} diff --git a/plugins/renatio/dynamicpdf/models/layout/columns.yaml b/plugins/renatio/dynamicpdf/models/layout/columns.yaml new file mode 100644 index 0000000..87c7278 --- /dev/null +++ b/plugins/renatio/dynamicpdf/models/layout/columns.yaml @@ -0,0 +1,21 @@ +# =================================== +# Column Definitions +# =================================== + +columns: + + name: + label: renatio.dynamicpdf::lang.templates.name + searchable: true + + code: + label: renatio.dynamicpdf::lang.templates.code + searchable: true + + created_at: + label: renatio.dynamicpdf::lang.templates.created_at + type: datetime + + updated_at: + label: renatio.dynamicpdf::lang.templates.updated_at + type: datetime \ No newline at end of file diff --git a/plugins/renatio/dynamicpdf/models/layout/fields.yaml b/plugins/renatio/dynamicpdf/models/layout/fields.yaml new file mode 100644 index 0000000..ea6c663 --- /dev/null +++ b/plugins/renatio/dynamicpdf/models/layout/fields.yaml @@ -0,0 +1,60 @@ +# =================================== +# Field Definitions +# =================================== + +fields: + + name@create: + label: renatio.dynamicpdf::lang.templates.name + span: left + + name@update: + label: renatio.dynamicpdf::lang.templates.name + span: full + + code@create: + label: renatio.dynamicpdf::lang.templates.code + comment: renatio.dynamicpdf::lang.templates.code_comment + preset: name + span: right + +secondaryTabs: + + fields: + + content_html: + type: codeeditor + size: giant + tab: renatio.dynamicpdf::lang.templates.content_html + language: html + stretch: true + default: | + + + + +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+ +Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+via Paddle.com
+ +John Doe
+ +
+ Example street 16
+ Warszawa, 50-100
+ Poland
+
VAT Number: PL2332213309
+Paddle.com Market Ltd
+ +
+ Judd House 18-29 Mora Street
+ London, EC1V 8BT
+ United Kingdom
+
VAT Number: EU372017215
+ +Company Number: 08172165
+Customer: michal.plodowski@gmail.com
+Order Number / Invoice: #28542217
+Billing date: 01 Sep 2020
+Payment method: Visa card ending 2222
+Currency: USD
+| Product | +Quantity | +Price | +
|---|---|---|
| TablePlus License Renewal | +1 | +US$39.00 | +
| VAT (0%) | +US$0.00 | +|
| YOUR ORDER | +US$39.00 | +|
| + No VAT - Supply may be subject to reverse charge in the country of receipt + | +||
+ The US$39.00 payment will appear on your bank/card statement as: + PADDLE.NET* TABLEPLUS +
+ ++ If you have a problem with your order (e.g. don’t recognise the charge, suspect a fraudulent transaction), please visit paddle.net. +
+ +