General jQuery based approach in frontend is working.

This commit is contained in:
2019-06-18 16:44:44 +02:00
parent a2eb141d5c
commit a30e5d76a1
7 changed files with 202 additions and 10 deletions

View File

@@ -0,0 +1,50 @@
<?php
use Joomla\CMS\Factory;
// No direct access.
defined('_JEXEC') or die;
$input = Factory::getApplication()->input;
$type = $input->get->getCmd('type');
$mode = $input->get->getCmd('mode', 'view');
$auth = new ClubsHelperAuth();
$user = $auth->getCurrentUser();
if($mode === 'edit')
{
echo "<form method='POST' action='index.php?option=com_clubs&task=parts.edit&format=json'>";
switch($type)
{
case 'name':
$partname = 'user.name';
$value = $user->getName();
$value = htmlentities($value);
$content = "<input name='name' value='$value'>";
break;
}
echo "<input type='hidden' name='partname' value='$partname'>";
echo $content;
echo '&nbsp;<a class="clubs-save" href="#"><span class="icon-ok"></span></a>&nbsp;';
echo '<a class="clubs-abort" href="index.php?option=com_clubs&view=mypage&layout=parts&type='.$type.'"><span class="icon-cancel-2"></span></a>';
echo '</form>';
}
elseif ($mode === 'view')
{
switch ($type)
{
case 'name':
$content = htmlentities($user->getName());
$partname = 'name';
break;
}
echo "<a class='clubs-edit' href='index.php?option=com_clubs&view=mypage&layout=parts&mode=edit&type=$partname'>";
echo $content;
echo "<span class='icon-apply clubs-hidden edit-icon' style='font-size: 200%; margin-left: 0.75em;'></span></a>";
}
jexit();