| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Formidable Forms |
| 4 |
Description: Quickly and easily create drag-and-drop forms |
| 5 |
Version: 2.05.09 |
| 6 |
Plugin URI: https://formidableforms.com/ |
| 7 |
Author URI: https://formidableforms.com/ |
| 8 |
Author: Strategy11 |
| 9 |
Text Domain: formidable |
| 10 |
*/ |
| 11 |
|
| 12 |
/* Copyright 2010 Formidable Forms |
| 13 |
|
| 14 |
This program is free software; you can redistribute it and/or modify |
| 15 |
it under the terms of the GNU General Public License, version 2, as |
| 16 |
published by the Free Software Foundation. |
| 17 |
|
| 18 |
This program is distributed in the hope that it will be useful, |
| 19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
GNU General Public License for more details. |
| 22 |
*/ |
| 23 |
|
| 24 |
global $frm_vars; |
| 25 |
$frm_vars = array( |
| 26 |
'load_css' => false, |
| 27 |
'forms_loaded' => array(), |
| 28 |
'created_entries' => array(), |
| 29 |
'pro_is_authorized' => false, |
| 30 |
); |
| 31 |
|
| 32 |
function frm_forms_autoloader( $class_name ) { |
| 33 |
// Only load Frm classes here |
| 34 |
if ( ! preg_match( '/^Frm.+$/', $class_name ) ) { |
| 35 |
return; |
| 36 |
} |
| 37 |
|
| 38 |
$filepath = dirname(__FILE__); |
| 39 |
if ( preg_match( '/^FrmPro.+$/', $class_name ) ) { |
| 40 |
$filepath .= '/pro'; |
| 41 |
} |
| 42 |
$filepath .= '/classes'; |
| 43 |
|
| 44 |
if ( preg_match( '/^.+Helper$/', $class_name ) ) { |
| 45 |
$filepath .= '/helpers/'; |
| 46 |
} else if ( preg_match( '/^.+Controller$/', $class_name ) ) { |
| 47 |
$filepath .= '/controllers/'; |
| 48 |
} else if ( preg_match( '/^.+Factory$/', $class_name ) ) { |
| 49 |
$filepath .= '/factories/'; |
| 50 |
} else { |
| 51 |
$filepath .= '/models/'; |
| 52 |
} |
| 53 |
|
| 54 |
$filepath .= $class_name . '.php'; |
| 55 |
|
| 56 |
if ( file_exists($filepath) ) { |
| 57 |
include($filepath); |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
// if __autoload is active, put it on the spl_autoload stack |
| 62 |
if ( is_array(spl_autoload_functions()) && in_array( '__autoload', spl_autoload_functions()) ) { |
| 63 |
spl_autoload_register('__autoload'); |
| 64 |
} |
| 65 |
|
| 66 |
// Add the autoloader |
| 67 |
spl_autoload_register('frm_forms_autoloader'); |
| 68 |
|
| 69 |
$frm_path = dirname(__FILE__); |
| 70 |
if ( file_exists($frm_path . '/pro/formidable-pro.php') ) { |
| 71 |
include( $frm_path . '/pro/formidable-pro.php' ); |
| 72 |
} |
| 73 |
|
| 74 |
FrmHooksController::trigger_load_hook(); |
| 75 |
|
| 76 |
include_once( $frm_path . '/deprecated.php' ); |
| 77 |
unset($frm_path); |
| 78 |
|