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


PHP FrmAppHelper::get_param方法代码示例

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


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

示例1: setup_edit_vars

 public static function setup_edit_vars($post, $check_post = true)
 {
     if (!$post) {
         return false;
     }
     $values = (object) $post;
     $defaults = self::get_default_opts();
     foreach (array('form_id', 'entry_id', 'post_id', 'dyncontent', 'param', 'type', 'show_count', 'insert_loc') as $var) {
         $values->{'frm_' . $var} = get_post_meta($post->ID, 'frm_' . $var, true);
         if ($check_post) {
             $values->{'frm_' . $var} = FrmAppHelper::get_param($var, $values->{'frm_' . $var});
         }
     }
     $options = get_post_meta($post->ID, 'frm_options', true);
     foreach ($defaults as $var => $default) {
         if (!isset($values->{'frm_' . $var})) {
             $values->{'frm_' . $var} = isset($options[$var]) ? $options[$var] : $default;
             if ($check_post) {
                 $values->{'frm_' . $var} = FrmAppHelper::get_post_param('options[' . $var . ']', $values->{'frm_' . $var});
             }
         } else {
             if ($var == 'param' && empty($values->{'frm_' . $var})) {
                 $values->{'frm_' . $var} = $default;
             }
         }
     }
     $values->frm_form_id = (int) $values->frm_form_id;
     $values->frm_order_by = empty($values->frm_order_by) ? array() : (array) $values->frm_order_by;
     $values->frm_order = empty($values->frm_order) ? array() : (array) $values->frm_order;
     return $values;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:31,代码来源:FrmProDisplaysHelper.php

示例2: setup_edit_vars

 function setup_edit_vars($record)
 {
     global $frm_entry_meta, $frm_form;
     $values = array();
     $record->field_options = maybe_unserialize($record->field_options);
     $values['id'] = $record->id;
     $values['form_id'] = $record->form_id;
     foreach (array('name' => $record->name, 'description' => $record->description) as $var => $default) {
         $values[$var] = htmlspecialchars(stripslashes(FrmAppHelper::get_param($var, $default)));
     }
     $values['form_name'] = $record->form_id ? $frm_form->getName($record->form_id) : '';
     foreach (array('field_key' => $record->field_key, 'type' => $record->type, 'default_value' => $record->default_value, 'field_order' => $record->field_order, 'required' => $record->required) as $var => $default) {
         $values[$var] = FrmAppHelper::get_param($var, $default);
     }
     $values['options'] = stripslashes_deep(maybe_unserialize($record->options));
     $values['field_options'] = $record->field_options;
     $defaults = FrmFieldsHelper::get_default_field_opts($values['type'], $record, true);
     if ($values['type'] == 'captcha') {
         global $frm_settings;
         $defaults['invalid'] = $frm_settings->re_msg;
     }
     foreach ($defaults as $opt => $default) {
         $values[$opt] = isset($record->field_options[$opt]) ? $record->field_options[$opt] : $default;
     }
     $values['custom_html'] = isset($record->field_options['custom_html']) ? stripslashes($record->field_options['custom_html']) : FrmFieldsHelper::get_default_html($record->type);
     return apply_filters('frm_setup_edit_field_vars', $values, $values['field_options']);
 }
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:27,代码来源:FrmFieldsHelper.php

示例3: get_form_nav

 function get_form_nav($id, $show_nav = false)
 {
     $show_nav = FrmAppHelper::get_param('show_nav', $show_nav);
     if ($show_nav) {
         include FRM_VIEWS_PATH . '/shared/form-nav.php';
     }
 }
开发者ID:moscarar,项目名称:cityhow,代码行数:7,代码来源:FrmAppController.php

示例4: route

 function route()
 {
     $action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
     $action = FrmAppHelper::get_param($action);
     if ($action == 'process-form') {
         return $this->process_form();
     } else {
         return $this->display_form();
     }
 }
开发者ID:moscarar,项目名称:cityhow,代码行数:10,代码来源:FrmSettingsController.php

示例5: frmpro_editing

 function frmpro_editing($continue, $form_id, $action = 'new')
 {
     //Determine if this is a new entry or if we're editing an old one
     $form_submitted = FrmAppHelper::get_param('form_id');
     if ($action == 'new' or $action == 'preview') {
         $continue = true;
     } else {
         $continue = (is_numeric($form_submitted) and (int) $form_id != (int) $form_submitted) ? true : false;
     }
     return $continue;
 }
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:11,代码来源:FrmProEntry.php

示例6: _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

示例7: route

 public static function route($stop_load = false)
 {
     $action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
     $action = FrmAppHelper::get_param($action, '', 'get', 'sanitize_title');
     if ($action == 'process-form') {
         return self::process_form($stop_load);
     } else {
         if ($stop_load != 'stop_load') {
             return self::display_form();
         }
     }
 }
开发者ID:LeanderWesterhout,项目名称:leander,代码行数:12,代码来源:FrmSettingsController.php

示例8: setup_edit_vars

 public static function setup_edit_vars($values)
 {
     $record = FrmForm::getOne($values['id']);
     foreach (array('logged_in' => $record->logged_in, 'editable' => $record->editable) as $var => $default) {
         $values[$var] = FrmAppHelper::get_param($var, $default);
     }
     foreach (self::get_default_opts() as $opt => $default) {
         if (!isset($values[$opt])) {
             $values[$opt] = $_POST && isset($_POST['options'][$opt]) ? $_POST['options'][$opt] : $default;
         }
         unset($opt, $default);
     }
     return $values;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:14,代码来源:FrmProFormsHelper.php

示例9: duplicate

 public static function duplicate($return = '')
 {
     $style_id = FrmAppHelper::get_param('style_id', 0, 'get', 'absint');
     if (!$style_id) {
         self::new_style($return);
         return;
     }
     $frm_style = new FrmProStyle();
     $style = $frm_style->duplicate($style_id);
     if ('style' == $return) {
         // return style object for header css link
         return $style;
     }
     self::load_styler($style);
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:15,代码来源:FrmProStylesController.php

示例10: setup_edit_vars

 function setup_edit_vars($values)
 {
     global $frm_form, $frmpro_settings;
     $record = $frm_form->getOne($values['id']);
     foreach (array('logged_in' => $record->logged_in, 'editable' => $record->editable) as $var => $default) {
         $values[$var] = FrmAppHelper::get_param($var, $default);
     }
     foreach (FrmProFormsHelper::get_default_opts() as $opt => $default) {
         if (!isset($values[$opt])) {
             $values[$opt] = ($_POST and isset($_POST['options'][$opt])) ? $_POST['options'][$opt] : $default;
         }
     }
     $values['also_email_to'] = (array) $values['also_email_to'];
     return $values;
 }
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:15,代码来源:FrmProFormsHelper.php

示例11: get_form_nav

 public static function get_form_nav($form, $show_nav = false, $title = 'show')
 {
     $show_nav = FrmAppHelper::get_param('show_nav', $show_nav, 'get', 'absint');
     if (empty($show_nav) || !$form) {
         return;
     }
     FrmForm::maybe_get_form($form);
     if (!is_object($form)) {
         return;
     }
     $id = $form->id;
     $current_page = self::get_current_page();
     $nav_items = self::get_form_nav_items($form);
     include FrmAppHelper::plugin_path() . '/classes/views/shared/form-nav.php';
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:15,代码来源:FrmAppController.php

示例12: isset

 public static function &allow_form_edit($action, $form)
 {
     if ($action != 'new') {
         // make sure there is an entry id in the url if the action is being set in the url
         $entry_id = isset($_GET['entry']) ? $_GET['entry'] : 0;
         if (empty($entry_id) && (!$_POST || !isset($_POST['frm_action']))) {
             $action = 'new';
         }
     }
     $user_ID = get_current_user_id();
     if (!$form or !$user_ID) {
         return $action;
     }
     if (!$form->editable) {
         $action = 'new';
     }
     $is_draft = false;
     if ($action == 'destroy') {
         return $action;
     }
     if ($form->editable and (isset($form->options['single_entry']) and $form->options['single_entry'] and $form->options['single_entry_type'] == 'user') or isset($form->options['save_draft']) and $form->options['save_draft']) {
         if ($action == 'update' and $form->id == FrmAppHelper::get_param('form_id')) {
             //don't change the action is this is the wrong form
         } else {
             global $frmdb;
             $args = array('user_id' => $user_ID, 'form_id' => $form->id);
             if (isset($form->options['save_draft']) and $form->options['save_draft'] and (!$form->editable or !isset($form->options['single_entry']) or !$form->options['single_entry'] or $form->options['single_entry_type'] != 'user')) {
                 $args['is_draft'] = 1;
             }
             $meta = $frmdb->get_var($frmdb->entries, $args);
             if ($meta) {
                 if (isset($args['is_draft'])) {
                     $is_draft = 1;
                 }
                 $action = 'edit';
             }
         }
     }
     //do not allow editing if user does not have permission
     if ($action != 'edit' || $is_draft) {
         return $action;
     }
     $entry = FrmAppHelper::get_param('entry', 0);
     if (!self::user_can_edit($entry, $form)) {
         $action = 'new';
     }
     return $action;
 }
开发者ID:amit0773,项目名称:manaslake,代码行数:48,代码来源:FrmProEntriesHelper.php

示例13: route

 public static function route()
 {
     $action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
     $action = FrmAppHelper::get_param($action, '', 'get', 'sanitize_title');
     if ($action == 'import_xml') {
         return self::import_xml();
     } else {
         if ($action == 'export_xml') {
             return self::export_xml();
         } else {
             if (apply_filters('frm_xml_route', true, $action)) {
                 return self::form();
             }
         }
     }
 }
开发者ID:mazykin46,项目名称:portfolio,代码行数:16,代码来源:FrmXMLController.php

示例14: get_current_user_id

 public static function &allow_form_edit($action, $form)
 {
     if ($action != 'new') {
         // make sure there is an entry id in the url if the action is being set in the url
         $entry_id = FrmAppHelper::simple_get('entry', 'sanitize_title', 0);
         if (empty($entry_id) && (!$_POST || !isset($_POST['frm_action']))) {
             $action = 'new';
         }
     }
     $user_ID = get_current_user_id();
     if (!$form || !$user_ID) {
         return $action;
     }
     if (!$form->editable) {
         $action = 'new';
     }
     $is_draft = false;
     if ($action == 'destroy') {
         return $action;
     }
     global $wpdb;
     if ($form->editable && (isset($form->options['single_entry']) && $form->options['single_entry'] && $form->options['single_entry_type'] == 'user') || isset($form->options['save_draft']) && $form->options['save_draft']) {
         if ($action == 'update' && $form->id == FrmAppHelper::get_param('form_id', '', 'get', 'absint')) {
             //don't change the action is this is the wrong form
         } else {
             $checking_drafts = isset($form->options['save_draft']) && $form->options['save_draft'] && (!$form->editable || !isset($form->options['single_entry']) || !$form->options['single_entry'] || $form->options['single_entry_type'] != 'user');
             $meta = self::check_for_user_entry($user_ID, $form, $checking_drafts);
             if ($meta) {
                 if ($checking_drafts) {
                     $is_draft = 1;
                 }
                 $action = 'edit';
             }
         }
     }
     //do not allow editing if user does not have permission
     if ($action != 'edit' || $is_draft) {
         return $action;
     }
     $entry = FrmAppHelper::get_param('entry', 0);
     if (!self::user_can_edit($entry, $form)) {
         $action = 'new';
     }
     return $action;
 }
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:45,代码来源:FrmProEntriesHelper.php

示例15: setup_edit_vars

 function setup_edit_vars($record)
 {
     if (!$record) {
         return false;
     }
     $values = array();
     $values['id'] = $record->id;
     foreach (array('name', 'description', 'display_key', 'form_id', 'entry_id', 'post_id', 'content', 'dyncontent', 'param', 'type', 'show_count', 'insert_loc') as $var) {
         $values[$var] = stripslashes(FrmAppHelper::get_param($var, $record->{$var}));
     }
     $options = maybe_unserialize($record->options);
     foreach (FrmProDisplaysHelper::get_default_opts() as $var => $default) {
         if (!isset($values[$var])) {
             $values[$var] = stripslashes_deep(FrmAppHelper::get_post_param('options[' . $var . ']', isset($options[$var]) ? $options[$var] : $default));
         }
     }
     return $values;
 }
开发者ID:moscarar,项目名称:cityhow,代码行数:18,代码来源:FrmProDisplaysHelper.php


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