diff --git a/admin/models/fields/tvoTeams.php b/admin/models/fields/tvoteam.php similarity index 65% rename from admin/models/fields/tvoTeams.php rename to admin/models/fields/tvoteam.php index c5bbf0a..d69ab04 100644 --- a/admin/models/fields/tvoTeams.php +++ b/admin/models/fields/tvoteam.php @@ -1,7 +1,7 @@ getQuery(true); - $query->select('id,teamId,title,published'); - $query->from('#__tvo_teams'); + $query->select('id,greeting'); + $query->from('#__helloworld'); $db->setQuery((string) $query); - $teams = $db->loadObjectList(); + $messages = $db->loadObjectList(); $options = array(); - if ($teams) { - foreach ($teams as $team) + if ($messages) + { + foreach ($messages as $message) { - $options[] = JHtml::_('select.option', $team->teamId, $team->title, $team->published); + $options[] = JHtml::_('select.option', $message->id, $message->greeting); } } diff --git a/admin/sql/install.mysql.utf8mb4.sql b/admin/sql/install.mysql.utf8mb4.sql index 6beb131..4341f06 100644 --- a/admin/sql/install.mysql.utf8mb4.sql +++ b/admin/sql/install.mysql.utf8mb4.sql @@ -1,16 +1,13 @@ -DROP TABLE IF EXISTS `#__tvo_teams`; +DROP TABLE IF EXISTS `#__helloworld`; -CREATE TABLE `#__tvo_teams` ( +CREATE TABLE `#__helloworld` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `title` VARCHAR(20) NOT NULL DEFAULT 'NoNameSet', - `teamId` INT(8) NOT NULL, - `published` BOOLEAN DEFAULT FALSE, + `greeting` VARCHAR(25) NOT NULL, + `published` tinyint(4) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) -ENGINE=InnoDB -DEFAULT CHARSET=utf8mb4 -DEFAULT COLLATE=utf8mb4_unicode_ci; +ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; -INSERT INTO `#__tvo_teams` (`teamId`, `title`) VALUES -('123456', 'Testteam01'), -('234567', 'Testteam02'); +INSERT INTO `#__helloworld` (`greeting`) VALUES +('Hello beautiful World!'), +('Good bye awful World!'); diff --git a/admin/sql/uninstall.mysql.utf8mb4.sql b/admin/sql/uninstall.mysql.utf8mb4.sql index b502dba..a789263 100644 --- a/admin/sql/uninstall.mysql.utf8mb4.sql +++ b/admin/sql/uninstall.mysql.utf8mb4.sql @@ -1 +1 @@ -DROP TABLE IF EXISTS `#__tvo_teams`; +DROP TABLE IF EXISTS `#__helloworld`; diff --git a/admin/sql/updates/mysql/0.0.8.sql b/admin/sql/updates/mysql/0.0.8.sql index 6beb131..4341f06 100644 --- a/admin/sql/updates/mysql/0.0.8.sql +++ b/admin/sql/updates/mysql/0.0.8.sql @@ -1,16 +1,13 @@ -DROP TABLE IF EXISTS `#__tvo_teams`; +DROP TABLE IF EXISTS `#__helloworld`; -CREATE TABLE `#__tvo_teams` ( +CREATE TABLE `#__helloworld` ( `id` INT(11) NOT NULL AUTO_INCREMENT, - `title` VARCHAR(20) NOT NULL DEFAULT 'NoNameSet', - `teamId` INT(8) NOT NULL, - `published` BOOLEAN DEFAULT FALSE, + `greeting` VARCHAR(25) NOT NULL, + `published` tinyint(4) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) -ENGINE=InnoDB -DEFAULT CHARSET=utf8mb4 -DEFAULT COLLATE=utf8mb4_unicode_ci; +ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; -INSERT INTO `#__tvo_teams` (`teamId`, `title`) VALUES -('123456', 'Testteam01'), -('234567', 'Testteam02'); +INSERT INTO `#__helloworld` (`greeting`) VALUES +('Hello beautiful World!'), +('Good bye awful World!'); diff --git a/admin/tables/tvoTable.php b/admin/tables/tvoteam.php similarity index 84% rename from admin/tables/tvoTable.php rename to admin/tables/tvoteam.php index 577bc23..dbff919 100644 --- a/admin/tables/tvoTable.php +++ b/admin/tables/tvoteam.php @@ -14,7 +14,7 @@ * * @since 0.0.1 */ -class TvoTableTvoTeams extends JTable +class TvoTableTvoTeam extends JTable { /** * Constructor @@ -23,6 +23,6 @@ class TvoTableTvoTeams extends JTable */ function __construct(&$db) { - parent::__construct('#__tvo_teams', 'id', $db); + parent::__construct('#__helloworld', 'id', $db); } } diff --git a/site/models/tvo.php b/site/models/tvo.php index 2003159..90e929c 100644 --- a/site/models/tvo.php +++ b/site/models/tvo.php @@ -11,11 +11,12 @@ defined('_JEXEC') or die('Restricted access'); /** - * Tvo Model + * HelloWorld Model * * @since 0.0.1 */ -class TvoModelTvo extends JModelItem { +class TvoModelTvo extends JModelItem +{ /** * @var array messages */ @@ -32,7 +33,7 @@ class TvoModelTvo extends JModelItem { * * @since 1.6 */ - public function getTable($type = 'tvoTeam', $prefix = 'TvoTable', $config = array()) + public function getTable($type = 'TvoTeam', $prefix = 'TvoTable', $config = array()) { return JTable::getInstance($type, $prefix, $config); } @@ -64,11 +65,9 @@ public function getMsg($id = 1) $table->load($id); // Assign the message - $this->messages[$id] = $table->title; + $this->messages[$id] = $table->greeting; } return $this->messages[$id]; } - - } diff --git a/site/views/tvo/tmpl/default.xml b/site/views/tvo/tmpl/default.xml index 7e32bf6..047c3e1 100644 --- a/site/views/tvo/tmpl/default.xml +++ b/site/views/tvo/tmpl/default.xml @@ -5,12 +5,12 @@
diff --git a/tvo.xml b/tvo.xml index b36627e..c93fcca 100644 --- a/tvo.xml +++ b/tvo.xml @@ -16,12 +16,12 @@ - sql/install.mysql.utf8mb4.sql + sql/install.mysql.utf8mb4.sql - sql/uninstall.mysql.utf8mb4.sql + sql/uninstall.mysql.utf8mb4.sql diff --git a/updates.xml b/updates.xml index 87c3019..ec46ad5 100644 --- a/updates.xml +++ b/updates.xml @@ -5,7 +5,7 @@ com_tvo component 0.0.9 - administrator + 0