本文整理汇总了PHP中PDF_Common::do_mergetags方法的典型用法代码示例。如果您正苦于以下问题:PHP PDF_Common::do_mergetags方法的具体用法?PHP PDF_Common::do_mergetags怎么用?PHP PDF_Common::do_mergetags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDF_Common
的用法示例。
在下文中一共展示了PDF_Common::do_mergetags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_pdf_parameters
public static function generate_pdf_parameters($index, $form_id, $lead_id, $template = '')
{
global $gfpdf;
$config = $gfpdf->configuration[$index];
$pdf_name = isset($config['filename']) && strlen($config['filename']) > 0 ? $gfpdf->get_pdf_name($index, $form_id, $lead_id) : PDF_Common::get_pdf_filename($form_id, $lead_id);
$template = isset($template) && strlen($template) > 0 ? $template : $gfpdf->get_template($index);
$pdf_size = isset($config['pdf_size']) && (is_array($config['pdf_size']) || strlen($config['pdf_size']) > 0) ? $config['pdf_size'] : PDFGenerator::$default['pdf_size'];
$orientation = isset($config['orientation']) && strlen($config['orientation']) > 0 ? $config['orientation'] : PDFGenerator::$default['orientation'];
$security = isset($config['security']) && $config['security'] ? $config['security'] : PDFGenerator::$default['security'];
$premium = isset($config['premium']) && $config['premium'] === true ? true : false;
/* added in v3.4.0 */
$dpi = isset($config['dpi']) && (int) $config['dpi'] > 0 ? (int) $config['dpi'] : false;
/* added in v3.4.0 */
$pdfa1b = isset($config['pdfa1b']) && $config['pdfa1b'] === true ? true : false;
/* added in v3.4.0 */
$pdfx1a = isset($config['pdfx1a']) && $config['pdfx1a'] === true ? true : false;
/*
* Validate privileges
* If blank and security is true then set privileges to all
*/
$privileges = isset($config['pdf_privileges']) ? $gfpdf->validate_privileges($config['pdf_privileges']) : $gfpdf->validate_privileges('');
$pdf_password = isset($config['pdf_password']) ? PDF_Common::do_mergetags($config['pdf_password'], $form_id, $lead_id) : '';
$master_password = isset($config['pdf_master_password']) ? PDF_Common::do_mergetags($config['pdf_master_password'], $form_id, $lead_id) : '';
$rtl = isset($config['rtl']) ? $config['rtl'] : false;
$form = RGFormsModel::get_form_meta($form_id);
$lead = RGFormsModel::get_lead($lead_id);
/*
* Run the options through filters
*/
$pdf_name = apply_filters('gfpdfe_pdf_name', $pdf_name, $form, $lead);
$template = apply_filters('gfpdfe_template', $template, $form, $lead);
$orientation = apply_filters('gfpdf_orientation', $orientation, $form, $lead);
$security = apply_filters('gfpdf_security', $security, $form, $lead);
$privileges = apply_filters('gfpdf_privilages', $privileges, $form, $lead);
$pdf_password = apply_filters('gfpdf_password', $pdf_password, $form, $lead);
$master_password = apply_filters('gfpdf_master_password', $master_password, $form, $lead);
$rtl = apply_filters('gfpdf_rtl', $rtl, $form, $lead);
$pdf_arguments = array('pdfname' => $pdf_name, 'template' => $template, 'pdf_size' => $pdf_size, 'orientation' => $orientation, 'security' => $security, 'pdf_password' => $pdf_password, 'pdf_privileges' => $privileges, 'pdf_master_password' => $master_password, 'rtl' => $rtl, 'premium' => $premium, 'dpi' => $dpi, 'pdfa1b' => $pdfa1b, 'pdfx1a' => $pdfx1a);
return $pdf_arguments;
}
示例2: test_replace_variables
/**
* Test GF replace variables function (merge tags)
* i.e GFCommon::replace_variables
*
* @group gravityforms
* @dataProvider provider_mergetag_test
*/
public function test_replace_variables($mergetag, $value)
{
$this->assertEquals($value, PDF_Common::do_mergetags($mergetag, $this->form_id[0], $this->entries[2]));
}