/**
  * Constructor
  *
  * @access	public
  * @param	bool		Enable calling of methods based on URI string
  * @return	string
  */
 public function __construct($switch = TRUE)
 {
     parent::__construct('freeform');
     // Install or Uninstall Request
     if ((bool) $switch === FALSE) {
         return;
     }
     if (!function_exists('lang')) {
         ee()->load->helper('language');
     }
     // --------------------------------------------
     //  Module Menu Items
     // --------------------------------------------
     $menu = array('module_forms' => array('link' => $this->base, 'title' => lang('forms')), 'module_fields' => array('link' => $this->base . AMP . 'method=fields', 'title' => lang('fields')), 'module_fieldtypes' => array('link' => $this->base . AMP . 'method=fieldtypes', 'title' => lang('fieldtypes')), 'module_notifications' => array('link' => $this->base . AMP . 'method=notifications', 'title' => lang('notifications')), 'module_utilities' => array('link' => $this->base . AMP . 'method=utilities', 'title' => lang('utilities')), 'module_preferences' => array('link' => $this->base . AMP . 'method=preferences', 'title' => lang('preferences')), 'module_documentation' => array('link' => FREEFORM_DOCS_URL, 'title' => lang('help'), 'new_window' => TRUE));
     $this->cached_vars['lang_module_version'] = lang('freeform_module_version');
     $this->cached_vars['module_version'] = FREEFORM_VERSION;
     $this->cached_vars['module_menu_highlight'] = 'module_forms';
     $this->cached_vars['inner_nav_links'] = array();
     // -------------------------------------
     //	css includes. WOOT!
     // -------------------------------------
     $this->cached_vars['cp_stylesheet'] = array('chosen', 'standard_cp');
     $this->cached_vars['cp_javascript'] = array('standard_cp.min', 'chosen.jquery.min');
     // -------------------------------------
     //	custom CP?
     // -------------------------------------
     $debug_normal = ee()->input->get_post('debug_normal') !== FALSE;
     $is_crappy_ie_version = FALSE;
     $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
     if (stristr($ua, 'msie 6') or stristr($ua, 'msie 7') or stristr($ua, 'msie 8')) {
         $is_crappy_ie_version = TRUE;
     }
     if (!$debug_normal and !$is_crappy_ie_version and !$this->check_no($this->preference('use_solspace_mcp_style'))) {
         $this->cached_vars['cp_stylesheet'][] = 'custom_cp';
     }
     // -------------------------------------
     //  Module Installed and What Version?
     // -------------------------------------
     if ($this->database_version() == FALSE) {
         return;
     } else {
         if ($this->version_compare($this->database_version(), '<', FREEFORM_VERSION) or !$this->extensions_enabled()) {
             // For EE 2.x, we need to redirect the request to
             // Update Routine
             $_GET['method'] = 'freeform_module_update';
         }
     }
     //avoids AR collisions
     $this->data->get_module_preferences();
     $this->data->get_global_module_preferences();
     $this->data->show_all_sites();
     // -------------------------------------
     //	run upgrade or downgrade scripts
     // -------------------------------------
     if (FREEFORM_PRO and $this->data->global_preference('ffp') === 'n' or !FREEFORM_PRO and $this->data->global_preference('ffp') === 'y') {
         $_GET['method'] = 'freeform_module_update';
         $this->pro_update = TRUE;
     }
     $this->cached_vars['module_menu'] = $menu;
 }
Esempio n. 2
0
 /**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function __construct()
 {
     parent::__construct();
     // --------------------------------------------
     //  Module Actions
     // --------------------------------------------
     $this->module_actions = array('save_form');
     // --------------------------------------------
     //  Extension Hooks
     // --------------------------------------------
     $default = array('class' => $this->extension_name, 'settings' => '', 'priority' => 10, 'version' => FREEFORM_VERSION, 'enabled' => 'y');
     $this->hooks = array();
 }
 /**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function __construct()
 {
     parent::__construct('freeform');
     // -------------------------------------
     //  Module Installed and Up to Date?
     // -------------------------------------
     if ($this->database_version() == FALSE or $this->version_compare($this->database_version(), '<', FREEFORM_VERSION) or !$this->extensions_enabled()) {
         $this->disabled = TRUE;
         trigger_error(lang('freeform_module_disabled'), E_USER_NOTICE);
     }
     ee()->load->helper(array('text', 'form', 'url', 'string'));
     //avoids AR collisions
     $this->data->get_module_preferences();
     $this->data->get_global_module_preferences();
     $this->data->show_all_sites();
 }
Esempio n. 4
0
 /**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function __construct()
 {
     parent::__construct();
     // -------------------------------------
     //  Module Installed and Up to Date?
     // -------------------------------------
     ee()->load->helper(array('text', 'form', 'url', 'string'));
     //avoids AR collisions
     $this->data->get_module_preferences();
     $this->data->get_global_module_preferences();
     $this->data->show_all_sites();
 }
Esempio n. 5
0
 /**
  * __construct
  *
  * @access	public
  */
 public function __construct()
 {
     parent::__construct();
     $this->name = lang('freeform_module_name');
     $this->description = lang('freeform_accessory_description');
 }
Esempio n. 6
0
 /**
  * Send AJAX response
  *
  * Outputs and exit either an HTML string or a
  * JSON array with the Profile disabled and correct
  * headers sent.
  *
  * @access	public
  * @param	string|array	String is sent as HTML, Array is sent as JSON
  * @param	bool			Is this an error message?
  * @param 	bool 			bust cache for JSON?
  * @return	void
  */
 public function send_ajax_response($msg, $error = FALSE, $cache_bust = TRUE)
 {
     $this->restore_xid();
     parent::send_ajax_response($msg, $error, $cache_bust);
 }