Exemplo n.º 1
0
 /**
  * Method to register custom library.
  *
  * @return  void
  */
 public function onAfterInitialise()
 {
     if (!$this->isRedcoreComponent()) {
         return;
     }
     $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
     if (file_exists($redcoreLoader)) {
         require_once $redcoreLoader;
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
         }
     }
     // Make available the fields
     JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields');
     // Make available the rules
     JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules');
 }
Exemplo n.º 2
0
 /**
  * Method to register custom library.
  *
  * @return  void
  */
 public function onAfterInitialise()
 {
     $isAdmin = JFactory::getApplication()->isAdmin();
     if (!$isAdmin || !$this->isRedradComponent()) {
         return;
     }
     $redradLoader = JPATH_LIBRARIES . '/redrad/bootstrap.php';
     if (file_exists($redradLoader) && !class_exists('Inflector')) {
         require_once $redradLoader;
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redrad/joomla', false, true);
         }
     }
     // Make available the fields
     JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redrad/form/fields');
     // Make available the rules
     JFormHelper::addRulePath(JPATH_LIBRARIES . '/redrad/form/rules');
 }
Exemplo n.º 3
0
/**
 * Bootstrap file.
 * Including this file into your application will make redRad available to use.
 *
 * @package    RedRad
 * @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('JPATH_REDRAD', __DIR__);
require JPATH_REDRAD . '/inflector/inflector.php';
// Use our own base field
if (!class_exists('JFormField', false)) {
    $baseField = JPATH_LIBRARIES . '/redrad/joomla/form/field.php';
    if (file_exists($baseField)) {
        require_once $baseField;
    }
}
// Register the classes for autoload.
JLoader::registerPrefix('R', JPATH_REDRAD);
// Setup the RLoader.
RLoader::setup();
// Make available the redRAD fields
JFormHelper::addFieldPath(JPATH_REDRAD . '/form/fields');
// Make available the redRAD form rules
JFormHelper::addRulePath(JPATH_REDRAD . '/form/rules');
// HTML helpers
JHtml::addIncludePath(JPATH_REDRAD . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_redrad', JPATH_SITE);
Exemplo n.º 4
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.º 5
0
 /**
  * Effectively bootstrap redCORE.
  *
  * @param   bool  $loadBootstrap  Load bootstrap with redcore plugin options
  *
  * @return  void
  */
 public static function bootstrap($loadBootstrap = true)
 {
     if ($loadBootstrap && !defined('REDCORE_BOOTSTRAPPED')) {
         define('REDCORE_BOOTSTRAPPED', 1);
     }
     if (!defined('REDCORE_LIBRARY_LOADED')) {
         // Sets bootstrapped variable, to avoid bootstrapping redCORE twice
         define('REDCORE_LIBRARY_LOADED', 1);
         // Use our own base field
         if (!class_exists('JFormField', false)) {
             $baseField = JPATH_LIBRARIES . '/redcore/joomla/form/field.php';
             if (file_exists($baseField)) {
                 require_once $baseField;
             }
         }
         // Register the classes for autoload.
         JLoader::registerPrefix('R', JPATH_REDCORE);
         // Setup the RLoader.
         RLoader::setup();
         // Make available the redCORE fields
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/field');
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/fields');
         // Make available the redCORE form rules
         JFormHelper::addRulePath(JPATH_REDCORE . '/form/rules');
         // HTML helpers
         JHtml::addIncludePath(JPATH_REDCORE . '/html');
         RHtml::addIncludePath(JPATH_REDCORE . '/html');
         // Load library language
         $lang = JFactory::getLanguage();
         $lang->load('lib_redcore', JPATH_REDCORE);
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
         }
         // Make available the fields
         JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields');
         // Make available the rules
         JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules');
         // Replaces Joomla database driver for redCORE database driver
         JFactory::$database = null;
         JFactory::$database = RFactory::getDbo();
         if (self::getConfig('enable_translations', 0) == 1 && !JFactory::getApplication()->isAdmin()) {
             // This is our object now
             $db = JFactory::getDbo();
             // Enable translations
             $db->translate = self::getConfig('enable_translations', 0) == 1;
             // Reset plugin translations params if needed
             RTranslationHelper::resetPluginTranslation();
         }
     }
 }
