Skip to content

Commit

Permalink
Update branch from development (#1568)
Browse files Browse the repository at this point in the history
* CSS Refactor

- Remove dependence on $CSS_VERSION_RELEASE and v202209 directory path
- Move all css files out of v202209 directory one directory down into css base directory
- Add $CSS_VERSION to CSS imports within head_template.php, thus allowing force reload of CSS files when that variable is changed within symbbase.php file
- Remove deprecated css/base.css file
- Remove deprecated files within css/symb/directory
- Reduce pixel size of Symbiota icon, which is much larger than a typical icon. Large version of icon is still conserved, but not used as the default icon.

* CSS modification by Logan

* header and footer adjustments

- Move javascript code out of footer into separate js file. This will allow us to make adjustments to code without needing individual non-template footer files to be adjusted to code changes.
- Remove code out of header_template file in preference to code run within symbbase.php file
- Given condition at top of header page testing if language file is imported, individual isset statements for each LANG variable is not needed.

* minimal header adjustments

- Remap minimalheader_template.php to minimalheader.php in support of the currently supported template system
- Add minimalheader_template.php to setup.sh file

* Add temporarily to resolve conflict

* Remove dependence on v202209

* Misc adjustments

- Bug fix: remove php code out of new js file
- Standardize syntax within footer template file
- Remove deprecated code within symbini config file

* Very minor code adjustment

* Increase Symbiota size of icon

* Misc adjustments

* Remove 202209 again

* Add break to collection profile title (#1556)

* Update variables.css

correct default header background image path.

* change the default project to 0 (#1546)

* fix typo in request (#1559)

* Change exsicatti to exsicattae (#1563)

* Change "open" to "toggle" record search form (#1565)

---------

Co-authored-by: Edward Gilbert <egbot@asu.edu>
Co-authored-by: Greg Post <gregory.post@asu.edu>
Co-authored-by: NikitaSalikov <86389284+NikitaSalikov@users.noreply.github.com>
  • Loading branch information
4 people committed Jul 31, 2024
1 parent 6bb2fb2 commit 50a93aa
Show file tree
Hide file tree
Showing 77 changed files with 148 additions and 2,398 deletions.
8 changes: 4 additions & 4 deletions checklists/checklistmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function parseNested(str) {
"Content-Type": "application/json",
}
})
const records = await response.json();
const records = await response.json();
const resultLimit = 10000;
const totalResults = records.total_results > resultLimit? resultLimit: records.total_results;
const maxPage = Math.floor(totalResults / 200);
Expand All @@ -202,7 +202,7 @@ function parseNested(str) {
page,
per_page: 200,
results: [],
total_results: 0
total_results: 0
}

if(page !== maxPage) {
Expand Down Expand Up @@ -251,15 +251,15 @@ function openIndPU(occId){
margin: 0;
padding: 0;
}
.screen-reader-only{
.screen-reader-only{
position: absolute;
left: -10000px;
}
</style>
</head>
<body style="background-color:#ffffff;" onload="initialize();">
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<h1 class="page-heading screen-reader-only"><?= $LANG['MAP_SECTION'] . ' ' . $clName; ?></h1>
<?php
Expand Down
28 changes: 14 additions & 14 deletions checklists/clgmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!DOCTYPE html>
<html lang="<?php echo $LANG_TAG ?>">
<head>
<?php
<?php
include_once($SERVER_ROOT.'/includes/leafletMap.php');
include_once($SERVER_ROOT.'/includes/googleMap.php');
?>
Expand All @@ -34,7 +34,7 @@
let checklists;
let pid;

function navigateToCheckList(clid, pid) {
function navigateToCheckList(clid, pid) {
window.location.href = `../ident/key.php?clid=${clid}&pid=${pid}&taxon=All+Species`;
}

Expand Down Expand Up @@ -75,24 +75,24 @@ function closeAllInfoWins(){
bounds.extend(coord);

let m = new google.maps.Marker({
position: coord,
map: map.mapLayer,
title: checklist.name,
position: coord,
map: map.mapLayer,
title: checklist.name,
})
const infoWin = new google.maps.InfoWindow({
content: `<div style=\'width:300px;\'>
<b>${checklist.name}</b><br/><?php echo (isset($LANG['DOUBLE_CLICK'])?$LANG['DOUBLE_CLICK']:'Double Click to open'); ?>
</div>`
</div>`
});

infoWins.push(infoWin);

google.maps.event.addListener(m, 'click', function(e){
closeAllInfoWins();
infoWin.open(map.mapLayer, m);
google.maps.event.addListener(m, 'click', function(e){
closeAllInfoWins();
infoWin.open(map.mapLayer, m);
});

google.maps.event.addListener(m, "dblclick", function(){
google.maps.event.addListener(m, "dblclick", function(){
closeAllInfoWins();
m.setAnimation(google.maps.Animation.BOUNCE);
navigateToCheckList(checklistId, pid);
Expand Down Expand Up @@ -134,13 +134,13 @@ function initialize(){
</head>
<body style="background-color:#ffffff;" onload="initialize()">
<?php
// if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
// if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<h1 class="page-heading screen-reader-only" style="margin-top:30px;">Checklist Map</h1>
<div id="map_canvas"></div>
<div
id="service-container"
class="service-container"
<div
id="service-container"
class="service-container"
data-checklists="<?= htmlspecialchars(json_encode($clManager->getResearchPoints()))?>"
data-pid="<?= htmlspecialchars($pid)?>"
>
Expand Down
8 changes: 4 additions & 4 deletions checklists/tools/mappointaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<title><?php echo $DEFAULT_TITLE; ?> - Coordinate Aid</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<?php
<?php
if(empty($GOOGLE_MAP_KEY)) {
include_once($SERVER_ROOT.'/includes/leafletMap.php');
} else {
Expand Down Expand Up @@ -136,9 +136,9 @@ function googleInit(){
});
}
function initialize() {
<?php if(empty($GOOGLE_MAP_KEY)): ?>
<?php if(empty($GOOGLE_MAP_KEY)): ?>
leafletInit();
<?php else:?>
<?php else:?>
googleInit();
<?php endif ?>
}
Expand Down Expand Up @@ -179,7 +179,7 @@ function updateParentForm() {
</head>
<body style="display:flex; flex-direction: column; background-color:#ffffff;" onload="initialize()">
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<h1 class="page-heading screen-reader-only">Map Point Helper</h1>
<div style="padding:0.5rem; width: fit-content; height:fit-content" class="minimal-header-margin">
Expand Down
2 changes: 1 addition & 1 deletion checklists/vamissingtaxa.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

$clid = array_key_exists('clid', $_REQUEST) ? filter_var($_REQUEST['clid'], FILTER_SANITIZE_NUMBER_INT) : 0;
$pid = array_key_exists('pid', $_REQUEST) ? htmlspecialchars($_REQUEST['pid'], ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE) : "";
$displayMode = array_key_exists('displayMode', $_REQUEST) ? filter_var($_REQUEST['displayMode'], FILTER_SANITIZE_NUMBER_INT) : 0;
$displayMode = array_key_exists('displaymode', $_REQUEST) ? filter_var($_REQUEST['displaymode'], FILTER_SANITIZE_NUMBER_INT) : 0;
$startIndex = array_key_exists('start', $_REQUEST) ? filter_var($_REQUEST['start'], FILTER_SANITIZE_NUMBER_INT) : 0;

$vManager = new ChecklistVoucherReport();
Expand Down
2 changes: 1 addition & 1 deletion collections/editor/dev/occurdataentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $CHARSET; ?>">
<title><?php echo $DEFAULT_TITLE; ?> Occurrence Editor</title>
<link href="<?php echo $CSS_BASE_PATH; ?>/jquery-ui.css" type="text/css" rel="stylesheet">
<link href="../../css/occureditor.css?<?php echo htmlspecialchars($CSS_VERSION, ENT_COMPAT | ENT_HTML401 | ENT_SUBSTITUTE); ?>" type="text/css" rel="stylesheet" id="editorCssLink" />
<link href="../../css/occureditor.css?ver=<?= $CSS_VERSION ?>" type="text/css" rel="stylesheet" id="editorCssLink" />
<script src="<?php echo $CLIENT_ROOT; ?>/js/jquery-3.7.1.min.js" type="text/javascript"></script>
<script src="<?php echo $CLIENT_ROOT; ?>/js/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
Expand Down
2 changes: 1 addition & 1 deletion collections/georef/georefclone.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function verifyCloneForm(f){
</head>
<body style="background-color:#ffffff;" onload="initialize()">
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<!-- Data Container for Passing to Js -->
<div id="service-container"
Expand Down
2 changes: 1 addition & 1 deletion collections/individual/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function initializeMap(){
</head>
<body>
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<header style="background-image: none;">
<a class="screen-reader-only" href="#end-nav"><?php echo $LANG['SKIP_NAV'] ?></a>
Expand Down
2 changes: 1 addition & 1 deletion collections/map/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ function initialize() {
</head>
<body style='width:100%;max-width:100%;min-width:500px;' <?php echo (!$activateGeolocation?'onload="initialize();"':''); ?>>
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<h1 class="page-heading screen-reader-only">Map Interface</h1>
<div
Expand Down
2 changes: 1 addition & 1 deletion collections/misc/collprofiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function directSubmitAction(e) {
if ($collData['collectioncode']) $codeStr .= '-' . $collData['collectioncode'];
$codeStr .= ')';
$_SESSION['colldata'] = $collData;
echo '<h1 class="page-heading">' . $LANG['COLL_PROF_FOR'] . ': ' . $collData['collectionname'] . $codeStr . '</h1>';
echo '<h1 class="page-heading">' . $LANG['COLL_PROF_FOR'] . ':<br>' . $collData['collectionname'] . $codeStr . '</h1>';
// GBIF citations widget
if ($datasetKey) {
echo '<div style="margin-left: 10px; margin-bottom: 20px;">';
Expand Down
52 changes: 26 additions & 26 deletions collections/tools/mappointaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function getErrorRadius() {
function leafletInit() {
//Setup Map Canvas
map = new LeafletMap('map_canvas', {
center: [latCenter, lngCenter],
center: [latCenter, lngCenter],
zoom: 15,
lang: "<?php echo $LANG_TAG; ?>"
});
Expand Down Expand Up @@ -150,13 +150,13 @@ function createMarker(lat, lng) {
setLatLngForm(lat, lng);

circ = errRadius && errRadius > 0?
L.circle(latlng, errRadius):
L.circle(latlng, errRadius):
false;
marker = L.marker(latlng);

function enableEdit() {
try {
//Very Jank and all the other ways current are also Jank
//Very Jank and all the other ways current are also Jank
drawControl._toolbars.edit._modes.edit.button.click()
} catch(e) {
console.log("Failed to enable edit")
Expand Down Expand Up @@ -208,11 +208,11 @@ function addCircleEvents(circle) {
}

map.mapLayer
.on('draw:deleted', e => {
.on('draw:deleted', e => {
errRadius = 0;
clearForm();
})
.on('draw:deletestop', e => {
.on('draw:deletestop', e => {
const hasCircle = circ && drawnItems.hasLayer(circ);
const hasMarker = drawnItems.hasLayer(marker);
//Add Back marker or Circle if change Reverted and were present
Expand Down Expand Up @@ -245,10 +245,10 @@ function addCircleEvents(circle) {
map.mapLayer.fitBounds(circ.getBounds())
} else if(radius) {
if(!editOn) errRadius = radius;
circ = L.circle(latlng, radius);
circ = L.circle(latlng, radius);
addCircleEvents(circ);
map.mapLayer.fitBounds(circ.getBounds())
}
}

});
}
Expand All @@ -261,12 +261,12 @@ function addCircleEvents(circle) {

latInput.addEventListener("change", onFormChange);
lngInput.addEventListener("change", onFormChange);
}
onFormChange = (event) => {
if(!marker) {
}
onFormChange = (event) => {
if(!marker) {
const pos = getLatLng();
createMarker();
}
}
}
latInput.addEventListener("change", onFormChange);
lngInput.addEventListener("change", onFormChange);
Expand All @@ -278,7 +278,7 @@ function addCircleEvents(circle) {
const lng = e.layer._latlng.lng;
createMarker(lat, lng)

}
}
})

//Draw marker if one exists
Expand All @@ -292,7 +292,7 @@ function addCircleEvents(circle) {
function googleInit() {
//Setup Map Canvas
map = new GoogleMap('map_canvas', {
center: new google.maps.LatLng(latCenter, lngCenter),
center: new google.maps.LatLng(latCenter, lngCenter),
zoom: 7
});

Expand Down Expand Up @@ -357,7 +357,7 @@ function drawError() {
}


onFormChange = (event) => {
onFormChange = (event) => {
errRadius = parseFloat(event.target.value);
const pos = getLatLng();
if(pos) createMarker(pos[0], pos[1]);
Expand All @@ -378,7 +378,7 @@ function drawError() {
if(errRadius) {
drawError();
}
})
})
}

function initialize() {
Expand All @@ -401,10 +401,10 @@ function initialize() {
} else {
alert(`Error: Not Coordinates lat: ${lat}, lng: ${lng}`);
}
}
<?php if(empty($GOOGLE_MAP_KEY)) { ?>
}
<?php if(empty($GOOGLE_MAP_KEY)) { ?>
leafletInit();
<?php } else { ?>
<?php } else { ?>
googleInit();
<?php } ?>
}
Expand Down Expand Up @@ -437,7 +437,7 @@ function updateParentForm(f) {
<style>
body { padding:0; margin:0 }
html, body, #map_canvas { width:100%; height: 100%;}
.screen-reader-only{
.screen-reader-only{
position: absolute;
left: -10000px;
}
Expand All @@ -449,31 +449,31 @@ function updateParentForm(f) {
</style>
</head>
<body style="display:flex; flex-direction: column;background-color:#ffffff;" onload="initialize()">
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimal_header_template.php');
<?php
if($shouldUseMinimalMapHeader) include_once($SERVER_ROOT . '/includes/minimalheader.php');
?>
<h1 class="page-heading screen-reader-only">Point-Radius Aid</h1>
<div
id="service-container"
class="service-container"
id="service-container"
class="service-container"
data-lat="<?= htmlspecialchars($latCenter)?>"
data-lng="<?= htmlspecialchars($lngCenter)?>"
>
</div>
<form class="minimal-header-margin" style="padding:0.5rem" name="coordform" action="" method="post" onsubmit="return false">
<div style="float:right;">
<button name="addcoords" type="button" onclick="updateParentForm(this.form);">
<b><?php echo isset($LANG['SUBMIT'])? $LANG['SUBMIT']: 'Submit' ?></b>
<b><?php echo isset($LANG['SUBMIT'])? $LANG['SUBMIT']: 'Submit' ?></b>
</button><br/>
</div>
<div style="margin:3px 20px 3px 0px;">
<?php echo isset($LANG['MPR_INSTRUCTIONS']) ?$LANG['MPR_INSTRUCTIONS']: 'Click once to capture coordinates. Click on the submit coordinate button to transfer coordinates.' ?>
<?php if($errMode) echo isset($LANG['MPR_UNCERTAINTY_INSTRUCTIONS']) ?$LANG['MPR_UNCERTAINTY_INSTRUCTIONS']: 'Enter uncertainty to create an error radius circle around the marker. '?>
</div>
<div style="margin-right:10px;">
<b><?php echo isset($LANG['MPR_LAT'])? $LANG['MPR_LAT']: 'Latitude' ?>:</b>
<b><?php echo isset($LANG['MPR_LAT'])? $LANG['MPR_LAT']: 'Latitude' ?>:</b>
<input type="text" id="latbox" name="lat" style="width:100px" />
<b><?php echo isset($LANG['MPR_LNG'])? $LANG['MPR_LNG']: 'Longitude' ?>:</b>
<b><?php echo isset($LANG['MPR_LNG'])? $LANG['MPR_LNG']: 'Longitude' ?>:</b>
<input type="text" id="lngbox" name="lon" style="width:100px" />
<?php if($errMode):?>
<b>
Expand Down
1 change: 1 addition & 0 deletions config/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ echo "Creating homepage: /index.php"
cp ../index_template.php ../index.php
echo "Creating header include: /includes/header.php"
cp ../includes/header_template.php ../includes/header.php
cp ../includes/minimalheader_template.php ../includes/minimalheader.php
echo "Creating Left Menu include: /includes/leftmenu.php"
cp ../includes/leftmenu_template.php ../includes/leftmenu.php
echo "Creating footer include: /includes/footer.php"
Expand Down
Loading

0 comments on commit 50a93aa

Please sign in to comment.