dev-2.1
INIIT
This commit is contained in:
176
templates/moko-cassiopeia/html/com_osmembership/plan/default.php
Normal file
176
templates/moko-cassiopeia/html/com_osmembership/plan/default.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$item = $this->item;
|
||||
|
||||
$clearfixClass = $this->bootstrapHelper->getClassMapping('clearfix');
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = Uri::base() . 'media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
if ($this->config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $this->Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $this->Itemid));
|
||||
}
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
$showPlanInformation = $this->params->get('show_plan_information', 1);
|
||||
$planInformationPosition = $this->params->get('plan_information_position', 0);
|
||||
|
||||
if ($showPlanInformation && $planInformationPosition == 0)
|
||||
{
|
||||
$leftClass = $this->bootstrapHelper->getClassMapping('span7');
|
||||
$rightClass = $this->bootstrapHelper->getClassMapping('span5');
|
||||
}
|
||||
else
|
||||
{
|
||||
$leftClass = $this->bootstrapHelper->getClassMapping('clearfix');
|
||||
$rightClass = $this->bootstrapHelper->getClassMapping('clearfix');
|
||||
}
|
||||
?>
|
||||
<div id="osm-plan-item" class="osm-container">
|
||||
<div class="osm-item-heading-box <?php echo $clearfixClass; ?>">
|
||||
<h1 class="osm-page-title">
|
||||
<?php echo $this->params->get('page_heading'); ?>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="osm-item-description <?php echo $clearfixClass; ?>">
|
||||
<div class="<?php echo $this->bootstrapHelper->getClassMapping('row-fluid clearfix'); ?>">
|
||||
<?php
|
||||
if ($showPlanInformation && $planInformationPosition == 1)
|
||||
{
|
||||
?>
|
||||
<div class="<?php echo $rightClass; ?>">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/plan_information.php', ['item' => $item]); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="osm-description-details <?php echo $leftClass; ?> ">
|
||||
<?php
|
||||
if ($item->thumb)
|
||||
{
|
||||
?>
|
||||
<img src="<?php echo $imgSrc; ?>" alt="<?php echo $item->title; ?>" class="osm-thumb-left img-polaroid"/>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($item->description)
|
||||
{
|
||||
echo $item->description;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $item->short_description;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if ($showPlanInformation && in_array($planInformationPosition, [0, 2]))
|
||||
{
|
||||
?>
|
||||
<div class="<?php echo $rightClass; ?>">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/plan_information.php', ['item' => $item]); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if (count($this->renewOptions) || count($this->upgradeRules))
|
||||
{
|
||||
echo $this->loadTemplate('renew_upgrade');
|
||||
}
|
||||
?>
|
||||
<div class="osm-taskbar <?php echo $clearfixClass; ?>">
|
||||
<ul>
|
||||
<?php
|
||||
$actions = OSMembershipHelperSubscription::getAllowedActions($item);
|
||||
|
||||
if (count($actions))
|
||||
{
|
||||
$language = Factory::getApplication()->getLanguage();
|
||||
|
||||
if (in_array('subscribe', $actions))
|
||||
{
|
||||
if ($language->hasKey('OSM_SIGNUP_PLAN_' . $item->id))
|
||||
{
|
||||
$signUpLanguageItem = 'OSM_SIGNUP_PLAN_' . $item->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpLanguageItem = 'OSM_SIGNUP';
|
||||
}
|
||||
|
||||
if ($language->hasKey('OSM_RENEW_PLAN_' . $item->id))
|
||||
{
|
||||
$renewLanguageItem = 'OSM_RENEW_PLAN_' . $item->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$renewLanguageItem = 'OSM_RENEW';
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $signUpUrl; ?>" class="<?php echo $this->bootstrapHelper->getClassMapping('btn btn-primary'); ?>">
|
||||
<?php echo in_array($item->id, $subscribedPlanIds) ? Text::_($renewLanguageItem) : Text::_($signUpLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (in_array('upgrade', $actions))
|
||||
{
|
||||
if ($language->hasKey('OSM_UPGRADE_PLAN_' . $item->id))
|
||||
{
|
||||
$upgradeLanguageItem = 'OSM_UPGRADE_PLAN_' . $item->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$upgradeLanguageItem = 'OSM_UPGRADE';
|
||||
}
|
||||
|
||||
if (count($item->upgrade_rules) > 1)
|
||||
{
|
||||
$link = Route::_('index.php?option=com_osmembership&view=upgrademembership&to_plan_id=' . $item->id . '&Itemid=' . OSMembershipHelperRoute::findView('upgrademembership', $this->Itemid));
|
||||
}
|
||||
else
|
||||
{
|
||||
$upgradeOptionId = $item->upgrade_rules[0]->id;
|
||||
$link = Route::_('index.php?option=com_osmembership&task=register.process_upgrade_membership&upgrade_option_id=' . $upgradeOptionId . '&Itemid=' . $this->Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="<?php echo $this->bootstrapHelper->getClassMapping('btn btn-primary'); ?>">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
?>
|
||||
<div class="<?php echo $this->bootstrapHelper->getClassMapping('row-fluid clearfix'); ?>">
|
||||
<?php
|
||||
if (count($this->renewOptions))
|
||||
{
|
||||
?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_osmembership&task=register.process_renew_membership&Itemid=' . $this->Itemid, false, $ssl); ?>" method="post" name="osm_form_renew" id="osm_form_renew" autocomplete="off" class="<?php echo $this->bootstrapHelper->getClassMapping('form form-horizontal'); ?>">
|
||||
<h2 class="osm-form-heading"><?php echo Text::_('OSM_RENEW_MEMBERSHIP'); ?></h2>
|
||||
<?php echo $this->loadCommonLayout('common/tmpl/renew_options.php');?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (count($this->upgradeRules))
|
||||
{
|
||||
?>
|
||||
<form action="<?php echo Route::_('index.php?option=com_osmembership&task=register.process_upgrade_membership&Itemid=' . $this->Itemid, false, $ssl); ?>" method="post" name="osm_form_update_membership" id="osm_form_update_membership" autocomplete="off" class="<?php echo $this->bootstrapHelper->getClassMapping('form form-horizontal'); ?>">
|
||||
<h2 class="osm-form-heading"><?php echo Text::_('OSM_UPGRADE_MEMBERSHIP'); ?></h2>
|
||||
<?php
|
||||
echo $this->loadCommonLayout('common/tmpl/upgrade_options.php');
|
||||
?>
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="<?php echo $this->bootstrapHelper->getClassMapping('btn btn-primary'); ?>" value="<?php echo Text::_('OSM_PROCESS_UPGRADE'); ?>"/>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
118
templates/moko-cassiopeia/html/com_osmembership/plan/index.html
Normal file
118
templates/moko-cassiopeia/html/com_osmembership/plan/index.html
Normal file
@@ -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