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

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Nov 5, 2019
1 parent 2550535 commit 2b3ed7e
Show file tree
Hide file tree
Showing 106 changed files with 21,964 additions and 137,022 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" version="3.5" method="upgrade">
<name>com_agosms</name>
<author>Astrid Günther</author>
<creationDate>2019-11-03</creationDate>
<creationDate>2019-11-05</creationDate>
<copyright>(C) 2019 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later;</license>
<authorEmail>info@astrid-guenther.de</authorEmail>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
/>
<field
name="url"
type="url"
type="hidden"
label="COM_AGOSMS_FIELD_URL_LABEL"
description="COM_AGOSMS_FIELD_URL_DESC"
class="span12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="package" version="1.0" method="upgrade">
<name>pkg_agosms</name>
<packagename>agosms</packagename>
<creationDate>2019-11-03</creationDate>
<creationDate>2019-11-05</creationDate>
<packager>Astrid Günther</packager>
<copyright>(C) 2019 Astrid Günther. All rights reserved.</copyright>
<packageremail>info@astrid-guenther.de</packageremail>
Expand Down
2 changes: 1 addition & 1 deletion dist/agosms-1.0.59/agosms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="component" version="3.5" method="upgrade">
<name>com_agosms</name>
<author>Astrid Günther</author>
<creationDate>2019-11-03</creationDate>
<creationDate>2019-11-05</creationDate>
<copyright>(C) 2019 Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later;</license>
<authorEmail>info@astrid-guenther.de</authorEmail>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,26 @@
/**
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(function () {
"use strict";
document.addEventListener('DOMContentLoaded', function () {
const cordsTextField = document.getElementById("jform_paramsmodal_cords_map");
const unique = cordsTextField.getAttribute('data-unique');
window['mymap' + unique] = L.map('mapid' + unique).setView([50.27264, 7.26469], 3);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(window['mymap' + unique]);
window['mymap' + unique].on('click', onMapClick);
var marker = L.marker([50.28, 7.27]).addTo(window['mymap' + unique]).bindPopup(Joomla.JText._('COM_AGOSMS_BUTTON_DEFAULT_POPUP_PROMPT')).openPopup();
cordsTextField.value = "50.28, 7.27";
function onMapClick(e) {
const cordsTextField = document.getElementById("jform_paramsmodal_cords_map");
if (cordsTextField) {
cordsTextField.value = e.latlng.lat + ', ' + e.latlng.lng;
var lat = (e.latlng.lat);
var lng = (e.latlng.lng);
var newLatLng = new L.LatLng(lat, lng);
marker.setLatLng(newLatLng);
}
}

var parts = window.location.search.substr(1).split("&");
var $_GET = {};
for (var i = 0; i < parts.length; i++) {
var temp = parts[i].split("=");
$_GET[decodeURIComponent(temp[0])] = decodeURIComponent(temp[1]);
}

const buttonSaveSelected = document.getElementById("buttonsaveselected");
const cordsParentTextField = window.parent.document.getElementById($_GET.fieldid);
if (buttonSaveSelected && cordsParentTextField && cordsTextField) {
buttonSaveSelected.addEventListener('click', function () {
cordsParentTextField.setAttribute("readonly", false);
cordsParentTextField.value = cordsTextField.value;
cordsParentTextField.setAttribute("readonly", true);
window.parent.jModalClose();
});
}

});
})();
(function(){'use strict';
document.addEventListener('DOMContentLoaded',function(){const;
cordsTextField=document.getElementById('jform_paramsmodal_cords_map');
const;
unique=cordsTextField.getAttribute('data-unique');
window['mymap'+unique]=L.map('mapid'+unique).setView([50.27264,7.26469],3);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(window['mymap'+unique]);
window['mymap'+unique].on('click',a);
var o=L.marker([50.28,7.27]).addTo(window['mymap'+unique]).bindPopup(Joomla.JText._('COM_AGOSMS_BUTTON_DEFAULT_POPUP_PROMPT')).openPopup();
cordsTextField.value='50.28, 7.27';
function a(e){const;
cordsTextField=document.getElementById('jform_paramsmodal_cords_map');
if(cordsTextField){cordsTextField.value=e.latlng.lat+', '+e.latlng.lng;
var t=(e.latlng.lat),n=(e.latlng.lng),d=new L.LatLng(t,n);
o.setLatLng(d)}};
var n=window.location.search.substr(1).split('&'),d={};
for(var e=0;e<n.length;e++){var t=n[e].split('=');
d[decodeURIComponent(t[0])]=decodeURIComponent(t[1])};
const;
buttonSaveSelected=document.getElementById('buttonsaveselected');
const;
cordsParentTextField=window.parent.document.getElementById(d.fieldid);
if(buttonSaveSelected&&cordsParentTextField&&cordsTextField){buttonSaveSelected.addEventListener('click',function(){cordsParentTextField.setAttribute('readonly',!1);
cordsParentTextField.value=cordsTextField.value;
cordsParentTextField.setAttribute('readonly',!0);
window.parent.jModalClose()})}})})();
76 changes: 15 additions & 61 deletions dist/agosms-1.0.59/media/com_agosms/js/admin-agosms-modal.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,15 @@
/**
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(function() {
"use strict";
/**
* Javascript to insert the link
* View element calls jSelectWeblink when an weblink is clicked
* jSelectWeblink creates the link tag, sends it to the editor,
* and closes the select frame.
**/
window.jSelectWeblink = function (id, title, catid, object, link, lang) {
var hreflang = '', editor, tag;

if (!Joomla.getOptions('xtd-weblinks')) {
// Something went wrong!
window.parent.jModalClose();
return false;
}

editor = Joomla.getOptions('xtd-weblinks').editor;

if (lang !== '')
{
hreflang = ' hreflang="' + lang + '"';
}

tag = '<a' + hreflang + ' href="' + link + '">' + title + '</a>';

/** Use the API, if editor supports it **/
if (window.Joomla && window.Joomla.editors && Joomla.editors.instances && Joomla.editors.instances.hasOwnProperty(editor)) {
Joomla.editors.instances[editor].replaceSelection(tag)
} else {
window.parent.jInsertEditorText(tag, editor);
}

window.parent.jModalClose();
};