Exemplo n.º 6
0
/**
 * @package     Tracks
 * @subpackage  Library
 * @copyright   Tracks (C) 2008-2015 Julien Vonthron. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
$redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
if (!file_exists($redcoreLoader) || !JPluginHelper::isEnabled('system', 'redcore')) {
    throw new Exception(JText::_('COM_TRACKS_REDCORE_INIT_FAILED'), 404);
}
include_once $redcoreLoader;
// Bootstraps redCORE
RBootstrap::bootstrap();
// Register library prefix
RLoader::registerPrefix('Trackslib', __DIR__);
// Make available the fields
JFormHelper::addFieldPath(JPATH_LIBRARIES . '/tracks/form/field');
JFormHelper::addFieldPath(JPATH_LIBRARIES . '/tracks/form/fields');
// Make available the form rules
JFormHelper::addRulePath(JPATH_LIBRARIES . '/tracks/form/rule');
JFormHelper::addRulePath(JPATH_LIBRARIES . '/tracks/form/rules');
/**
 * Tracks bootstrap class
 *
 * @package     Tracks
 * @subpackage  Library
 * @since       3.0
 */
class TrackslibBootstrap
{
Exemplo n.º 7
0
<?php

/**
 * @package    Redsource.Admin
 *
 * @copyright  Copyright (C) 2012 - 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('_JEXEC') or die;
if (!class_exists('RLoader')) {
    throw new RuntimeException('Please enable redRAD System plugin!');
}
RLoader::registerPrefix('Redsource', __DIR__);
RLoader::registerPrefix('Redsource', JPATH_LIBRARIES . '/redsource');
$app = JFactory::getApplication();
// Check access.
if (!JFactory::getUser()->authorise('core.manage', 'com_redsource')) {
    $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
    return false;
}
// Instanciate and execute the front controller.
$controller = JControllerLegacy::getInstance('Redsource');
$controller->execute($app->input->get('task'));
$controller->redirect();
Exemplo n.º 8
0
<?php

/**
 * @package    Redcore.Admin
 *
 * @copyright  Copyright (C) 2012 - 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('_JEXEC') or die;
if (!class_exists('RLoader')) {
    throw new RuntimeException('Please enable redCORE System plugin!');
}
RLoader::registerPrefix('Redcore', __DIR__);
$app = JFactory::getApplication();
// Check access.
if (!JFactory::getUser()->authorise('core.manage', 'com_redcore')) {
    $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
    return false;
}
// Instanciate and execute the front controller.
$controller = JControllerLegacy::getInstance('Redcore');
$controller->execute($app->input->get('task'));
$controller->redirect();
Exemplo n.º 9
0
<?php

/**
 * Created by JetBrains PhpStorm.
 * User: nha.redweb
 * Date: 4/3/13
 * Time: 11:46 AM
 * To change this template use File | Settings | File Templates.
 */
// No direct access to this file
defined('_JEXEC') or die;
// Register component prefix
RLoader::registerPrefix('OpenHrm', __DIR__);
// Access check: is this user allowed to access the backend of this component?
if (!JFactory::getUser()->authorise('core.manage', 'com_openhrm')) {
    return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}
// require helper file
JLoader::register('OpenHrm', dirname(__FILE__) . '/helpers/openhrm.php');
require_once JPATH_ADMINISTRATOR . '/components/com_openhrm/define.php';
require_once JPATH_ADMINISTRATOR . '/components/com_openhrm/classes/admin.view.php';
// Get an instance of the controller
$controller = JControllerLegacy::getInstance('OpenHrm');
// Get the task
$input = JFactory::getApplication()->input;
$task = $input->get('task', "", 'SRT');
// Perform the Request task
$controller->execute($task);
// Redirect if set by the controller
$controller->redirect();
Exemplo n.º 10
0
<?php

/**
 * @package     Jab.Admin
 * @subpackage  Entry
 *
 * @copyright   Copyright (C) 2013 Roberto Segura López. All rights reserved.
 * @license     GNU General Public License version 2 or later, see LICENSE.
 */
defined('_JEXEC') or die;
// Register component prefix
JLoader::registerPrefix('Jab', __DIR__);
RLoader::registerPrefix('Jab', JPATH_LIBRARIES . '/jab');
// Require redRAD
require_once JPATH_LIBRARIES . '/redrad/bootstrap.php';
$app = JFactory::getApplication();
// Check access.
if (!JFactory::getUser()->authorise('core.manage', 'com_redtest')) {
    $app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
    return false;
}
// Instanciate and execute the front controller.
$controller = JControllerLegacy::getInstance('Jab');
$controller->execute($app->input->get('task'));
$controller->redirect();