diff --git a/src/com_tjvendors/site/views/vendor/tmpl/edit.php b/src/com_tjvendors/site/views/vendor/tmpl/edit.php new file mode 100644 index 0000000..e98fb70 --- /dev/null +++ b/src/com_tjvendors/site/views/vendor/tmpl/edit.php @@ -0,0 +1,16 @@ + + * @copyright Copyright (C) 2024 Techjoomla. All rights reserved. + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + */ + +// Do not allow direct access +defined('_JEXEC') or die('Restricted access'); + +$bsVersion = (JVERSION >= '4.0.0') ? 'bs5' : 'bs3'; + +echo $this->loadTemplate($bsVersion); diff --git a/src/com_tjvendors/site/views/vendor/tmpl/edit_bs3.php b/src/com_tjvendors/site/views/vendor/tmpl/edit_bs3.php new file mode 100644 index 0000000..b4263a6 --- /dev/null +++ b/src/com_tjvendors/site/views/vendor/tmpl/edit_bs3.php @@ -0,0 +1,177 @@ + + * @copyright Copyright (C) 2024 Techjoomla. All rights reserved. + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL + */ + +// No direct access +defined('_JEXEC') or die; + +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; + +HTMLHelper::addIncludePath(JPATH_COMPONENT . '/helpers/html'); +HTMLHelper::_('bootstrap.tooltip'); +HTMLHelper::_('behavior.formvalidator'); +HTMLHelper::_('formbehavior.chosen', 'select'); +HTMLHelper::_('behavior.keepalive'); +HTMLHelper::script(Uri::root(true) . '/libraries/techjoomla/assets/js/tjvalidator.js'); + +$script = array(); +$script[] = 'var layout = "edit"'; +$script[] = 'let CommonObj = new tjvendor.UI.CommonUI();'; +$script[] = 'var _URL = window.URL || window.webkitURL;'; +$script[] = 'var allowedMediaSizeErrorMessage = "' . Text::_("COM_TJVENDORS_VENDOR_LOGO_SIZE_VALIDATE") . $this->params->get("image_size") . "KB" . '"'; +$script[] = 'var allowedImageDimensionErrorMessage = "' . Text::_("COM_TJVENDORS_VENDOR_LOGO_DIMENSIONS_VALIDATE") . '"'; +$script[] = 'var allowedImageTypeErrorMessage = "' . Text::_("COM_TJVENDORS_VENDOR_LOGO_IMAGE_TYPE_VALIDATION") . '"'; +$script[] = 'const vendorAllowedMediaSize = "' . $max_images_size = $this->params->get("image_size") * 1024 . '"'; +$script[] = 'var country = "' . $this->vendor->country . '"'; +$script[] = 'var region = "' . $this->vendor->region . '"'; +$script[] = 'var city = "' . $this->vendor->city . '"'; +$script[] = 'tjVSite.vendor.initVendorJs();'; + +Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); +?> +