本文整理匯總了PHP中PDF_Common::get_ids方法的典型用法代碼示例。如果您正苦於以下問題:PHP PDF_Common::get_ids方法的具體用法?PHP PDF_Common::get_ids怎麽用?PHP PDF_Common::get_ids使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PDF_Common
的用法示例。
在下文中一共展示了PDF_Common::get_ids方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: do_notification
public static function do_notification($notification, $form, $entry)
{
/*
* Allow the template/function access to these variables
*/
global $gfpdf, $form_id, $lead_id;
$notification_name = isset($notification['name']) ? $notification['name'] : '';
/*
* Set data used to determine if PDF needs to be created and attached to notification
* Don't change anything here.
*/
$form_title = $form['title'];
$form_id = $entry['form_id'];
$lead_id = apply_filters('gfpdfe_lead_id', $entry['id'], $form, $entry, $gfpdf);
/* allow premium plugins to override the lead ID */
/*
* Before setting up PDF options we will check if a configuration is found
* If not, we will set up defaults defined in configuration.php
*/
self::check_configuration($form_id);
/*
* Check if form is in configuration
*/
if (!($config = $gfpdf->get_config($form_id))) {
return $notification;
}
/* set up the correct lead IDs */
PDF_Common::get_ids();
/*
* To have our configuration indexes so loop through the PDF template configuration
* and generate and attach PDF files.
*/
foreach ($config as $index) {
$template = isset($gfpdf->configuration[$index]['template']) ? $gfpdf->configuration[$index]['template'] : '';
/* Get notifications user wants PDF attached to and check if the correct notifications hook is running */
$notifications = self::get_form_notifications($form, $index);
/*
* Premium plugin filter
* Allows manual override of the notification
* Allows the multi-report plugin to automate PDFs based on weekly/fortnightly/monthly basis
* Only allow boolean to be returned
*/
$notification_override = (bool) apply_filters('gfpdfe_notification_override', false, $notification_name, $notifications, $form, $entry, $gfpdf);
if (self::check_notification($notification_name, $notifications) || $notification_override === true) {
/* only generate the PDF is attaching to notification */
$pdf_arguments = self::generate_pdf_parameters($index, $form_id, $lead_id, $template);
/* generate and save default PDF */
$filename = $gfpdf->render->PDF_Generator($form_id, $lead_id, $pdf_arguments);
$notification['attachments'][] = $filename;
}
}
return $notification;
}