/** * Constructor * * @access public * @return null */ function __construct() { parent::Addon_builder_rating('rating'); // -------------------------------------------- // Default Preferences // -------------------------------------------- $this->default_preferences = array('can_delete_ratings' => array(), 'can_report_ratings' => array(), 'can_post_ratings' => array(), 'enabled_channels' => array('all'), 'quarantine_minimum' => 3, 'require_email' => 'n', 'use_captcha' => 'n'); // ------------------------------------- // Module Installed and What Version? // ------------------------------------- if ($this->database_version() == FALSE or $this->version_compare($this->database_version(), '<', RATING_VERSION) or !$this->extensions_enabled()) { return; } }
/** * Constructor * * @access public * @param bool Enable calling of methods based on URI string * @return string */ public function __construct($switch = TRUE) { parent::Module_builder_rating('rating'); if ((bool) $switch === FALSE) { return; } // Install or Uninstall Request // -------------------------------------------- // Module Menu Items // -------------------------------------------- $menu = array('module_home' => array('link' => $this->base, 'title' => lang('rated_entries')), 'module_ratings' => array('link' => $this->base . AMP . 'method=view_ratings', 'title' => lang('ratings')), 'module_fields' => array('link' => $this->base . AMP . 'method=fields', 'title' => lang('fields')), 'module_templates' => array('link' => $this->base . AMP . 'method=templates', 'title' => lang('notification_templates')), 'module_preferences' => array('link' => $this->base . AMP . 'method=preferences', 'title' => lang('rating_preferences')), 'module_utilities' => array('link' => $this->base . AMP . 'method=utilities', 'title' => lang('utilities')), 'module_documentation' => array('link' => RATING_DOCS_URL, 'new_window' => TRUE, 'title' => lang('online_documentation') . (APP_VER < 2.0 ? ' (' . RATING_VERSION . ')' : ''))); $this->cached_vars['lang_module_version'] = lang('rating_module_version'); $this->cached_vars['module_menu'] = $menu; //needed for header.html file views $this->cached_vars['js_magic_checkboxes'] = $this->js_magic_checkboxes(); // ------------------------------------- // Module Installed and What Version? // ------------------------------------- if ($this->database_version() == FALSE) { return; } elseif ($this->version_compare($this->database_version(), '<', RATING_VERSION) or !$this->extensions_enabled()) { if (APP_VER < 2.0) { if ($this->rating_module_update() === FALSE) { return; } } else { // For EE 2.x, we need to redirect the request to Update Routine $_GET['method'] = 'rating_module_update'; } } // ------------------------------------- // Request and View Builder // ------------------------------------- if (APP_VER < 2.0 && $switch !== FALSE) { if (ee()->input->get('method') === FALSE) { $this->index(); } elseif (!method_exists($this, ee()->input->get('method'))) { $this->add_crumb(lang('invalid_request')); $this->cached_vars['error_message'] = lang('invalid_request'); return $this->ee_cp_view('error_page.html'); } else { $this->{ee()->input->get('method')}(); } } }
/** * Constructor * * @access public * @return null */ public function __construct() { parent::Module_builder_rating('rating'); //load helpers for everything ee()->load->helper(array('text', 'form', 'url', 'security', 'string')); // ------------------------------------- // Module Installed and Up to Date? // ------------------------------------- if ($this->database_version() == FALSE or $this->version_compare($this->database_version(), '<', RATING_VERSION) or !$this->extensions_enabled()) { $this->disabled = TRUE; trigger_error(ee()->lang->line('rating_module_disabled'), E_USER_NOTICE); } // -------------------------------------------- // Legacy form_name="" parameter maps to collection="" // -------------------------------------------- if (isset(ee()->TMPL) && is_object(ee()->TMPL) && isset(ee()->TMPL->tagparams['form_name'])) { ee()->TMPL->tagparams['collection'] = ee()->TMPL->tagparams['form_name']; } }