Ejemplo n.º 1
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $options = array();
     foreach ($node->children() as $option) {
         $val = $option->attributes('value');
         $text = $option->data();
         $options[] = (object) array('id' => $val, 'title' => JText::_($text));
     }
     $config = array('list' => (object) $options, 'name' => $control_name . '[' . $name . ']', 'selected' => $value);
     return Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select')->radiolist($config);
 }
Ejemplo n.º 2
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     $template = Library\ObjectManager::getInstance()->getObject('com:pages.view.page')->getTemplate();
     $class = $node->attributes('class') ? $node->attributes('class') : 'inputbox';
     $helper = Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select', array('template' => $template));
     $options = array();
     foreach ($node->children() as $option) {
         $options[] = $helper->option(array('value' => $option->attributes('value'), 'text' => $option->data()));
     }
     $config = array('options' => $options, 'name' => $control_name . '[' . $name . ']', 'selected' => $value, 'attribs' => array('class' => array($class)));
     return Nooku\Library\ObjectManager::getInstance()->getObject('lib:template.helper.select', array('template' => $template))->optionlist($config);
 }
Ejemplo n.º 3
0
 /**
  * Get a cache object
  *
  * Returns a reference to the global {@link JCache} object
  *
  * @access public
  * @param string The cache group name
  * @param string The handler to use
  * @param string The storage method
  * @return object JCache
  */
 function &getCache($group = '', $handler = 'callback', $storage = null)
 {
     $handler = $handler == 'function' ? 'callback' : $handler;
     $conf =& JFactory::getConfig();
     if (!isset($storage)) {
         $storage = $conf->getValue('config.cache_handler', 'file');
     }
     $options = array('defaultgroup' => $group, 'cachebase' => $conf->getValue('config.cache_path'), 'lifetime' => $conf->getValue('config.cachetime') * 60, 'language' => $conf->getValue('config.language'), 'storage' => $storage, 'site' => Nooku\Library\ObjectManager::getInstance()->getObject('application')->getSite());
     jimport('joomla.cache.cache');
     $cache =& JCache::getInstance($handler, $options);
     $cache->setCaching($conf->getValue('config.caching'));
     return $cache;
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  *
  * Prevent creating instances of this class by making the constructor private
  *
  * @param  array  An optional array with configuration options.
  */
 private final function __construct($config = array())
 {
     //Initialize the path
     $this->_path = dirname(__FILE__);
     //Load the legacy functions
     require_once $this->_path . '/legacy.php';
     //Create the loader
     require_once $this->_path . '/class/loader.php';
     $loader = Nooku\Library\ClassLoader::getInstance($config);
     //Create the object manager
     $config['class_loader'] = $loader;
     Nooku\Library\ObjectManager::getInstance($config);
 }
Ejemplo n.º 5
0
<?php

/**
 * @package     Nooku_Server
 * @copyright   Copyright (C) 2007 - 2012 Johan Janssens. All rights reserved.
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */
define('JPATH_ROOT', realpath($_SERVER['DOCUMENT_ROOT']));
define('JPATH_APPLICATION', JPATH_ROOT . '/application/admin');
define('JPATH_VENDOR', JPATH_ROOT . '/vendor');
define('JPATH_SITES', JPATH_ROOT . '/sites');
define('JPATH_BASE', JPATH_APPLICATION);
define('DS', DIRECTORY_SEPARATOR);
require_once __DIR__ . '/bootstrap.php';
Nooku\Library\ObjectManager::getInstance()->getObject('application')->run();
Ejemplo n.º 6
0
 /**
  * Create a language object
  *
  * @access private
  * @return object JLanguage
  * @since 1.5
  */
 function &_createLanguage()
 {
     jimport('joomla.language.language');
     //Get the active language
     $languages = Nooku\Library\ObjectManager::getInstance()->getObject('application.languages');
     $active = $languages->getActive()->iso_code;
     $conf =& JFactory::getConfig();
     $lang =& JLanguage::getInstance($active);
     $lang->setDebug($conf->getValue('config.debug_lang'));
     return $lang;
 }