From 70e987b338fc72a5f4b579846fd05ef40dd71eac Mon Sep 17 00:00:00 2001 From: Thomas Kuschel Date: Thu, 5 Oct 2023 14:34:11 +0200 Subject: [PATCH] part.xml was in wrong folder, must be "admin/forms" --- admin/{form => forms}/part.xml | 0 admin/src/View/Part/HtmlView.php | 72 ++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 13 deletions(-) rename admin/{form => forms}/part.xml (100%) diff --git a/admin/form/part.xml b/admin/forms/part.xml similarity index 100% rename from admin/form/part.xml rename to admin/forms/part.xml diff --git a/admin/src/View/Part/HtmlView.php b/admin/src/View/Part/HtmlView.php index 62c75a9..903fc80 100644 --- a/admin/src/View/Part/HtmlView.php +++ b/admin/src/View/Part/HtmlView.php @@ -1,28 +1,74 @@ -* @copyright (C) 2023 KW4NZ, -* @license GNU General Public License version 2 or later; see LICENSE.md -* @since 0.0.3 -*/ - namespace KW4NZ\Component\Depot\Administrator\View\Part; + +defined('_JEXEC') or die; + +use Joomla\CMS\Factory; +use Joomla\CMS\Helper\ContentHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Toolbar\ToolbarHelper; -\defined('_JEDEC') or die; - +/** + * View to edit an article. + * + * @since 1.6 + */ class HtmlView extends BaseHtmlView { + /** + * The \JForm object + * + * @var \JForm + */ protected $form; + + /** + * The active item + * + * @var object + */ protected $item; + /** + * The model state + * + * @var object + */ + protected $state; + + /** + * The actions the user is authorised to perform + * + * @var \JObject + */ + protected $canDo; + + /** + * Execute and display a template script. + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return mixed A string if successful, otherwise an Error object. + * + * @throws \Exception + * @since 1.6 + */ public function display($tpl = null) { $this->form = $this->get('Form'); $this->item = $this->get('Item'); + $this->state = $this->get('State'); - parent::display($tpl); + if (count($errors = $this->get('Errors'))) { + throw new GenericDataException(implode("\n", $errors), 500); + } + + // $this->addToolbar(); + + return parent::display($tpl); } -} + +} \ No newline at end of file