本文整理汇总了PHP中FrmAppHelper类的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper类的具体用法?PHP FrmAppHelper怎么用?PHP FrmAppHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FrmAppHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: setup_edit_vars
public static function setup_edit_vars($post, $check_post = true)
{
if (!$post) {
return false;
}
$values = (object) $post;
$defaults = FrmProDisplaysHelper::get_default_opts();
foreach (array('form_id', 'entry_id', 'post_id', 'dyncontent', 'param', 'type', 'show_count', 'insert_loc') as $var) {
if ($check_post) {
$values->{'frm_' . $var} = FrmAppHelper::get_param($var, get_post_meta($post->ID, 'frm_' . $var, true));
} else {
$values->{'frm_' . $var} = get_post_meta($post->ID, 'frm_' . $var, true);
}
}
$options = get_post_meta($post->ID, 'frm_options', true);
foreach ($defaults as $var => $default) {
if (!isset($values->{'frm_' . $var})) {
if ($check_post) {
$values->{'frm_' . $var} = FrmAppHelper::get_post_param('options[' . $var . ']', isset($options[$var]) ? $options[$var] : $default);
} else {
$values->{'frm_' . $var} = isset($options[$var]) ? $options[$var] : $default;
}
} else {
if ($var == 'param' and 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:amit0773,项目名称:manaslake,代码行数:33,代码来源:FrmProDisplaysHelper.php
示例3: update
function update($id, $values)
{
global $wpdb, $frmprodb, $frm_field;
$new_values = array();
$values['display_key'] = isset($values['display_key']) ? $values['display_key'] : $values['name'];
$new_values['display_key'] = FrmAppHelper::get_unique_key($values['display_key'], $frmprodb->displays, 'display_key', $id);
$new_values['param'] = isset($values['param']) ? sanitize_title_with_dashes($values['param']) : '';
$fields = array('name', 'description', 'content', 'dyncontent', 'insert_loc', 'type', 'show_count', 'form_id', 'entry_id', 'post_id');
foreach ($fields as $field) {
$new_values[$field] = $values[$field];
}
$new_values['entry_id'] = isset($values['entry_id']) ? (int) $values['entry_id'] : 0;
if (isset($values['options'])) {
$new_values['options'] = array();
foreach ($values['options'] as $key => $value) {
$new_values['options'][$key] = $value;
}
$new_values['options'] = maybe_serialize($new_values['options']);
}
$query_results = $wpdb->update($frmprodb->displays, $new_values, array('id' => $id));
if ($query_results) {
wp_cache_delete($id, 'frm_display');
do_action('frm_update_display', $id, $values);
}
return $query_results;
}
开发者ID:moscarar,项目名称:cityhow,代码行数:26,代码来源:FrmProDisplay.php
示例4: pro_tip
public static function pro_tip($callback, $html = '')
{
if (FrmAppHelper::pro_is_installed()) {
return;
}
$tips = self::$callback();
$tip = self::get_random_tip($tips);
if ($html == 'p') {
echo '<p>';
}
?>
<a href="<?php
echo esc_url(FrmAppHelper::make_affiliate_url($tip['link']));
?>
" target="_blank" class="frm_pro_tip">
<span><i class="frm_icon_font frm_check1_icon"></i> Pro Tip:</span>
<?php
echo esc_html($tip['tip']);
?>
<?php
if (isset($tip['call'])) {
?>
<span><?php
echo esc_html($tip['call']);
?>
</span>
<?php
}
?>
</a>
<?php
if ($html == 'p') {
echo '</p>';
}
}
开发者ID:hugocica,项目名称:locomotiva-2016,代码行数:35,代码来源:FrmTipsHelper.php
示例5: enqueue_jquery_css
public static function enqueue_jquery_css()
{
$theme_css = FrmStylesController::get_style_val('theme_css');
if ($theme_css != -1) {
wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version());
}
}
开发者ID:EasyDayCleaning,项目名称:Easy-Day-Team2,代码行数:7,代码来源:FrmStylesHelper.php
示例6: 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);
}
开发者ID:swc-dng,项目名称:swcsandbox,代码行数:8,代码来源:FrmProStylesController.php
示例7: license_settings
public static function license_settings()
{
$plugins = apply_filters('frm_installed_addons', array());
if (empty($plugins)) {
_e('There are no plugins on your site that require a license', 'formidable');
return;
}
include FrmAppHelper::plugin_path() . '/classes/views/addons/settings.php';
}
开发者ID:LeanderWesterhout,项目名称:leander,代码行数:9,代码来源:FrmAddonsController.php
示例8: load_css
public static function load_css()
{
global $frmpro_settings;
if (!is_admin()) {
$use_saved = true;
}
include FrmAppHelper::plugin_path() . '/pro/css/custom_theme.css.php';
die;
}
开发者ID:amit0773,项目名称:manaslake,代码行数:9,代码来源:FrmProAppController.php
示例9: 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
示例10: test_load_wp_admin_style
/**
* @covers FrmAppController::load_wp_admin_style
*/
public function test_load_wp_admin_style()
{
$this->set_admin_screen();
ob_start();
do_action('admin_enqueue_scripts');
do_action('admin_print_styles');
$styles = ob_get_contents();
ob_end_clean();
$this->assertNotEmpty($styles);
$this->assertTrue(strpos($styles, FrmAppHelper::plugin_url() . '/css/frm_fonts.css') !== false, 'The frm_fonts stylesheet is missing');
}
开发者ID:knightzac19,项目名称:formidable-forms,代码行数:14,代码来源:test_FrmAppController.php
示例11: getAll
function getAll($where = '', $order_by = '', $limit = '')
{
global $wpdb;
$query = "SELECT * FROM {$this->table_name} " . FrmAppHelper::prepend_and_or_where(' WHERE ', $where) . $order_by . $limit;
if ($limit == ' LIMIT 1') {
$results = $wpdb->get_row($query);
} else {
$results = $wpdb->get_results($query);
}
return $results;
}
开发者ID:amit0773,项目名称:manaslake,代码行数:11,代码来源:FrmProCopy.php
示例12: get_default_field_opts
function get_default_field_opts($type, $field, $limit = false)
{
$field_options = array('size' => '', 'max' => '', 'label' => '', 'blank' => '', 'required_indicator' => '*', 'invalid' => '', 'separate_value' => 0, 'clear_on_focus' => 0, 'default_blank' => 0, 'classes' => '', 'custom_html' => '');
if ($limit) {
return $field_options;
}
global $frmdb, $frm_app_helper, $frm_settings;
$form_id = is_numeric($field) ? $field : $field->form_id;
$key = is_numeric($field) ? FrmAppHelper::get_unique_key('', $frmdb->fields, 'field_key') : $field->field_key;
$field_count = $frm_app_helper->getRecordCount("form_id='{$form_id}'", $frmdb->fields);
return array('name' => __('Untitled', 'formidable'), 'description' => '', 'field_key' => $key, 'type' => $type, 'options' => '', 'default_value' => '', 'field_order' => $field_count + 1, 'required' => false, 'blank' => __('This field cannot be blank', 'formidable'), 'invalid' => __('This field is invalid', 'formidable'), 'form_id' => $form_id, 'field_options' => $field_options);
}
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:12,代码来源:FrmFieldsHelper.php
示例13: 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
示例14: test_add_js
public function test_add_js()
{
$frm_settings = FrmAppHelper::get_settings();
global $frm_vars;
if ($frm_settings->jquery_css) {
$this->assertNotEmpty($frm_vars['datepicker_loaded']);
}
if ($frm_settings->accordion_js) {
$this->assertTrue(wp_script_is('jquery-ui-widget', 'enqueued'));
$this->assertTrue(wp_script_is('jquery-ui-accordion', 'enqueued'));
}
}
开发者ID:rbkhrlstn,项目名称:formidable-forms,代码行数:12,代码来源:test_FrmProEntriesController.php
示例15: setUp
function setUp()
{
parent::setUp();
FrmAppController::install();
$this->import_xml();
$this->factory->form = new Form_Factory($this);
$this->factory->field = new Field_Factory($this);
$this->factory->entry = new Entry_Factory($this);
$this->is_pro_active = FrmAppHelper::pro_is_installed();
$current_class_name = get_class($this);
if (strpos($current_class_name, 'FrmPro') && !$this->is_pro_active) {
$this->markTestSkipped('Pro is not active');
}
}
开发者ID:knightzac19,项目名称:formidable-forms,代码行数:14,代码来源:FrmAjaxUnitTest.php
示例16: 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
示例17: head
public static function head()
{
FrmSettingsController::route('stop_load');
wp_enqueue_script('jquery-frm-themepicker');
?>
<link type="text/css" rel="stylesheet" href="http<?php
echo is_ssl() ? 's' : '';
?>
://ajax.googleapis.com/ajax/libs/jqueryui/1.7.3/themes/base/ui.all.css" />
<link href="<?php
echo admin_url('admin-ajax.php');
?>
?action=frmpro_css" type="text/css" rel="Stylesheet" class="frm-custom-theme"/>
<?php
require FrmAppHelper::plugin_path() . '/classes/views/shared/head.php';
}
开发者ID:amit0773,项目名称:manaslake,代码行数:16,代码来源:FrmProSettingsController.php
示例18: update
function update($id, $values)
{
global $wpdb, $frmdb;
if (isset($values['field_key'])) {
$values['field_key'] = FrmAppHelper::get_unique_key($values['field_key'], $frmdb->fields, 'field_key', $id);
}
if (isset($values['field_options']) and is_array($values['field_options'])) {
$values['field_options'] = serialize($values['field_options']);
}
$query_results = $wpdb->update($frmdb->fields, $values, array('id' => $id));
unset($values);
if ($query_results) {
wp_cache_delete($id, 'frm_field');
}
return $query_results;
}
开发者ID:moscarar,项目名称:cityhow,代码行数:16,代码来源:FrmField.php
示例19: 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
示例20: test_front_head
/**
* Make sure the stylesheet is loaded at the right times
*/
public function test_front_head()
{
$this->set_front_end();
if (defined('DOING_AJAX') && DOING_AJAX) {
$this->markTestSkipped('Run with --group styles');
}
ob_start();
do_action('wp_head');
$styles = ob_get_contents();
ob_end_clean();
$this->assertNotEmpty($styles);
$frm_settings = FrmAppHelper::get_settings();
$stylesheet_urls = $this->get_custom_stylesheet();
$style_included = strpos($styles, $stylesheet_urls['formidable']);
if ($frm_settings->load_style == 'all') {
$this->assertTrue($style_included !== false, 'The formidablepro stylesheet is missing');
} else {
$this->assertFalse($style_included, 'The formidablepro stylesheet is included when it should not be');
}
}
开发者ID:knightzac19,项目名称:formidable-forms,代码行数:23,代码来源:test_FrmStylesController.php
注:本文中的FrmAppHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论