public function display($tpl = null) { // Request $month = KInput::get('month', 'get', 'digit', null, date('m')); $year = KInput::get('year', 'get', 'int', null, date('Y')); $graph = KInput::get('graph', 'get', 'cmd', null, 'translations'); $table_name = KInput::get('table_name', 'get', KFactory::tmp('admin::com.nooku.filter.tablename'), null, ''); $this->assign('graph', $graph); $this->assign('table_name', $table_name); $this->assign('month', $month); $this->assign('year', $year); // URI $uri =& JURI::getInstance(JURI::base() . 'index.php?option=com_nooku&format=openflashchart'); $uri->setVar('table_name', $table_name); $uri->setVar('layout', 'bar'); $uri->setVar('view', 'statistics.translations'); $this->assign('translations', $uri->toString()); $uri->setVar('year', date('Y')); $uri->setVar('month', date('n')); $uri->setVar('view', 'statistics.translators'); $this->assign('translators', $uri->toString()); // panes Koowa::import('lib.joomla.html.pane'); $this->assignRef('panes', JPane::getInstance('tabs')); // Mixin a menubar object $this->mixin(new NookuMixinMenu($this)); $this->displayMenubar(); $this->displayMenutitle(); $this->displayToolbar(); // Display the layout parent::display($tpl); }
/** * Proxy for the onGetWebServices * * Will call describe for each xmlrpc event handler and return the results to * the xmlrpc server. * * @return array An array of associative arrays defining the available methods */ function onGetWebServices() { $services = array(); //Get the event dispatcher $dispatcher = KFactory::get('lib.koowa.event.dispatcher'); $path = JPATH_COMPONENT . DS . 'xmlrpc'; $dir = new DirectoryIterator($path); foreach ($dir as $file) { //Make sure we found a valid file if ($file->isDot() || in_array($file->getFilename(), array('.svn', 'index.html'))) { continue; } $filename = basename($file->getFilename(), ".php"); //Load the event handler Koowa::import('admin::com.nooku.xmlrpc.' . $filename); //Register the event handler $dispatcher->register('NookuXmlrpc' . ucfirst($filename)); } $results = $dispatcher->dispatch('describe', new ArrayObject()); foreach ($results as $result) { foreach ($result as $key => $value) { $services[$key] = $value; } } return $services; }
/** * Get a list of tablename => links * * @return array */ public function getLinks() { if (!isset($this->_links)) { // Load all editlinks files Koowa::import('lib.joomla.filesystem.folder'); $filter = '\\.php$'; $path = JPATH_COMPONENT . DS . 'configs'; foreach (JFolder::files($path . DS . 'core', $filter, false, true) as $file) { include $file; } foreach (JFolder::files($path . DS . 'user', $filter, false, true) as $file) { include $file; } } return $this->_links; }
<?php /** * @version $Id:openflashchart.php 137 2007-11-20 18:32:09Z mjaz $ * @category Koowa * @package Koowa_Chart * @subpackage OpenFlashChart * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.koowa.org */ Koowa::import('lib.koowa.chart.renderer.open-flash-chart.open-flash-chart'); /** * Chart Data class with Open Flash Chart * * @author Mathias Verraes <*****@*****.**> * @category Koowa * @package Koowa_Chart * @subpackage OpenFlashChart * @uses KObject */ class KChartOpenflashchart extends KObject { /** * The Openflashchart data * * @var object Graph */ protected $_data; public function __construct() {
<?php // Require the defines Koowa::import('admin::com.immotoa.defines'); Koowa::import('admin::com.immotoa.loader'); // Create the component dispatcher $dispatcher = KFactory::get('admin::com.immotoa.dispatcher'); $dispatcher->dispatch(array('default_view' => 'properties'));
<?php // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Require the defines Koowa::import('admin::com.picman.defines'); // Create the component dispatcher $dispatcher = KFactory::get('site::com.picman.dispatcher'); $dispatcher->dispatch(array('default_view' => 'albums'));
* @version $Id: nooku.php 923 2009-03-03 17:54:50Z johan $ * @category Nooku * @package Nooku_Administrator * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.nooku.org */ // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Check if Nooku is active if (!defined('NOOKU')) { JError::raiseWarning(0, JText::_("The Nooku plugin isn't enabled.")); return; } // Require the defines Koowa::import('admin::com.nooku.defines'); Koowa::import('admin::com.nooku.loader'); // Check if this is the first run include JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_nooku' . DS . 'configs' . DS . 'first_run.php'; if ($first_run) { KInput::set('view', 'installation', 'get'); KInput::set('task', 'finish', 'get'); } // Create the component dispatcher $dispatcher = KFactory::get('admin::com.nooku.dispatcher'); $dispatcher->dispatch(array('default_view' => 'dashboard'));
* @package Nooku_Plugins * @subpackage System * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPLv2 * @link http://www.nooku.org */ // Check if Koowa is active if (!defined('KOOWA')) { return; } // Require the library loader Koowa::import('admin::com.nooku.defines'); //import the dbo decorator Koowa::import('admin::com.nooku.proxies.database'); Koowa::import('admin::com.nooku.proxies.language'); Koowa::import('com.nooku.proxies.application'); /** * Nooku System plugin * * @author Johan Janssens <*****@*****.**> * @category Nooku * @package Nooku_Plugins * @subpackage System */ class plgSystemNooku extends JPlugin { public function __construct($subject, $config = array()) { $db =& JFactory::getDBO(); if (!$db instanceof KDatabase) { return;
<?php // Require the defines Koowa::import('admin::com.picman.defines'); Koowa::import('admin::com.picman.loader'); // Create the component dispatcher $dispatcher = KFactory::get('admin::com.picman.dispatcher'); $dispatcher->dispatch(array('default_view' => 'imageslist'));
/** * Get a Pagination object * * @return JPagination */ public function getPagination() { // Get the data if it doesn't already exist if (!isset($this->_pagination)) { Koowa::import('lib.joomla.html.pagination'); $this->_pagination = new JPagination($this->getTotal(), $this->getState('offset'), $this->getState('limit')); } return $this->_pagination; }
<?php // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Require the defines Koowa::import('admin::com.immotoa.defines'); // Create the component dispatcher $dispatcher = KFactory::get('site::com.immotoa.dispatcher'); $dispatcher->dispatch(array('default_view' => 'properties'));
<?php /** * @version $Id: nooku.php 923 2009-03-03 17:54:50Z johan $ * @category Nooku * @package Nooku_Plugins * @subpackage Editor-Xtd * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPLv2 * @link http://www.nooku.org */ Koowa::import('admin::com.nooku.defines'); /** * Nooku Editors-xtd plugin * * @author Johan Janssens <*****@*****.**> * @category Nooku * @package Nooku_Plugins * @subpackage Editor-Xtd */ class plgButtonNooku extends JPlugin { /** * Handle the onDisplay event for the button * * @return object A JObject containing the button settings */ function onDisplay($name) { if (!KFactory::get('admin::com.nooku.model.permissions')->canTranslate() || KInput::get('option', array('post', 'get'), 'cmd') != 'com_content' || KInput::get('task', array('post', 'get'), 'cmd') != 'edit') { return new JObject();
<?php // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Require the defines Koowa::import('admin::com.formules.defines'); // Create the component dispatcher $dispatcher = KFactory::get('site::com.formules.dispatcher'); $dispatcher->dispatch(array('default_view' => 'claeys'));
<?php /** * @version $Id: poll.php 970 2009-04-12 16:05:22Z johan $ * @category Nooku * @package Nooku_Administrator * @subpackage Events * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.nooku.org */ Koowa::import('admin::com.nooku.events.default'); /** * Poll Event Handler * * @author Johan Janssens <*****@*****.**> * @category Nooku * @package Nooku_Administrator * @subpackage Events */ class NookuEventPoll extends NookuEventDefault { public function __construct() { parent::__construct(); $this->_table = 'polls'; } }
/** * Load a template file -- first look in the templates folder for an override * * @param string $tpl The name of the template source file ... * automatically searches the template paths and compiles as needed. * @throws KViewException * @return string The output of the the template script. */ public function loadTemplate($tpl = null) { // clear prior output $this->_output = null; // clean the file name //$tpl = preg_replace('/[^A-Z0-9_\.-]/i', '', $tpl); //create the template file name based on the layout $file = isset($tpl) ? $this->_layout . '_' . $tpl : $this->_layout; // load the template script Koowa::import('lib.joomla.filesystem.path'); $this->_template = JPath::find($this->_templatePath, $file . '.php'); if ($this->_template === false) { throw new KViewException('Layout "' . $file . '" not found'); } // unset so as not to introduce into template scope unset($tpl); unset($file); // never allow a 'this' property if (isset($this->this)) { unset($this->this); } // start capturing output into a buffer ob_start(); // include the requested template filename in the local scope // (this will execute the view logic). include 'tmpl://' . $this->_template; // done with the requested template; get the buffer and // clear it. $this->_output = ob_get_contents(); ob_end_clean(); return $this->_output; }
<?php // Require the defines Koowa::import('admin::com.duuka.defines'); Koowa::import('admin::com.duuka.loader'); // Create the component dispatcher $dispatcher = KFactory::get('admin::com.duuka.dispatcher'); $dispatcher->dispatch(array('default_view' => 'items'));
<?php // Require the defines Koowa::import('admin::com.formules.defines'); Koowa::import('admin::com.formules.loader'); // Create the component dispatcher $dispatcher = KFactory::get('admin::com.formules.dispatcher'); $dispatcher->dispatch(array('default_view' => 'taxations'));
/** * @version $Id: nooku.php 923 2009-03-03 17:54:50Z johan $ * @category Nooku * @package Nooku_Site * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.nooku.org */ // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Check if Nooku is active if (!defined('NOOKU')) { JError::raiseWarning(0, JText::_("The Nooku plugin isn't enabled.")); return; } // Require the defines Koowa::import('site::com.nooku.defines'); Koowa::import('site::com.nooku.loader'); // Options for the dispatcher $options = array('default_view' => 'translate'); // Map views to dispatchers $map = array('translate' => 'admin::com.nooku.dispatcher', 'translate.source' => 'admin::com.nooku.dispatcher', 'redirect' => 'site::com.nooku.dispatcher', 'default' => 'site::com.nooku.dispatcher'); // Create the component dispatcher $view = KInput::get('view', 'get', 'cmd'); $name = array_key_exists($view, $map) ? $map[$view] : $map['default']; KFactory::get($name)->dispatch($options);
/** * Get an instance of an instanciatable class * * @param array Object information * @param array Object options * @throws KFactoryAdapterException * @return object */ protected static function _getInstanceByArray($object, array $options = array()) { $instance = false; if (array_key_exists('application', $object)) { $client = $object['application']; } else { $client = ''; } if (array_key_exists('component', $object)) { $component = $object['component']; } else { $component = ''; } if (array_key_exists('type', $object)) { $type = $object['type']; } else { $type = ''; } if (array_key_exists('name', $object)) { $name = $object['name']; } else { $name = ''; } if (array_key_exists($object['type'], self::$_objectMap)) { $base = self::$_objectMap[$object['type']]; } else { $base = $object['type']; } $classname = ucfirst($component) . ucfirst($type) . ucfirst($name); if (!class_exists($classname)) { //Create path if (!isset($options['base_path'])) { $options['base_path'] = JApplicationHelper::getClientInfo($client, true)->path; $options['base_path'] .= DS . 'components' . DS . 'com_' . $component; if (!empty($name)) { $options['base_path'] .= DS . KInflector::pluralize($type); } } //Find the file Koowa::import('lib.joomla.filesystem.path'); if ($file = JPath::find($options['base_path'], self::_getFileName($type, $name))) { require_once $file; if (!class_exists($classname)) { throw new KFactoryAdapterException($classname . ' not found in file.'); } //Set the view base_path in the options array $options['base_path'] = dirname($file); } else { if (class_exists('K' . ucfirst($base) . ucfirst($name))) { $classname = 'K' . ucfirst($base) . ucfirst($name); } else { $classname = 'K' . ucfirst($base) . 'Default'; } } } if (class_exists($classname)) { $options['name'] = array('prefix' => $component, 'base' => $base, 'suffix' => $name); $instance = new $classname($options); } return $instance; }
<?php /** * @version $Id: line.php 663 2009-03-03 18:34:43Z johan $ * @category Koowa * @package Koowa_Chart * @subpackage Sparkline * @copyright Copyright (C) 2007 - 2009 Joomlatools. All rights reserved. * @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html> * @link http://www.koowa.org */ Koowa::import('lib.koowa.chart.renderer.sparkline.Sparkline_Line'); /** * Sparkline Line * * @author Mathias Verraes <*****@*****.**> * @category Koowa * @package Koowa_Chart * @subpackage Sparkline */ class KChartSparklineLine extends KChartSparkline { /** * Get an instance of a SparklineLine object, always creating it * * @param array Configuration array * @return object KChartSparklineBar proxy object */ public static function getInstance($config = array()) { if (!isset($config['catch_errors'])) {
<?php // no direct access defined('_JEXEC') or die('Restricted access'); // Check if Koowa is active if (!defined('KOOWA')) { JError::raiseWarning(0, JText::_("Koowa wasn't found. Please install the Koowa plugin and enable it.")); return; } // Require the defines Koowa::import('admin::com.duuka.defines'); // Create the component dispatcher $dispatcher = KFactory::get('site::com.duuka.dispatcher'); $dispatcher->dispatch(array('default_view' => 'items'));