Ejemplo n.º 1
0
 /**
  * Sets tracking for the rendered form
  *
  * @since 1.0.0
  *
  * @return string  the form HTML
  */
 public function set_tracking($prefix, $form_id, $selector)
 {
     global $formworks_tracker;
     $formworks = \calderawp\frmwks\options::get_single('formworks');
     // add loaded notch
     tracker::add_notch($prefix, $form_id, 'loaded');
     if (empty($selector['selector']) || empty($selector['name'])) {
         return;
     }
     $selector['prefix'] = $prefix;
     $selector['id'] = $form_id;
     $formworks_tracker['selectors'][] = $selector;
     // URL hack :)
     $script_array = array('frmwksurl' => admin_url('admin-ajax.php'), 'config' => $formworks_tracker);
     wp_localize_script('formworks-front-binding', 'formworks', $script_array);
     wp_enqueue_script('formworks-front-binding');
 }
Ejemplo n.º 2
0
 /**
  * Add options page
  *
  * @since 1.0.0
  *
  * @uses "admin_menu" hook
  */
 public function add_settings_pages()
 {
     // This page will be under "Settings"
     $this->plugin_screen_hook_suffix['formworks'] = add_menu_page(__('Formworks', 'formworks'), __('Formworks', 'formworks'), 'manage_options', 'formworks', array($this, 'create_admin_page'), 'dashicons-tablet');
     add_action('admin_print_styles-' . $this->plugin_screen_hook_suffix['formworks'], array($this, 'enqueue_admin_stylescripts'));
     $formworks = \calderawp\frmwks\options::get_single('formworks');
     if (empty($formworks) || empty($formworks['track_form'])) {
         return;
     }
 }
Ejemplo n.º 3
0
<?php

global $wpdb;
/**
 * Main edit interface for single items.
 *
 * @package   Formworks
 * @author    David Cramer
 * @license   GPL-2.0+
 * @link
 * @copyright 2015 David Cramer
 */
// simple make stuff
$types = array('view', 'view', 'view', 'loaded', 'loaded', 'loaded', 'submission', 'engage', 'engage');
$formworks = \calderawp\frmwks\options::get_single('formworks');
$formworks['_current_tab'] = '#formworks-panel-forms';
$formworks['forms'] = apply_filters('formworks_get_forms', array());
// add slug
foreach ($formworks['forms'] as $slug => &$forms_set) {
    $forms_set['slug'] = $slug;
    foreach ($forms_set['forms'] as $form_id => $form) {
        // hack to populate
        for ($i = 0; $i < 20; $i++) {
            $entry = array('form_id' => $form_id, 'prefix' => $slug, 'user_id' => 1, 'user_key' => '56334b88a6dc8', 'datestamp' => date('Y-m-d H:i:s', strtotime("-" . rand(0, DAY_IN_SECONDS) . " seconds")), 'meta_key' => $types[rand(0, 8)], 'meta_value' => 1);
            //$wpdb->insert( 'wp_formworks_tracker', $entry );
        }
        $list = array();
        $activity_list = array();
        $limit = count($activity_list);
        $users_query = new \WP_User_Query(array('role' => 'administrator', 'fields' => 'ID', 'number' => -1));
        $admins = $users_query->get_results();
Ejemplo n.º 4
0
<?php

/**
 * Main edit interface for admin page.
 *
 * @package   Formworks
 * @author    David Cramer
 * @license   GPL-2.0+
 * @link
 * @copyright 2015 David Cramer
 */
$formworks = \calderawp\frmwks\options::get_single($formwork_id);
$modules = apply_filters('formworks_stat_modules', array());
// simplyfy creation
$formworks['id'] = '__' . $formwork_id;
$formworks['_current_tab'] = '#formworks-panel-stats';
$formworks['forms'] = apply_filters('formworks_get_forms', array());
$form_parts = explode('_', $formwork_id, 2);
$formworks['form_id'] = $form_parts[1];
$formworks['form_slug'] = $form_parts[0];
$formworks['filters']['date']['start'] = date('Y-m-d', strtotime("-7 days"));
$formworks['filters']['date']['end'] = date('Y-m-d', strtotime("tomorrow"));
$formworks['filters']['date']['preset'] = 'this_week';
if (empty($formworks['forms'][$form_parts[0]]['forms'][$form_parts[1]])) {
    wp_die(__('Invalid form or form removed', 'formworks'));
}
$formworks['name'] = $formworks['forms'][$form_parts[0]]['forms'][$form_parts[1]];
if (empty($formworks['page'])) {
    $formworks['page'] = 1;
}
$formworks['data'] = null;
Ejemplo n.º 5
0
?>

<div class="formworks-backdrop formworks-insert-modal" style="display: none;"></div>
<div id="formworks_shortcode_modal" class="formworks-modal-wrap formworks-insert-modal" style="display: none; width: 600px; max-height: 500px; margin-left: -300px;">
	<div class="formworks-modal-title" id="formworks_shortcode_modalTitle" style="display: block;">
		<a href="#close" class="formworks-modal-closer" data-dismiss="modal" aria-hidden="true" id="formworks_shortcode_modalCloser">×</a>
		<h3 class="modal-label" id="formworks_shortcode_modalLable"><?php 
esc_html_e('Insert Form View', 'formworks');
?>
</h3>
	</div>
	<div class="formworks-modal-body none" id="formworks_shortcode_modalBody">
		<div class="modal-body">

		<?php 
$formworks = \calderawp\frmwks\options::get_registry();
if (!empty($formworks)) {
    foreach ($formworks as $formworks_id => $formwork) {
        if (false === strpos($formwork['type'], 'front_')) {
            continue;
        }
        echo '<div class="modal-list-item-frmwks"><label><input name="insert_formworks_id" autocomplete="off" class="selected-formworks-shortcode" value="' . $formwork['slug'] . '" type="radio">' . $formwork['name'];
        echo ' </label></div>';
        $has = true;
    }
}
if (empty($has)) {
    echo '<p>' . esc_html__('You don\'t have any Formworks Frontend Views to insert.', 'formworks') . '</p>';
}
?>