/** * This checks for the correct Short Version. * * @return void */ public function testGetShortVersion() { $this->assertThat(JPlatform::getShortVersion(), $this->isType('string'), 'getShortVersion should return a string with the version.'); }
public function onBeforeDisplayCheckoutStep2View(&$view) { $session = JFactory::getSession(); $db = JFactory::getDbo(); // Получение списка городов/стран (через кэш) $list = $this->getDestinations(); // Формирования значения по умолчанию для поля city/state $code_city = $view->user->city ? array_search($view->user->city, $list['city']) : 0; $code_region = $view->user->state ? array_search($view->user->state, $list['region']) : 0; // Формирования значения по умолчанию для поля d_city/d_state $code_d_city = $view->user->d_city ? array_search($view->user->d_city, $list['city']) : 0; $code_d_region = $view->user->d_state ? array_search($view->user->d_state, $list['region']) : 0; $q = "SELECT `country_id` FROM `#__jshopping_countries` WHERE `name_en-GB` = 'Russian Federation' LIMIT 1"; $db->setQuery($q); $russia_code = $db->loadResult(); // Проверка наличия способов доставки кроме eDost // Если есть, то пропускать на след.шаг с неверно заполненным полем город/область $ship = JTable::getInstance('shippingmethod', 'jshop'); $shipCount = count($ship->getAllShippingMethods(1)); // Проверка текущей версии Joomla $isJ25 = version_compare(JPlatform::getShortVersion(), '12.0') < 0; // Добавление директории tmpl для поиска layot'ов (специальное оформление страницы адреса) $edExt = JTable::getInstance('shippingExt', 'jshop'); $edExt->load(array('alias' => 'edost')); $edCfg = $edExt->getParams(); $tmpl = $edCfg['layout'] ? $edCfg['layout'] : 'default'; $view->addTemplatePath(JPATH_ROOT . '/components/com_jshopping/shippings/edost/tmpl/layout/' . $tmpl); $view->assign('code_city', $code_city); $view->assign('code_region', $code_region); $view->assign('code_d_city', $code_d_city); $view->assign('code_d_region', $code_d_region); $view->assign('russia_code', $russia_code); $view->assign('edostRequired', $shipCount > 1 ? false : true); $view->assign('edostRegions', $list['region']); $view->assign('edostCitys', $list['city']); $view->assign('regionGroups', $list['region_group']); $view->assign('cityLink', $list['city_link']); $view->assign('def_region', $edCfg['def_region']); $view->assign('isJ25', $isJ25); // Принудительная настройка полей для основного адреса $view->config_fields['city']['display'] = 1; $view->config_fields['city']['require'] = 0; $view->config_fields['country']['display'] = 1; $view->config_fields['country']['require'] = 0; $view->config_fields['zip']['display'] = 1; $view->config_fields['zip']['require'] = 0; $view->config_fields['state']['display'] = 1; $view->config_fields['state']['require'] = 0; // Принудительная настройка полей для дополнительного адреса $view->config_fields['d_city']['display'] = 1; $view->config_fields['d_city']['require'] = 0; $view->config_fields['d_country']['display'] = 1; $view->config_fields['d_country']['require'] = 0; $view->config_fields['d_zip']['display'] = 1; $view->config_fields['d_zip']['require'] = 0; $view->config_fields['d_state']['display'] = 1; $view->config_fields['d_state']['require'] = 0; return true; }
/** * This checks for the correct Short Version. * * @return void */ public function testGetShortVersion() { $expected = '11.2.0'; $this->assertEquals($expected, JPlatform::getShortVersion(), 'Should get the correct Short Version'); }
<?php /** * @package Joomla.Platform * * @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; // Define the Joomla Platform version if not already defined. if (!defined('JPLATFORM')) { define('JPLATFORM', JPlatform::getShortVersion()); } /** * Version information class for the Joomla Platform. * * @package Joomla.Platform * @since 11.1 */ final class JPlatform { // Product name. const PRODUCT = 'Joomla Platform'; // Release version. const RELEASE = '11.1'; // Maintenance version. const MAINTENANCE = '0'; // Development STATUS. const STATUS = 'Dev'; // Build number. const BUILD = 0;
<?php /* * pm_edost.php * * Copyright 2015 Bass <*****@*****.**> * */ defined('_JEXEC') or die('Restricted access'); if (version_compare(JPlatform::getShortVersion(), '12.0') >= 0) { // Joomla 3.x define('IS_J2x', false); } else { // Joomla 2.5 define('IS_J2x', true); } class pm_edost extends PaymentRoot { const NAME = "pm_edost"; const LOG_NAME = "PMED"; function __construct() { $lang = JFactory::getLanguage(); $lang->load('plg_jshoppingcheckout_edost.sys', JPATH_ADMINISTRATOR); } // ------------------------------------------------------------------------- // Формирование интерфейса конфигурирования (админка) // ------------------------------------------------------------------------- // cfg Текущая конфигурация модуля // ------------------------------------------------------------------------- function showAdminFormParams($cfg)