Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An optional associative array of configuration settings.
  *                             Recognized key values include 'name', 'group', 'params', 'language'
  *                             (this list is not meant to be comprehensive).
  *
  * @since   1.5
  */
 public function __construct(&$subject, $config = array())
 {
     parent::__construct($subject, $config);
     $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
     if (file_exists($redcoreLoader)) {
         require_once $redcoreLoader;
         // Sets plugin parameters for further use
         RBootstrap::$config = $this->params;
         // Sets initalization variables for frontend in Bootstrap class, according to plugin parameters
         RBootstrap::$loadFrontendCSS = $this->params->get('frontend_css', false);
         RBootstrap::$loadFrontendjQuery = $this->params->get('frontend_jquery', true);
         RBootstrap::$loadFrontendjQueryMigrate = $this->params->get('frontend_jquery_migrate', true);
         RBootstrap::$disableFrontendMootools = $this->params->get('frontend_disable_mootools', false);
         if (!$this->isInstaller()) {
             RBootstrap::bootstrap(false);
         }
     }
 }
Exemplo n.º 2
0
<?php

/**
 * redCORE lib currency helper test
 *
 * @package    Redcore.UnitTest
 * @copyright  Copyright (C) 2008 - 2015 redCOMPONENT.com
 * @license    GNU General Public License version 2 or later
 */
// Register library prefix
require_once JPATH_LIBRARIES . '/redcore/bootstrap.php';
// Bootstraps redCORE
RBootstrap::bootstrap(false);
/**
 * Test class for Redevent lib helper class
 *
 * @package  Redevent.UnitTest
 * @since    1.2.0
 */
class currencyTest extends JoomlaTestCase
{
    /**
     * Test GetIsoCode
     *
     * @return void
     */
    public function testGetIsoCode()
    {
        $this->assertEquals(RHelperCurrency::getIsoCode(978), 'EUR');
        $this->assertEquals(RHelperCurrency::getIsoCode(233445), false);
        $this->assertEquals(RHelperCurrency::getIsoCode('asdasd'), false);
Exemplo n.º 3
0
<?php

/**
 * Dummy Library file.
 * Including this file into your application will make dummy available to use.
 *
 * @package    Dummy.Library
 * @copyright  Copyright (C) 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('JPATH_PLATFORM') or die;
// Define dummy Library Folder Path
define('JPATH_DUMMY_LIBRARY', __DIR__);
// Bootstraps redCORE
RBootstrap::bootstrap();
// Register library prefix
RLoader::registerPrefix('Dummy', JPATH_DUMMY_LIBRARY);
// Make available the dummy fields
JFormHelper::addFieldPath(JPATH_DUMMY_LIBRARY . '/form/fields');
// Make available the dummy form rules
JFormHelper::addRulePath(JPATH_DUMMY_LIBRARY . '/form/rules');
Exemplo n.º 4
0
 /**
  * Load redCORE library
  *
  * @return  void
  */
 public function loadRedcoreLibrary()
 {
     $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
     if (file_exists($redcoreLoader)) {
         require_once $redcoreLoader;
         RBootstrap::bootstrap(false);
     }
 }