diff --git a/application/controllers/Options.php b/application/controllers/Options.php index 21a74b60..c83bcf27 100644 --- a/application/controllers/Options.php +++ b/application/controllers/Options.php @@ -136,6 +136,43 @@ class Options extends CI_Controller { } } + // function used to display the /dxcluster url + function dxcluster() { + $data['page_title'] = $this->lang->line('options_cloudlog_options'); + $data['sub_heading'] = $this->lang->line('options_dxcluster_settings'); + + $this->load->view('interface_assets/header', $data); + $this->load->view('options/dxcluster'); + $this->load->view('interface_assets/footer'); + } + + // Handles saving the DXCluster options to the options system. + function dxcluster_save() { + + // Get Language Options + + $data['page_title'] = $this->lang->line('options_cloudlog_options'); + $data['sub_heading'] = $this->lang->line('options_dxcluster_settings'); + + $this->load->helper(array('form', 'url')); + + $this->load->library('form_validation'); + + $this->form_validation->set_rules('dxcache_url', 'URL of DXCache', 'valid_url'); + + if ($this->form_validation->run() == FALSE) { + $this->load->view('interface_assets/header', $data); + $this->load->view('options/dxcluster'); + $this->load->view('interface_assets/footer'); + } else { + $dxcache_url_update = $this->optionslib->update('dxcache_url', $this->input->post('dxcache_url'), 'yes'); + if($dxcache_url_update == TRUE) { + $this->session->set_flashdata('success', $this->lang->line('options_dxcache_url_changed_to').$this->input->post('dxcache_url')); + } + redirect('/options/dxcluster'); + } + } + // function used to display the /radio url function radio() { diff --git a/application/language/english/options_lang.php b/application/language/english/options_lang.php index af31fe80..70814e49 100644 --- a/application/language/english/options_lang.php +++ b/application/language/english/options_lang.php @@ -58,4 +58,11 @@ $lang['options_grouped_search'] = 'Grouped search'; $lang['options_when_this_is_on_all_station_locations_with_oqrs_active_will_be_searched_at_once'] = 'When this is on, all station locations with OQRS active, will be searched at once.'; $lang['options_oqrs_options_have_been_saved'] = 'OQRS options have been saved.'; -$lang['options_save'] = 'Save'; \ No newline at end of file +$lang['options_dxcluster'] = 'DXCluster'; +$lang['options_dxcluster_provider'] = 'Provider of DXClusterCache'; +$lang['options_dxcluster_longtext'] = 'The Provider of the DXCluster-Cache. You can set up your own Cache with DXClusterAPI or use a public one'; +$lang['options_dxcluster_hint'] = 'URL of the DXCluster-Cache. e.g. https://dxc.jo30.de/dxcache'; +$lang['options_dxcluster_settings'] = 'DXCluster'; +$lang['options_dxcache_url_changed_to'] = 'DXCluster Cache URL changed to '; + +$lang['options_save'] = 'Save'; diff --git a/application/language/german/options_lang.php b/application/language/german/options_lang.php index 50032646..eee2cdfd 100644 --- a/application/language/german/options_lang.php +++ b/application/language/german/options_lang.php @@ -58,4 +58,12 @@ $lang['options_grouped_search'] = 'Gruppierte Suche'; $lang['options_when_this_is_on_all_station_locations_with_oqrs_active_will_be_searched_at_once'] = 'Wenn aktiviert, werden alle Stationsstandorte auf einmal durchsucht.'; $lang['options_oqrs_options_have_been_saved'] = 'OQRS options have been saved.'; +$lang['options_dxcluster'] = 'DXCluster'; +$lang['options_dxcluster_provider'] = 'Provider des DXClusterCache'; +$lang['options_dxcluster_longtext'] = 'Der Provider des DXCluster-Caches. Du kannst Deinen eigenen Cache mit DXClusterAPI aufsetzen, oder einen öffentlichen nutzen'; +$lang['options_dxcluster_hint'] = 'URL des DXCluster-Caches. z.B. https://dxc.jo30.de/dxcache'; +$lang['options_dxcluster_settings'] = 'DXCluster'; +$lang['options_dxcache_url_changed_to'] = 'DXCluster Cache URL geänder zu '; + + $lang['options_save'] = 'Speichern'; diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 574f57fb..db2d2fb2 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -933,9 +933,26 @@ $(document).on('keypress',function(e) { uri->segment(1) == "qso") { ?> - optionslib->get_option('dxcache_url') != ''){ ?> + +load->model('stations'); $active_station_id = $this->stations->find_active(); $station_profile = $this->stations->profile($active_station_id); diff --git a/application/views/options/dxcluster.php b/application/views/options/dxcluster.php new file mode 100644 index 00000000..645eb923 --- /dev/null +++ b/application/views/options/dxcluster.php @@ -0,0 +1,52 @@ +