当前位置: 首页>>代码示例>>PHP>>正文


PHP FrmForm::getOne方法代码示例

本文整理汇总了PHP中FrmForm::getOne方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmForm::getOne方法的具体用法?PHP FrmForm::getOne怎么用?PHP FrmForm::getOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrmForm的用法示例。


在下文中一共展示了FrmForm::getOne方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _setup_test_update_values

 function _setup_test_update_values($entry)
 {
     $form = FrmForm::getOne($entry->form_id);
     $this->set_current_user_to_1();
     $values = array('form_id' => $entry->form_id, 'frm_hide_fields_' . $entry->form_id => '', 'frm_helers_' . $entry->form_id => '', 'form_key' => $form->form_key, 'item_meta' => $entry->metas, 'frm_submit_entry_' . $entry->form_id => wp_create_nonce('frm_submit_entry_' . $entry->form_id), '_wp_http_referer' => '/features/create-a-post-no-categories/?frm_action=edit&entry=' . $entry->id, 'id' => $entry->id, 'item_key' => $entry->item_key, 'item_name' => $entry->name, 'frm_user_id' => $entry->user_id, 'frm_skip_cookie' => 1);
     return $values;
 }
开发者ID:knightzac19,项目名称:formidable-forms,代码行数:7,代码来源:test_FrmEntry.php

示例2: user_can_edit_check

 function user_can_edit_check($entry, $form)
 {
     global $user_ID;
     if (!$user_ID) {
         return false;
     }
     if (is_numeric($form)) {
         $form = FrmForm::getOne($form);
     }
     $form->options = maybe_unserialize($form->options);
     //if editable and user can edit someone elses entry
     if ($form->editable and isset($form->options['open_editable']) and $form->options['open_editable'] and isset($form->options['open_editable_role']) and FrmAppHelper::user_has_permission($form->options['open_editable_role'])) {
         return true;
     }
     if (is_object($entry)) {
         if ($entry->user_id == $user_ID) {
             return true;
         } else {
             return false;
         }
     }
     $where = "user_id='{$user_ID}' and fr.id='{$form->id}'";
     if ($entry and !empty($entry)) {
         if (is_numeric($entry)) {
             $where .= ' and it.id=' . $entry;
         } else {
             $where .= " and item_key='" . $entry . "'";
         }
     }
     return FrmEntry::getAll($where, '', ' LIMIT 1', true);
 }
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:31,代码来源:FrmProEntry.php

示例3: show

 public static function show()
 {
     FrmAppHelper::permission_check('frm_view_reports');
     remove_action('frm_form_action_reports', 'FrmStatisticsController::list_reports');
     add_filter('frm_form_stop_action_reports', '__return_true');
     global $wpdb;
     $form = false;
     if (isset($_REQUEST['form'])) {
         $form = FrmForm::getOne($_REQUEST['form']);
     }
     if (!$form) {
         require FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/select.php';
         return;
     }
     $exclude_types = FrmField::no_save_fields();
     $exclude_types = array_merge($exclude_types, array('rte', 'textarea', 'file', 'grid', 'signature', 'form', 'table'));
     $fields = FrmField::getAll(array('fi.form_id' => (int) $form->id, 'fi.type not' => $exclude_types), 'field_order');
     $js = '';
     $data = array();
     $colors = '#21759B,#EF8C08,#C6C6C6';
     $data['time'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors, 'bg_color' => 'transparent'));
     $data['month'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors, 'bg_color' => 'transparent', 'width' => '100%'), 'MONTH');
     foreach ($fields as $field) {
         $this_data = self::graph_shortcode(array('id' => $field->id, 'field' => $field, 'is3d' => true, 'min' => 0, 'colors' => $colors, 'width' => 650, 'bg_color' => 'transparent'));
         if (strpos($this_data, 'frm_no_data_graph') === false) {
             $data[$field->id] = $this_data;
         }
         unset($field, $this_data);
     }
     $entries = FrmDb::get_col($wpdb->prefix . 'frm_items', array('form_id' => $form->id), 'created_at');
     // trigger the scripts to load
     global $frm_vars;
     $frm_vars['forms_loaded'][] = true;
     include FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/show.php';
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:35,代码来源:FrmProStatisticsController.php

