Hierarchy Fix
This commit is contained in:
56
src/templates/html/mod_virtuemart_search/default.php
Normal file
56
src/templates/html/mod_virtuemart_search/default.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
vmJsApi::cssSite();
|
||||
?>
|
||||
|
||||
<form action="<?php echo Route::_('index.php?option=com_virtuemart&view=category&search=true&limitstart=0&virtuemart_category_id='.$category_id ); ?>" method="get">
|
||||
<div class="<?php echo $button && $button_text == vmText::_ ('MOD_VIRTUEMART_SEARCH_GO') ? 'vmbasic-search ' : ''; ?>input-group mod-vm-search<?php echo $params->get('moduleclass_sfx') ? ' ' . $params->get('moduleclass_sfx') : ''; ?>">
|
||||
<?php
|
||||
$output = '<input name="keyword" id="mod_virtuemart_search" maxlength="'.$maxlength.'" placeholder="'.$text.'" class="form-control'. $moduleclass_sfx .'" type="text" size="'.$width.'" />';
|
||||
$image = Uri::base() . $imagepath;
|
||||
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
|
||||
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
|
||||
</svg>';
|
||||
|
||||
if ($button) :
|
||||
if ($imagebutton && $imagepath) :
|
||||
$button = '<button type="submit" class="btn ' . $moduleclass_sfx . '"><img src="' . $image . '" alt="' . $button_text . '" /></button>';
|
||||
elseif ($button_text != vmText::_ ('MOD_VIRTUEMART_SEARCH_GO')) :
|
||||
$button = '<button type="submit" class="btn btn-primary ' . $moduleclass_sfx . '">' . $button_text . '</button>';
|
||||
else :
|
||||
$button = '<button type="submit" class="btn btn-svg '.$moduleclass_sfx.'">' . $svg . '</button>';
|
||||
endif;
|
||||
|
||||
switch ($button_pos) :
|
||||
case 'right' :
|
||||
$output = $output.$button;
|
||||
break;
|
||||
case 'left' :
|
||||
$output = $button.$output;
|
||||
break;
|
||||
default :
|
||||
$output = $output.$button;
|
||||
break;
|
||||
endswitch;
|
||||
endif;
|
||||
|
||||
echo $output;
|
||||
?>
|
||||
</div>
|
||||
<input type="hidden" name="limitstart" value="0" />
|
||||
<input type="hidden" name="option" value="com_virtuemart" />
|
||||
<input type="hidden" name="view" value="category" />
|
||||
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>
|
||||
<?php
|
||||
if (!empty($set_Itemid))
|
||||
{
|
||||
echo '<input type="hidden" name="Itemid" value="'.$set_Itemid.'" />';
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
89
src/templates/html/mod_virtuemart_search/index.html
Normal file
89
src/templates/html/mod_virtuemart_search/index.html
Normal file
@@ -0,0 +1,89 @@
|
||||
<!-- Copyright (C) 2025 Moko Consulting <jmiller@mokoconsulting.tech>
|
||||
|
||||
This file is part of a Moko Consulting project.
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/ .
|
||||
|
||||
# FILE INFORMATION
|
||||
DEFGROUP: Joomla.Templates.Site
|
||||
INGROUP: Moko-Cassiopeia
|
||||
FILE: index.html
|
||||
BRIEF: Security redirect page to block folder access and forward to site root.
|
||||
-->
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Redirecting…</title>
|
||||
|
||||
<!-- Search engines: do not index this placeholder redirect page -->
|
||||
<meta name="robots" content="noindex, nofollow, noarchive" />
|
||||
|
||||
<!-- Instant redirect fallback even if JavaScript is disabled -->
|
||||
<meta http-equiv="refresh" content="0; url=/" />
|
||||
|
||||
<!-- Canonical root reference -->
|
||||
<link rel="canonical" href="/" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<script>
|
||||
|
||||
(function redirectToRoot() {
|
||||
// Configuration object with safe defaults.
|
||||
var opts = {
|
||||
fallbackPath: "/", // string: fallback destination if origin is unavailable
|
||||
delayMs: 0, // number: delay before redirect in ms (0 = immediate)
|
||||
behavior: "replace" // enum: "replace" | "assign"
|
||||
};
|
||||
|
||||
// Determine absolute origin in all mainstream browsers.
|
||||
var origin = (typeof location.origin === "string" && location.origin)
|
||||
|| (location.protocol + "//" + location.host);
|
||||
|
||||
// Final destination: absolute root of the current site, or fallback path.
|
||||
var destination = origin ? origin + "/" : opts.fallbackPath;
|
||||
|
||||
function go() {
|
||||
if (opts.behavior === "assign") {
|
||||
location.assign(destination);
|
||||
} else {
|
||||
location.replace(destination);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute redirect, optionally after a short delay.
|
||||
if (opts.delayMs > 0) {
|
||||
setTimeout(go, opts.delayMs);
|
||||
} else {
|
||||
go();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!--
|
||||
Secondary meta-refresh for no-JS environments is already set above.
|
||||
Some very old crawlers may ignore JS; the meta refresh ensures coverage.
|
||||
-->
|
||||
|
||||
<noscript>
|
||||
<!-- Extra defense-in-depth: if JS is disabled, meta refresh (above) handles redirect. -->
|
||||
<style>
|
||||
html, body { height:100%; }
|
||||
body { display:flex; align-items:center; justify-content:center; margin:0; font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }
|
||||
.msg { opacity: .75; text-align: center; }
|
||||
</style>
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
<div class="msg">Redirecting to the site root… If you are not redirected, <a href="/">click here</a>.</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user