/** * Proxy the application getMenu() method * * @access public * @param array $options An optional associative array of configuration settings. * @return object NookuProxyMenu. */ public function getMenu($name = null, $options = array()) { if (!isset(self::$_menu)) { self::$_menu = KFactory::get('site::com.nooku.proxy.menu', $options); } return self::$_menu; }
public function __construct($subject, $config = array()) { $db =& JFactory::getDBO(); if (!$db instanceof KDatabase) { return; } //Create the application proxy object $app =& JFactory::getApplication(); if ($app instanceof KPatternProxy) { $app =& $app->getObject(); } $app = new NookuProxyApplication($app); //Create the router proxy object (force load it) $router = $app->getRouter(); //Create the database proxy object $db =& JFactory::getDBO(); if ($db instanceof KPatternProxy) { $db =& $db->getObject(); } $db = new NookuProxyDatabase($db); //Set the data in the database proxy $nooku = KFactory::get('admin::com.nooku.model.nooku'); $db->setLanguages($nooku->getLanguages()); $db->setTables($nooku->getTables()); $db->setPrimaryLanguage($nooku->getPrimaryLanguage()->iso_code); //Set the language $nooku->setLanguage(); //Create the language proxy object $lang =& JFactory::getLanguage(); $lang = new NookuProxyLanguage($lang); // Add 'metadata' to inflector cache KInflector::addWord('metadata', 'metadata'); // Nooku is active define('NOOKU', 1); parent::__construct($subject, $config); }