From 8ae5723d1442206612c90238a7b3816a37672b67 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 6 Jun 2024 10:47:30 +0200 Subject: [PATCH] get rid of unnessesary lang loads --- application/controllers/Awards.php | 4 ---- application/controllers/Contesting.php | 1 - application/controllers/Dashboard.php | 3 --- application/controllers/Eqsl.php | 1 - application/controllers/Logbook.php | 14 -------------- application/controllers/Lotw.php | 3 --- application/controllers/Notes.php | 3 --- application/controllers/Options.php | 5 ----- application/controllers/Oqrs.php | 11 +---------- application/controllers/Qsl.php | 5 ++--- application/controllers/Qso.php | 2 -- application/controllers/Search.php | 6 ------ application/controllers/Statistics.php | 5 ----- application/controllers/Themes.php | 1 - application/controllers/User.php | 12 ------------ 15 files changed, 3 insertions(+), 73 deletions(-) mode change 100755 => 100644 application/controllers/Qso.php diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 8a73292cb..47fe74f17 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -14,10 +14,6 @@ class Awards extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - $this->lang->load(array( - 'lotw', - 'eqsl' - )); } public function index() diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index b4ccf3628..011836341 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -9,7 +9,6 @@ class Contesting extends CI_Controller { function __construct() { parent::__construct(); - $this->lang->load('contesting'); $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 077e03f75..85a6a1c8e 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -5,9 +5,6 @@ class Dashboard extends CI_Controller public function index() { - // Load language files - $this->lang->load('lotw'); - // Database connections $this->load->model('logbook_model'); $this->load->model('user_model'); diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 79c3a70e9..160770e17 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -18,7 +18,6 @@ class eqsl extends CI_Controller { // Default view when loading controller. public function index() { - $this->lang->load('qslcard'); $this->load->model('eqsl_images'); $this->load->library('Genfunctions'); $folder_name = $this->eqsl_images->get_imagePath('p'); diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index a984ddcb0..149d207af 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -3,20 +3,6 @@ class Logbook extends CI_Controller { - function __construct() - { - parent::__construct(); - - // Load language files - $this->lang->load(array( - 'contesting', - 'qslcard', - 'lotw', - 'eqsl', - 'qso' - )); - } - function index() { diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 2ae672a06..d8e4c2a3d 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -24,9 +24,6 @@ class Lotw extends CI_Controller { parent::__construct(); $this->load->helper(array('form', 'url')); - // Load language files - $this->lang->load('lotw'); - if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') { echo "Maintenance Mode is active. Try again later.\n"; redirect('user/login'); diff --git a/application/controllers/Notes.php b/application/controllers/Notes.php index 3101da887..a8de4a478 100644 --- a/application/controllers/Notes.php +++ b/application/controllers/Notes.php @@ -8,9 +8,6 @@ class Notes extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - - // Load language files - $this->lang->load('notes'); } diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 6d34f3c23..988449446 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -14,11 +14,6 @@ class Options extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(99)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - // Load language files - $this->lang->load(array( - 'options', - )); - } diff --git a/application/controllers/Oqrs.php b/application/controllers/Oqrs.php index d1539cd03..e59da7ff9 100644 --- a/application/controllers/Oqrs.php +++ b/application/controllers/Oqrs.php @@ -7,16 +7,7 @@ if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Oqrs extends CI_Controller { - function __construct() { - parent::__construct(); - $this->lang->load('lotw'); - $this->lang->load('eqsl'); - // Commented out to get public access - // $this->load->model('user_model'); - // if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - } - - public function index() { + public function index() { $this->load->model('oqrs_model'); $data['stations'] = $this->oqrs_model->get_oqrs_stations(); diff --git a/application/controllers/Qsl.php b/application/controllers/Qsl.php index e6ee4b678..cf7899a93 100644 --- a/application/controllers/Qsl.php +++ b/application/controllers/Qsl.php @@ -8,9 +8,8 @@ class Qsl extends CI_Controller { function __construct() { parent::__construct(); - $this->lang->load('qslcard'); - $this->load->model('user_model'); - if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } // Default view when loading controller. diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php old mode 100755 new mode 100644 index dfcf07454..6b331ce2a --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -5,8 +5,6 @@ class QSO extends CI_Controller { function __construct() { parent::__construct(); - $this->lang->load('qso'); - $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } diff --git a/application/controllers/Search.php b/application/controllers/Search.php index 57c8cdeb7..571da9343 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -12,12 +12,6 @@ class Search extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } } - - // Load language files - $this->lang->load(array( - 'lotw', - 'eqsl', - )); } public function index() diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index 593bda6ca..a2487f8a1 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -5,11 +5,6 @@ class Statistics extends CI_Controller { function __construct() { parent::__construct(); - - // Load language files - $this->lang->load(array( - 'statistics', - )); } diff --git a/application/controllers/Themes.php b/application/controllers/Themes.php index b0582ff25..b7bddddb7 100644 --- a/application/controllers/Themes.php +++ b/application/controllers/Themes.php @@ -12,7 +12,6 @@ class Themes extends CI_Controller { function __construct() { parent::__construct(); - $this->lang->load('contesting'); $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } diff --git a/application/controllers/User.php b/application/controllers/User.php index e4016539f..a763b1a3d 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -2,18 +2,6 @@ class User extends CI_Controller { - function __construct() - { - parent::__construct(); - - $this->lang->load(array( - 'account', - 'lotw', - 'eqsl', - 'admin', - )); - } - public function index() { $this->load->model('user_model');