/**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 function Extension_builder_rating($name = '')
 {
     parent::Addon_builder_rating($name);
     /** --------------------------------------------
         /**  Set Required Extension Variables
         /** --------------------------------------------*/
     $this->fetch_language_file($this->lower_name);
     $this->name = $this->line($this->lower_name . '_label');
     $this->description = $this->line($this->lower_name . '_description');
     if (defined(strtoupper($this->lower_name) . '_VERSION') and defined(strtoupper($this->lower_name) . '_DOCS_URL')) {
         $this->version = constant(strtoupper($this->lower_name) . '_VERSION');
         $this->docs_url = constant(strtoupper($this->lower_name) . '_DOCS_URL');
     }
     /** --------------------------------------------
         /**  Extension Table Defaults
         /** --------------------------------------------*/
     $this->extension_defaults = array('class' => $this->extension_name, 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => 'y');
     /** --------------------------------------------
     		/**  Default CP Variables
     		/** --------------------------------------------*/
     if (REQ == 'CP') {
         //BASE is not set until AFTER sessions_end, and we don't want to clobber it.
         $base_const = defined('BASE') ? BASE : SELF . '?S=0';
         //2.x adds an extra param for base
         if (!(APP_VER < 2.0)) {
             $base_const .= '&amp;D=cp';
         }
         // For 2.0, we have '&amp;D=cp' with BASE and we want pure characters, so we convert it
         $this->base = APP_VER < 2.0 ? $base_const . '&C=admin&M=utilities&P=extension_settings&name=' . $this->lower_name : str_replace('&amp;', '&', $base_const) . '&C=addons_extensions&M=extension_settings&file=' . $this->lower_name;
         $this->cached_vars['page_crumb'] = '';
         $this->cached_vars['page_title'] = '';
         $this->cached_vars['base_uri'] = $this->base;
         $this->cached_vars['onload_events'] = '';
         $this->cached_vars['extension_menu'] = array();
         $this->cached_vars['extension_menu_highlight'] = '';
         /** --------------------------------------------
         			/**  Default Crumbs for Module
         			/** --------------------------------------------*/
         if (APP_VER < 2.0) {
             $this->add_crumb($this->EE->config->item('site_name'), $base_const);
             $this->add_crumb(ee()->lang->line('admin'), $base_const . AMP . 'C=admin');
             $this->add_crumb(ee()->lang->line('utilities'), $base_const . AMP . 'C=admin' . AMP . 'area=utilities');
             $this->add_crumb(ee()->lang->line('extensions_manager'), $base_const . AMP . 'C=admin' . AMP . 'M=utilities' . AMP . 'P=extensions_manager');
         }
         $this->add_crumb($this->EE->lang->line($this->lower_name . '_label'), $this->cached_vars['base_uri']);
     }
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @access	public
  * @return	null
  */
 public function Module_builder_rating($name = '')
 {
     parent::Addon_builder_rating($name);
     // --------------------------------------------
     //  Default CP Variables
     // --------------------------------------------
     if (REQ == 'CP') {
         //BASE is not set until AFTER sessions_end, and we don't want to clobber it.
         $base_const = defined('BASE') ? BASE : SELF . '?S=0';
         //2.x adds an extra param for base
         if (!(APP_VER < 2.0) && substr($base_const, -4) != 'D=cp') {
             $base_const .= '&amp;D=cp';
         }
         // For 2.0, we have '&amp;D=cp' with BASE and
         //	we want pure characters, so we convert it
         $this->base = APP_VER < 2.0 ? $base_const . '&C=modules&M=' . $this->lower_name : str_replace('&amp;', '&', $base_const) . '&C=addons_modules&M=show_module_cp&module=' . $this->lower_name;
         $this->cached_vars['page_crumb'] = '';
         $this->cached_vars['page_title'] = '';
         $this->cached_vars['base_uri'] = $this->base;
         $this->cached_vars['onload_events'] = '';
         $this->cached_vars['module_menu'] = array();
         $this->cached_vars['module_menu_highlight'] = 'module_home';
         $this->cached_vars['module_version'] = $this->version;
         // --------------------------------------------
         //  Default Crumbs for Module
         // --------------------------------------------
         if (APP_VER < 2.0) {
             $this->add_crumb(ee()->config->item('site_name'), $base_const);
             $this->add_crumb(ee()->lang->line('modules'), $base_const . AMP . 'C=modules');
         }
         $this->add_crumb(ee()->lang->line($this->lower_name . '_module_name'), $this->base);
     }
     // --------------------------------------------
     //  Module Installed and Up to Date?
     // --------------------------------------------
     if (REQ == 'PAGE' and constant(strtoupper($this->lower_name) . '_VERSION') !== NULL and ($this->database_version() == FALSE or $this->version_compare($this->database_version(), '<', constant(strtoupper($this->lower_name) . '_VERSION')))) {
         $this->disabled = TRUE;
         if (empty($this->cache['disabled_message']) and !empty(ee()->lang->language[$this->lower_name . '_module_disabled'])) {
             trigger_error(ee()->lang->line($this->lower_name . '_module_disabled'), E_USER_NOTICE);
             $this->cache['disabled_message'] = TRUE;
         }
     }
 }