示例4: create

 function create($values)
 {
     global $wpdb, $blog_id, $frmpro_display;
     $exists = $wpdb->query("DESCRIBE {$this->table_name}");
     if (!$exists) {
         $this->install(true);
     }
     unset($exists);
     $new_values = array();
     $new_values['blog_id'] = $blog_id;
     $new_values['form_id'] = isset($values['form_id']) ? (int) $values['form_id'] : null;
     $new_values['type'] = isset($values['type']) ? $values['type'] : 'form';
     //options here are: form, display
     if ($new_values['type'] == 'form') {
         $frm_form = new FrmForm();
         $form_copied = $frm_form->getOne($new_values['form_id']);
         $new_values['copy_key'] = $form_copied->form_key;
     } else {
         $form_copied = $frmpro_display->getOne($new_values['form_id']);
         $new_values['copy_key'] = $form_copied->post_name;
     }
     $new_values['created_at'] = current_time('mysql', 1);
     $exists = $this->getAll(array('blog_id' => $blog_id, 'form_id' => $new_values['form_id'], 'type' => $new_values['type']), '', ' LIMIT 1');
     if ($exists) {
         return false;
     }
     $query_results = $wpdb->insert($this->table_name, $new_values);
     if ($query_results) {
         return $wpdb->insert_id;
     } else {
         return false;
     }
 }
开发者ID:amit0773,项目名称:manaslake,代码行数:33,代码来源:FrmProCopy.php

