Reset
This commit is contained in:
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2012 - 2025 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Toolbar\Toolbar;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
HTMLHelper::_('formbehavior.chosen', 'select');
|
||||
|
||||
$bootstrapHelper = OSMembershipHelperBootstrap::getInstance();
|
||||
$centerClass = $bootstrapHelper->getClassMapping('center');
|
||||
$cols = 10;
|
||||
$config = OSMembershipHelper::getConfig();
|
||||
?>
|
||||
<div id="osm-manage-plans" class="osm-container osm-container-j4">
|
||||
<?php
|
||||
if ($this->params->get('show_page_heading', 1))
|
||||
{
|
||||
if ($this->input->getInt('hmvc_call'))
|
||||
{
|
||||
$hTag = 'h2';
|
||||
}
|
||||
else
|
||||
{
|
||||
$hTag = 'h1';
|
||||
}
|
||||
?>
|
||||
<<?php echo $hTag; ?> class="osm-heading"><?php echo Text::_('OSM_MANAGE_PLANS'); ?></<?php echo $hTag; ?>>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (OSMembershipHelper::isValidMessage($this->params->get('intro_text')))
|
||||
{
|
||||
?>
|
||||
<div class="osm-description osm-page-intro-text <?php echo $this->bootstrapHelper->getClassMapping('clearfix'); ?>">
|
||||
<?php echo HTMLHelper::_('content.prepare', $this->params->get('intro_text')); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="btn-toolbar" id="btn-toolbar">
|
||||
<?php echo Toolbar::getInstance('toolbar')->render(); ?>
|
||||
</div>
|
||||
<form action="<?php echo Route::_('index.php?option=com_osmembership&view=mplans&Itemid=' . $this->Itemid, false); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="filters btn-toolbar clearfix mt-2 mb-2">
|
||||
<?php echo $this->loadTemplate('search_bar'); ?>
|
||||
</div>
|
||||
<table class="<?php echo $bootstrapHelper->getClassMapping('table table-striped table-bordered table-hover'); ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20">
|
||||
<?php echo HTMLHelper::_('grid.checkall'); ?>
|
||||
</th>
|
||||
<th class="title">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_TITLE'), 'tbl.title', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<?php
|
||||
if ($this->showCategory)
|
||||
{
|
||||
$cols++;
|
||||
?>
|
||||
<th class="title">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_CATEGORY'), 'b.title', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($this->showThumbnail)
|
||||
{
|
||||
$cols++;
|
||||
?>
|
||||
<th class="title" width="10%">
|
||||
<?php echo Text::_('OSM_THUMB'); ?>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<th class="title" width="8%">
|
||||
<?php echo Text::_('OSM_LENGTH'); ?>
|
||||
</th>
|
||||
<th class="center" width="8%">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_RECURRING'), 'tbl.recurring_subscription', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<th class="title" width="8%">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_PRICE'), 'tbl.price', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<th class="title center" width="12%">
|
||||
<?php echo Text::_('OSM_TOTAL_SUBSCRIBERS'); ?>
|
||||
</th>
|
||||
<th class="title center" width="12%">
|
||||
<?php echo Text::_('OSM_ACTIVE_SUBSCRIBERS'); ?>
|
||||
</th>
|
||||
<th width="5%">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('JGRID_HEADING_ACCESS'), 'tbl.access', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<th width="5%">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_PUBLISHED'), 'tbl.published', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
<th width="2%">
|
||||
<?php echo HTMLHelper::_('searchtools.sort', Text::_('OSM_ID'), 'tbl.id', $this->state->filter_order_Dir, $this->state->filter_order); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="<?php echo $cols; ?>">
|
||||
<?php echo $this->pagination->getListFooter(); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
$k = 0;
|
||||
for ($i = 0, $n = count($this->items); $i < $n; $i++)
|
||||
{
|
||||
$row = $this->items[$i];
|
||||
$link = Route::_('index.php?option=com_osmembership&task=mplan.edit&id=' . $row->id . '&Itemid=' . $this->Itemid, false);
|
||||
$checked = HTMLHelper::_('grid.id', $i, $row->id);
|
||||
$published = HTMLHelper::_('jgrid.published', $row->published, $i, 'mplan.');
|
||||
$symbol = $row->currency_symbol ?: $row->currency;
|
||||
?>
|
||||
<tr class="<?php echo "row$k"; ?>">
|
||||
<td>
|
||||
<?php echo $checked; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if (OSMembershipHelperAcl::canEditPlan($row->id))
|
||||
{
|
||||
?>
|
||||
<a href="<?php echo $link; ?>"><?php echo $row->title ; ?></a>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $row->title;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if ($this->showCategory)
|
||||
{
|
||||
?>
|
||||
<td><?php echo $row->category_title; ?></td>
|
||||
<?php
|
||||
}
|
||||
if ($this->showThumbnail)
|
||||
{
|
||||
?>
|
||||
<td class="center">
|
||||
<?php
|
||||
if ($row->thumb)
|
||||
{
|
||||
?>
|
||||
<a href="<?php echo Uri::root() . 'media/com_osmembership/' . $row->thumb ; ?>" class="modal"><img src="<?php echo Uri::root() . '/media/com_osmembership/' . $row->thumb ; ?>" /></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
if ($row->lifetime_membership)
|
||||
{
|
||||
echo Text::_('OSM_LIFETIME');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo OSMembershipHelperSubscription::getDurationText($row->subscription_length, $row->subscription_length_unit);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php echo $row->recurring_subscription ? Text::_('JYES') : Text::_('JNO'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if ($row->price > 0)
|
||||
{
|
||||
echo OSMembershipHelper::formatCurrency($row->price, $config, $symbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo Text::_('OSM_FREE');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php echo OSMembershipHelper::countSubscribers($row->id); ?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php echo OSMembershipHelper::countSubscribers($row->id, 1); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $row->access_level; ?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php
|
||||
if (OSMembershipHelperAcl::canChangePlanState($row->id))
|
||||
{
|
||||
echo $published;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $row->published ? Text::_('JYES') : Text::_('JNO');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="center">
|
||||
<?php echo $row->id; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$k = 1 - $k;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="task" value="" />
|
||||
<input type="hidden" name="boxchecked" value="0" />
|
||||
<input type="hidden" name="filter_order" value="<?php echo $this->state->filter_order; ?>" />
|
||||
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->filter_order_Dir; ?>" />
|
||||
<?php echo HTMLHelper::_('form.token'); ?>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2012 - 2025 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$pullLeftClass = $this->bootstrapHelper->getClassMapping('pull-left');
|
||||
?>
|
||||
<div class="filter-search btn-group <?php echo $pullLeftClass; ?>">
|
||||
<div class="input-group">
|
||||
<label for="filter_search" class="sr-only"><?php echo Text::_('OSM_FILTER_SEARCH_PLANS_DESC');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->filter_search); ?>" class="hasTooltip form-control" title="<?php echo HTMLHelper::tooltipText('OSM_SEARCH_PLANS_DESC'); ?>" />
|
||||
<span class="input-group-append">
|
||||
<button type="submit" class="btn hasTooltip" title="<?php echo HTMLHelper::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="fa fa-search"></span></button>
|
||||
<button type="button" class="btn hasTooltip" title="<?php echo HTMLHelper::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="fa fa-remove"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group <?php echo $pullLeftClass; ?> ml-2">
|
||||
<?php
|
||||
if (isset($this->lists['filter_category_id']))
|
||||
{
|
||||
echo $this->lists['filter_category_id'];
|
||||
}
|
||||
|
||||
echo $this->lists['filter_state'];
|
||||
echo $this->pagination->getLimitBox();
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2012 - 2025 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$pullLeftClass = $this->bootstrapHelper->getClassMapping('pull-left');
|
||||
?>
|
||||
<div class="filter-search btn-group <?php echo $pullLeftClass; ?>">
|
||||
<label for="filter_search" class="element-invisible sr-only"><?php echo Text::_('OSM_FILTER_SEARCH_PLANS_DESC');?></label>
|
||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->filter_search); ?>" class="hasTooltip input-medium" title="<?php echo HTMLHelper::tooltipText('OSM_SEARCH_PLANS_DESC'); ?>" />
|
||||
</div>
|
||||
<div class="btn-group <?php echo $pullLeftClass; ?>">
|
||||
<button type="submit" class="btn btn-primary hasTooltip" title="<?php echo HTMLHelper::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><span class="<?php echo $this->bootstrapHelper->getClassMapping('icon-search'); ?>"></span></button>
|
||||
<button type="button" class="btn btn-primary hasTooltip" title="<?php echo HTMLHelper::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.getElementById('filter_search').value='';this.form.submit();"><span class="<?php echo $this->bootstrapHelper->getClassMapping('icon-remove'); ?>"></span></button>
|
||||
</div>
|
||||
<div class="btn-group <?php echo $pullLeftClass; ?>">
|
||||
<?php
|
||||
if (isset($this->lists['filter_category_id']))
|
||||
{
|
||||
echo $this->lists['filter_category_id'];
|
||||
}
|
||||
|
||||
echo $this->lists['filter_state'];
|
||||
|
||||
echo $this->pagination->getLimitBox();
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
<!--
|
||||
* 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.Site
|
||||
* INGROUP: Templates.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>
|
||||
/**
|
||||
* @defgroup Dolibarr
|
||||
* @file index.html (embedded script)
|
||||
* @version 1.0.0
|
||||
* @brief Security redirect logic. Replaces the current history entry with the site root.
|
||||
* @details This script computes the absolute root URL using `location.origin` and
|
||||
* forwards the user immediately. It prevents leaving the protected folder
|
||||
* in the browser history by default.
|
||||
*
|
||||
* @section VARIABLES
|
||||
* @var {Object} opts Configuration options for the redirect behavior.
|
||||
* @var {string} opts.fallbackPath Path used when `location.origin` cannot be determined.
|
||||
* @var {number} opts.delayMs Optional delay in milliseconds before redirecting.
|
||||
* @var {"replace"|"assign"} opts.behavior Navigation method used for the redirect.
|
||||
*
|
||||
* @section OPTIONS
|
||||
* - opts.fallbackPath: default "/" (root path)
|
||||
* - opts.delayMs: default 0 (immediate)
|
||||
* - opts.behavior: one of
|
||||
* * "replace" — calls `location.replace(url)`; does not keep the folder page in history.
|
||||
* * "assign" — calls `location.assign(url)`; keeps an extra history entry.
|
||||
*/
|
||||
(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