本文整理汇总了PHP中Ninja_Forms::config方法的典型用法代码示例。如果您正苦于以下问题:PHP Ninja_Forms::config方法的具体用法?PHP Ninja_Forms::config怎么用?PHP Ninja_Forms::config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ninja_Forms
的用法示例。
在下文中一共展示了Ninja_Forms::config方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Redirect', 'ninja-forms');
$settings = Ninja_Forms::config('ActionRedirectSettings');
$this->_settings = array_merge($this->_settings, $settings);
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Success Message', 'ninja-forms');
$settings = Ninja_Forms::config('ActionSuccessMessageSettings');
$this->_settings = array_merge($this->_settings, $settings);
add_action('nf_before_import_form', array($this, 'import_form_action_success_message'), 11);
}
示例3: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Email', 'ninja-forms');
$settings = Ninja_Forms::config('ActionEmailSettings');
$this->_settings = array_merge($this->_settings, $settings);
$this->_backwards_compatibility();
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->_blacklist = apply_filters('ninja_forms_uploads_extension_blacklist', Ninja_Forms::config('UploadsExtensionBlacklist'));
add_action('wp_ajax_nf_async_upload', array($this, 'upload'));
add_action('wp_ajax_nopriv_nf_async_upload', array($this, 'upload'));
add_action('nf_uploads_delete_temporary_file', array($this, 'delete_temporary_file'), 10, 1);
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->_nicename = __('Collect Payment', 'ninja-forms');
$settings = Ninja_Forms::config('ActionCollectPaymentSettings');
$this->_settings = array_merge($this->_settings, $settings);
add_action('plugins_loaded', array($this, 'register_payment_gateways'));
add_filter('ninja_forms_action_type_settings', array($this, 'maybe_remove_action'));
}
示例6: update_settings
public function update_settings()
{
if (!current_user_can(apply_filters('ninja_forms_admin_form_settings_capabilities', 'manage_options'))) {
return;
}
if (!isset($_POST[$this->_prefix])) {
return;
}
$settings = $_POST['ninja_forms'];
if (isset($settings['currency'])) {
$currency = sanitize_text_field($settings['currency']);
$currency_symbols = Ninja_Forms::config('CurrencySymbol');
$settings['currency_symbol'] = isset($currency_symbols[$currency]) ? $currency_symbols[$currency] : '';
}
foreach ($settings as $id => $value) {
$value = sanitize_text_field($value);
$value = apply_filters('ninja_forms_update_setting_' . $id, $value);
Ninja_Forms()->update_setting($id, $value);
do_action('ninja_forms_save_setting_' . $id, $value);
}
}
示例7: _localize_form_settings
protected function _localize_form_settings()
{
$form_settings_types = Ninja_Forms::config('FormSettingsTypes');
$form_settings['display'] = Ninja_Forms::config('FormDisplaySettings');
$form_settings['restrictions'] = Ninja_Forms::config('FormRestrictionSettings');
$form_settings['calculations'] = Ninja_Forms::config('FormCalculationSettings');
$form_settings = apply_filters('ninja_forms_localize_forms_settings', $form_settings);
$groups = Ninja_Forms::config('SettingsGroups');
$master_settings = array();
foreach ($form_settings_types as $id => $type) {
$unique_settings = $this->_unique_settings($form_settings[$id]);
$master_settings = array_merge($master_settings, $unique_settings);
$form_settings_types[$id]['settingGroups'] = $this->_group_settings($form_settings[$id], $groups);
$form_settings_types[$id]['settingDefaults'] = $this->_setting_defaults($unique_settings);
}
?>
<script>
var formSettingTypeData = <?php
echo wp_json_encode($form_settings_types);
?>
;
var formSettings = <?php
echo wp_json_encode(array_values($master_settings));
?>
;
</script>
<?php
}
示例8: enqueue_scripts
public static function enqueue_scripts($form_id)
{
$form = Ninja_Forms()->form($form_id)->get();
$is_preview = $form->get_tmp_id();
$ver = Ninja_Forms::VERSION;
$js_dir = Ninja_Forms::$url . 'assets/js/min/';
$css_dir = Ninja_Forms::$url . 'assets/css/';
switch (Ninja_Forms()->get_setting('opinionated_styles')) {
case 'light':
wp_enqueue_style('nf-display', $css_dir . 'display-opinions-light.css', array('dashicons'));
wp_enqueue_style('nf-font-awesome', $css_dir . 'font-awesome.min.css');
break;
case 'dark':
wp_enqueue_style('nf-display', $css_dir . 'display-opinions-dark.css', array('dashicons'));
wp_enqueue_style('nf-font-awesome', $css_dir . 'font-awesome.min.css');
break;
default:
wp_enqueue_style('nf-display', $css_dir . 'display-structure.css', array('dashicons'));
}
if ($is_preview || self::form_uses_recaptcha($form_id)) {
$recaptcha_lang = Ninja_Forms()->get_setting('recaptcha_lang');
wp_enqueue_script('google-recaptcha', 'https://www.google.com/recaptcha/api.js?hl=' . $recaptcha_lang, array('jquery'), $ver);
}
if ($is_preview || self::form_uses_datepicker($form_id)) {
wp_enqueue_style('pikaday-responsive', $css_dir . 'pikaday-package.css', $ver);
wp_enqueue_script('nf-front-end--datepicker', $js_dir . 'front-end--datepicker.min.js', array('jquery'), $ver);
}
if ($is_preview || self::form_uses_inputmask($form_id)) {
wp_enqueue_script('nf-front-end--inputmask', $js_dir . 'front-end--inputmask.min.js', array('jquery'), $ver);
}
if ($is_preview || self::form_uses_rte($form_id)) {
if ($is_preview || self::form_uses_textarea_media($form_id)) {
wp_enqueue_media();
}
wp_enqueue_style('summernote', $css_dir . 'summernote.css', $ver);
wp_enqueue_style('codemirror', $css_dir . 'codemirror.css', $ver);
wp_enqueue_style('codemirror-monokai', $css_dir . 'monokai-theme.css', $ver);
wp_enqueue_script('nf-front-end--rte', $js_dir . 'front-end--rte.min.js', array('jquery'), $ver);
}
if ($is_preview || self::form_uses_helptext($form_id)) {
wp_enqueue_style('jBox', $css_dir . 'jBox.css', $ver);
wp_enqueue_script('nf-front-end--helptext', $js_dir . 'front-end--helptext.min.js', array('jquery'), $ver);
}
if ($is_preview || self::form_uses_starrating($form_id)) {
wp_enqueue_style('rating', $css_dir . 'rating.css', Ninja_Forms::VERSION);
wp_enqueue_script('nf-front-end--starrating', $js_dir . 'front-end--starrating.min.js', array('jquery'), $ver);
}
wp_enqueue_script('nf-front-end-deps', $js_dir . 'front-end-deps.js', array('jquery', 'backbone'), $ver);
wp_enqueue_script('nf-front-end', $js_dir . 'front-end.js', array('nf-front-end-deps'), $ver);
wp_localize_script('nf-front-end', 'nfi18n', Ninja_Forms::config('i18nFrontEnd'));
$data = apply_filters('ninja_forms_render_localize_script_data', array('ajaxNonce' => wp_create_nonce('ninja_forms_display_nonce'), 'adminAjax' => admin_url('admin-ajax.php'), 'requireBaseUrl' => Ninja_Forms::$url . 'assets/js/', 'use_merge_tags' => array(), 'opinionated_styles' => Ninja_Forms()->get_setting('opinionated_styles')));
foreach (Ninja_Forms()->fields as $field) {
foreach ($field->use_merge_tags() as $merge_tag) {
$data['use_merge_tags'][$merge_tag][$field->get_type()] = $field->get_type();
}
}
wp_localize_script('nf-front-end', 'nfFrontEnd', $data);
do_action('ninja_forms_enqueue_scripts', array('form_id' => $form_id));
do_action('nf_display_enqueue_scripts');
}
示例9: load_settings
protected function load_settings($only_settings = array())
{
$settings = array();
// Loads a settings array from the FieldSettings configuration file.
$all_settings = Ninja_Forms::config('FieldSettings');
foreach ($only_settings as $setting) {
if (isset($all_settings[$setting])) {
$settings[$setting] = $all_settings[$setting];
}
}
return apply_filters('ninja_forms_field_' . $this->_name . '_settings', $settings);
}
示例10: load_settings
protected function load_settings($only_settings = array())
{
$settings = array();
// Loads a settings array from the FieldSettings configuration file.
$all_settings = Ninja_Forms::config('FieldSettings');
foreach ($only_settings as $setting) {
if (isset($all_settings[$setting])) {
$settings[$setting] = $all_settings[$setting];
}
}
return $settings;
}
示例11: apply_filters
<?php
if (!defined('ABSPATH')) {
exit;
}
return apply_filters('ninja_forms_form_display_settings', array('title' => array('name' => 'title', 'type' => 'textbox', 'label' => __('Form Title', 'ninja-forms'), 'width' => 'full', 'group' => 'primary', 'value' => ''), 'show_title' => array('name' => 'show_title', 'type' => 'toggle', 'label' => __('Display Form Title', 'ninja-forms'), 'width' => 'full', 'group' => 'primary', 'value' => 1), 'clear_complete' => array('name' => 'clear_complete', 'type' => 'toggle', 'label' => __('Clear successfully completed form?', 'ninja-forms'), 'width' => 'full', 'group' => 'primary', 'value' => 1, 'help' => __('If this box is checked, Ninja Forms will clear the form values after it has been successfully submitted.', 'ninja-forms')), 'hide_complete' => array('name' => 'hide_complete', 'type' => 'toggle', 'label' => __('Hide successfully completed form?', 'ninja-forms'), 'width' => 'full', 'group' => 'primary', 'value' => 1, 'help' => __('If this box is checked, Ninja Forms will hide the form after it has been successfully submitted.', 'ninja-forms')), 'default_label_pos' => array('name' => 'default_label_pos', 'type' => 'select', 'label' => __('Default Label Position', 'ninja-forms'), 'width' => 'full', 'group' => 'advanced', 'options' => array(array('label' => __('Above Element', 'ninja-forms'), 'value' => 'above'), array('label' => __('Below Element', 'ninja-forms'), 'value' => 'below'), array('label' => __('Left of Element', 'ninja-forms'), 'value' => 'left'), array('label' => __('Right of Element', 'ninja-forms'), 'value' => 'right'), array('label' => __('Hidden', 'ninja-forms'), 'value' => 'hidden')), 'value' => 'above'), 'classes' => array('name' => 'classes', 'type' => 'fieldset', 'label' => __('Custom Class Names', 'ninja-forms'), 'width' => 'full', 'group' => 'advanced', 'settings' => array(array('name' => 'wrapper_class', 'type' => 'textbox', 'placeholder' => '', 'label' => __('Wrapper', 'ninja-forms'), 'width' => 'one-half', 'value' => '', 'use_merge_tags' => FALSE), array('name' => 'element_class', 'type' => 'textbox', 'label' => __('Element', 'ninja-forms'), 'placeholder' => '', 'width' => 'one-half', 'value' => '', 'use_merge_tags' => FALSE))), 'key' => array('name' => 'key', 'type' => 'textbox', 'label' => __('Form Key', 'ninja-forms'), 'width' => 'full', 'group' => 'administration', 'value' => '', 'help' => __('Programmatic name that can be used to reference this form.', 'ninja-forms')), 'add_submit' => array('name' => 'add_submit', 'type' => 'toggle', 'label' => __('Add Submit Button', 'ninja-forms'), 'width' => 'full', 'group' => '', 'value' => 1, 'help' => __('We\'ve noticed that don\'t have a submit button on your form. We can add one for your automatically.', 'ninja-forms')), 'currency' => array('name' => 'currency', 'type' => 'select', 'options' => array_merge(array(array('label' => __('Plugin Default', 'ninja-forms'), 'value' => '')), Ninja_Forms::config('Currency')), 'label' => __('Currency', 'ninja-forms'), 'width' => 'full', 'group' => 'advanced', 'value' => '')));
示例12: apply_filters
<?php
if (!defined('ABSPATH')) {
exit;
}
return apply_filters('ninja_forms_plugin_settings_general', array('version' => array('id' => 'version', 'type' => 'desc', 'label' => __('Version', 'ninja-forms'), 'desc' => ''), 'date_format' => array('id' => 'date_format', 'type' => 'textbox', 'label' => __('Date Format', 'ninja-forms'), 'desc' => 'e.g. m/d/Y, d/m/Y - ' . sprintf(__('Tries to follow the %sPHP date() function%s specifications, but not every format is supported.', 'ninja-forms'), '<a href="http://www.php.net/manual/en/function.date.php" target="_blank">', '</a>')), 'currency' => array('id' => 'currency', 'type' => 'select', 'options' => Ninja_Forms::config('Currency'), 'label' => __('Currency', 'ninja-forms'), 'value' => 'USD')));
示例13: _fetch_action_feed
protected function _fetch_action_feed()
{
return Ninja_Forms::config('AvailableActions');
}
示例14: __construct
/**
* Constructor
*/
public function __construct()
{
// Loads a settings array from the ActionSettings configuration file.
$this->_settings = Ninja_Forms::config('ActionSettings');
}