Started writing code for views
This commit is contained in:
19
src/site/controllers/user.php
Normal file
19
src/site/controllers/user.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\Controller\BaseController;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsControllerUser extends BaseController
|
||||
{
|
||||
public function savepwd()
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
|
||||
public function savedata()
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
}
|
||||
14
src/site/css/clubs.css
Normal file
14
src/site/css/clubs.css
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
.clubs_content_row
|
||||
{
|
||||
margin-left: 2em;
|
||||
}
|
||||
.clubs_title_row
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
.clubs_row
|
||||
{
|
||||
margin: 10px 0px;
|
||||
}
|
||||
34
src/site/views/club/tmpl/default.php
Normal file
34
src/site/views/club/tmpl/default.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $this->clubname; ?></h1>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Adresse</div>
|
||||
<div class='clubs_content_row'><?php echo nl2br(htmlentities($this->address)); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Kontaktperson</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->contactperson); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Mail-Adresse</div>
|
||||
<div class='clubs_content_row'><a href='mailto:<?php echo htmlentities($this->email); ?>'><?php echo htmlentities($this->email); ?></a></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Telefon</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->phone); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Assoziierte Personen</div>
|
||||
<!-- FIXME <div class='clubs_content_row'><?php echo htmlentities($this->phone); ?></div>-->
|
||||
</div>
|
||||
|
||||
26
src/site/views/club/view.html.php
Normal file
26
src/site/views/club/view.html.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewClub extends HtmlView
|
||||
{
|
||||
|
||||
public function display(string $tpl = null)
|
||||
{
|
||||
// FIXME Insert code from DB
|
||||
$this->clubname = "Testclub";
|
||||
$this->address = "Strasse 1\n66123 Ort";
|
||||
$this->contactperson = "Max Mustermann";
|
||||
$this->email = "me@club.de";
|
||||
$this->phone = "012345";
|
||||
|
||||
Factory::getDocument()->addStyleSheet(Uri::base(true) . "components/com_clubs/css/clubs.css");
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
@@ -4,4 +4,7 @@
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
asd
|
||||
|
||||
<pre>
|
||||
Ort Verein Adresse Ansprechpartner Email
|
||||
</pre>
|
||||
|
||||
16
src/site/views/myclubs/tmpl/default.php
Normal file
16
src/site/views/myclubs/tmpl/default.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($this->clubs as $c) {
|
||||
?>
|
||||
<li><a href='?option=com_clubs&view=club&clubid=<?php echo $c['id']; ?>'><?php echo htmlentities($c['name']); ?></a></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
30
src/site/views/myclubs/view.html.php
Normal file
30
src/site/views/myclubs/view.html.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewMyClubs extends HtmlView
|
||||
{
|
||||
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// FIXME
|
||||
$this->clubs = array();
|
||||
|
||||
$c = array();
|
||||
$c['name'] = "Ein Test-Club";
|
||||
$c['city'] = "Saarbrücken";
|
||||
$c['id'] = 2;
|
||||
$this->clubs[] = $c;
|
||||
|
||||
$c = array();
|
||||
$c['name'] = "Ein zweiter Test-Club";
|
||||
$c['city'] = "Saarlouis";
|
||||
$c['id'] = 4;
|
||||
$this->clubs[] = $c;
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
36
src/site/views/user/tmpl/default.php
Normal file
36
src/site/views/user/tmpl/default.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Name</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->username); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Addresse</div>
|
||||
<div class='clubs_content_row'><?php echo nl2br(htmlentities($this->address)); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Haupt-Email</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->mail); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Telefon</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->phone); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Handy</div>
|
||||
<div class='clubs_content_row'><?php echo htmlentities($this->mobile); ?></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<a href="?option=com_clubs&view=userdata&id=<?php echo $this->id; ?>">Daten anpassen</a><br />
|
||||
<a href="?option=com_clubs&view=userpwd&id=<?php echo $this->id; ?>">Passwort ändern</a>
|
||||
</div>
|
||||
25
src/site/views/user/view.html.php
Normal file
25
src/site/views/user/view.html.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewUser extends HtmlView
|
||||
{
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// FIXME
|
||||
$this->id = 1;
|
||||
$this->username = "Max Mustermann";
|
||||
$this->address = "Strasse 3274\n66123 Saarland";
|
||||
$this->mail = "mmuster@mail.de";
|
||||
$this->phone = "0123456";
|
||||
$this->mobile = "0178 8375";
|
||||
|
||||
Factory::getDocument()->addStyleSheet(Uri::base(true) . '/components/com_clubs/css/clubs.css');
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
37
src/site/views/userdata/tmpl/default.php
Normal file
37
src/site/views/userdata/tmpl/default.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<form action="?option=com_clubs&task=user.savedata" method="post">
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Name</div>
|
||||
<div class='clubs_content_row'><input type="text" name='name' value='<?php echo $this->username; ?>' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Addresse</div>
|
||||
<div class='clubs_content_row'><textarea rows="4" style='width:100%;'><?php echo $this->address; ?></textarea></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Haupt-Email</div>
|
||||
<div class='clubs_content_row'><input type="text" name='name' value='<?php echo $this->mail; ?>' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Telefon</div>
|
||||
<div class='clubs_content_row'><input type="text" name='name' value='<?php echo $this->phone; ?>' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Handy</div>
|
||||
<div class='clubs_content_row'><input type="text" name='name' value='<?php echo $this->mobile; ?>' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<input type="submit" value='Speichern' name='submit'>
|
||||
<input type="reset" value='Werte zurücksetzen'>
|
||||
</form>
|
||||
17
src/site/views/userdata/view.html.php
Normal file
17
src/site/views/userdata/view.html.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewUSerdata extends HtmlView
|
||||
{
|
||||
public function display(string $tpl = null)
|
||||
{
|
||||
Factory::getDocument()->addStyleSheet(Uri::base(true) . 'components/com_clubs/css/clubs.css');
|
||||
parent::display($tpl);
|
||||
}
|
||||
}
|
||||
26
src/site/views/userpwd/tmpl/default.php
Normal file
26
src/site/views/userpwd/tmpl/default.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<form action="?option=com_clubs&task=user.savepwd" method="post">
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Altes Passwort</div>
|
||||
<div class='clubs_content_row'><input type="password" name='old' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Neues Passwort</div>
|
||||
<div class='clubs_content_row'><input type="password" name='new' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<div class='clubs_row'>
|
||||
<div class='clubs_title_row'>Neues Passwort wiederholen</div>
|
||||
<div class='clubs_content_row'><input type="password" name='repeat' style='width:100%;'></div>
|
||||
</div>
|
||||
|
||||
<input type="submit" value='Speichern' name='submit'>
|
||||
</form>
|
||||
11
src/site/views/userpwd/view.html.php
Normal file
11
src/site/views/userpwd/view.html.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Joomla\CMS\MVC\View\HtmlView;
|
||||
|
||||
// No direct access.
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
class ClubsViewUserpwd extends HtmlView
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
Reference in New Issue
Block a user