List views updated to new structure

This commit is contained in:
Christian Wolf 2019-06-03 11:59:36 +02:00
parent 904d31843a
commit eb704af915
7 changed files with 55 additions and 42 deletions

View File

@ -7,7 +7,7 @@ class CommonClubsModelPosition extends AbstractCommonClubsModel
{ {
protected function getFactory() protected function getFactory()
{ {
new CommonClubsModelFactoryPosition(); return new CommonClubsModelFactoryPosition();
} }
public function getName() public function getName()

View File

@ -1,7 +1,6 @@
<?php <?php
// No direct access. // No direct access.
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@ -11,26 +10,25 @@ defined('_JEXEC') or die;
<thead> <thead>
<tr> <tr>
<th width='30%'>Bezeichnung</th> <th width='30%'>Bezeichnung</th>
<th width='25%'>Stadt</th> <th width='20%'>Stadt</th>
<th width='20%'>Homepage</th> <th width='20%'>Homepage</th>
<th width='25%'>E-Mail</th> <th width='20%'>E-Mail</th>
<th width='5%'>L&ouml;schen?</th> <th width='10%'></th>
<th width='5%'>id</th> <th width='3%'>id</th>
</tr> </tr>
</thead> </thead>
<?php foreach($this->clubs as $club): ?> <?php foreach($this->objects as $club): ?>
<?php $link = Route::_('index.php?option=com_clubs&view=club&id=' . $club->getId()); ?>
<?php $url = htmlentities($club->getHomepage()); ?> <?php $url = htmlentities($club->getHomepage()); ?>
<?php $mail = htmlentities($club->getMail()); ?> <?php $mail = htmlentities($club->getMail()); ?>
<tr> <tr>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($club->getName()); ?></a></td> <td><a href='<?php echo str_replace('__ID__', $club->getId(), $this->changeUrl); ?>'><?php echo htmlentities($club->getName()); ?></a></td>
<td><?php echo htmlentities($club->getCity()); ?></td> <td><?php echo htmlentities($club->getCity()); ?></td>
<td><a href='<?php echo $url; ?>' target='_blank'><?php echo $url; ?></a></td> <td><a href='<?php echo $url; ?>' target='_blank'><?php echo $url; ?></a></td>
<td><a href='mailto:<?php echo $mail; ?>'><?php echo $mail; ?></a></td> <td><a href='mailto:<?php echo $mail; ?>'><?php echo $mail; ?></a></td>
<td><!--<a href='<?php echo Route::_('index.php?option=com_clubs&task=club.delete&id=' . $club->getId()); ?>'>Del</a> --></td> <td><a href='<?php echo str_replace('__ID__', $club->getId(), $this->delUrl); ?>'><span class='icon-delete'></span>L&ouml;schen</a></td>
<td><?php echo htmlentities($club->getId()); ?></td> <td><?php echo htmlentities($club->getId()); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<div><a href='<?php echo Route::_('index.php?option=com_clubs&view=club&id=new'); ?>'>Neuen Verein anlegen</a></div> <div><a href='<?php echo $this->addUrl; ?>'><span class='icon-new'></span>Neuen Verein anlegen</a></div>

View File

@ -1,22 +1,27 @@
<?php <?php
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Toolbar\ToolbarHelper;
// No direct access. // No direct access.
defined('_JEXEC') or die; defined('_JEXEC') or die;
class ClubsViewClubs extends HtmlView class ClubsViewClubs extends AbstractClubsViewList
{ {
function display($tpl = null) function display($tpl = null)
{ {
// $this->offers = ClubsOffer::loadOffers(); ToolbarHelper::title('Club-Management - Clubs', 'cube');
$factory = new CommonClubsModelFactoryClub();
$this->clubs = $factory->loadElements();
ToolbarHelper::title('Club-Management - Clubs');
parent::display($tpl); parent::display($tpl);
} }
protected function getFactory()
{
return new CommonClubsModelFactoryClub();
}
protected function getSingleBaseName()
{
return 'club';
}
} }

View File

@ -1,7 +1,6 @@
<?php <?php
// No direct access. // No direct access.
use Joomla\CMS\Router\Route;
defined('_JEXEC') or die; defined('_JEXEC') or die;
@ -11,18 +10,17 @@ defined('_JEXEC') or die;
<thead> <thead>
<tr> <tr>
<th width='30%'>Bezeichnung</th> <th width='30%'>Bezeichnung</th>
<th width='5%'>L&ouml;schen?</th> <th width='5%'></th>
<th width='5%'>id</th> <th width='5%'>id</th>
</tr> </tr>
</thead> </thead>
<?php foreach($this->positions as $position): ?> <?php foreach($this->objects as $position): ?>
<?php $link = Route::_('index.php?option=com_clubs&view=position&id=' . $position->getId()); ?>
<tr> <tr>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($position->getName()); ?></a></td> <td><a href='<?php echo str_replace('__ID__', $position->getId(), $this->changeUrl); ?>'><?php echo htmlentities($position->getName()); ?></a></td>
<td><a href='<?php echo Route::_('index.php?option=com_clubs&task=position.delete&id=' . $position->getId()); ?>'>Del</a></td> <td><a href='<?php echo str_replace('__ID__', $position->getId(), $this->delUrl); ?>'><span class='icon-delete'></span>L&ouml;schen</a></td>
<td><?php echo htmlentities($position->getId()); ?></td> <td><?php echo htmlentities($position->getId()); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<div><a href='<?php echo Route::_('index.php?option=com_clubs&view=position&id=new'); ?>'>Neuen Posten anlegen</a></div> <div><a href='<?php echo $this->addUrl; ?>'><span class='icon-new'></span>Neuen Posten anlegen</a></div>

View File

@ -1,20 +1,27 @@
<?php <?php
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Toolbar\ToolbarHelper;
// No direct access. // No direct access.
defined('_JEXEC') or die; defined('_JEXEC') or die;
class ClubsViewPositions extends HtmlView class ClubsViewPositions extends AbstractClubsViewList
{ {
function display($tpl = null) function display($tpl = null)
{ {
$this->positions = ClubsPosition::loadPositions(); ToolbarHelper::title('Club-Management - Positionen', 'users');
ToolbarHelper::title('Club-Management - Positionen');
parent::display($tpl); parent::display($tpl);
} }
protected function getFactory()
{
return new CommonClubsModelFactoryPosition();
}
protected function getSingleBaseName()
{
return 'position';
}
} }

View File

@ -14,22 +14,22 @@ defined('_JEXEC') or die;
<th width='20%'>Name</th> <th width='20%'>Name</th>
<th width='30%'>Ort</th> <th width='30%'>Ort</th>
<th width='30%'>E-Mail</th> <th width='30%'>E-Mail</th>
<th width='5%'>L&ouml;schen?</th> <th width='5%'></th>
<th width='5%'>id</th> <th width='5%'>id</th>
</tr> </tr>
</thead> </thead>
<?php foreach($this->users as $user): ?> <?php foreach($this->objects as $user): ?>
<?php $link = Route::_('index.php?option=com_clubs&view=user&id=' . $user->getId()); ?> <?php $link = str_replace('__ID__', $user->getId(), $this->changeUrl); ?>
<tr> <tr>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($user->getUser()); ?></a></td> <td><a href='<?php echo $link; ?>'><?php echo htmlentities($user->getUserName()); ?></a></td>
<td><a href='<?php echo $link; ?>'><?php echo htmlentities($user->getName()); ?></a></td> <td><a href='<?php echo $link; ?>'><?php echo htmlentities($user->getName()); ?></a></td>
<td><?php echo htmlentities($user->getCity()); ?></td> <td><?php echo htmlentities($user->getCity()); ?></td>
<td><a href='mailto:<?php echo htmlentities($user->getMail()); ?>'><?php echo htmlentities($user->getMail()); ?></a></td> <td><a href='mailto:<?php echo htmlentities($user->getMail()); ?>'><?php echo htmlentities($user->getMail()); ?></a></td>
<td><a href='<?php echo Route::_('index.php?option=com_clubs&task=user.delete&id=' . $user->getId()); ?>'>Del</a></td> <td><a href='<?php echo str_replace('__ID__', $user->getId(), $this->delUrl); ?>'><span class='icon-delete'></span>L&ouml;schen</a></td>
<td><?php echo htmlentities($user->getId()); ?></td> <td><?php echo htmlentities($user->getId()); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<div><a href='<?php echo Route::_('index.php?option=com_clubs&view=user&id=new'); ?>'>Neuen Benutzer anlegen</a></div> <div><a href='<?php echo $this->addUrl; ?>'><span class='icon-new'></span>Neuen Benutzer anlegen</a></div>

View File

@ -1,22 +1,27 @@
<?php <?php
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Toolbar\ToolbarHelper;
// No direct access. // No direct access.
defined('_JEXEC') or die; defined('_JEXEC') or die;
// JLoader::register("ClubsModelUser", JPATH_ROOT . "/administrator/components/com_clubs/models/user.php"); class ClubsViewUsers extends AbstractClubsViewList
class ClubsViewUsers extends HtmlView
{ {
function display($tpl = null) function display($tpl = null)
{ {
$this->users = ClubsUser::loadUsers();
ToolbarHelper::title('Club-Management - Personen', 'user'); ToolbarHelper::title('Club-Management - Personen', 'user');
parent::display($tpl); parent::display($tpl);
} }
protected function getFactory()
{
return new CommonClubsModelFactoryUser();
}
protected function getSingleBaseName()
{
return 'user';
}
} }