/** * Returns a logger instance */ public static function getLogger() { if (!logger_manager::$_instance) { logger_manager::$_instance = new logger_manager(); } return logger_manager::$_instance; }
//session_start(); ini_set('display_errors', 0); error_reporting(0); define('SUGARCRM_ABS_PATH', dirname(__FILE__) . '/'); define('ROOT_DIRECTORY', 'sugarcrm-plugin/'); define('SUGARCRM_SHORT_CODE', 'CRM_FORM'); require_once ABSPATH . '/wp-includes/pluggable.php'; $GLOBALS['sugarEntry'] = true; // This was moved to wpr_crm.php // add_action('admin_menu', 'wp_plugin_admin'); register_activation_hook(__FILE__, 'crmtb_install'); register_activation_hook(__FILE__, 'crm_install_data'); register_deactivation_hook(__FILE__, 'crmtb_uninstall'); require_once SUGARCRM_ABS_PATH . 'log/logger_manager.php'; logger_manager::$log_dir = SUGARCRM_ABS_PATH; $GLOBALS['wpr_logger'] = logger_manager::getLogger(); $GLOBALS['wpr_logger']->setLevel('debug'); $GLOBALS['wpr_logger']->debug('SUGARCRM_ABS_PATH: ' . SUGARCRM_ABS_PATH); $wp_sugar_obj = new wp_sugar(); add_action('init', array('wp_sugar', 'get_form_html')); add_action('wp_print_scripts', 'enqueue_my_scripts'); add_action('wp_print_styles', 'enqueue_my_styles'); wp_enqueue_script('my_awesome_script1', '/wp-content/plugins/sugarcrm-plugin/jquery.ui.core.js', array('jquery')); wp_enqueue_script('my_awesome_script2', '/wp-content/plugins/sugarcrm-plugin/jquery.ui.widget.js', array()); wp_enqueue_script('my_awesome_script3', '/wp-content/plugins/sugarcrm-plugin/jquery.ui.datepicker.js', array()); wp_enqueue_script('my_awesome_script4', '/wp-content/plugins/sugarcrm-plugin/jquery.validate.js', array()); wp_enqueue_style('my_awesome_style1', '/wp-content/plugins/sugarcrm-plugin/cal_css/jquery.ui.all.css', array()); add_shortcode(SUGARCRM_SHORT_CODE, array(&$wp_sugar_obj, 'get_form_html')); require_once SUGARCRM_ABS_PATH . 'classes.php'; require_once SUGARCRM_ABS_PATH . 'class.Template.php'; require_once SUGARCRM_ABS_PATH . 'rest_utils.php';