當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GFExport::set_property_as_key方法代碼示例

本文整理匯總了PHP中GFExport::set_property_as_key方法的典型用法代碼示例。如果您正苦於以下問題:PHP GFExport::set_property_as_key方法的具體用法?PHP GFExport::set_property_as_key怎麽用?PHP GFExport::set_property_as_key使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GFExport的用法示例。


在下文中一共展示了GFExport::set_property_as_key方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generateForm

 public static function generateForm()
 {
     if (class_exists('GFAPI')) {
         $thankyouPage = get_page_by_path('events/thank-you', OBJECT, 'page');
         $form = array('labelPlacement' => 'top_label', 'useCurrentUserAsAuthor' => '1', 'title' => self::$formTitle, 'descriptionPlacement' => 'below', 'button' => array('type' => 'text', 'text' => 'Submit'), 'fields' => array(array('id' => '1', 'isRequired' => '1', 'size' => 'medium', 'type' => 'name', 'nameFormat' => 'simple', 'label' => 'First Name'), array('id' => '2', 'isRequired' => '1', 'size' => 'medium', 'type' => 'name', 'nameFormat' => 'simple', 'label' => 'Last Name'), array('id' => '3', 'isRequired' => '1', 'size' => 'medium', 'type' => 'email', 'label' => 'Email'), array('id' => '4', 'isRequired' => '1', 'size' => 'medium', 'type' => 'phone', 'phoneFormat' => 'standard', 'label' => 'Phone'), array('id' => '5', 'isRequired' => '1', 'size' => 'medium', 'type' => 'select', 'label' => 'Number Attending', 'choices' => array(array('text' => '1', 'value' => '1'), array('text' => '2', 'value' => '2'), array('text' => '3', 'value' => '3'), array('text' => '4', 'value' => '4'), array('text' => '5', 'value' => '5'), array('text' => '6', 'value' => '6'), array('text' => '7', 'value' => '7'), array('text' => '8', 'value' => '8'))), array('id' => '6', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{embed_post:post_title}', 'label' => 'Event Name'), array('id' => '7', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{embed_post:ID}', 'label' => 'Event Post ID'), array('id' => '8', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{custom_field:_EventStartDate}', 'label' => 'Event Start Date'), array('id' => '9', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{custom_field:_EventEndDate}', 'label' => 'Event End Date'), array('id' => '10', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{custom_field:_EventRecurrence}', 'label' => 'Event Recurrence'), array('id' => '11', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '{custom_field:_EventAllDay}', 'label' => 'All Day Event'), array('id' => '90', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '', 'label' => 'Event Formatted Date'), array('id' => '91', 'size' => 'medium', 'type' => 'hidden', 'defaultValue' => '', 'label' => 'Event Formatted Time')), 'cssClass' => 'contact-form-gfec-form', 'enableHoneypot' => '1', 'confirmations' => array(array('id' => '5316355c6c8c1', 'isDefault' => '1', 'type' => 'page', 'name' => 'Default Confirmation', 'pageId' => $thankyouPage->ID, 'queryString' => 'eventID={post_id:7}')), 'notifications' => array(array('id' => '53163750d13d3', 'to' => '3', 'name' => 'RSVP', 'event' => 'form_submission', 'toType' => 'field', 'subject' => 'Thank You for Registering for (Event Name:5} - {Event Date:6}', 'message' => '{all_fields}', 'from' => '{admin_email}', 'fromName' => get_bloginfo('name'))));
         if (RGFormsModel::is_unique_title($form['title'])) {
             $form_id = RGFormsModel::insert_form($form['title']);
             $form["id"] = $form_id;
             GFFormsModel::trim_form_meta_values($form);
             if (isset($form['confirmations'])) {
                 $form['confirmations'] = GFExport::set_property_as_key($form['confirmations'], 'id');
                 $form['confirmations'] = GFFormsModel::trim_conditional_logic_values($form['confirmations'], $form);
                 GFFormsModel::update_form_meta($form_id, $form['confirmations'], 'confirmations');
                 unset($form['confirmations']);
             }
             if (isset($form['notifications'])) {
                 $form['notifications'] = GFExport::set_property_as_key($form['notifications'], 'id');
                 $form['notifications'] = GFFormsModel::trim_conditional_logic_values($form['notifications'], $form);
                 GFFormsModel::update_form_meta($form_id, $form['notifications'], 'notifications');
                 unset($form['notifications']);
             }
             RGFormsModel::update_form_meta($form_id, $form);
         }
     }
 }
開發者ID:brooklyntri,項目名稱:btc-plugins,代碼行數:25,代碼來源:ecgf.php


注:本文中的GFExport::set_property_as_key方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。