This is the source code for the website of Serenum.
https://serenum.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
369 lines
12 KiB
369 lines
12 KiB
<?php |
|
|
|
require_once 'site-header.php'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '<section id="settings">'; |
|
|
|
if(!isset($_GET['lat']) AND !isset($_GET['lng'])) { |
|
echo '<div class="welcome">'; |
|
echo $lang->page_settings->welcome; |
|
echo '</div>'; |
|
} |
|
|
|
|
|
|
|
echo '<h2>'.$lang->page_settings->title.'</h2>'; |
|
|
|
echo '<div id="map-overlay">'; |
|
echo $lang->various->map->loading; |
|
echo '</div>'; |
|
|
|
echo '<div id="map" data-coordinates="'; |
|
if($cookie_exists == true) { |
|
echo $cs_coordinates; |
|
} else { |
|
echo (($latitude_shorten == null AND $longitude_shorten == null) ? $settings->defaults->coordinates->latitude.','.$settings->defaults->coordinates->longitude : $latitude_shorten.','.$longitude_shorten); |
|
} |
|
echo '"></div>'; |
|
|
|
echo '<div class="message"><div>'; |
|
echo '<div class="icon error"><div>'.svgicon('error').'</div></div>'; |
|
echo '<div class="icon info"><div>'.svgicon('info').'</div></div>'; |
|
|
|
echo '<div class="text"></div>'; |
|
echo '</div></div>'; |
|
|
|
|
|
# echo '<form action="'.url('form:settings').'" method="POST" autocomplete="off" novalidate>'; |
|
echo '<form action="javascript:void(0)" method="GET" autocomplete="off" novalidate>'; |
|
|
|
echo '<div class="side-by-side">'; |
|
|
|
echo '<div class="gps'; |
|
echo ($config_allow_gps == false ? ' disabled' : ''); |
|
echo '">'; |
|
|
|
echo '<h4>'; |
|
echo svgicon('gps'); |
|
echo $lang->page_settings->subtitle_gps; |
|
echo '</h4>'; |
|
|
|
echo '<div class="desc">'; |
|
echo $lang->page_settings->desc_gps; |
|
echo '</div>'; |
|
|
|
|
|
echo '<div class="option">'; |
|
echo '<a href="javascript:void(0)" id="gps"'.($config_allow_gps == false ? ' class="hidden"' : '').'>'; |
|
echo $lang->page_settings->gps_fetch; |
|
echo '</a>'; |
|
|
|
echo '<span class="gps-disabled'.($config_allow_gps == false ? '' : ' hidden').'">'; |
|
echo $lang->page_settings->gps_fetch; |
|
echo '</span>'; |
|
|
|
echo '<span class="fetching">'; |
|
echo $lang->page_settings->gps_fetching; |
|
echo '</span>'; |
|
|
|
echo '<span class="js-disabled">'; |
|
echo $lang->page_settings->gps_fetch; |
|
echo '</span>'; |
|
echo '</div>'; |
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="search'; |
|
echo ($config_allow_search == false ? ' disabled' : ''); |
|
echo '">'; |
|
|
|
echo '<h4>'; |
|
echo svgicon('search'); |
|
echo $lang->page_settings->subtitle_manualplace; |
|
echo '</h4>'; |
|
|
|
echo '<div class="desc">'; |
|
echo '<div class="js-enabled">'; |
|
echo $lang->page_settings->desc_manualplace_jsenabled; |
|
echo '</div>'; |
|
|
|
echo '<div class="js-disabled">'; |
|
echo $lang->page_settings->desc_manualplace_jsdisabled; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
|
|
echo '<div class="items">'; |
|
echo '<div class="place">'; |
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_place; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<input type="text" name="field-search-place"'; |
|
echo ($config_allow_search == false ? ' disabled' : ''); |
|
echo '>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="searching color-blue"><div>'; |
|
echo svgicon('loading'); |
|
echo $lang->page_settings->info_searching; |
|
echo '</div></div>'; |
|
|
|
echo '<div class="result"></div>'; |
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="item coordinates">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_coordinates; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<input type="text" name="field-search-coordinates" placeholder="'.$config_default_coordinates_latitude.','.$config_default_coordinates_longitude.'" value="'; |
|
if($cookie_exists == true) { |
|
echo $cs_coordinates; |
|
} else { |
|
echo (($latitude_shorten == null AND $longitude_shorten == null) ? $config_default_coordinates_latitude.','.$config_default_coordinates_longitude : $latitude_shorten.','.$longitude_shorten); |
|
} |
|
echo '"'; |
|
echo ($config_allow_search == false ? ' disabled' : ''); |
|
echo '>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '</div>'; |
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="options">'; |
|
echo '<details>'; |
|
echo '<summary class="no-select">'.$lang->page_settings->subtitle_options.'</summary>'; |
|
|
|
echo '<div class="content">'; |
|
echo '<div class="items">'; |
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_unit; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<select name="field-option-unit" class="select-css">'; |
|
echo '<option value="metric"'.(($cs_unit == 'metric' OR $settings_unit == 'metric') ? ' selected' : '').'>'.$lang->page_settings->unit_metric.' (km/h, kilometer)</option>'; |
|
echo '<option value="imperial"'.(($cs_unit == 'imperial' OR $settings_unit == 'imperial') ? ' selected' : '').'>'.$lang->page_settings->unit_imperial.' (mph, miles)</option>'; |
|
echo '</select>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_language; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<select name="field-option-language" class="select-css">'; |
|
foreach(glob('languages/*.json') AS $langfile) { |
|
$langscoop = json_decode(file_get_contents($langfile)); |
|
echo '<option value="'.$langscoop->language_name->short.'"'.(($cs_language == $langscoop->language_name->short OR $settings_language == $langscoop->language_name->short) ? ' selected' : '').'>'.$langscoop->language_name->full.'</option>'; |
|
} |
|
echo '</select>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_decimal; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<select name="field-option-decimal" class="select-css">'; |
|
echo '<option value="comma"'.(($cs_decimal == 'comma' OR $settings_decimal == 'comma') ? ' selected' : '').'>'.$lang->page_settings->decimal_comma.' (14,7)</option>'; |
|
echo '<option value="dot"'.(($cs_decimal == 'dot' OR $settings_decimal == 'dot') ? ' selected' : '').'>'.$lang->page_settings->decimal_dot.' (14.7)</option>'; |
|
echo '</select>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_time; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<select name="field-option-time" class="select-css">'; |
|
echo '<option value="24h"'.(($cs_time == '24h' OR $settings_time == '24h') ? ' selected' : '').'>24h</option>'; |
|
echo '<option value="12h"'.(($cs_time == '12h' OR $settings_time == '12h') ? ' selected' : '').'>12h</option>'; |
|
echo '</select>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_theme; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<select name="field-option-theme" class="select-css">'; |
|
echo '<option value="light"'.(($cs_theme == 'light' OR $settings_theme == 'light') ? ' selected' : '').'>'.$lang->page_settings->theme_light.'</option>'; |
|
echo '<option value="dark"'.(($cs_theme == 'dark' OR $settings_theme == 'dark') ? ' selected' : '').'>'.$lang->page_settings->theme_dark.'</option>'; |
|
echo '</select>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
|
|
echo '<div class="checkbox pretty p-default p-round p-fill">'; |
|
echo '<input type="checkbox" name="check-1" id="check-1"'; |
|
echo ($settings_updategps == 0 ? '' : ' checked'); |
|
echo '>'; |
|
|
|
echo '<div class="state p-primary">'; |
|
echo '<label for="check-1">'; |
|
echo $lang->page_settings->gps_checkbox_updateposition; |
|
echo '</label>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</details>'; |
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="apikey'; |
|
echo ($config_allow_own_apikey == false ? ' disabled' : ''); |
|
echo '">'; |
|
|
|
echo '<details>'; |
|
echo '<summary>'.$lang->page_settings->subtitle_apikey.'</summary>'; |
|
|
|
echo '<div class="content">'; |
|
echo '<div class="desc">'; |
|
echo $lang->page_settings->desc_apikey; |
|
echo '</div>'; |
|
|
|
echo '<div class="items">'; |
|
echo '<div class="item">'; |
|
echo '<div class="label">'; |
|
echo $lang->page_settings->field_apikey; |
|
echo '</div>'; |
|
|
|
echo '<div class="field">'; |
|
echo '<input type="text" name="field-api-key"'; |
|
if($cs_apikey == null) { |
|
echo ($settings_apikey == null ? null : ' value="'.$settings_apikey.'"'); |
|
} else { |
|
echo ' value="'.$cs_apikey.'"'; |
|
} |
|
echo ($config_allow_own_apikey == false ? ' disabled' : ''); |
|
echo '>'; |
|
|
|
echo '<div class="icon"><div>'.svgicon('clear').'</div></div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</details>'; |
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="save">'; |
|
echo '<details>'; |
|
echo '<summary>'.$lang->page_settings->subtitle_save.'</summary>'; |
|
|
|
echo '<div class="content">'; |
|
echo '<div class="desc">'; |
|
echo $lang->page_settings->desc_save; |
|
echo '</div>'; |
|
|
|
echo '<div class="url">'; |
|
echo $protocol.'://'.$host.'/'.basename(__DIR__).'/'; |
|
|
|
echo '<span class="language">'.$settings_language.'</span>/'; |
|
echo '<span class="coordinates">'.$latitude_shorten.','.$longitude_shorten.'</span>/'; |
|
echo 's:'; |
|
echo '<span class="unit">'.($settings_unit == 'metric' ? 0 : 1).'</span>'; |
|
echo '<span class="decimal">'.($settings_decimal == 'comma' ? 0 : 1).'</span>'; |
|
echo '<span class="time">'.($settings_time == '24h' ? 0 : 1).'</span>'; |
|
echo '<span class="theme">'.($settings_theme == 'light' ? 0 : 1).'</span>'; |
|
echo '-'; |
|
echo '<span class="update-gps">'.$settings_updategps.'</span>'; |
|
echo '<span class="apikey">'.($settings_apikey == null ? null : $settings_apikey).'</span>'; |
|
echo '</div>'; |
|
|
|
echo '<p class="copy">'; |
|
echo '<a href="javascript:void(0)" id="copy" class="js-enabled">'; |
|
echo $lang->page_settings->link_copy; |
|
echo '</a>'; |
|
|
|
echo '<span class="js-disabled">'; |
|
echo $lang->page_settings->link_copy; |
|
echo '</span>'; |
|
|
|
echo '<span class="copied color-green">'; |
|
echo $lang->page_settings->info_urlcopied; |
|
echo '</span>'; |
|
|
|
echo '<span class="failed color-red">'; |
|
echo $lang->page_settings->error_failedtocopyurl; |
|
echo '</span>'; |
|
echo '</p>'; |
|
|
|
echo '<div class="checkbox pretty p-default p-round p-fill">'; |
|
echo '<input type="checkbox" name="check-2" id="check-2"'; |
|
echo ($cookie_exists == true ? ' checked' : ''); |
|
echo '>'; |
|
|
|
echo '<div class="state p-primary">'; |
|
echo '<label for="check-2">'; |
|
echo $lang->page_settings->cookie_store; |
|
echo '</label>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
|
|
echo '<div class="delete-cookie">'; |
|
echo '<a href="javascript:void(0)" id="delete-cookie">'; |
|
echo $lang->page_settings->cookie_delete; |
|
echo '</a>'; |
|
|
|
echo '<div class="will-be-deleted color-blue">'; |
|
echo 'The cookie will be deleted if you continue'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</div>'; |
|
echo '</details>'; |
|
echo '</div>'; |
|
|
|
|
|
|
|
echo '<div class="button">'; |
|
echo '<input type="submit" name="button-continue" value="'.$lang->page_settings->button_continue.'">'; |
|
echo '</div>'; |
|
|
|
echo '</form>'; |
|
|
|
echo '</section>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once 'site-footer.php'; |
|
|
|
?>
|
|
|