예제 #1
0
 function __construct()
 {
     parent::__construct();
     if (defined('NTS_DEVELOPMENT')) {
         if (!($this->input->is_ajax_request() or $this->is_module())) {
             $this->output->enable_profiler(TRUE);
         }
     }
     $this->load->database();
     $ri = HC_Lib::ri();
     if (!$this->is_setup()) {
         $setup_redirect = 'setup';
         if ($ri) {
             $setup_redirect = $ri . '/setup';
         }
         $this->redirect($setup_redirect);
         exit;
     }
     $this->load->library(array('session', 'hc_modules'));
     /* add module models paths for autoloading */
     $extensions = HC_App::extensions();
     $acl = HC_App::acl();
     $look_in_dirs = $this->config->look_in_dirs();
     foreach ($look_in_dirs as $ldir) {
         if (class_exists('Datamapper')) {
             Datamapper::add_model_path($ldir);
         }
         $this->load->add_package_path($ldir);
         $extensions->add_dir($ldir);
         $acl->add_dir($ldir);
     }
     $extensions->init();
     $acl->init();
     /* reload config paths */
     $app_conf = HC_App::app_conf();
     $this->load->library('hc_modules');
     /* events and notifiers */
     $this->load->library(array('hc_events', 'hc_email'));
     $this->hc_email->from = $app_conf->get('email_from');
     $this->hc_email->fromName = $app_conf->get('email_from_name');
     // conf
     $this->load->library('hc_auth', NULL, 'auth');
     $user = $this->auth->user();
     $acl->set_user($user);
     $CI =& ci_get_instance();
     $current_url = $CI->config->site_url($CI->uri->uri_string());
     $this->session->set_flashdata('referrer', $current_url);
     $this->layout = new HC_View_Layout();
 }
예제 #2
0
 function __construct()
 {
     parent::__construct();
     if (defined('NTS_DEVELOPMENT')) {
         //			$this->output->enable_profiler(TRUE);
     }
     if (!isset($this->conf)) {
         $this->conf = array();
     }
     if (!isset($this->conf['path'])) {
         $this->conf['path'] = '';
     }
     $this->load->database();
     $this->load->helper(array('url', 'language', 'form', 'hitcode', 'language', 'form'));
     $this->load->library(array('form_validation', 'session', 'hc_bootstrap'));
     $this->load->library('hc_form');
     $this->load->library('hc_modules');
     $this->form_validation->set_error_delimiters('<div class="hc-form-error">', '</div>');
     // conf
     $this->auth = NULL;
     $this->data = array();
     $this->data['message'] = $this->session->flashdata('message');
     $this->data['error'] = $this->session->flashdata('error');
     $this->session->set_flashdata('referrer', current_url());
     $this->set_include('');
     $this->data['page_title'] = $this->config->item('nts_app_title') . ' :: ' . 'Installation';
     /* add module models paths for autoloading */
     $modules = $this->config->get_modules();
     if (is_array($modules)) {
         reset($modules);
         foreach ($modules as $module) {
             $mod_dir = $this->hc_modules->module_dir($module);
             if ($mod_dir) {
                 Datamapper::add_model_path($mod_dir);
             }
         }
     }
 }
예제 #3
0
 function __construct()
 {
     parent::__construct();
     $this->builtin_views = '_boilerplate';
     $this->load->helper(array('language', 'form'));
     if (defined('NTS_DEVELOPMENT')) {
         if (!($this->input->is_ajax_request() or $this->is_module())) {
             $this->output->enable_profiler(TRUE);
         }
     }
     if (!isset($this->conf)) {
         $this->conf = array();
     }
     if (!isset($this->conf['path'])) {
         $this->conf['path'] = '';
     }
     $this->load->database();
     $this->load->helper(array('url'));
     $skip_setup = array('setup', 'demo');
     if (!in_array($this->router->fetch_class(), $skip_setup) and !$this->is_setup()) {
         $setup_redirect = 'setup';
         $remote_integration = $this->remote_integration();
         if ($remote_integration) {
             $setup_redirect = $remote_integration . '/setup';
         }
         ci_redirect($setup_redirect);
         exit;
     }
     $this->load->helper(array('hitcode'));
     $this->load->library(array('form_validation', 'session', 'hc_bootstrap'));
     $this->load->library('hc_modules');
     $this->load->library('conf/app_conf');
     $this->load->library('user_agent');
     /* add module models paths for autoloading */
     $modules = $this->config->get_modules();
     $modules_locations = $this->config->item('modules_locations');
     if (is_array($modules)) {
         reset($modules);
         foreach ($modules as $module) {
             reset($modules_locations);
             foreach ($modules_locations as $ml) {
                 $mod_dir = $ml . $module;
                 if (file_exists($mod_dir)) {
                     Datamapper::add_model_path($mod_dir);
                     $this->load->add_package_path($mod_dir);
                 }
             }
         }
     }
     /* reload config paths */
     $this->app_conf->init();
     $this->load->library('hc_modules');
     /* events and notifiers */
     $this->load->library(array('hc_events', 'hc_notifier', 'hc_email'));
     $this->hc_email->from = $this->app_conf->get('email_from');
     $this->hc_email->fromName = $this->app_conf->get('email_from_name');
     $this->form_validation->set_error_delimiters('<div class="hc-form-error">', '</div>');
     // table
     $this->load->library('table');
     $table_tmpl = array('table_open' => '<table class="table table-striped">');
     $this->table->set_template($table_tmpl);
     // pagination
     $this->load->library('pagination');
     // conf
     $this->load->library('hc_auth', NULL, 'auth');
     $this->load->library('hc_access_manager', array('auth' => $this->auth), 'access_manager');
     $this->data = array();
     $this->data['page_title'] = $this->config->item('nts_app_title');
     $this->data['message'] = $this->session->flashdata('message');
     $this->data['debug_message'] = $this->session->flashdata('debug_message');
     $this->data['error'] = $this->session->flashdata('error');
     /* menu */
     $this->config->load('menu', TRUE, TRUE);
     //		$this->config->load('config', TRUE, TRUE );
     $this->session->set_flashdata('referrer', current_url());
     $this->set_include('');
     $this->set_layout();
 }