<?php
/*
Plugin Name: Forms.io
Plugin URI: forms.io/
Author: 500apps
Author URI: 500apps.com/
Version: 0.5
Description:  Enhance customer experience like never before by embedding all your Forms.io forms with WordPress website.
 */

define('FORMIO_ROOT', __FILE__);
define('FORMIO_DIR', plugin_dir_path(__FILE__));

require __DIR__ . '/formio_functions.php'; 
spl_autoload_register('formsio_class_loader');

/**
 * Parse configuration
 */
$settingsforms = parse_ini_file(__DIR__ . '/settingsforms.ini', true);
add_action('plugins_loaded', array(\formsio\AdminForms::$class, 'init'));

add_action('admin_menu', 'formsio_add_metabox_shortcode');
add_action('admin_menu', 'formsio_add_metabox_shortcode_page');
add_action('wp_ajax_formsio_addtoken', 'formsio_addtoken');

/**
 * Admin Script
 */
function wpFormIOScripts(){
    wp_register_script('form_app_script', plugins_url('/js/formsio_admin.js', FORMIO_ROOT), array('jquery'),time(),true);
    wp_enqueue_script('form_app_script');
}    

add_action('admin_enqueue_scripts', 'wpFormIOScripts');
