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();
 }
Exemple #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);
             }
         }
     }
 }
Exemple #3
0
 function Comment()
 {
     parent::Datamapper();
 }
 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();
 }
Exemple #5
0
 function Categorie()
 {
     parent::Datamapper();
 }
Exemple #6
0
 function Lead()
 {
     parent::Datamapper();
 }
Exemple #7
0
 function __construct()
 {
     parent::__construct();
 }
Exemple #8
0
function hc_presenter_autoload($class)
{
    $class = strtolower($class);
    $suffix = '_hc_presenter';
    if (substr($class, -strlen($suffix)) != $suffix) {
        return;
    }
    //echo "TRYING '$class'<br>";
    $paths = Datamapper::get_model_paths();
    $paths = array_merge(array(APPPATH), $paths);
    foreach ($paths as $path) {
        // Prepare file
        $class_file = substr($class, 0, -strlen($suffix));
        $file = $path . 'presenters/' . $class_file . EXT;
        //			echo $file .' <br>';
        // Check if file exists, require_once if it does
        if (file_exists($file)) {
            require_once $file;
            break;
        }
    }
}
Exemple #9
0
 function __construct()
 {
     // Call the Model constructor
     parent::__construct();
 }
Exemple #10
0
 function Account()
 {
     parent::Datamapper();
 }
Exemple #11
0
 /**
  * Delete a group
  *
  * @access public
  * @param int $id The ID of the group to delete
  * @return
  */
 public function delete($id = 0)
 {
     $this->load->model('users/user_m');
     // don't delete the group if there are still users assigned to it
     if ($this->user_m->count_by(array('group_id' => $id)) > 0) {
         return FALSE;
     }
     // Dont let them delete the "admin" group or the "user" group.
     // The interface does not have a delete button for these, this is just insurance
     $this->db->where_not_in('name', array('user', 'admin'));
     return parent::delete($id);
 }
Exemple #12
0
 function Tag()
 {
     parent::Datamapper();
 }
Exemple #13
0
 function Countrie()
 {
     parent::Datamapper();
 }
Exemple #14
0
 function Share()
 {
     parent::Datamapper();
 }
Exemple #15
0
 function Like()
 {
     parent::Datamapper();
 }
Exemple #16
0
 function Campaign()
 {
     parent::Datamapper();
 }
Exemple #17
0
 function __construct($id = NULL)
 {
     parent::__construct($id);
 }
Exemple #18
0
 function __construct($id = 1)
 {
     parent::__construct($id);
 }