51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?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' class='clubs-part'>";
|
|
|
|
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();
|
|
|