document.addEventListener('DOMContentLoaded', function(){
// Get the elements
var elements = document.querySelectorAll('.select-link');

for(var i = 0, l = elements.length; l>i; i++) {
// Listen for click event
elements[i].addEventListener('click', function (event) {
event.preventDefault();
var functionName = event.target.getAttribute('data-function');

if (functionName === 'jSelectWeblink') {
// Used in xtd_weblinks
window[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null));
} else {
// Used in com_menus
window.parent[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), event.target.getAttribute('data-cat-id'), null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language', null));
}
})
}
});
})();
(function(){'use strict';
window.jSelectWeblink=function(n,r,l,d,o,i){var a='',t,e;
if(!Joomla.getOptions('xtd-weblinks')){window.parent.jModalClose();
return!1};
t=Joomla.getOptions('xtd-weblinks').editor;
if(i!==''){a=' hreflang="'+i+'"'};
e='<a'+a+' href="'+o+'">'+r+'</a>';
if(window.Joomla&&window.Joomla.editors&&Joomla.editors.instances&&Joomla.editors.instances.hasOwnProperty(t)){Joomla.editors.instances[t].replaceSelection(e)}
else{window.parent.jInsertEditorText(e,t)};
window.parent.jModalClose()};
document.addEventListener('DOMContentLoaded',function(){var e=document.querySelectorAll('.select-link');
for(var t=0,a=e.length;a>t;t++){e[t].addEventListener('click',function(t){t.preventDefault();
var e=t.target.getAttribute('data-function');
if(e==='jSelectWeblink'){window[e](t.target.getAttribute('data-id'),t.target.getAttribute('data-title'),t.target.getAttribute('data-cat-id'),null,t.target.getAttribute('data-uri'),t.target.getAttribute('data-language',null))}
else{window.parent[e](t.target.getAttribute('data-id'),t.target.getAttribute('data-title'),t.target.getAttribute('data-cat-id'),null,t.target.getAttribute('data-uri'),t.target.getAttribute('data-language',null))}})}})})();
64 changes: 30 additions & 34 deletions dist/agosms-1.0.59/modules/mod_agosm/helper.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package Joomla.Site
* @subpackage pkg_agosms
Expand Down Expand Up @@ -97,8 +98,7 @@ public static function getCategory(&$params)

