Reset
This commit is contained in:
@@ -0,0 +1,195 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var int $Itemid
|
||||
* @var int $categoryId
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
*/
|
||||
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$rowFluidClass = $bootstrapHelper->getClassMapping('row-fluid');
|
||||
$span7Class = $bootstrapHelper->getClassMapping('span7');
|
||||
$span5class = $bootstrapHelper->getClassMapping('span5');
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$btnClass = $bootstrapHelper->getClassMapping('btn');
|
||||
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn btn-primary');
|
||||
$clearfixClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
|
||||
$defaultItemId = $Itemid;
|
||||
|
||||
for ($i = 0 , $n = count($items) ; $i < $n ; $i++)
|
||||
{
|
||||
$item = $items[$i];
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
if ($item->category_id)
|
||||
{
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
}
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
|
||||
$symbol = $item->currency_symbol ?: $item->currency;
|
||||
?>
|
||||
<div class="osm-item-wrapper <?php echo $clearfixClass; ?>">
|
||||
<div class="osm-item-heading-box <?php echo $clearfixClass; ?>">
|
||||
<h3 class="osm-item-title">
|
||||
<a href="<?php echo $url; ?>" title="<?php echo $item->title; ?>">
|
||||
<?php echo $item->title; ?>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="osm-item-description <?php echo $clearfixClass; ?>">
|
||||
<div class="<?php echo $rowFluidClass; ?>">
|
||||
<div class="osm-description-details <?php echo $span7Class; ?>">
|
||||
<?php
|
||||
if ($item->thumb)
|
||||
{
|
||||
?>
|
||||
<img src="<?php echo $imgSrc; ?>" alt="<?php echo $item->title; ?>" class="osm-thumb-left <?php echo $imgClass; ?>"/>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($item->short_description)
|
||||
{
|
||||
echo $item->short_description;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $item->description;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo $span5class; ?>">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/plan_information.php', ['item' => $item]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<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 $btnPrimaryClass; ?>">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="<?php echo $btnPrimaryClass; ?>">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($config->hide_details_button))
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="<?php echo $btnClass; ?>">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2012 - 2025 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var string $selector
|
||||
* @var string $title
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
Factory::getApplication()
|
||||
->getDocument()
|
||||
->getWebAssetManager()
|
||||
->useScript('core');
|
||||
|
||||
Text::script('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST');
|
||||
$message = "alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));";
|
||||
?>
|
||||
<button type="button" data-toggle="modal" onclick="if (document.adminForm.boxchecked.value==0){<?php echo $message; ?>}else{jQuery( '#<?php echo $selector; ?>' ).modal('show'); return true;}" class="btn btn-small">
|
||||
<span class="icon-checkbox-partial" aria-hidden="true"></span>
|
||||
<?php echo $title; ?>
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2010 - 2022 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var string $selector
|
||||
* @var string $title
|
||||
*/
|
||||
?>
|
||||
<button type="button" data-toggle="modal" onclick="jQuery( '#<?php echo $selector; ?>' ).modal('show'); return true;" class="btn btn-small">
|
||||
<span class="icon-checkbox-partial" aria-hidden="true"></span>
|
||||
<?php echo $title; ?>
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var MPFConfig $config
|
||||
* @var int $categoryId
|
||||
* @var int $Itemid
|
||||
*/
|
||||
|
||||
$bootstrapHelper = OSMembershipHelperBootstrap::getInstance();
|
||||
$clearfixClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
|
||||
for ($i = 0 , $n = count($items) ; $i < $n ; $i++)
|
||||
{
|
||||
$item = $items[$i];
|
||||
$link = Route::_(OSMembershipHelperRoute::getCategoryRoute($item->id, $Itemid));
|
||||
?>
|
||||
<div class="osm-item-wrapper clearfix">
|
||||
<div class="osm-item-heading-box">
|
||||
<h3 class="osm-item-title">
|
||||
<a href="<?php echo $link; ?>" class="osm-item-title-link">
|
||||
<?php echo $item->title;?>
|
||||
</a>
|
||||
<span class="<?php echo $bootstrapHelper->getClassMapping('badge badge-info'); ?>"><?php echo $item->total_plans ;?> <?php echo $item->total_plans > 1 ? Text::_('OSM_PLANS') : Text::_('OSM_PLAN') ; ?></span>
|
||||
</h3>
|
||||
</div>
|
||||
<?php
|
||||
if($item->description)
|
||||
{
|
||||
?>
|
||||
<div class="osm-item-description <?php echo $clearfixClass; ?>">
|
||||
<?php echo HTMLHelper::_('content.prepare', $item->description);?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -0,0 +1,219 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var int $categoryId
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
* @var \Joomla\Registry\Registry $params
|
||||
* @var int $Itemid
|
||||
*/
|
||||
|
||||
Factory::getApplication()
|
||||
->getDocument()
|
||||
->getWebAssetManager()
|
||||
->useScript('core');
|
||||
|
||||
$rootUri = Uri::root(true);
|
||||
$minHeight = 130;
|
||||
|
||||
if (isset($params))
|
||||
{
|
||||
$minHeight = (int) $params->get('min_height', 130) ?: 130;
|
||||
}
|
||||
|
||||
OSMembershipHelperJquery::responsiveEqualHeight('.osm-item-description-text', $minHeight);
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (isset($input) && $input->getInt('number_columns'))
|
||||
{
|
||||
$numberColumns = $input->getInt('number_columns');
|
||||
}
|
||||
elseif (!empty($config->number_columns))
|
||||
{
|
||||
$numberColumns = $config->number_columns;
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberColumns = 3;
|
||||
}
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$span = intval(12 / $numberColumns);
|
||||
|
||||
$btnClass = $bootstrapHelper->getClassMapping('btn');
|
||||
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn btn-primary');
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$spanClass = $bootstrapHelper->getClassMapping('span' . $span);
|
||||
$rowFluidClearfixClass = $bootstrapHelper->getClassMapping('row-fluid clearfix');
|
||||
$clearFixClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
?>
|
||||
<div class="<?php echo $rowFluidClearfixClass; ?>">
|
||||
<?php
|
||||
$i = 0;
|
||||
$numberPlans = count($items);
|
||||
$defaultItemId = $Itemid;
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
?>
|
||||
<div class="osm-item-wrapper <?php echo $spanClass; ?>">
|
||||
<div class="osm-item-heading-box <?php echo $clearFixClass; ?>">
|
||||
<h2 class="osm-item-title">
|
||||
<a href="<?php echo $url; ?>" title="<?php echo $item->title; ?>">
|
||||
<?php echo $item->title; ?>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="osm-item-description <?php echo $clearFixClass; ?>">
|
||||
<?php
|
||||
if ($item->thumb)
|
||||
{
|
||||
?>
|
||||
<a href="<?php echo $url; ?>" title="<?php echo $item->title; ?>">
|
||||
<img src="<?php echo $imgSrc; ?>" class="osm-thumb-left <?php echo $imgClass; ?>" />
|
||||
</a>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!$item->short_description)
|
||||
{
|
||||
$item->short_description = $item->description;
|
||||
}
|
||||
?>
|
||||
<div class="osm-item-description-text"><?php echo $item->short_description; ?></div>
|
||||
<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 $btnPrimaryClass; ?>">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="<?php echo $btnPrimaryClass; ?>">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($config->hide_details_button))
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="<?php echo $btnClass; ?>">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ($i % $numberColumns == 0 && $i < $numberPlans)
|
||||
{
|
||||
?>
|
||||
</div>
|
||||
<div class="<?php echo $rowFluidClearfixClass; ?>">
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -0,0 +1,231 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var int $categoryId
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
* @var \Joomla\Registry\Registry $params
|
||||
* @var int $Itemid
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$rowFluidClass = $bootstrapHelper->getClassMapping('row-fluid');
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$btnClass = $bootstrapHelper->getClassMapping('btn');
|
||||
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn btn-primary');
|
||||
$clearfixClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
|
||||
$defaultItemId = $Itemid;
|
||||
|
||||
if (isset($params))
|
||||
{
|
||||
$showPlanInformation = $params->get('show_plan_information', 1);
|
||||
$planInformationPosition = $params->get('plan_information_position', 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$showPlanInformation = 1;
|
||||
$planInformationPosition = 0;
|
||||
}
|
||||
|
||||
if ($showPlanInformation && $planInformationPosition == 0)
|
||||
{
|
||||
$leftClass = $bootstrapHelper->getClassMapping('span7');
|
||||
$rightClass = $bootstrapHelper->getClassMapping('span5');
|
||||
}
|
||||
else
|
||||
{
|
||||
$leftClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
$rightClass = $bootstrapHelper->getClassMapping('clearfix');
|
||||
}
|
||||
|
||||
for ($i = 0 , $n = count($items) ; $i < $n ; $i++)
|
||||
{
|
||||
$item = $items[$i];
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
if ($item->category_id)
|
||||
{
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
}
|
||||
else
|
||||
{
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
}
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
?>
|
||||
<div class="osm-item-wrapper <?php echo $clearfixClass; ?>">
|
||||
<div class="osm-item-heading-box <?php echo $clearfixClass; ?>">
|
||||
<h2 class="osm-item-title">
|
||||
<a href="<?php echo $url; ?>" title="<?php echo $item->title; ?>">
|
||||
<?php echo $item->title; ?>
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="osm-item-description <?php echo $clearfixClass; ?>">
|
||||
<div class="<?php echo $rowFluidClass; ?>">
|
||||
<?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 <?php echo $imgClass; ?>"/>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($item->short_description)
|
||||
{
|
||||
echo $item->short_description;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $item->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>
|
||||
<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 $btnPrimaryClass; ?>">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="<?php echo $btnPrimaryClass; ?>">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($config->hide_details_button))
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="<?php echo $btnClass; ?>">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $rowMembers
|
||||
*/
|
||||
|
||||
$names = [];
|
||||
|
||||
foreach ($rowMembers as $rowMember)
|
||||
{
|
||||
$names[] = trim($rowMember->first_name . ' ' . $rowMember->last_name);
|
||||
}
|
||||
|
||||
echo implode("\r\n", $names);
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var string $redirectHeading
|
||||
* @var string $url
|
||||
* @var bool $newWindow
|
||||
* @var array $data
|
||||
*/
|
||||
?>
|
||||
<div class="payment-heading"><?php echo $redirectHeading; ?></div>
|
||||
<form method="post" action="<?php echo $url; ?>" name="payment_form"
|
||||
id="payment_form"<?php if ($newWindow) echo ' target="_blank"'; ?>>
|
||||
<?php
|
||||
foreach ($data as $key => $val)
|
||||
{
|
||||
echo '<input type="hidden" name="' . $key . '" value="' . $val . '" />';
|
||||
echo "\n";
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
document.payment_form.submit();
|
||||
</script>
|
||||
</form>
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var stdClass $item
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Form\Form;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
try
|
||||
{
|
||||
$form = Form::getInstance('plan_fields', JPATH_ROOT . '/components/com_osmembership/fields.xml', [], false, '//config');
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($form->getFieldset('basic') as $field)
|
||||
{
|
||||
if ($field->getAttribute('hide'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_($field->getAttribute('label')); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php echo $item->fieldsData->get($field->getAttribute('name')); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla
|
||||
* @subpackage Membership Pro
|
||||
* @author Tuan Pham Ngoc
|
||||
* @copyright Copyright (C) 2012 - 2025 Ossolution Team
|
||||
* @license GNU/GPL, see LICENSE.php
|
||||
*/
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var stdClass $item
|
||||
*/
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
$bootstrapHelper = OSMembershipHelperBootstrap::getInstance();
|
||||
$config = OSMembershipHelper::getConfig();
|
||||
$symbol = $item->currency_symbol ?: $item->currency;
|
||||
?>
|
||||
<table class="<?php echo $bootstrapHelper->getClassMapping('table table-striped table-bordered'); ?>">
|
||||
<?php
|
||||
if ($item->setup_fee > 0)
|
||||
{
|
||||
?>
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_('OSM_SETUP_FEE'); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php echo OSMembershipHelper::formatCurrency($item->setup_fee, $config, $symbol); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($item->recurring_subscription && $item->trial_duration)
|
||||
{
|
||||
?>
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_('OSM_TRIAL_DURATION'); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php
|
||||
if ($item->lifetime_membership)
|
||||
{
|
||||
echo Text::_('OSM_LIFETIME');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo OSMembershipHelperSubscription::getDurationText($item->trial_duration, $item->trial_duration_unit);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_('OSM_TRIAL_PRICE'); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php
|
||||
if ($item->trial_amount > 0)
|
||||
{
|
||||
echo OSMembershipHelper::formatCurrency($item->trial_amount, $config, $symbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo Text::_('OSM_FREE');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!((int) $item->expired_date))
|
||||
{
|
||||
?>
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_('OSM_DURATION'); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php
|
||||
if ($item->lifetime_membership)
|
||||
{
|
||||
echo Text::_('OSM_LIFETIME');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo OSMembershipHelperSubscription::getDurationText($item->subscription_length, $item->subscription_length_unit);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr class="osm-plan-property">
|
||||
<td class="osm-plan-property-label">
|
||||
<?php echo Text::_('OSM_PRICE'); ?>:
|
||||
</td>
|
||||
<td class="osm-plan-property-value">
|
||||
<?php
|
||||
if ($item->price > 0)
|
||||
{
|
||||
echo OSMembershipHelper::formatCurrency($item->price, $config, $symbol);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo Text::_('OSM_FREE');
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if (file_exists(JPATH_ROOT . '/components/com_osmembership/fields.xml')
|
||||
&& filesize(JPATH_ROOT . '/components/com_osmembership/fields.xml'))
|
||||
{
|
||||
echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/plan_custom_fields.php', ['item' => $item]);
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var stdClass $item
|
||||
*/
|
||||
|
||||
$config = OSMembershipHelper::getConfig();
|
||||
|
||||
$dec_point = $config->dec_point ?? '.';
|
||||
$thousands_sep = $config->thousands_sep ?? ',';
|
||||
|
||||
if ($item->lifetime_membership)
|
||||
{
|
||||
$subscriptionLengthText = Text::_('OSM_LIFETIME');
|
||||
}
|
||||
else
|
||||
{
|
||||
$subscriptionLengthText = OSMembershipHelperSubscription::getDurationText($item->subscription_length, $item->subscription_length_unit, false);
|
||||
}
|
||||
|
||||
if ($item->price > 0)
|
||||
{
|
||||
$priceParts = explode('.', $item->price);
|
||||
|
||||
if ($priceParts[1] == '00' || $config->decimals === '0')
|
||||
{
|
||||
$numberDecimals = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberDecimals = 2;
|
||||
}
|
||||
|
||||
$symbol = $item->currency_symbol ?: $item->currency;
|
||||
|
||||
if (!$symbol)
|
||||
{
|
||||
$symbol = $config->currency_symbol;
|
||||
}
|
||||
|
||||
if ($config->currency_position == 0)
|
||||
{
|
||||
echo $symbol . number_format($item->price, $numberDecimals, $dec_point, $thousands_sep) . ($subscriptionLengthText ? "<sub>/$subscriptionLengthText</sub>" : '');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo number_format($item->price, $numberDecimals, $dec_point, $thousands_sep) . $symbol . ($subscriptionLengthText ? "<sub>/$subscriptionLengthText</sub>" : '');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo Text::_('OSM_FREE') . ($subscriptionLengthText ? "<sub> /$subscriptionLengthText</sub>" : '');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var int $Itemid
|
||||
* @var int $categoryId
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
*/
|
||||
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (empty($params))
|
||||
{
|
||||
$params = Factory::getApplication()->getParams();
|
||||
}
|
||||
|
||||
if (isset($input) && $input->getInt('recommended_plan_id'))
|
||||
{
|
||||
$recommendedPlanId = $input->getInt('recommended_plan_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommendedPlanId = (int) $params->get('recommended_campaign_id');
|
||||
}
|
||||
|
||||
$standardPlanBackgroundColor = $params->get('standard_plan_color', '#00B69C');
|
||||
$recommendedPlanBackgroundColor = $params->get('recommended_plan_color', '#bF75500');
|
||||
$showDetailsButton = $params->get('show_details_button', 0);
|
||||
|
||||
if (isset($input) && $input->getInt('number_columns'))
|
||||
{
|
||||
$numberColumns = $input->getInt('number_columns');
|
||||
}
|
||||
elseif (isset($config->number_columns))
|
||||
{
|
||||
$numberColumns = $config->number_columns;
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberColumns = 3;
|
||||
}
|
||||
|
||||
$numberColumns = min($numberColumns, 5);
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$span = intval(12 / $numberColumns);
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$spanClass = $bootstrapHelper->getClassMapping('span' . $span);
|
||||
|
||||
$i = 0;
|
||||
$numberPlans = count($items);
|
||||
$defaultItemId = $Itemid;
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
|
||||
if (!$item->short_description)
|
||||
{
|
||||
$item->short_description = $item->description;
|
||||
}
|
||||
|
||||
if ($item->id == $recommendedPlanId)
|
||||
{
|
||||
$recommended = true;
|
||||
$backgroundColor = $recommendedPlanBackgroundColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommended = false;
|
||||
$backgroundColor = $standardPlanBackgroundColor;
|
||||
}
|
||||
|
||||
if ($i % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
<div class="<?php echo $bootstrapHelper->getClassMapping('row-fluid clearfix'); ?> osm-pricing-table-circle">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo $spanClass; ?>">
|
||||
<div class="osm-plan osm-plan-<?php echo $item->id; ?>">
|
||||
<div class="osm-plan-header" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<h2 class="osm-plan-title">
|
||||
<?php echo $item->title; ?>
|
||||
</h2>
|
||||
<div class="osm-plan-price" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<p class="price">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/priceduration.php', ['item' => $item]); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="osm-plan-short-description">
|
||||
<?php echo $item->short_description;?>
|
||||
</div>
|
||||
<ul class="osm-signup-container">
|
||||
<?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="btn-signup" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="btn-signup" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if ($showDetailsButton)
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="btn-signup" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (($i + 1) % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($i % $numberColumns != 0)
|
||||
{
|
||||
echo '</div>' ;
|
||||
}
|
||||
?>
|
||||
<style type="text/css">
|
||||
.osm-pricing-table-circle .osm-plan:hover .osm-plan-price {
|
||||
background-color: <?php echo $recommendedPlanBackgroundColor; ?>!important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,233 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var int $Itemid
|
||||
* @var int $categoryId
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
*/
|
||||
|
||||
// Load equals height script
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (empty($params))
|
||||
{
|
||||
$params = Factory::getApplication()->getParams();
|
||||
}
|
||||
|
||||
if (isset($input) && $input->getInt('recommended_plan_id'))
|
||||
{
|
||||
$recommendedPlanId = $input->getInt('recommended_plan_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommendedPlanId = (int) $params->get('recommended_campaign_id');
|
||||
}
|
||||
|
||||
$standardPlanBackgroundColor = $params->get('standard_plan_color', '#00B69C');
|
||||
$recommendedPlanBackgroundColor = $params->get('recommended_plan_color', '#F75500');
|
||||
$showDetailsButton = $params->get('show_details_button', 0);
|
||||
|
||||
if (isset($input) && $input->getInt('number_columns'))
|
||||
{
|
||||
$numberColumns = $input->getInt('number_columns');
|
||||
}
|
||||
elseif (isset($config->number_columns))
|
||||
{
|
||||
$numberColumns = $config->number_columns;
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberColumns = 3;
|
||||
}
|
||||
|
||||
$numberColumns = min($numberColumns, 5);
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$span = intval(12 / $numberColumns);
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$spanClass = $bootstrapHelper->getClassMapping('span' . $span);
|
||||
|
||||
$i = 0;
|
||||
$numberPlans = count($items);
|
||||
$defaultItemId = $Itemid;
|
||||
$rootUri = Uri::root(true);
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
|
||||
if (!$item->short_description)
|
||||
{
|
||||
$item->short_description = $item->description;
|
||||
}
|
||||
|
||||
if ($item->id == $recommendedPlanId)
|
||||
{
|
||||
$recommended = true;
|
||||
$backgroundColor = $recommendedPlanBackgroundColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommended = false;
|
||||
$backgroundColor = $standardPlanBackgroundColor;
|
||||
}
|
||||
|
||||
if ($i % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
<div class="<?php echo $bootstrapHelper->getClassMapping('row-fluid clearfix'); ?> osm-pricing-table-flat">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo $spanClass; ?>">
|
||||
<div class="osm-plan osm-plan-<?php echo $item->id; ?>" style="background-color: <?php echo $backgroundColor; ?>">
|
||||
<div class="osm-plan-header">
|
||||
<h2 class="osm-plan-title">
|
||||
<?php echo $item->title; ?>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="osm-plan-price">
|
||||
<p class="price">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/priceduration.php', ['item' => $item]); ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="osm-plan-short-description">
|
||||
<?php echo $item->short_description;?>
|
||||
</div>
|
||||
<ul class="osm-signup-container">
|
||||
<?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="btn-signup">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="btn-signup">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if ($showDetailsButton)
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="btn-signup oms-btn-details">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (($i + 1) % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($i % $numberColumns != 0)
|
||||
{
|
||||
echo '</div>' ;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,261 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $items
|
||||
* @var MPFInput $input
|
||||
* @var MPFConfig $config
|
||||
* @var int $Itemid
|
||||
* @var int $categoryId
|
||||
* @var OSMembershipHelperBootstrap $bootstrapHelper
|
||||
*/
|
||||
|
||||
$subscribedPlanIds = OSMembershipHelperSubscription::getSubscribedPlans();
|
||||
|
||||
if (empty($params))
|
||||
{
|
||||
$params = Factory::getApplication()->getParams();
|
||||
}
|
||||
|
||||
// Background color settings
|
||||
$badgeBgColor = $params->get('recommended_badge_background_color');
|
||||
$headerBgColor = $params->get('header_background_color');
|
||||
$priceBgColor = $params->get('price_background_color');
|
||||
$recommendedPriceBgColor = $params->get('recommended_plan_price_background_color');
|
||||
|
||||
if (isset($input) && $input->getInt('recommended_plan_id'))
|
||||
{
|
||||
$recommendedPlanId = $input->getInt('recommended_plan_id');
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommendedPlanId = (int) $params->get('recommended_campaign_id');
|
||||
}
|
||||
|
||||
$showDetailsButton = $params->get('show_details_button', 0);
|
||||
|
||||
if (isset($input) && $input->getInt('number_columns'))
|
||||
{
|
||||
$numberColumns = $input->getInt('number_columns');
|
||||
}
|
||||
elseif (isset($config->number_columns))
|
||||
{
|
||||
$numberColumns = $config->number_columns ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$numberColumns = 3 ;
|
||||
}
|
||||
|
||||
$numberColumns = min($numberColumns, 4);
|
||||
|
||||
if (!isset($categoryId))
|
||||
{
|
||||
$categoryId = 0;
|
||||
}
|
||||
|
||||
$span = intval(12 / $numberColumns);
|
||||
|
||||
$btnClass = $bootstrapHelper->getClassMapping('btn');
|
||||
$btnPrimaryClass = $bootstrapHelper->getClassMapping('btn btn-primary');
|
||||
$imgClass = $bootstrapHelper->getClassMapping('img-polaroid');
|
||||
$spanClass = $bootstrapHelper->getClassMapping('span' . $span);
|
||||
|
||||
$rootUri = Uri::root(true);
|
||||
$i = 0;
|
||||
$numberPlans = count($items);
|
||||
$defaultItemId = $Itemid;
|
||||
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$Itemid = OSMembershipHelperRoute::getPlanMenuId($item->id, $item->category_id, $defaultItemId);
|
||||
|
||||
if ($item->thumb)
|
||||
{
|
||||
$imgSrc = $rootUri . '/media/com_osmembership/' . $item->thumb;
|
||||
}
|
||||
|
||||
$url = Route::_('index.php?option=com_osmembership&view=plan&catid=' . $item->category_id . '&id=' . $item->id . '&Itemid=' . $Itemid);
|
||||
|
||||
if ($config->use_https)
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid), false, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$signUpUrl = Route::_(OSMembershipHelperRoute::getSignupRoute($item->id, $Itemid));
|
||||
}
|
||||
|
||||
if (!$item->short_description)
|
||||
{
|
||||
$item->short_description = $item->description;
|
||||
}
|
||||
|
||||
if ($item->id == $recommendedPlanId)
|
||||
{
|
||||
$recommended = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$recommended = false;
|
||||
}
|
||||
|
||||
if ($recommended && $recommendedPriceBgColor)
|
||||
{
|
||||
$planPriceBackgroundColor = $recommendedPriceBgColor;
|
||||
}
|
||||
elseif ($priceBgColor)
|
||||
{
|
||||
$planPriceBackgroundColor = $priceBgColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
$planPriceBackgroundColor = '';
|
||||
}
|
||||
|
||||
if ($i % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
<div class="<?php echo $bootstrapHelper->getClassMapping('row-fluid clearfix'); ?> osm-pricing-table">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo $spanClass; ?>">
|
||||
<div class="osm-plan<?php if ($recommended) echo ' osm-plan-recommended'; ?> osm-plan-<?php echo $item->id; ?>">
|
||||
<?php
|
||||
if ($recommended)
|
||||
{
|
||||
?>
|
||||
<p class="plan-recommended"<?php if ($badgeBgColor) echo ' style=" background-color:' . $badgeBgColor . '";'; ?>><?php echo Text::_('OSM_RECOMMENDED'); ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="osm-plan-header"<?php if ($headerBgColor) echo ' style=" background-color:' . $headerBgColor . '";'; ?>>
|
||||
<h2 class="osm-plan-title">
|
||||
<?php echo $item->title; ?>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="osm-plan-price"<?php if ($planPriceBackgroundColor) echo ' style=" background-color:' . $planPriceBackgroundColor . '";'; ?>>
|
||||
<h2>
|
||||
<p class="price">
|
||||
<?php echo OSMembershipHelperHtml::loadCommonLayout('common/tmpl/priceduration.php', ['item' => $item]); ?>
|
||||
</p>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="osm-plan-short-description">
|
||||
<?php echo $item->short_description;?>
|
||||
</div>
|
||||
<?php
|
||||
$actions = OSMembershipHelperSubscription::getAllowedActions($item);
|
||||
|
||||
if (count($actions) || $showDetailsButton)
|
||||
{
|
||||
$language = Factory::getApplication()->getLanguage();
|
||||
?>
|
||||
<ul class="osm-signup-container">
|
||||
<?php
|
||||
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 $btnPrimaryClass; ?> btn-singup">
|
||||
<?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', $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=' . $Itemid);
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $link; ?>" class="<?php echo $btnPrimaryClass; ?> btn-singup">
|
||||
<?php echo Text::_($upgradeLanguageItem); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($showDetailsButton)
|
||||
{
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $url; ?>" class="<?php echo $btnClass; ?>">
|
||||
<?php echo Text::_('OSM_DETAILS'); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (($i + 1) % $numberColumns == 0)
|
||||
{
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($i % $numberColumns != 0)
|
||||
{
|
||||
echo '</div>' ;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
<?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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
?>
|
||||
<ul class="osm-renew-options">
|
||||
<?php
|
||||
$userId = Factory::getApplication()->getIdentity()->id;
|
||||
$renewOptionCount = 0;
|
||||
$fieldSuffix = OSMembershipHelper::getFieldSuffix();
|
||||
|
||||
foreach ($this->planIds as $planId)
|
||||
{
|
||||
$plan = $this->plans[$planId];
|
||||
$taxRate = 0;
|
||||
|
||||
if ($this->config->show_price_including_tax && !$this->config->setup_price_including_tax)
|
||||
{
|
||||
$taxRate = OSMembershipHelper::calculateMaxTaxRate($planId);
|
||||
}
|
||||
|
||||
$symbol = $plan->currency_symbol ?: $plan->currency;
|
||||
$renewOptions = $this->renewOptions[$planId] ?? [];
|
||||
|
||||
if (count($renewOptions))
|
||||
{
|
||||
foreach ($renewOptions as $renewOption)
|
||||
{
|
||||
$checked = '';
|
||||
|
||||
if ($renewOptionCount == 0)
|
||||
{
|
||||
$checked = ' checked="checked" ';
|
||||
}
|
||||
|
||||
$renewOptionCount++;
|
||||
$renewOptionLengthText = OSMembershipHelperSubscription::getDurationText($renewOption->renew_option_length, $renewOption->renew_option_length_unit);
|
||||
|
||||
$renewOptionText = Text::sprintf('OSM_RENEW_OPTION_TEXT', $plan->title, $renewOptionLengthText, OSMembershipHelper::formatCurrency($renewOption->price * (1 + $taxRate / 100), $this->config, $symbol));
|
||||
|
||||
if (strpos($renewOptionText, '[EXPIRED_DATE]'))
|
||||
{
|
||||
$expiredDate = OSMembershipHelperSubscription::getPlanExpiredDate($planId);
|
||||
|
||||
if ($expiredDate)
|
||||
{
|
||||
$expiredDate = HTMLHelper::_('date', $expiredDate, $this->config->date_format);
|
||||
}
|
||||
|
||||
$renewOptionText = str_replace('[EXPIRED_DATE]', $expiredDate, $renewOptionText);
|
||||
}
|
||||
?>
|
||||
<li class="osm-renew-option">
|
||||
<input type="radio" class="validate[required]<?php echo $this->bootstrapHelper->getFrameworkClass('uk-radio', 1); ?>" id="renew_option_id_<?php echo $renewOptionCount; ?>" name="renew_option_id" value="<?php echo $planId . '|' . $renewOption->id; ?>" <?php echo $checked; ?> />
|
||||
<label for="renew_option_id_<?php echo $renewOptionCount; ?>"><?php echo $renewOptionText; ?></label>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$checked = '';
|
||||
|
||||
if ($renewOptionCount == 0)
|
||||
{
|
||||
$checked = ' checked="checked" ';
|
||||
}
|
||||
|
||||
$renewOptionCount++;
|
||||
$subscriptionLengthText = OSMembershipHelperSubscription::getDurationText($plan->subscription_length, $plan->subscription_length_unit);
|
||||
|
||||
$renewalDiscountRule = OSMembershipHelperSubscription::getRenewalDiscount($userId, $planId);
|
||||
|
||||
if ($renewalDiscountRule)
|
||||
{
|
||||
if ($renewalDiscountRule->discount_type == 0)
|
||||
{
|
||||
$plan->price = round($plan->price * (1 - $renewalDiscountRule->discount_amount / 100), 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
$plan->price = $plan->price - $renewalDiscountRule->discount_amount;
|
||||
}
|
||||
|
||||
if ($plan->price < 0)
|
||||
{
|
||||
$plan->price = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$renewOptionText = Text::sprintf('OSM_RENEW_OPTION_TEXT', $plan->title, $subscriptionLengthText, OSMembershipHelper::formatCurrency($plan->price * (1 + $taxRate / 100), $this->config, $symbol));
|
||||
|
||||
if (strpos($renewOptionText, '[EXPIRED_DATE]'))
|
||||
{
|
||||
$expiredDate = OSMembershipHelperSubscription::getPlanExpiredDate($plan->id);
|
||||
|
||||
if ($expiredDate)
|
||||
{
|
||||
$expiredDate = HTMLHelper::_('date', $expiredDate, $this->config->date_format);
|
||||
}
|
||||
|
||||
$renewOptionText = str_replace('[EXPIRED_DATE]', $expiredDate, $renewOptionText);
|
||||
}
|
||||
?>
|
||||
<li class="osm-renew-option">
|
||||
<input type="radio" class="validate[required]<?php echo $this->bootstrapHelper->getFrameworkClass('uk-radio', 1); ?>" id="renew_option_id_<?php echo $renewOptionCount; ?>" name="renew_option_id" value="<?php echo $planId;?>" <?php echo $checked; ?>/>
|
||||
<label for="renew_option_id_<?php echo $renewOptionCount; ?>"><?php echo $renewOptionText; ?></label>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div class="form-actions">
|
||||
<input type="submit" class="<?php echo $this->bootstrapHelper->getClassMapping('btn btn-primary'); ?>" value="<?php echo Text::_('OSM_PROCESS_RENEW'); ?>"/>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var string $introText
|
||||
* @var string $msg
|
||||
* @var string $context
|
||||
* @var stdClass $row
|
||||
*/
|
||||
|
||||
if (isset($introText))
|
||||
{
|
||||
echo '<div class="intro-text">' . $introText . '</div>';
|
||||
}
|
||||
?>
|
||||
<div class="text-info">
|
||||
<?php echo $msg; ?>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var bool $showPagination
|
||||
* @var \Joomla\CMS\Pagination\Pagination $pagination
|
||||
*/
|
||||
|
||||
/* @var \Joomla\Database\DatabaseDriver $db */
|
||||
$db = Factory::getContainer()->get('db');
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from('#__osmembership_plugins')
|
||||
->where('published = 1')
|
||||
->where('name NOT LIKE "os_offline%"');
|
||||
$db->setQuery($query);
|
||||
$hasOnlinePaymentPlugin = $db->loadResult() > 0;
|
||||
|
||||
$makePaymentItemid = OSMembershipHelperRoute::getViewRoute('payment', $this->Itemid);
|
||||
|
||||
$cols = 5;
|
||||
|
||||
$bootstrapHelper = OSMembershipHelperBootstrap::getInstance();
|
||||
$centerClass = $bootstrapHelper->getClassMapping('center');
|
||||
$hiddenPhoneClass = $bootstrapHelper->getClassMapping('hidden-phone');
|
||||
?>
|
||||
<table class="<?php echo $bootstrapHelper->getClassMapping('table table-striped table-bordered') ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo Text::_('OSM_PLAN') ?>
|
||||
</th>
|
||||
<th class="<?php echo $centerClass; ?>">
|
||||
<?php echo Text::_('OSM_SUBSCRIPTION_DATE') ; ?>
|
||||
</th>
|
||||
<th class="<?php echo $centerClass; ?>">
|
||||
<?php echo Text::_('OSM_ACTIVATE_TIME') ; ?>
|
||||
</th>
|
||||
<th style="text-align: right;" class="<?php echo $hiddenPhoneClass; ?>">
|
||||
<?php echo Text::_('OSM_GROSS_AMOUNT') ; ?>
|
||||
</th>
|
||||
<th class="<?php echo $hiddenPhoneClass; ?>">
|
||||
<?php echo Text::_('OSM_SUBSCRIPTION_STATUS'); ?>
|
||||
</th>
|
||||
<?php
|
||||
if ($this->config->activate_invoice_feature)
|
||||
{
|
||||
$cols++ ;
|
||||
?>
|
||||
<th class="<?php echo $hiddenPhoneClass . ' ' . $centerClass; ?>">
|
||||
<?php echo Text::_('OSM_INVOICE_NUMBER') ; ?>
|
||||
</th>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$k = 0 ;
|
||||
for ($i = 0 , $n = count($this->items) ; $i < $n ; $i++) {
|
||||
$row = $this->items[$i];
|
||||
$k = 1 - $k;
|
||||
$link = Route::_('index.php?option=com_osmembership&view=subscription&id=' . $row->id . '&Itemid=' . $this->Itemid);
|
||||
$symbol = $row->currency_symbol ?: $row->currency;
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?php echo $link; ?>"><?php echo $row->plan_title; ?></a>
|
||||
</td>
|
||||
<td class="<?php echo $centerClass; ?>">
|
||||
<?php echo HTMLHelper::_('date', $row->created_date, $this->config->date_format); ?>
|
||||
</td>
|
||||
<td class="<?php echo $centerClass; ?>">
|
||||
<strong><?php echo HTMLHelper::_('date', $row->from_date, $this->config->date_format); ?></strong> <?php echo Text::_('OSM_TO'); ?>
|
||||
<strong>
|
||||
<?php
|
||||
if ($row->lifetime_membership || $row->to_date == '2099-12-31 23:59:59')
|
||||
{
|
||||
echo Text::_('OSM_LIFETIME');
|
||||
}
|
||||
else
|
||||
{
|
||||
echo HTMLHelper::_('date', $row->to_date, $this->config->date_format);
|
||||
}
|
||||
?>
|
||||
</strong>
|
||||
</td>
|
||||
<td style="text-align: right;" class="<?php echo $hiddenPhoneClass; ?>">
|
||||
<?php echo OSMembershipHelper::formatCurrency($row->gross_amount, $this->config, $symbol)?>
|
||||
</td>
|
||||
<td class="<?php echo $hiddenPhoneClass; ?>">
|
||||
<?php
|
||||
switch ($row->published)
|
||||
{
|
||||
case 0 :
|
||||
echo Text::_('OSM_PENDING');
|
||||
|
||||
if ($this->config->enable_subscription_payment && $row->gross_amount > 0 && $hasOnlinePaymentPlugin)
|
||||
{
|
||||
?>
|
||||
<br /><a class="<?php echo $bootstrapHelper->getClassMapping('btn btn-primary'); ?>" href="<?php echo Route::_('index.php?option=com_osmembership&view=payment&transaction_id=' . $row->transaction_id . '&Itemid=' . $makePaymentItemid); ?>"><?php echo Text::_('OSM_MAKE_PAYMENT'); ?></a>
|
||||
<?php
|
||||
}
|
||||
|
||||
break;
|
||||
case 1 :
|
||||
echo Text::_('OSM_ACTIVE');
|
||||
break;
|
||||
case 2 :
|
||||
echo Text::_('OSM_EXPIRED');
|
||||
break;
|
||||
case 3 :
|
||||
echo Text::_('OSM_CANCELLED_PENDING');
|
||||
break;
|
||||
case 4 :
|
||||
echo Text::_('OSM_CANCELLED_REFUNDED');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
if ($this->config->activate_invoice_feature)
|
||||
{
|
||||
?>
|
||||
<td class="<?php echo $hiddenPhoneClass . ' ' . $centerClass; ?>">
|
||||
<?php
|
||||
if ($row->invoice_number)
|
||||
{
|
||||
?>
|
||||
<a href="<?php echo Route::_('index.php?option=com_osmembership&task=download_invoice&id=' . $row->id); ?>" title="<?php echo Text::_('OSM_DOWNLOAD'); ?>"><?php echo OSMembershipHelper::formatInvoiceNumber($row, $this->config); ?></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<?php
|
||||
if ($showPagination && ($pagination->total > $pagination->limit))
|
||||
{
|
||||
?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="<?php echo $cols; ?>">
|
||||
<div class="pagination"><?php echo $this->pagination->getListFooter(); ?></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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;
|
||||
|
||||
/**
|
||||
* Layout variables
|
||||
*
|
||||
* @var array $rows
|
||||
* @var array $fields
|
||||
*/
|
||||
|
||||
$config = OSMembershipHelper::getConfig();
|
||||
$i = 1;
|
||||
?>
|
||||
<p style="padding-bottom: 20px; text-align: center;">
|
||||
<h1><?php echo Text::_('OSM_SUBSCRIPTIONS_LIST'); ?></h1>
|
||||
</p>
|
||||
<table border="1" width="100%" cellspacing="0" cellpadding="2" style="margin-top: 100px;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="3%" height="20" style="text-align: center;">
|
||||
No
|
||||
</th>
|
||||
<th height="20" width="8%">
|
||||
<?php echo Text::_('OSM_FIRSTNAME'); ?>
|
||||
</th height="20">
|
||||
<th height="20" width="10%">
|
||||
<?php echo Text::_('OSM_LASTNAME'); ?>
|
||||
</th height="20">
|
||||
<th height="20" width="20%">
|
||||
<?php echo Text::_('OSM_PLAN'); ?>
|
||||
</th>
|
||||
<th height="20" width="17%" style="text-align: center">
|
||||
<?php echo Text::_('OSM_START_DATE') . ' / ' . Text::_('OSM_END_DATE'); ?>
|
||||
</th>
|
||||
<th height="20" width="16%">
|
||||
<?php echo Text::_('OSM_EMAIL'); ?>
|
||||
</th>
|
||||
<th height="20" width="9%" style="text-align: center;">
|
||||
<?php echo Text::_('OSM_CREATED_DATE'); ?>
|
||||
</th>
|
||||
<th width="6%" height="20" style="text-align: right;">
|
||||
<?php echo Text::_('OSM_GROSS_AMOUNT'); ?>
|
||||
</th>
|
||||
<th width="8%" height="20">
|
||||
<?php echo Text::_('OSM_SUBSCRIPTION_STATUS'); ?>
|
||||
</th>
|
||||
<th width="3%" height="20" style="text-align: center;">
|
||||
<?php echo Text::_('OSM_ID'); ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($rows as $row)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td width="3%" style="text-align: center;"><?php echo $i++; ?></td>
|
||||
<td width="8%"><?php echo $row->first_name; ?></td>
|
||||
<td width="10%"><?php echo $row->last_name; ?></td>
|
||||
<td width="20%;"><?php echo $row->plan; ?></td>
|
||||
<td width="17%" style="text-align: center"><?php echo $row->from_date . ' / ' . $row->to_date; ?></td>
|
||||
<td width="16%"><?php echo $row->email; ?></td>
|
||||
<td width="9%" style="text-align: center;"><?php echo $row->created_date; ?></td>
|
||||
<td width="6%" style="text-align: right;"><?php echo $row->amount; ?></td>
|
||||
<th width="8%" height="20">
|
||||
<?php
|
||||
switch ($row->published)
|
||||
{
|
||||
case 0:
|
||||
echo Text::_('OSM_PENDING');
|
||||
break;
|
||||
case 1:
|
||||
echo Text::_('OSM_ACTIVE');
|
||||
break;
|
||||
case 2:
|
||||
echo Text::_('OSM_EXPIRED');
|
||||
break;
|
||||
case 3 :
|
||||
echo Text::_('OSM_CANCELLED_PENDING');
|
||||
break ;
|
||||
case 4 :
|
||||
echo Text::_('OSM_CANCELLED_REFUNDED');
|
||||
break ;
|
||||
}
|
||||
?>
|
||||
</th>
|
||||
<td width="3%" style="text-align: center;"><?php echo $row->id; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
<ul class="osm-upgrade-options">
|
||||
<?php
|
||||
$upgradeOptionCount = 0;
|
||||
|
||||
foreach ($this->upgradeRules as $rule)
|
||||
{
|
||||
$checked = '';
|
||||
|
||||
if ($upgradeOptionCount == 0)
|
||||
{
|
||||
$checked = ' checked="checked" ';
|
||||
}
|
||||
|
||||
$upgradeOptionCount++;
|
||||
$upgradeToPlan = $this->plans[$rule->to_plan_id];
|
||||
$symbol = $upgradeToPlan->currency_symbol ?: $upgradeToPlan->currency;
|
||||
|
||||
$taxRate = 0;
|
||||
|
||||
if ($this->config->show_price_including_tax && !$this->config->setup_price_including_tax)
|
||||
{
|
||||
$taxRate = OSMembershipHelper::calculateMaxTaxRate($rule->to_plan_id);
|
||||
}
|
||||
?>
|
||||
<li class="osm-upgrade-option">
|
||||
<input type="radio" class="validate[required]<?php echo $this->bootstrapHelper->getFrameworkClass('uk-radio', 1);?>" id="upgrade_option_id_<?php echo $upgradeOptionCount; ?>" name="upgrade_option_id" value="<?php echo $rule->id; ?>"<?php echo $checked; ?> />
|
||||
<label for="upgrade_option_id_<?php echo $upgradeOptionCount; ?>"><?php Text::printf('OSM_UPGRADE_OPTION_TEXT', $this->plans[$rule->from_plan_id]->title, $upgradeToPlan->title, OSMembershipHelper::formatCurrency($rule->price * (1 + $taxRate / 100), $this->config, $symbol)); ?></label>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user