try to get it work
This commit is contained in:
parent
f85556f466
commit
47796a6ada
16
admin/src/Controller/PartController.php
Normal file
16
admin/src/Controller/PartController.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Depot.Administrator
|
||||||
|
* @subpackage com_depot
|
||||||
|
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||||
|
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||||
|
* @since 0.0.3
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Joomla\CMS\MVC\Controller\FormController;
|
||||||
|
|
||||||
|
class PartController extends FormController
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
29
admin/src/Model/DepotModel.php
Normal file
29
admin/src/Model/DepotModel.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Depot.Administrator
|
||||||
|
* @subpackage com_depot
|
||||||
|
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||||
|
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||||
|
* @since 0.0.3
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace KW4NZ\Component\Depot\Administrator\Model;
|
||||||
|
|
||||||
|
use Joomla\CMS\MVC\Model\AdminModel;
|
||||||
|
|
||||||
|
\defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
class DepotModel extends AdminModel
|
||||||
|
{
|
||||||
|
public function getForm($data = [], $loadData = true)
|
||||||
|
{
|
||||||
|
$form = $this->loadForm('com_depot.part', 'part', ['control' => 'jform', 'load_data' => $loadData]);
|
||||||
|
|
||||||
|
if (empty($form)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $form;
|
||||||
|
}
|
||||||
|
}
|
24
admin/src/Table/DepotTable.php
Normal file
24
admin/src/Table/DepotTable.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Depot.Administrator
|
||||||
|
* @subpackage com_depot
|
||||||
|
* @author Thomas Kuschel <thomas@kuschel.at>
|
||||||
|
* @copyright (C) 2023 KW4NZ, <https://www.kuschel.at>
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.md
|
||||||
|
* @since 0.0.2
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace KW4NZ\Component\Depot\Administrator\Table;
|
||||||
|
|
||||||
|
use Joomla\CMS\Table\Table;
|
||||||
|
use Joomla\Database\DatabaseDriver;
|
||||||
|
|
||||||
|
\defined('_JEXEC') or die;
|
||||||
|
|
||||||
|
class DepotTable extends Table
|
||||||
|
{
|
||||||
|
function __construct(DatabaseDriver $db)
|
||||||
|
{
|
||||||
|
parent::__construct('#__depot', 'id', $db);
|
||||||
|
}
|
||||||
|
}
|
1
admin/tmpl/part/default.php
Normal file
1
admin/tmpl/part/default.php
Normal file
@ -0,0 +1 @@
|
|||||||
|
<h2>Welcome to my Depot Component - part!</h2>
|
@ -8,17 +8,20 @@
|
|||||||
* @since 0.0.3
|
* @since 0.0.3
|
||||||
*/
|
*/
|
||||||
use Joomla\CMS\HTML\HTMLHelper;
|
use Joomla\CMS\HTML\HTMLHelper;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
|
||||||
$wa = $this->document->getWebAssetManager();
|
//$wa = $this->document->getWebAssetManager();
|
||||||
|
//$wa->useScript('keepalive');
|
||||||
|
//$wa->useScript('form.validate');
|
||||||
|
HTMLHelper::('behavior.formvalidator');
|
||||||
|
HTMLHelper::('behavior.keepalive');
|
||||||
|
|
||||||
$wa->useScript('keepalive');
|
|
||||||
$wa->useScript('form.validate');
|
|
||||||
?>
|
?>
|
||||||
<form action="<?php echo Route::_('index.php?option=com_depot&layout=edit&id=' . (int) $this->item->id); ?>"
|
<form action="<?php echo Route::_('index.php?option=com_depot&view=part&layout=edit&id=' . (int) $this->item->id); ?>"
|
||||||
method="post" name="adminForm" id="item-form" class="form-validate">
|
method="post" name="adminForm" id="item-form" class="form-validate">
|
||||||
|
|
||||||
<?php echo $this->form->renderField('component_name'); ?>
|
<?php echo $this->form->renderField('titel'); ?>
|
||||||
|
|
||||||
<input type="hidden" name="task" value="part.edit" />
|
<input type="hidden" name="task" value="part.edit" />
|
||||||
<?= HTMLHelper::_('form.token'); ?>
|
<?php echo HTMLHelper::_('form.token'); ?>
|
||||||
</form>
|
</form>
|
||||||
|
@ -9,3 +9,4 @@
|
|||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
<h2>Welcome to my Depot Component!</h2>
|
<h2>Welcome to my Depot Component!</h2>
|
||||||
|
Link: <a href="index.php?option=com_depot&view=part&layout=edit">Part</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user