if ($items)
{
foreach ($items as $item)
{
foreach ($items as $item) {
$category = $model->getCategory($item->id);
break;
}
Expand Down Expand Up @@ -205,8 +205,7 @@ public static function getListCustomField(&$params)

if ($items)
{
foreach ($items as $key => $item)
{
foreach ($items as $key => $item) {
if ($item->state !== "1")
{
continue;
Expand All @@ -216,37 +215,34 @@ public static function getListCustomField(&$params)
// (calling plugins events and loading layouts to get their HTML display)
$fields = FieldsHelper::getFields('com_content.article', $item, true);

$itemfiltered1 = new stdClass;
$itemfiltered2 = new stdClass;
$itemfiltered3 = new stdClass;

foreach ($fields as $key => $field)
{
foreach ($fields as $key => $field) {

$itemfiltered = new stdClass;

if ($field->title == 'lat, lon')
{
$itemfiltered1->cords = $field->value;
$test = explode(",", $itemfiltered1->cords);
$itemfiltered->cords = $field->value;
$test = explode(",", $itemfiltered->cords);

if (is_numeric($test[0]) && is_numeric($test[1]))
{
$itemfiltered1->title = $item->title;
$itemfiltered1->id = $item->id;
$itemfiltered1->type = $field->type;
$itemsfiltered[] = $itemfiltered1;
$itemfiltered->title = $item->title;
$itemfiltered->id = $item->id;
$itemfiltered->type = $field->type;
}
}

if ($field->type == 'agosmsmarker')
{
$itemfiltered2->cords = $field->value;
$test = explode(",", $itemfiltered2->cords);
$itemfiltered->cords = $field->value;
$test = explode(",", $itemfiltered->cords);

if (is_numeric($test[0]) && is_numeric($test[1]))
{
$itemfiltered2->title = $item->title;
$itemfiltered2->id = $item->id;
$itemfiltered2->type = $field->type;
$itemsfiltered[] = $itemfiltered2;
$itemfiltered->title = $item->title;
$itemfiltered->id = $item->id;
$itemfiltered->type = $field->type;
}
}

Expand All @@ -256,32 +252,31 @@ public static function getListCustomField(&$params)
$popup = $field->fieldparams->get('popup', '0');
$specialicon = $field->fieldparams->get('specialicon', '0');

$itemfiltered3->cords = $field->rawvalue;
$test = explode(",", $itemfiltered3->cords);
$itemfiltered->cords = $field->rawvalue;
$test = explode(",", $itemfiltered->cords);

if (sizeof($test) > 5 && is_numeric($test[0]) && is_numeric($test[1]))
{
$itemfiltered3->title = $item->title;
$itemfiltered3->id = $item->id;
$itemfiltered3->type = $field->type;
$itemfiltered3->lat = $test[0];
$itemfiltered3->lon = $test[1];
$itemfiltered->title = $item->title;
$itemfiltered->id = $item->id;
$itemfiltered->type = $field->type;
$itemfiltered->lat = $test[0];
$itemfiltered->lon = $test[1];

if ($specialicon)
{
$itemfiltered3->iconcolor = $test[2];
$itemfiltered3->markercolor = $test[3];
$itemfiltered3->icon = $test[4];
$itemfiltered->iconcolor = $test[2];
$itemfiltered->markercolor = $test[3];
$itemfiltered->icon = $test[4];
}

if ($popup)
{
$itemfiltered3->popuptext = $test[5];
$itemfiltered->popuptext = $test[5];
}

$itemsfiltered[] = $itemfiltered3;
}
}
$itemsfiltered[] = $itemfiltered;
}
}
}
Expand Down Expand Up @@ -328,4 +323,5 @@ public static function getListExternaldb(&$params)

return $results;
}

}
Loading

0 comments on commit 2b3ed7e

Please sign in to comment.