General jQuery based approach in frontend is working.
This commit is contained in:
50
src/site/views/mypage/tmpl/parts.php
Normal file
50
src/site/views/mypage/tmpl/parts.php
Normal 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 ' <a class="clubs-save" href="#"><span class="icon-ok"></span></a> ';
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user