Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
add message for upload if folder does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Jul 23, 2019
1 parent edd3990 commit aa4570b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
23 changes: 23 additions & 0 deletions src/language/de-DE/de-DE.mod_agosm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,29 @@ MOD_AG_FORBIDDEN_SCRIPT_FOUND="Security Error - Forbidden script file detected"
MOD_AG_PHP_TAG_FOUND="Security Error - PHP tag found in file"
MOD_AG_SHORT_TAG_FOUND="Security Error - Short tag found in file"
MOD_AG_FORBIDDEN_IN_ARCHIVE_FOUND="Security Error - Forbidden script file detected in archive"
MOD_AGOSM_UPLOAD_FIELDSET="Upload"
MOD_AG_FOLDER_NOT_EXISTS="The folder for uploading files does not exist. Please check the value for the folder in the options of the module."

; Google Gesture
MOD_AGOSM_SCROLLWHEELZOOM_LABEL="Scrollwheelzoom"
MOD_AGOSM_NOWORLDWARP_SCROLLWHEELZOOM_DESC="<p><strong>No: </strong>You can scroll through the page without stopping at the map. You can activate/deactivate the wheel zoom with a click on the map.</p><p><strong>Yes: </strong>You can scrolling down a side with a mouse wheel. When you arrive at the map, it automatically zooms into the map.</p><p><strong>Google Gesture Handling: </strong>See: https://developers.google.com/maps/documentation/javascript/examples/interaction-cooperative</p>"
PLG_AGOSMSADDRESSMARKER_TOUCH="Use two fingers to move the map"
PLG_AGOSMSADDRESSMARKER_SCROLL="Use ctrl + scroll to zoom the map"
PLG_AGOSMSADDRESSMARKER_SCROLLMAC="Use \u2318 + scroll to zoom the map"
PLG_AGOSMSADDRESSMARKER_OWNGOOGLEGESTURETEXT="Use own text"
PLG_AGOSMSADDRESSMARKER_OWNGOOGLEGESTURETEXT_DESC="Use own text in language files. You can override the language strings PLG_AGOSMSADDRESSMARKER_TOUCH, PLG_AGOSMSADDRESSMARKER_SCROLL and PLG_AGOSMSADDRESSMARKER_SCROLLMAC"

; Marker from Database
MOD_AGOSM_DATABASE_FIELDSET="Show pins from external database"
MOD_AGOSM_SHOWEXTERNALDATABASE_LABEL="Show pins from external database"
MOD_AGOSM_SHOWEXTERNALDATABASE_DESC="Show pins from external database"
MOD_AGOSM_COLUMN_COORDINATES="Column with Coordinates"
MOD_AGOSM_COLUMN_POPUPTEXT="Column with Pop up text"
MOD_AGOSM_HOST="Database Hostname"
MOD_AGOSM_PASSWORD="Password"
MOD_AGOSM_TABLE="Database Table"
MOD_AGOSM_USER="Database User"
MOD_AGOSM_MARKERS="Experimental Version"

; Documentation
MOD_AG_DOCUMENTATION="https://www.astrid-guenther.de"
1 change: 1 addition & 0 deletions src/language/en-GB/en-GB.mod_agosm.ini
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ MOD_AG_PHP_TAG_FOUND="Security Error - PHP tag found in file"
MOD_AG_SHORT_TAG_FOUND="Security Error - Short tag found in file"
MOD_AG_FORBIDDEN_IN_ARCHIVE_FOUND="Security Error - Forbidden script file detected in archive"
MOD_AGOSM_UPLOAD_FIELDSET="Upload"
MOD_AG_FOLDER_NOT_EXISTS="The folder for uploading files does not exist. Please check the value for the folder in the options of the module."

; Google Gesture
MOD_AGOSM_SCROLLWHEELZOOM_LABEL="Scrollwheelzoom"
Expand Down
14 changes: 11 additions & 3 deletions src/modules/mod_agosm/Helper/EasyFileUploaderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,19 @@ private static function actualMIME($file)
private static function storeUploadedFile($filepath, &$params, &$result, &$i, $replaced = false)
{
$result_text = '';
$success = false;

// Move the file to the destination folder
$success = move_uploaded_file(
$_FILES[$params->get('ag_variable')]["tmp_name"][$i], $filepath . DIRECTORY_SEPARATOR . $_FILES[$params->get('ag_variable')]["name"][$i]
);
if (file_exists($filepath))
{
$success = move_uploaded_file(
$_FILES[$params->get('ag_variable')]["tmp_name"][$i], $filepath . DIRECTORY_SEPARATOR . $_FILES[$params->get('ag_variable')]["name"][$i]
);
}
else
{
$result_text .= Text::_('MOD_AG_FOLDER_NOT_EXISTS') . " ";
}

if ($replaced)
{
Expand Down
2 changes: 1 addition & 1 deletion src/modules/mod_agosm/mod_agosm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@
/>
<field name="ag_filetypes"
type="textarea"
default="text/xml;application/gpx+xml;"
default="text/xml;application/gpx+xml;application/octet-stream;"
label="MOD_AG_FILETYPES_LABEL"
description="MOD_AG_FILETYPES_DESC"
rows="10"
Expand Down

0 comments on commit aa4570b

Please sign in to comment.