Skip to content

Commit

Permalink
Support for "inline codes" provided by the R&OS pdf class
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1986 committed Apr 10, 2021
1 parent 5ffb39c commit 1dad12c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion menu/invoice-menu.php
Expand Up @@ -237,7 +237,7 @@ public function DisplaySettings()
WCInvoicePdf::addField('wc_pdf_logo', 'Logo', 'media');
WCInvoicePdf::addField('wc_pdf_addressline', __('Address line', 'wc-invoice-pdf'));
WCInvoicePdf::addField('wc_pdf_condition', __('Payment terms', 'wc-invoice-pdf'), 'textarea');
WCInvoicePdf::addField('wc_pdf_info', 'Info Block', 'textarea');
WCInvoicePdf::addField('wc_pdf_info', '<strong>Info Block</strong><br />' . 'Supports "Inline codes" provided by the <a href="https://github.com/rospdf/pdf-php/blob/master/README.md" target="_blank">R&amp;OS pdf class</a>', 'textarea', ['input_attr' => ['style' => 'width: 340px; height: 100px']]);
WCInvoicePdf::addField('wc_pdf_keeprows', '<strong>' . __('Protect rows from splitting', 'wc-invoice-pdf') . '</strong><br />' . __('Keep rows together when page breaks', 'wc-invoice-pdf'), 'checkbox');

WCInvoicePdf::addField('wc_pdf_block1', 'Block #1', 'rte', ['container' => 'div', 'input_attr' => ['style'=>'width: 350px;display:inline-block;'] ]);
Expand Down
2 changes: 1 addition & 1 deletion model/invoice-pdf.php
Expand Up @@ -197,7 +197,7 @@ public function BuildInvoice($invoice, $isOffer = false, $stream = false)

$pdf->ezSetDy(-30);

$pdf->ezTable($data, $cols, '', ['width' => '500','splitRows' => !boolval(\WCInvoicePdf\WCInvoicePdf::$OPTIONS['wc_pdf_keeprows']),'gridlines' => EZ_GRIDLINE_HEADERONLY, 'cols' => $colOptions]);
$pdf->ezTable($data, $cols, '', ['width' => '500','splitRows' => !boolval(\WCInvoicePdf\WCInvoicePdf::$OPTIONS['wc_pdf_keeprows'] ?? 0),'gridlines' => EZ_GRIDLINE_HEADERONLY, 'cols' => $colOptions]);

$colOptions = [
['justification' => 'right'],
Expand Down
2 changes: 1 addition & 1 deletion wc-invoice-pdf.php
Expand Up @@ -222,7 +222,7 @@ public static function addField($name, $title, $type = 'text', $args = [])
} elseif ($type == 'email') {
echo '<input type="'.$type.'" class="regular-text" name="'.$name.'" value="'.$optValue.'"'.$attrStr.' />';
} elseif ($type == 'textarea') {
echo '<textarea name="'.$name.'" '.$attrStr.'>' . strip_tags($optValue) . '</textarea>';
echo '<textarea name="'.$name.'" '.$attrStr.'>' . esc_attr($optValue) . '</textarea>';
} elseif ($type == 'checkbox') {
echo '<input type="'.$type.'" name="'.$name.'" value="1"' . (($optValue == '1')?'checked':'') .' />';
} elseif ($type == 'rte') {
Expand Down

0 comments on commit 1dad12c

Please sign in to comment.