Skip to content

Commit

Permalink
update MY_Controller.php & autoload.php file
Browse files Browse the repository at this point in the history
  • Loading branch information
domProjects committed May 8, 2019
1 parent 904d045 commit dd48686
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 31 deletions.
10 changes: 5 additions & 5 deletions application/config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
| $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/
$autoload['packages'] = array();
$autoload['packages'] = array(APPPATH.'third_party/ion_auth');

/*
| -------------------------------------------------------------------
Expand All @@ -58,7 +58,7 @@
|
| $autoload['libraries'] = array('user_agent' => 'ua');
*/
$autoload['libraries'] = array();
$autoload['libraries'] = array('form_validation', 'ion_auth', 'template', 'common/mobile_detect');

/*
| -------------------------------------------------------------------
Expand All @@ -83,7 +83,7 @@
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array();
$autoload['helper'] = array('array', 'language', 'url');

/*
| -------------------------------------------------------------------
Expand All @@ -97,7 +97,7 @@
| config files. Otherwise, leave it blank.
|
*/
$autoload['config'] = array();
$autoload['config'] = array('common/dp_config', 'common/dp_language');

/*
| -------------------------------------------------------------------
Expand Down Expand Up @@ -126,4 +126,4 @@
|
| $autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
$autoload['model'] = array('common/prefs_model');
45 changes: 19 additions & 26 deletions application/core/MY_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,31 @@ public function __construct()
/* COMMON :: ADMIN & PUBLIC */
/* Load */
$this->load->database();
$this->load->add_package_path(APPPATH . 'third_party/ion_auth/');
$this->load->config('common/dp_config');
$this->load->config('common/dp_language');
$this->load->library(array('form_validation', 'ion_auth', 'template', 'common/mobile_detect'));
$this->load->helper(array('array', 'language', 'url'));
$this->load->model('common/prefs_model');

/* Data */
$this->data['lang'] = element($this->config->item('language'), $this->config->item('language_abbr'));
$this->data['charset'] = $this->config->item('charset');
$this->data['lang'] = element($this->config->item('language'), $this->config->item('language_abbr'));
$this->data['charset'] = $this->config->item('charset');
$this->data['frameworks_dir'] = $this->config->item('frameworks_dir');
$this->data['plugins_dir'] = $this->config->item('plugins_dir');
$this->data['avatar_dir'] = $this->config->item('avatar_dir');
$this->data['plugins_dir'] = $this->config->item('plugins_dir');
$this->data['avatar_dir'] = $this->config->item('avatar_dir');

/* Any mobile device (phones or tablets) */
if ($this->mobile_detect->isMobile())
{
$this->data['mobile'] = TRUE;

if ($this->mobile_detect->isiOS()){
$this->data['ios'] = TRUE;
$this->data['ios'] = TRUE;
$this->data['android'] = FALSE;
}
else if ($this->mobile_detect->isAndroidOS())
elseif ($this->mobile_detect->isAndroidOS())
{
$this->data['ios'] = FALSE;
$this->data['ios'] = FALSE;
$this->data['android'] = TRUE;
}
else
{
$this->data['ios'] = FALSE;
$this->data['ios'] = FALSE;
$this->data['android'] = FALSE;
}

Expand All @@ -54,9 +48,9 @@ public function __construct()
}
else
{
$this->data['mobile'] = FALSE;
$this->data['ios'] = FALSE;
$this->data['android'] = FALSE;
$this->data['mobile'] = FALSE;
$this->data['ios'] = FALSE;
$this->data['android'] = FALSE;
$this->data['mobile_ie'] = FALSE;
}
}
Expand All @@ -77,31 +71,30 @@ public function __construct()
{
/* Load */
$this->load->config('admin/dp_config');
$this->load->library('admin/page_title');
$this->load->library('admin/breadcrumbs');
$this->load->library(['admin/breadcrumbs', 'admin/page_title']);
$this->load->model('admin/core_model');
$this->load->helper('menu');
$this->lang->load(array('admin/main_header', 'admin/main_sidebar', 'admin/footer', 'admin/actions'));
$this->lang->load(['admin/main_header', 'admin/main_sidebar', 'admin/footer', 'admin/actions']);

/* Load library function */
$this->breadcrumbs->unshift(0, $this->lang->line('menu_dashboard'), 'admin/dashboard');

/* Data */
$this->data['title'] = $this->config->item('title');
$this->data['title_lg'] = $this->config->item('title_lg');
$this->data['title_mini'] = $this->config->item('title_mini');
$this->data['title'] = $this->config->item('title');
$this->data['title_lg'] = $this->config->item('title_lg');
$this->data['title_mini'] = $this->config->item('title_mini');
$this->data['admin_prefs'] = $this->prefs_model->admin_prefs();
$this->data['user_login'] = $this->prefs_model->user_info_login($this->ion_auth->user()->row()->id);
$this->data['user_login'] = $this->prefs_model->user_info_login($this->ion_auth->user()->row()->id);

if ($this->router->fetch_class() == 'dashboard')
{
$this->data['dashboard_alert_file_install'] = $this->core_model->get_file_install();
$this->data['header_alert_file_install'] = NULL;
$this->data['header_alert_file_install'] = NULL;
}
else
{
$this->data['dashboard_alert_file_install'] = NULL;
$this->data['header_alert_file_install'] = NULL; /* << A MODIFIER !!! */
$this->data['header_alert_file_install'] = NULL; /* << A MODIFIER !!! */
}
}
}
Expand Down

0 comments on commit dd48686

Please sign in to comment.