-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized views
einzelteam
and teamliste
- Loading branch information
Showing
14 changed files
with
671 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<?php | ||
// Check to ensure this file is included in Joomla! | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
JFormHelper::loadFieldClass('list'); | ||
|
||
|
||
|
||
|
||
// ###################################### | ||
// ############## DROPDOWN ############ | ||
|
||
// // Liefert ein Dropdown-Feld zur Auswahl eines EINZELNEN Teams | ||
// class JFormFieldListOfAllTeams extends JFormFieldList { | ||
// | ||
// protected $type = 'listOfAllTeams'; | ||
// | ||
// public function getOptions() { | ||
// $db = JFactory::getDBO(); | ||
// $query = $db->getQuery(true); | ||
// $query->select('id, title'); | ||
// $query->from('#__tvo_teams'); | ||
// $db->setQuery((string) $query); | ||
// $teams = $db->loadObjectList(); | ||
// $options = array(); | ||
// | ||
// foreach ($teams as $team) { | ||
// $options[] = JHtml::_('select.option', $team->id, $team->title); | ||
// } | ||
// | ||
// $options = array_merge(parent::getOptions(), $options); | ||
// return $options; | ||
// } | ||
// } | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// jimport('joomla.form.helper'); | ||
// JFormHelper::loadFieldClass('Radio'); | ||
// | ||
// class JFormFieldListOfAllTeams extends JFormFieldRadio { | ||
// | ||
// public function varDump($var) | ||
// { | ||
// echo '<pre>'; | ||
// var_dump($var); | ||
// echo '</pre>'; | ||
// return; | ||
// } | ||
// | ||
// //The field class must know its own type through the variable $type. | ||
// protected $type = 'listOfAllTeams'; | ||
// | ||
// public function getLabel() { | ||
// // code that returns HTML that will be shown as the label | ||
// return 'Teams'; | ||
// } | ||
// | ||
// | ||
// public function getInput() { | ||
// // code that returns HTML that will be shown as the form field | ||
// $db = JFactory::getDBO(); | ||
// $query = $db->getQuery(true); | ||
// $query->select('id, title'); | ||
// $query->from('#__tvo_teams'); | ||
// $db->setQuery((string) $query); | ||
// $teams = $db->loadObjectList(); | ||
// $options = array(); | ||
// | ||
// if ($teams) { | ||
// foreach ($teams as $team) { | ||
// $options[] = JHtml::_('select.option', $team->id, $team->title); | ||
// } | ||
// } | ||
// | ||
// $options = array_merge(parent::getOptions(), $options); | ||
// | ||
// | ||
// return '<fieldset id="team1" class="btn-group btn-group-yesno radio"> | ||
// <input type="radio" id="team1_show0" name="teamsList[show]" value="1"> | ||
// <label for="team1_show0" class="btn active btn-success">Anzeigen</label> | ||
// | ||
// <input type="radio" id="team1_show1" name="teamsList[show]" value="0"> | ||
// <label for="team1_show1" class="btn">Verbergen</label> | ||
// </fieldset>'; | ||
// | ||
// } | ||
// } | ||
|
||
|
||
|
||
|
||
|
||
|
||
// //###################################### | ||
// //############## CHECKBOXES ############ | ||
// | ||
// | ||
// jimport('joomla.form.helper'); | ||
// JFormHelper::loadFieldClass('Checkboxes'); | ||
// | ||
// | ||
// | ||
// class JFormFieldListOfAllTeams extends JFormFieldCheckboxes { | ||
// public function getOptions() { | ||
// $db = JFactory::getDBO(); | ||
// $query = $db->getQuery(true); | ||
// $query->select('id, title'); | ||
// $query->from('#__tvo_teams'); | ||
// $db->setQuery((string) $query); | ||
// $teams = $db->loadObjectList(); | ||
// $options = array(); | ||
// | ||
// foreach ($teams as $team) { | ||
// $options[] = JHtml::_('select.option', $team->id, $team->title); | ||
// } | ||
// | ||
// $options = array_merge(parent::getOptions(), $options); | ||
// return $options; | ||
// } | ||
// } | ||
|
||
|
||
|
||
|
||
|
||
//############################################## | ||
//############## MULTI CHOICE (TAGS) ############ | ||
|
||
jimport('joomla.form.helper'); | ||
JFormHelper::loadFieldClass('Tag'); | ||
|
||
// $getInput = JFormHelper::loadFieldType('Tag', false); | ||
// $taginput = $tags->getInput(); | ||
|
||
|
||
class JFormFieldListOfAllTeams extends JFormFieldTag { | ||
|
||
// protected $type = 'ListOfAllTeams'; // this line causes unknown error while loading page | ||
|
||
public function getOptions() { | ||
$db = JFactory::getDBO(); | ||
$query = $db->getQuery(true); | ||
$query->select('id, title'); | ||
$query->from('#__tvo_teams'); | ||
$query->where('published = 1'); | ||
$db->setQuery((string) $query); | ||
$teams = $db->loadObjectList(); | ||
$options = array(); | ||
|
||
foreach ($teams as $team) { | ||
$options[] = JHtml::_('select.option', $team->id, $team->title); | ||
} | ||
|
||
|
||
return $options; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_tvo | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* HelloWorldList Model | ||
* | ||
* @since 0.0.1 | ||
*/ | ||
class TvoModelTvo extends JModelList | ||
{ | ||
/** | ||
* Method to build an SQL query to load the list data. | ||
* | ||
* @return string An SQL query | ||
*/ | ||
protected function getListQuery() | ||
{ | ||
// Initialize variables. | ||
$db = JFactory::getDbo(); | ||
$query = $db->getQuery(true); | ||
|
||
// Create the base select statement. | ||
$query->select('*') | ||
->from($db->quoteName('#__tvo_teams')); | ||
|
||
return $query; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Administrator | ||
* @subpackage com_tvo | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
// No direct access to this file | ||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
/** | ||
* HelloWorldList Model | ||
* | ||
* @since 0.0.1 | ||
*/ | ||
class TvoModelTvoTeamsList extends JModelList | ||
{ | ||
/** | ||
* Method to build an SQL query to load the list data. | ||
* | ||
* @return string An SQL query | ||
*/ | ||
protected function getListQuery() | ||
{ | ||
// Initialize variables. | ||
$db = JFactory::getDbo(); | ||
$query = $db->getQuery(true); | ||
|
||
// Create the base select statement. | ||
$query->select('*') | ||
->from($db->quoteName('#__tvo_teams')); | ||
|
||
return $query; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.