本文整理汇总了PHP中FrmAppHelper::plugin_path方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::plugin_path方法的具体用法?PHP FrmAppHelper::plugin_path怎么用?PHP FrmAppHelper::plugin_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::plugin_path方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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';
}
示例2: 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;
}
示例3: 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';
}
示例4: save_settings
/**
* Create static css file
*/
public function save_settings($styles)
{
$filename = FrmAppHelper::plugin_path() . '/css/custom_theme.css.php';
update_option('frm_last_style_update', date('njGi'));
if (!is_file($filename)) {
return;
}
$defaults = $this->get_defaults();
$uploads = wp_upload_dir();
$target_path = $uploads['basedir'] . '/formidable';
$needed_dirs = array($target_path, $target_path . '/css');
$dirs_exist = true;
$saving = true;
$css = '/* ' . __('WARNING: Any changes made to this file will be lost when your Formidable settings are updated', 'formidable') . ' */' . "\n";
ob_start();
$frm_style = $this;
include $filename;
$css .= preg_replace('/\\/\\*(.|\\s)*?\\*\\//', '', str_replace(array("\r\n", "\r", "\n", "\t", ' '), '', ob_get_contents()));
ob_end_clean();
$access_type = get_filesystem_method();
if ($access_type === 'direct') {
$creds = request_filesystem_credentials(site_url() . '/wp-admin/', '', false, false, array());
} else {
$creds = $this->get_ftp_creds($access_type);
}
if (!empty($creds)) {
// initialize the API
if (!WP_Filesystem($creds)) {
// any problems and we exit
$dirs_exist = false;
}
if ($dirs_exist) {
global $wp_filesystem;
$chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : fileperms(ABSPATH) & 0777 | 0755;
$chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : fileperms(ABSPATH . 'index.php') & 0777 | 0644;
// Create the directories if need be:
foreach ($needed_dirs as $_dir) {
// Only check to see if the Dir exists upon creation failure. Less I/O this way.
if (!$wp_filesystem->mkdir($_dir, $chmod_dir) && !$wp_filesystem->is_dir($_dir)) {
$dirs_exist = false;
}
}
$index_path = $target_path . '/index.php';
$wp_filesystem->put_contents($index_path, "<?php\n// Silence is golden.\n?>", $chmod_file);
// only write the file if the folders exist
if ($dirs_exist) {
$css_file = $target_path . '/css/formidablepro.css';
$wp_filesystem->put_contents($css_file, $css, $chmod_file);
}
}
}
update_option('frmpro_css', $css);
delete_transient('frmpro_css');
set_transient('frmpro_css', $css);
}
示例5: display_form
public static function display_form($errors = array(), $message = '')
{
global $frm_vars;
$frm_settings = FrmAppHelper::get_settings();
$frm_roles = FrmAppHelper::frm_capabilities();
$uploads = wp_upload_dir();
$target_path = $uploads['basedir'] . '/formidable/css';
$sections = apply_filters('frm_add_settings_section', array());
$captcha_lang = FrmAppHelper::locales('captcha');
require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php';
}
示例6: validate
public static function validate($params, $fields, $form, $title, $description)
{
global $frm_vars;
$frm_settings = FrmAppHelper::get_settings();
if (($_POST && isset($_POST['frm_page_order_' . $form->id]) || FrmProFormsHelper::going_to_prev($form->id)) && !FrmProFormsHelper::saving_draft()) {
$errors = '';
$fields = FrmFieldsHelper::get_form_fields($form->id);
$submit = isset($form->options['submit_value']) ? $form->options['submit_value'] : $frm_settings->submit_value;
$values = $fields ? FrmEntriesHelper::setup_new_vars($fields, $form) : array();
require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/new.php';
add_filter('frm_continue_to_create', '__return_false');
} else {
if ($form->editable && isset($form->options['single_entry']) && $form->options['single_entry'] && $form->options['single_entry_type'] == 'user') {
$user_ID = get_current_user_id();
if ($user_ID) {
$entry = FrmEntry::getAll(array('it.user_id' => $user_ID, 'it.form_id' => $form->id), '', 1, true);
if ($entry) {
$entry = reset($entry);
}
} else {
$entry = false;
}
if ($entry && !empty($entry) && (!isset($frm_vars['created_entries'][$form->id]) || !isset($frm_vars['created_entries'][$form->id]['entry_id']) || $entry->id != $frm_vars['created_entries'][$form->id]['entry_id'])) {
FrmProEntriesController::show_responses($entry, $fields, $form, $title, $description);
} else {
$record = $frm_vars['created_entries'][$form->id]['entry_id'];
$saved_message = isset($form->options['success_msg']) ? $form->options['success_msg'] : $frm_settings->success_msg;
if (FrmProFormsHelper::saving_draft()) {
$saved_message = isset($form->options['draft_msg']) ? $form->options['draft_msg'] : __('Your draft has been saved.', 'formidable');
}
$saved_message = apply_filters('frm_content', $saved_message, $form, $record ? $record : false);
$message = wpautop(do_shortcode($record ? $saved_message : $frm_settings->failed_msg));
$message = '<div class="frm_message" id="message">' . $message . '</div>';
FrmProEntriesController::show_responses($record, $fields, $form, $title, $description, $message);
}
add_filter('frm_continue_to_create', '__return_false');
} else {
if (FrmProFormsHelper::saving_draft()) {
$record = isset($frm_vars['created_entries']) && isset($frm_vars['created_entries'][$form->id]) ? $frm_vars['created_entries'][$form->id]['entry_id'] : 0;
if (!$record) {
return;
}
$saved_message = '';
FrmProFormsHelper::save_draft_msg($saved_message, $form, $record);
$message = FrmFormsHelper::get_success_message(array('message' => $saved_message, 'form' => $form, 'entry_id' => $record, 'class' => 'frm_message'));
FrmProEntriesController::show_responses($record, $fields, $form, $title, $description, $message);
add_filter('frm_continue_to_create', '__return_false');
}
}
}
}
示例7: 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';
}
示例8: edd_plugin_updater
public function edd_plugin_updater()
{
$license = trim($this->license);
if (!empty($license)) {
if (!class_exists('EDD_SL_Plugin_Updater')) {
include FrmAppHelper::plugin_path() . '/classes/models/EDD_SL_Plugin_Updater.php';
}
// setup the updater
$edd = new EDD_SL_Plugin_Updater($this->pro_mothership, $this->plugin_file, array('version' => $this->version, 'license' => $license, 'item_name' => $this->edd_plugin_name, 'author' => $this->author));
$this->edd = $edd;
// let WordPress handle the changelog
remove_filter('plugins_api', array($edd, 'plugins_api_filter'), 10, 3);
}
}
示例9: display_form
public static function display_form($errors = array(), $message = '')
{
global $frm_vars;
$frm_settings = FrmAppHelper::get_settings();
$frm_roles = FrmAppHelper::frm_capabilities();
$uploads = wp_upload_dir();
$target_path = $uploads['basedir'] . '/formidable/css';
$sections = array();
if (apply_filters('frm_include_addon_page', false)) {
$sections['licenses'] = array('class' => 'FrmAddonsController', 'function' => 'license_settings', 'name' => __('Plugin Licenses', 'formidable'));
}
$sections = apply_filters('frm_add_settings_section', $sections);
$captcha_lang = FrmAppHelper::locales('captcha');
require FrmAppHelper::plugin_path() . '/classes/views/frm-settings/form.php';
}
示例10: 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';
}
示例11: list_entries
public static function list_entries()
{
global $frm_entry;
$frm_form = new FrmForm();
$form_select = $frm_form->getAll("is_template=0 AND (status is NULL OR status = '' OR status = 'published')", ' ORDER BY name');
$form_id = FrmAppHelper::get_param('form', false);
if ($form_id) {
$form = $frm_form->getOne($form_id);
} else {
$form = isset($form_select[0]) ? $form_select[0] : 0;
}
if ($form) {
$entry_count = $frm_entry->getRecordCount($form->id);
}
include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/list.php';
}
示例12: load_admin_hooks
public static function load_admin_hooks()
{
add_action('admin_menu', 'FrmAppController::menu', 1);
add_action('admin_enqueue_scripts', 'FrmAppController::load_wp_admin_style');
add_action('admin_notices', 'FrmAppController::pro_get_started_headline');
add_action('admin_init', 'FrmAppController::admin_init', 11);
add_filter('admin_body_class', 'FrmAppController::wp_admin_body_class');
add_filter('plugin_action_links_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'FrmAppController::settings_link');
register_activation_hook(FrmAppHelper::plugin_path() . '/formidable.php', 'FrmAppController::activation_install');
// Entries Controller
add_action('admin_menu', 'FrmEntriesController::menu', 12);
add_filter('contextual_help', 'FrmEntriesController::contextual_help', 10, 3);
add_filter('set-screen-option', 'FrmEntriesController::save_per_page', 10, 3);
add_filter('update_user_metadata', 'FrmEntriesController::check_hidden_cols', 10, 5);
add_action('updated_user_meta', 'FrmEntriesController::update_hidden_cols', 10, 4);
// Fields Controller
add_filter('frm_display_field_options', 'FrmFieldsController::display_field_options');
add_action('frm_field_options_form', 'FrmFieldsController::add_conditional_update_msg', 50);
// Form Actions Controller
if (FrmAppHelper::is_admin_page('formidable')) {
add_action('frm_before_update_form_settings', 'FrmFormActionsController::update_settings');
}
add_action('frm_after_duplicate_form', 'FrmFormActionsController::duplicate_form_actions', 20, 3);
// Forms Controller
add_action('admin_menu', 'FrmFormsController::menu', 10);
add_action('admin_head-toplevel_page_formidable', 'FrmFormsController::head');
add_filter('set-screen-option', 'FrmFormsController::save_per_page', 10, 3);
add_action('admin_footer', 'FrmFormsController::insert_form_popup');
add_filter('media_buttons_context', 'FrmFormsController::insert_form_button');
// Forms Model
add_action('frm_after_duplicate_form', 'FrmForm::after_duplicate', 10, 2);
// Settings Controller
add_action('admin_menu', 'FrmSettingsController::menu', 45);
add_action('frm_before_settings', 'FrmSettingsController::license_box');
// Stats Controller
add_action('admin_menu', 'FrmStatisticsController::menu', 24);
add_action('frm_form_action_reports', 'FrmStatisticsController::list_reports');
// Styles Controller
add_action('admin_menu', 'FrmStylesController::menu', 14);
add_action('admin_init', 'FrmStylesController::admin_init');
// XML Controller
add_action('admin_menu', 'FrmXMLController::menu', 41);
}
示例13: pro_get_started_headline
public static function pro_get_started_headline()
{
// Don't display this error as we're upgrading the thing, or if the user shouldn't see the message
if ('upgrade-plugin' == FrmAppHelper::simple_get('action', 'sanitize_title') || !current_user_can('update_plugins')) {
return;
}
if (get_site_option('frmpro-authorized') && !file_exists(FrmAppHelper::plugin_path() . '/pro/formidable-pro.php')) {
FrmAppHelper::load_admin_wide_js();
// user is authorized, but running free version
$inst_install_url = 'https://formidablepro.com/knowledgebase/install-formidable-forms/';
?>
<div class="error" class="frm_previous_install">
<?php
echo wp_kses_post(apply_filters('frm_pro_update_msg', sprintf(__('This site has been previously authorized to run Formidable Forms.<br/>%1$sInstall Formidable Pro%2$s or %3$sdeauthorize%4$s this site to continue running the free version and remove this message.', 'formidable'), '<a href="' . esc_url($inst_install_url) . '" target="_blank">', '</a>', '<a href="#" class="frm_deauthorize_link">', '</a>'), esc_url($inst_install_url)));
?>
</div>
<?php
}
}
示例14: no_items
function no_items()
{
switch ($this->plural) {
case 'entries':
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
if (!empty($s)) {
_e('No Entries Found', 'formidable');
} else {
$frm_form = new FrmForm();
$form_id = $this->params['form'];
$form = $frm_form->getOne($form_id);
$colspan = $this->get_column_count();
if ($form) {
include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/no_entries.php';
}
}
break;
default:
parent::no_items();
}
}
示例15: show
public static function show()
{
global $frmdb, $frm_field, $frm_entry_meta, $frm_entry, $wpdb;
if (!isset($_GET['form'])) {
require FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/show.php';
return;
}
$frm_form = new FrmForm();
$form = $frm_form->getOne($_GET['form']);
$form_options = maybe_unserialize($form->options);
$fields = $frm_field->getAll("fi.type not in ('divider','captcha','break','rte','textarea','file','grid','html','signature','table') and fi.form_id=" . (int) $form->id, 'field_order ASC');
$js = '';
$data = array();
$colors = '#21759B,#EF8C08,#C6C6C6';
$data['time'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors));
$data['month'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors), 'MONTH');
foreach ($fields as $field) {
$data[$field->id] = self::graph_shortcode(array('id' => $field->id, 'field' => $field, 'is3d' => true, 'min' => 0, 'colors' => $colors, 'width' => 650));
unset($field);
}
include FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/show.php';
}