Club frontend partly created, missing the special cases

This commit is contained in:
2019-06-26 14:29:24 +02:00
parent 7dae1d826e
commit 3f96022176
15 changed files with 505 additions and 24 deletions

View File

@@ -11,6 +11,16 @@ abstract class ClubsHelperParts
*/
abstract protected function getPartName();
/**
* @var int
*/
protected $id;
public function __construct($id = null)
{
$this->id = $id;
}
/**
* @return string
*/
@@ -18,11 +28,16 @@ abstract class ClubsHelperParts
{
$partname = $this->getPartName();
$ret = "<form method='POST' action='index.php?option=com_clubs&task=parts.edit&format=json' class='clubs-part'>";
$ret = "<form method='POST' action='index.php?option=com_clubs&task=parts.edit&format=json' class='clubs-part'>";
$ret .= "<input type='hidden' name='partname' value='$partname'>";
if(isset($this->id))
$ret .= "<input type='hidden' name='id' value='{$this->id}'>";
$ret .= $this->getEditMarkup();
$ret .= '&nbsp;<a class="clubs-save" href="#"><span class="icon-ok"></span></a>&nbsp;';
$ret .= '<a class="clubs-abort" href="index.php?option=com_clubs&view=part&type='.$partname.'"><span class="icon-cancel-2"></span></a>';
$idPart = '';
if(isset($this->id))
$idPart = "&id=" . $this->id;
$ret .= '<a class="clubs-abort" href="index.php?option=com_clubs&view=part&type='.$partname.$idPart.'"><span class="icon-cancel-2"></span></a>';
$ret .= '</form>';
return $ret;
@@ -54,12 +69,19 @@ abstract class ClubsHelperParts
*/
public function getViewPart()
{
$ret = '';
$idPart = '';
if(isset($this->id))
$idPart = "&id={$this->id}";
$ret = "<a class='clubs-edit' href='index.php?option=com_clubs&view=part&mode=edit&type=" . $this->getPartName(). "'>";
$ret = "<a class='clubs-edit' href='index.php?option=com_clubs&view=part&mode=edit&type=" . $this->getPartName(). "$idPart'>";
$ret .= $this->getViewContent();
$ret .= "<span class='icon-apply clubs-hidden edit-icon' style='font-size: 200%; margin-left: 0.75em;'></span></a>";
$ret .= "<span class='icon-apply clubs-hidden edit-icon' style='font-size: {$this->getEditSymbolSize()}; margin-left: 0.75em; margin-right: 0.4em; '></span></a>";
return $ret;
}
protected function getEditSymbolSize()
{
return '120%';
}
}