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

Commit

Permalink
frontend editing
Browse files Browse the repository at this point in the history
  • Loading branch information
astridx committed Jul 23, 2019
1 parent acf1008 commit edd3990
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 32 deletions.
2 changes: 1 addition & 1 deletion dist/current
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension type="component" version="3.5" method="upgrade">
<name>com_agosms</name>
<author>Astrid Günther</author>
<creationDate>2019-07-20</creationDate>
<creationDate>2019-07-23</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>
<authorUrl>www.astrid-guenther.de</authorUrl>
<version>1.0.44</version>
<version>1.0.45</version>
<description>COM_AGOSMS_XML_DESCRIPTION</description>
<scriptfile>script.php</scriptfile>

Expand Down
Binary file modified dist/zips/com_agosms.zip
Binary file not shown.
Binary file modified dist/zips/mod_agosm.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion jorobo.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extension = agosms
version = 1.0.44
version = 1.0.45
source = src
target = package

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ 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"
PLG_AGOSMSADDRESSMARKER_COMPONENT_NOT_SUPPORTET_FOR_FRONTENDEDITING="Custom Field Agosmsaddressmarker: Component not supported for frontend editing."
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ document.addEventListener('click', function (e) {
} else if (results.length > 0) {
// Limit is fix set to 1 up to now
} else {
console.log("Why is there noe result?");
console.log("Why is there no result?");
tempAlert("Error: " + addressstring, 2000, "dc3545");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* @license GNU General Public License version 2 or later;
* @link astrid-guenther.de
*/

defined('JPATH_BASE') or die;

extract($displayData);
Expand Down Expand Up @@ -44,7 +43,6 @@
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
*/

// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9'));
Expand All @@ -62,7 +60,7 @@
JHtml::_('script', 'plg_fields_agosmsaddressmarker/agosmsaddressmarkerGoogle.js', array('version' => 'auto', 'relative' => true));
}
else
{
{
JHtml::_('script', 'plg_fields_agosmsaddressmarker/agosmsaddressmarkerNominatim.js', array('version' => 'auto', 'relative' => true));
}

Expand All @@ -86,13 +84,30 @@
?>


<?php
<?php
// Load the Fields of this item
$current_component = JFactory::getApplication()->input->getCmd('option');
$current_view = JFactory::getApplication()->input->getCmd('view');
$current_context = $current_component . '.' . $current_view;
$app = JFactory::getApplication();
$current_component = $app->input->getCmd('option');
$current_view = $app->input->getCmd('view');
$current_context = $current_component . '.' . $current_view;
$item = new stdClass;
$item->id = (int) JFactory::getApplication()->input->getCmd('id');

if ($app->isClient('administrator'))
{
$item->id = (int) JFactory::getApplication()->input->getCmd('id');
}
else if (
$app->isClient('site')
&& $current_component === "com_content"
&& $app->input->getCmd('a_id') !== null)
{
$item->id = (int) $app->input->getCmd('a_id');
$current_context = $current_component . '.article';
}
else
{
JFactory::getApplication()->enqueueMessage(JText::_('PLG_AGOSMSADDRESSMARKER_COMPONENT_NOT_SUPPORTET_FOR_FRONTENDEDITING'), 'message');
}

$fields = FieldsHelper::getFields($current_context, $item);

Expand Down Expand Up @@ -129,32 +144,29 @@

<hr>
<p>
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_HINT'); ?>
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_HINT'); ?>
</p>
<div class="agosmsaddressmarkersurroundingdiv">
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_LAT'); ?><input type="text" class="agosmsaddressmarkerlat" >
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_LON'); ?><input type="text" class="agosmsaddressmarkerlon" >
<br>
<button
data-addressstring="<?php echo htmlspecialchars($addressstring, ENT_QUOTES, 'UTF-8'); ?>"
data-mapboxkey="<?php echo $mapboxkey; ?>"
data-googlekey="<?php echo $googlekey; ?>"
class="btn btn-success agosmsaddressmarkerbutton"
type="button">
<br>
<button
data-addressstring="<?php echo htmlspecialchars($addressstring, ENT_QUOTES, 'UTF-8'); ?>"
data-mapboxkey="<?php echo $mapboxkey; ?>"
data-googlekey="<?php echo $googlekey; ?>"
class="btn btn-success agosmsaddressmarkerbutton"
type="button">
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_CALCULATE_CORDS'); ?>
</button>
<p>
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_USED_FIELDS'); ?>
<?php echo $fieldnames; ?>
</p>
</button>
<p>
<?php echo JText::_('PLG_AGOSMSADDRESSMARKER_USED_FIELDS'); ?>
<?php echo $fieldnames; ?>
</p>



<input class="agosmsaddressmarkerhiddenfield"
type="hidden"
readonly name="<?php
echo $name; ?>" id="<?php
echo $id; ?>" value="<?php
echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" <?php echo implode(' ', $attributes); ?> />
<input class="agosmsaddressmarkerhiddenfield"
type="hidden"
readonly name="<?php echo $name; ?>" id="<?php echo $id; ?>" value="<?php echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>" <?php echo implode(' ', $attributes); ?> />
</div>
<hr>

0 comments on commit edd3990

Please sign in to comment.