本文整理汇总了PHP中FrmAppHelper::simple_get方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::simple_get方法的具体用法?PHP FrmAppHelper::simple_get怎么用?PHP FrmAppHelper::simple_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::simple_get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public static function destroy()
{
$id = FrmAppHelper::simple_get('id', 'absint');
$frm_style = new FrmStyle();
$frm_style->destroy($id);
$message = __('Your styling settings have been deleted.', 'formidable');
self::edit('default', $message);
}
示例2: license_box
public static function license_box()
{
$edd_update = new FrmProEddController();
$a = FrmAppHelper::simple_get('t', 'sanitize_title', 'general_settings');
remove_action('frm_before_settings', 'FrmSettingsController::license_box');
$show_creds_form = !is_multisite() || is_super_admin() || !get_site_option($edd_update->pro_wpmu_store);
include FrmAppHelper::plugin_path() . '/pro/classes/views/settings/license_box.php';
}
示例3: manage_columns
public static function manage_columns($columns)
{
global $frm_vars, $wpdb;
$form_id = FrmForm::get_current_form_id();
$columns[$form_id . '_id'] = 'ID';
$columns[$form_id . '_item_key'] = esc_html__('Entry Key', 'formidable');
if (!$form_id) {
return $columns;
}
$form_cols = FrmField::get_all_for_form($form_id, '', 'include');
foreach ($form_cols as $form_col) {
if (FrmField::is_no_save_field($form_col->type)) {
continue;
}
if ($form_col->type == 'form' && isset($form_col->field_options['form_select']) && !empty($form_col->field_options['form_select'])) {
$sub_form_cols = FrmField::get_all_for_form($form_col->field_options['form_select']);
if ($sub_form_cols) {
foreach ($sub_form_cols as $k => $sub_form_col) {
if (FrmField::is_no_save_field($sub_form_col->type)) {
unset($sub_form_cols[$k]);
continue;
}
$columns[$form_id . '_' . $sub_form_col->field_key . '-_-' . $form_col->id] = FrmAppHelper::truncate($sub_form_col->name, 35);
unset($sub_form_col);
}
}
unset($sub_form_cols);
} else {
$col_id = $form_col->field_key;
if ($form_col->form_id != $form_id) {
$col_id .= '-_-form' . $form_col->form_id;
}
if (isset($form_col->field_options['separate_value']) && $form_col->field_options['separate_value']) {
$columns[$form_id . '_frmsep_' . $col_id] = FrmAppHelper::truncate($form_col->name, 35);
}
$columns[$form_id . '_' . $col_id] = FrmAppHelper::truncate($form_col->name, 35);
}
}
$columns[$form_id . '_created_at'] = __('Entry creation date', 'formidable');
$columns[$form_id . '_updated_at'] = __('Entry update date', 'formidable');
$columns[$form_id . '_ip'] = 'IP';
$frm_vars['cols'] = $columns;
$action = FrmAppHelper::simple_get('frm_action', 'sanitize_title');
if (FrmAppHelper::is_admin_page('formidable-entries') && in_array($action, array('', 'list', 'destroy'))) {
add_screen_option('per_page', array('label' => __('Entries', 'formidable'), 'default' => 20, 'option' => 'formidable_page_formidable_entries_per_page'));
}
return $columns;
}
示例4: replace_shortcodes
public static function replace_shortcodes($html, $field, $errors = array(), $form = false, $args = array())
{
$html = apply_filters('frm_before_replace_shortcodes', $html, $field, $errors, $form);
$defaults = array('field_name' => 'item_meta[' . $field['id'] . ']', 'field_id' => $field['id'], 'field_plus_id' => '', 'section_id' => '');
$args = wp_parse_args($args, $defaults);
$field_name = $args['field_name'];
$field_id = $args['field_id'];
$html_id = self::get_html_id($field, $args['field_plus_id']);
if (FrmField::is_multiple_select($field)) {
$field_name .= '[]';
}
//replace [id]
$html = str_replace('[id]', $field_id, $html);
// Remove the for attribute for captcha
if ($field['type'] == 'captcha') {
$html = str_replace(' for="field_[key]"', '', $html);
}
// set the label for
$html = str_replace('field_[key]', $html_id, $html);
//replace [key]
$html = str_replace('[key]', $field['field_key'], $html);
//replace [description] and [required_label] and [error]
$required = FrmField::is_required($field) ? $field['required_indicator'] : '';
if (!is_array($errors)) {
$errors = array();
}
$error = isset($errors['field' . $field_id]) ? $errors['field' . $field_id] : false;
//If field type is section heading, add class so a bottom margin can be added to either the h3 or description
if ($field['type'] == 'divider') {
if (FrmField::is_option_true($field, 'description')) {
$html = str_replace('frm_description', 'frm_description frm_section_spacing', $html);
} else {
$html = str_replace('[label_position]', '[label_position] frm_section_spacing', $html);
}
}
foreach (array('description' => $field['description'], 'required_label' => $required, 'error' => $error) as $code => $value) {
self::remove_inline_conditions($value && $value != '', $code, $value, $html);
}
//replace [required_class]
$required_class = FrmField::is_required($field) ? ' frm_required_field' : '';
$html = str_replace('[required_class]', $required_class, $html);
//replace [label_position]
$field['label'] = apply_filters('frm_html_label_position', $field['label'], $field, $form);
$field['label'] = $field['label'] && $field['label'] != '' ? $field['label'] : 'top';
$html = str_replace('[label_position]', in_array($field['type'], array('divider', 'end_divider', 'break')) ? $field['label'] : ' frm_primary_label', $html);
//replace [field_name]
$html = str_replace('[field_name]', $field['name'], $html);
//replace [error_class]
$error_class = isset($errors['field' . $field_id]) ? ' frm_blank_field' : '';
self::get_more_field_classes($error_class, $field, $field_id, $html);
if ($field['type'] == 'html' && strpos($html, '[error_class]') === false) {
// there is no error_class shortcode to use for addign fields
$html = str_replace('class="frm_form_field', 'class="frm_form_field ' . $error_class, $html);
}
$html = str_replace('[error_class]', $error_class, $html);
//replace [entry_key]
$entry_key = FrmAppHelper::simple_get('entry', 'sanitize_title');
$html = str_replace('[entry_key]', $entry_key, $html);
//replace [input]
preg_match_all("/\\[(input|deletelink)\\b(.*?)(?:(\\/))?\\]/s", $html, $shortcodes, PREG_PATTERN_ORDER);
global $frm_vars;
$frm_settings = FrmAppHelper::get_settings();
foreach ($shortcodes[0] as $short_key => $tag) {
$atts = shortcode_parse_atts($shortcodes[2][$short_key]);
$tag = self::get_shortcode_tag($shortcodes, $short_key, array('conditional' => false, 'conditional_check' => false));
$replace_with = '';
if ($tag == 'input') {
if (isset($atts['opt'])) {
$atts['opt']--;
}
$field['input_class'] = isset($atts['class']) ? $atts['class'] : '';
if (isset($atts['class'])) {
unset($atts['class']);
}
$field['shortcodes'] = $atts;
ob_start();
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/input.php';
$replace_with = ob_get_contents();
ob_end_clean();
} else {
if ($tag == 'deletelink' && FrmAppHelper::pro_is_installed()) {
$replace_with = FrmProEntriesController::entry_delete_link($atts);
}
}
$html = str_replace($shortcodes[0][$short_key], $replace_with, $html);
}
if ($form) {
$form = (array) $form;
//replace [form_key]
$html = str_replace('[form_key]', $form['form_key'], $html);
//replace [form_name]
$html = str_replace('[form_name]', $form['name'], $html);
}
$html .= "\n";
//Return html if conf_field to prevent loop
if (isset($field['conf_field']) && $field['conf_field'] == 'stop') {
return $html;
}
//If field is in repeating section
if ($args['section_id']) {
//.........这里部分代码省略.........
示例5: _e
<div id="poststuff" class="metabox-holder">
<div id="post-body">
<div class="meta-box-sortables">
<div class="categorydiv postbox" id="frm-categorydiv">
<h3 class="hndle"><span><?php
_e('Global Settings', 'formidable');
?>
</span></h3>
<div class="inside frm-help-tabs">
<div id="contextual-help-back"></div>
<div id="contextual-help-columns">
<div class="contextual-help-tabs">
<ul class="frm-category-tabs">
<?php
$a = FrmAppHelper::simple_get('t', 'sanitize_title', 'general_settings');
?>
<li <?php
echo $a == 'general_settings' ? 'class="tabs active"' : '';
?>
><a href="#general_settings" class="frm_cursor_pointer"><?php
_e('General', 'formidable');
?>
</a></li>
<?php
foreach ($sections as $sec_name => $section) {
?>
<li <?php
echo $a == $sec_name . '_settings' ? 'class="tabs active"' : '';
?>
>
示例6: extract
<?php
if (isset($_GET['frm_style_setting']) || isset($_GET['flat'])) {
if (isset($_GET['frm_style_setting'])) {
extract($_GET['frm_style_setting']['post_content']);
} else {
extract($_GET);
}
$important_style = isset($important_style) ? $important_style : 0;
$auto_width = isset($auto_width) ? $auto_width : 0;
$submit_style = isset($submit_style) ? $submit_style : 0;
$style_name = FrmAppHelper::simple_get('style_name', 'sanitize_title');
if (!empty($style_name)) {
$style_class = $style_name . '.with_frm_style';
} else {
$style_class = 'with_frm_style';
}
} else {
$style_class = 'frm_style_' . $style->post_name . '.with_frm_style';
extract($style->post_content);
}
$important = empty($important_style) ? '' : ' !important';
$label_margin = (int) $width + 10;
$minus_icons = FrmStylesHelper::minus_icons();
$arrow_icons = FrmStylesHelper::arrow_icons();
// If left/right label is over a certain size, adjust the field description margin at a different screen size
$temp_label_width = str_replace('px', '', $width);
$change_margin = false;
if ($temp_label_width >= 230) {
$change_margin = 800 . 'px';
} else {
示例7: is_edit_view_page
public static function is_edit_view_page()
{
global $pagenow;
$post_type = FrmAppHelper::simple_get('post_type', 'sanitize_title');
return is_admin() && $pagenow == 'edit.php' && $post_type == FrmProDisplaysController::$post_type;
}
示例8: isset
<?php
if (!isset($new_field) || !$new_field) {
?>
<input type="text" name="<?php
echo isset($current_field_id) ? 'field_options[hide_opt_' . $current_field_id . ']' : $field_name;
?>
" value="" />
<?php
return;
}
if (!isset($is_settings_page)) {
$is_settings_page = FrmAppHelper::simple_get('frm_action') == 'settings';
$anything = $is_settings_page ? '' : __('Anything', 'formidable');
}
if ($new_field->type == 'data') {
if (isset($new_field->field_options['form_select']) && is_numeric($new_field->field_options['form_select'])) {
$new_entries = FrmEntryMeta::getAll(array('it.field_id' => (int) $new_field->field_options['form_select']), '', ' LIMIT 300', true);
}
$new_field->options = array();
if (isset($new_entries) && !empty($new_entries)) {
foreach ($new_entries as $ent) {
$new_field->options[$ent->item_id] = $ent->meta_value;
}
}
} else {
if (isset($new_field->field_options['post_field']) && $new_field->field_options['post_field'] == 'post_status') {
$new_field->options = FrmProFieldsHelper::get_status_options($new_field);
}
}
if (isset($new_field->field_options['post_field']) && $new_field->field_options['post_field'] == 'post_category') {
示例9: maybe_add_cat_query
/**
* Get fields with specified field value 'frm_cat' = field key/id,
* 'frm_cat_id' = order position of selected option
* @since 2.0.6
*/
private static function maybe_add_cat_query(&$where)
{
$frm_cat = FrmAppHelper::simple_get('frm_cat', 'sanitize_title');
$frm_cat_id = FrmAppHelper::simple_get('frm_cat_id', 'sanitize_title');
if (!$frm_cat || !isset($_GET['frm_cat_id'])) {
return;
}
$cat_field = FrmField::getOne($frm_cat);
if (!$cat_field) {
return;
}
$categories = maybe_unserialize($cat_field->options);
if (isset($categories[$frm_cat_id])) {
$cat_entry_ids = FrmEntryMeta::getEntryIds(array('meta_value' => $categories[$frm_cat_id], 'fi.field_key' => $frm_cat));
if ($cat_entry_ids) {
$where['it.id'] = $cat_entry_ids;
} else {
$where['it.id'] = 0;
}
}
}
示例10: get_file_name
public static function get_file_name($media_ids, $short = true)
{
$value = '';
foreach ((array) $media_ids as $media_id) {
if (!is_numeric($media_id)) {
continue;
}
$attachment = get_post($media_id);
if (!$attachment) {
continue;
}
$url = wp_get_attachment_url($media_id);
$label = $short ? basename($attachment->guid) : $url;
$action = FrmAppHelper::simple_get('action', 'sanitize_title');
$frm_action = FrmAppHelper::simple_get('frm_action', 'sanitize_title');
if ($frm_action == 'csv' || $action == 'frm_entries_csv') {
if (!empty($value)) {
$value .= ', ';
}
} else {
if (FrmAppHelper::is_admin()) {
$url = '<a href="' . esc_url($url) . '">' . $label . '</a>';
if (strpos(FrmAppHelper::simple_get('page', 'sanitize_title'), 'formidable') === 0) {
$url .= '<br/><a href="' . esc_url(admin_url('media.php') . '?action=edit&attachment_id=' . $media_id) . '">' . __('Edit Uploaded File', 'formidable') . '</a>';
}
} else {
if (!empty($value)) {
$value .= "<br/>\r\n";
}
}
}
$value .= $url;
unset($media_id);
}
return $value;
}
示例11: include_style_section
public static function include_style_section($atts, $sec)
{
extract($atts);
$current_tab = FrmAppHelper::simple_get('page-tab', 'sanitize_title', 'default');
include FrmAppHelper::plugin_path() . '/classes/views/styles/_' . $sec['args'] . '.php';
}
示例12: isset
</div><!-- #misc-publishing-actions -->
<div class="clear"></div>
</div><!-- #minor-publishing -->
<div id="major-publishing-actions">
<div id="delete-action">
<?php
echo FrmFormsHelper::delete_trash_link($id, $values['status']);
?>
</div>
<div id="publishing-action">
<span class="spinner"></span>
<?php
if ('settings' == FrmAppHelper::simple_get('frm_action', 'sanitize_title')) {
?>
<input type="button" value="<?php
esc_attr_e('Update', 'formidable');
?>
" class="frm_submit_form frm_submit_settings_btn button-primary button-large" id="frm_submit_side_top" />
<?php
} else {
?>
<input type="button" value="<?php
echo isset($button) ? esc_attr($button) : __('Update', 'formidable');
?>
" class="frm_submit_form frm_submit_<?php
echo isset($values['ajax_load']) && $values['ajax_load'] ? '' : 'no_';
?>
ajax button-primary button-large" id="frm_submit_side_top" />
示例13: get_frm_field_value_entry
/**
* Get entry object for frm_field_value shortcode
* Uses user_id, entry, or ip atts to fetch the entry
*
* @since 2.0.13
* @param object $field
* @param array $atts
* @return boolean|object $entry
*/
private static function get_frm_field_value_entry($field, &$atts)
{
$query = array('form_id' => $field->form_id);
if ($atts['user_id']) {
// make sure we are not getting entries for logged-out users
$query['user_id'] = (int) FrmAppHelper::get_user_id_param($atts['user_id']);
$query['user_id !'] = 0;
}
if ($atts['entry']) {
if (!is_numeric($atts['entry'])) {
$atts['entry'] = FrmAppHelper::simple_get($atts['entry'], 'sanitize_title', $atts['entry']);
}
if (empty($atts['entry'])) {
return;
}
if (is_numeric($atts['entry'])) {
$query[] = array('or' => 1, 'id' => $atts['entry'], 'parent_item_id' => $atts['entry']);
} else {
$query[] = array('item_key' => $atts['entry']);
}
}
if ($atts['ip']) {
$query['ip'] = $atts['ip'] == true ? FrmAppHelper::get_ip_address() : $atts['ip'];
}
$entry = FrmDb::get_row('frm_items', $query, 'post_id, id', array('order_by' => 'created_at DESC'));
return $entry;
}
示例14: license_box
public static function license_box()
{
$a = FrmAppHelper::simple_get('t', 'sanitize_title', 'general_settings');
include FrmAppHelper::plugin_path() . '/classes/views/frm-settings/license_box.php';
}
示例15: test_simple_get
/**
* @covers FrmAppHelper::simple_get
* @covers FrmAppHelper::get_simple_request
*/
function test_simple_get()
{
$set_value = '<script></script>test';
$expected_value = 'test';
$_GET['test4'] = $set_value;
$result = FrmAppHelper::simple_get('test4');
$this->assertEquals($result, $expected_value);
}