Removed unneeded part class
This commit is contained in:
parent
b61df340e8
commit
2bdf581ba1
@ -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äche: ' . htmlentities($p->getArea()) . 'qm';
|
||||
$ret .= "</div>\n";
|
||||
}
|
||||
|
||||
|
||||
if(! $hasPlaces)
|
||||
{
|
||||
// Reset to info string
|
||||
$ret = '<i>Der Verein hat keine Räume eingetragen.</i>';
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user