Started to work on frontend code
This commit is contained in:
59
src/site/helpers/parts.php
Normal file
59
src/site/helpers/parts.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
abstract class ClubsHelperParts
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract protected function getPartName();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getEditPart()
|
||||
{
|
||||
$partname = $this->getPartName();
|
||||
|
||||
$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'>";
|
||||
$ret .= $this->getEditMarkup();
|
||||
$ret .= ' <a class="clubs-save" href="#"><span class="icon-ok"></span></a> ';
|
||||
$ret .= '<a class="clubs-abort" href="index.php?option=com_clubs&view=mypage&layout=parts&type='.$partname.'"><span class="icon-cancel-2"></span></a>';
|
||||
$ret .= '</form>';
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
abstract protected function getEditMarkup();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
abstract protected function getEditContent();
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getViewContent()
|
||||
{
|
||||
return $this->getEditContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getViewPart()
|
||||
{
|
||||
$ret = '';
|
||||
|
||||
$ret = "<a class='clubs-edit' href='index.php?option=com_clubs&view=mypage&layout=parts&mode=edit&type=" . $this->getPartName();
|
||||
$ret .= $this->getViewContent();
|
||||
$ret .= "<span class='icon-apply clubs-hidden edit-icon' style='font-size: 200%; margin-left: 0.75em;'></span></a>";
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user