Removed unneeded part class

This commit is contained in:
Christian Wolf 2019-06-27 16:35:48 +02:00
parent b61df340e8
commit 2bdf581ba1

View File

@ -1,75 +0,0 @@
<?php
// No direct access.
defined('_JEXEC') or die;
class ClubsPartClubPlaces extends ClubsHelperParts
{
protected function getPartName()
{
return 'club.places';
}
protected function getEditContent()
{
throw new Exception();
}
protected function getEditMarkup()
{
$ret = '';
$factory = new CommonClubsModelFactoryClub();
$club = $factory->loadById($this->id);
$offers = $club->getOffers();
$first = true;
foreach($offers as $o)
{
if(!$first)
$ret .= '<br />';
$checked = $o['valid'] ? ' checked' : '';
$ret .= "<input type='checkbox' name='offers[]' value='{$o['offer']->getId()}'$checked>";
$ret .= htmlentities($o['offer']->getName());
$first = false;
}
return $ret;
}
protected function getViewContent()
{
$ret = '';
$factory = new CommonClubsModelFactoryClub();
$club = $factory->loadById($this->id);
$places = $club->getPlaces();
$hasPlaces = count($places) > 0;
foreach($places as $p)
{
$ret .= "<div class='clubs_content_row'><b>";
$ret .= htmlentities($p->getName());
$ret .= "</b><br /><i>";
$ret .= 'Adresse';
$ret .= "</i>";
if($p->getArea() !== null)
$ret .= '<br />Fl&auml;che: ' . htmlentities($p->getArea()) . 'qm';
$ret .= "</div>\n";
}
if(! $hasPlaces)
{
// Reset to info string
$ret = '<i>Der Verein hat keine R&auml;ume eingetragen.</i>';
}
return $ret;
}
}