[Exportmap] Defaults if icons are not set in user_options

This commit is contained in:
Andreas Kristiansen
2024-04-14 14:09:52 +02:00
parent d7ef14d767
commit 3d0121df17

View File

@@ -507,12 +507,28 @@ class Visitor extends CI_Controller {
$this->load->model('user_options_model');
$result=$this->user_options_model->get_options('map_custom', null, $userid);
$jsonout=[];
$result = $this->user_options_model->get_options('map_custom', null, $userid);
$jsonout = [];
foreach($result->result() as $options) {
if ($options->option_name=='icon') $jsonout[$options->option_key]=json_decode($options->option_value,true);
else $jsonout[$options->option_name.'_'.$options->option_key]=$options->option_value;
}
if (count($jsonout) == 0) {
$jsonout['qso'] = array(
"icon" => "fas fa-dot-circle",
"color" => "#ff0000"
);
$jsonout['qsoconfirm'] = array(
"icon" => "fas fa-dot-circle",
"color" => "#00aa00"
);
$jsonout['station'] = array(
"icon" => "fas fa-broadcast-tower",
"color" => "#0000ff"
);
}
$jsonout['gridsquare_layer'] = $this->user_options_model->get_options('ExportMapOptions',array('option_name'=>'gridsquare_layer','option_key'=>$slug), $userid)->row()->option_value ?? true;
$jsonout['path_lines'] = $this->user_options_model->get_options('ExportMapOptions',array('option_name'=>'path_lines','option_key'=>$slug), $userid)->row()->option_value ?? true;
$jsonout['cqzone_layer'] = $this->user_options_model->get_options('ExportMapOptions',array('option_name'=>'cqzone_layer','option_key'=>$slug), $userid)->row()->option_value ?? true;