示例5: add_form_nav

 public static function add_form_nav($views)
 {
     if (!FrmProDisplaysHelper::is_edit_view_page()) {
         return $views;
     }
     $form = isset($_REQUEST['form']) && is_numeric($_REQUEST['form']) ? $_REQUEST['form'] : false;
     if (!$form) {
         return $views;
     }
     $form = FrmForm::getOne($form);
     if (!$form) {
         return $views;
     }
     echo '<div id="poststuff">';
     echo '<div id="post-body" class="metabox-holder columns-2">';
     echo '<div id="post-body-content">';
     FrmAppController::get_form_nav($form, true, 'hide');
     echo '</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '<div id="titlediv"><input id="title" type="text" value="' . esc_attr($form->name == '' ? __('(no title)') : $form->name) . '" readonly="readonly" disabled="disabled" /></div>';
     echo '</div>';
     echo '<style type="text/css">p.search-box{margin-top:-91px;}</style>';
     return $views;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:25,代码来源:FrmProDisplaysController.php

示例6: create

 public static function create($values)
 {
     global $wpdb, $blog_id;
     $exists = $wpdb->query('DESCRIBE ' . self::table_name());
     if (!$exists) {
         self::install(true);
     }
     unset($exists);
     $new_values = array();
     $new_values['blog_id'] = $blog_id;
     $new_values['form_id'] = isset($values['form_id']) ? (int) $values['form_id'] : null;
     $new_values['type'] = isset($values['type']) ? $values['type'] : 'form';
     //options here are: form, display
     if ($new_values['type'] == 'form') {
         $form_copied = FrmForm::getOne($new_values['form_id']);
         $new_values['copy_key'] = $form_copied->form_key;
     } else {
         $form_copied = FrmProDisplay::getOne($new_values['form_id']);
         $new_values['copy_key'] = $form_copied->post_name;
     }
     $new_values['created_at'] = current_time('mysql', 1);
     $exists = self::getAll(array('blog_id' => $blog_id, 'form_id' => $new_values['form_id'], 'type' => $new_values['type']), '', ' LIMIT 1');
     if ($exists) {
         return false;
     }
     $query_results = $wpdb->insert(self::table_name(), $new_values);
     if ($query_results) {
         return $wpdb->insert_id;
     } else {
         return false;
     }
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:32,代码来源:FrmProCopy.php

示例7: duplicate

 function duplicate($id, $template = false, $copy_keys = false, $blog_id = false)
 {
     global $wpdb;
     $frm_form = new FrmForm();
     $values = $frm_form->getOne($id, $blog_id);
     if (!$values) {
         return false;
     }
     $new_key = $copy_keys ? $values->form_key : '';
     $new_values = array('form_key' => FrmAppHelper::get_unique_key($new_key, $wpdb->prefix . 'frm_forms', 'form_key'), 'name' => $values->name, 'description' => $values->description, 'status' => $template ? '' : 'draft', 'logged_in' => $values->logged_in ? $values->logged_in : 0, 'editable' => $values->editable ? $values->editable : 0, 'created_at' => current_time('mysql', 1), 'is_template' => $template ? 1 : 0);
     if ($blog_id) {
         $new_values['status'] = 'published';
         $new_options = maybe_unserialize($values->options);
         $new_options['email_to'] = get_option('admin_email');
         $new_options['copy'] = false;
         $new_values['options'] = $new_options;
     } else {
         $new_values['options'] = $values->options;
     }
     if (is_array($new_values['options'])) {
         $new_values['options'] = serialize($new_values['options']);
     }
     $query_results = $wpdb->insert($wpdb->prefix . 'frm_forms', $new_values);
     if ($query_results) {
         global $frm_field;
         $form_id = $wpdb->insert_id;
         $frm_field->duplicate($id, $form_id, $copy_keys, $blog_id);
         // update form settings after fields are created
         do_action('frm_after_duplicate_form', $form_id, $new_values);
         return $form_id;
     } else {
         return false;
     }
 }
开发者ID:amit0773,项目名称:manaslake,代码行数:34,代码来源:FrmForm.php

示例8: import_xml

 function import_xml()
 {
     // install test data in older format
     add_filter('frm_default_templates_files', 'FrmUnitTest::install_data');
     FrmXMLController::add_default_templates();
     $form = FrmForm::getOne('contact-db12');
     $this->assertEquals($form->form_key, 'contact-db12');
 }
开发者ID:amando96,项目名称:formidable-forms,代码行数:8,代码来源:FrmAjaxUnitTest.php

示例9: _check_form_select

 /**
  * @covers FrmXMLHelper::track_repeating_fields
  * @covers FrmXMLHelper::update_repeat_field_options
  */
 public function _check_form_select($f, $expected_form_key)
 {
     $this->assertNotEmpty($f->field_options['form_select'], 'Imported repeating section has a blank form_select.');
     // Check if the form_select setting matches the correct form
     $nested_form = FrmForm::getOne($f->field_options['form_select']);
     $this->assertNotEmpty($nested_form, 'The form_select in an imported repeating section is not updating correctly.');
     $this->assertEquals($expected_form_key, $nested_form->form_key, 'The form_select is not updating properly when a repeating section is imported.');
 }
开发者ID:rbkhrlstn,项目名称:formidable-forms,代码行数:12,代码来源:test_FrmXMLHelper.php

示例10: FrmForm

 function entry_created($entry_id, $form_id)
 {
     if (apply_filters('frm_stop_standard_email', false, $entry_id)) {
         return;
     }
     global $frm_entry, $frm_entry_meta;
     $entry = $frm_entry->getOne($entry_id, true);
     $frm_form = new FrmForm();
     $form = $frm_form->getOne($form_id);
     $values = $frm_entry_meta->getAll("it.item_id = {$entry_id}", " ORDER BY fi.field_order");
     if (isset($form->options['notification'])) {
         $notification = reset($form->options['notification']);
     } else {
         $notification = $form->options;
     }
     // Set the from and to email names and addresses
     $to_email = $notification['email_to'];
     if (empty($to_email)) {
         $to_email = '[admin_email]';
     }
     $to_emails = explode(',', $to_email);
     $reply_to = $reply_to_name = '';
     foreach ($values as $value) {
         $val = apply_filters('frm_email_value', maybe_unserialize($value->meta_value), $value, $entry);
         if (is_array($val)) {
             $val = implode(', ', $val);
         }
         if (isset($notification['reply_to']) and (int) $notification['reply_to'] == $value->field_id and is_email($val)) {
             $reply_to = $val;
         }
         if (isset($notification['reply_to_name']) and (int) $notification['reply_to_name'] == $value->field_id) {
             $reply_to_name = $val;
         }
     }
     if (empty($reply_to) && $notification['reply_to'] == 'custom') {
         $reply_to = $notification['cust_reply_to'];
     }
     if (empty($reply_to_name) && $notification['reply_to_name'] == 'custom') {
         $reply_to_name = $notification['cust_reply_to_name'];
     }
     // Set the email message
     $plain_text = isset($notification['plain_text']) && $notification['plain_text'] ? true : false;
     $mail_body = isset($notification['email_message']) ? $notification['email_message'] : '';
     $mail_body = FrmEntriesHelper::replace_default_message($mail_body, array('id' => $entry->id, 'entry' => $entry, 'plain_text' => $plain_text, 'user_info' => isset($notification['inc_user_info']) ? $notification['inc_user_info'] : false));
     // Set the subject
     $subject = isset($notification['email_subject']) ? $notification['email_subject'] : '';
     if (empty($subject)) {
         $frm_blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
         $subject = sprintf(__('%1$s Form submitted on %2$s', 'formidable'), $form->name, $frm_blogname);
     }
     // Send the emails now
     foreach ((array) $to_emails as $to_email) {
         $this->send_notification_email(trim($to_email), $subject, $mail_body, $reply_to, $reply_to_name, $plain_text);
     }
 }
开发者ID:amit0773,项目名称:manaslake,代码行数:55,代码来源:FrmNotification.php

示例11: _logic_row

 public static function _logic_row()
 {
     check_ajax_referer('frm_ajax', 'nonce');
     $meta_name = FrmAppHelper::get_param('meta_name', '', 'get', 'sanitize_title');
     $form_id = FrmAppHelper::get_param('form_id', '', 'get', 'absint');
     $key = FrmAppHelper::get_param('email_id', '', 'get', 'sanitize_title');
     $type = FrmAppHelper::get_param('type', '', 'get', 'sanitize_title');
     $form = FrmForm::getOne($form_id);
     FrmProFormsController::include_logic_row(array('form_id' => $form->id, 'form' => $form, 'meta_name' => $meta_name, 'condition' => array('hide_field_cond' => '==', 'hide_field' => ''), 'key' => $key, 'name' => 'frm_' . $type . '_action[' . $key . '][post_content][conditions][' . $meta_name . ']'));
     wp_die();
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:11,代码来源:FrmProFormActionsController.php

示例12: duplicate

 function duplicate($id, $copy_keys = false, $blog_id = false)
 {
     global $wpdb;
     $values = $this->getOne($id, $blog_id, true);
     if (!$values or !is_numeric($values->frm_form_id)) {
         return false;
     }
     $new_values = array();
     foreach (array('post_name', 'post_title', 'post_excerpt', 'post_content', 'post_status', 'post_type') as $k) {
         $new_values[$k] = $values->{$k};
         unset($k);
     }
     $meta = array();
     foreach (array('form_id', 'entry_id', 'post_id', 'dyncontent', 'param', 'type', 'show_count', 'insert_loc') as $k) {
         $meta[$k] = $values->{'frm_' . $k};
         unset($k);
     }
     $default = FrmProDisplaysHelper::get_default_opts();
     $meta['options'] = array();
     foreach ($default as $k => $v) {
         if (isset($meta[$k])) {
             continue;
         }
         $meta['options'][$k] = $values->{'frm_' . $k};
         unset($k);
         unset($v);
     }
     $meta['options']['copy'] = false;
     if ($blog_id) {
         $frm_form = new FrmForm();
         $old_form = $frm_form->getOne($values->frm_form_id, $blog_id);
         $new_form = $frm_form->getOne($old_form->form_key);
         $meta['form_id'] = $new_form->id;
     } else {
         $meta['form_id'] = $values->form_id;
     }
     $post_ID = wp_insert_post($new_values);
     $new_values = array_merge((array) $new_values, $meta);
     $this->update($post_ID, $new_values);
     return $post_ID;
 }
开发者ID:amit0773,项目名称:manaslake,代码行数:41,代码来源:FrmProDisplay.php

示例13: save_wppost_actions

 public static function save_wppost_actions($settings, $action)
 {
     $form_id = $action['menu_order'];
     if (isset($settings['post_custom_fields'])) {
         foreach ($settings['post_custom_fields'] as $cf_key => $n) {
             if (!isset($n['custom_meta_name'])) {
                 continue;
             }
             if ($n['meta_name'] == '' && $n['custom_meta_name'] != '') {
                 $settings['post_custom_fields'][$cf_key]['meta_name'] = $n['custom_meta_name'];
             }
             unset($settings['post_custom_fields'][$cf_key]['custom_meta_name']);
             unset($cf_key, $n);
         }
     }
     self::create_post_category_field($settings, $form_id);
     self::create_post_status_field($settings, $form_id);
     //update/create View
     if (!empty($settings['display_id'])) {
         if (is_numeric($settings['display_id'])) {
             //updating View
             $type = get_post_meta($settings['display_id'], 'frm_show_count', true);
             if ('one' == $type) {
                 $display = get_post($settings['display_id'], ARRAY_A);
                 $display['post_content'] = $_POST['dyncontent'];
                 wp_insert_post($display);
             } else {
                 update_post_meta($settings['display_id'], 'frm_dyncontent', $_POST['dyncontent']);
             }
         } else {
             if ('new' == $settings['display_id']) {
                 // Get form name for View title
                 $form = FrmForm::getOne($form_id);
                 if (!empty($form->name)) {
                     $post_title = $form->name;
                 } else {
                     $post_title = __('Single Post', 'formidable');
                 }
                 //create new
                 $cd_values = array('post_status' => 'publish', 'post_type' => 'frm_display', 'post_title' => $post_title, 'post_excerpt' => __('Used for the single post page', 'formidable'), 'post_content' => $_POST['dyncontent']);
                 $display_id = wp_insert_post($cd_values);
                 $settings['display_id'] = $display_id;
                 unset($cd_values);
                 update_post_meta($display_id, 'frm_param', 'entry');
                 update_post_meta($display_id, 'frm_type', 'display_key');
                 update_post_meta($display_id, 'frm_show_count', 'one');
                 update_post_meta($display_id, 'frm_form_id', $form_id);
             }
         }
     }
     return $settings;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:52,代码来源:FrmProForm.php

示例14: _setup_post_values

 function _setup_post_values($form_id)
 {
     $fields = FrmField::get_all_for_form($form_id);
     $form = FrmForm::getOne($form_id);
     $_POST = array('page' => 'formidable', 'frm_action' => 'update', 'id' => $form_id, 'action' => 'update', 'frm_save_form' => wp_create_nonce('frm_save_form_nonce'), 'status' => 'published', 'new_status' => '', 'name' => $form->name, 'frm_fields_submitted' => array(), 'item_meta' => array(), 'field_options' => array());
     foreach ($fields as $field) {
         $_POST['frm_fields_submitted'][] = $field->id;
         $_POST['item_meta'][$field->id] = 'default';
         $field_options = array('description_' . $field->id => '', 'type_' . $field->id => '', 'required_indicator_' . $field->id => '*', 'field_key_' . $field->id => $field->field_key, 'classes_' . $field->id => '', 'label_' . $field->id => '', 'size_' . $field->id => '', 'max_' . $field->id => '', 'admin_only_' . $field->id => '', 'use_calc_' . $field->id => 1, 'calc_' . $field->id => '', 'calc_dec_' . $field->id => '', 'show_hide_' . $field->id => 'show', 'any_all_' . $field->id => 'any', 'blank_' . $field->id => 'This field cannot be blank.', 'unique_msg_' . $field->id => '');
         $_POST['field_options'] = array_merge($_POST['field_options'], $field_options);
         $_REQUEST = $_POST;
     }
 }
开发者ID:knightzac19,项目名称:formidable-forms,代码行数:13,代码来源:test_FrmFormsController.php

示例15: no_items

 public function no_items()
 {
     $s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
     if (!empty($s)) {
         _e('No Entries Found', 'formidable');
         return;
     }
     $form_id = $form = $this->params['form'];
     if ($form_id) {
         $form = FrmForm::getOne($form_id);
     }
     $colspan = $this->get_column_count();
     include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/no_entries.php';
 }
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:14,代码来源:FrmEntriesListHelper.php


注:本文中的FrmForm::getOne方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。