public function onApplicationAfterDispatch(ArrayObject $args) { if (KInput::get('task', 'get', 'cmd') == 'edit') { $doc = KFactory::get('lib.joomla.document'); $doc->addScript(Koowa::getUrl('js') . 'koowa.js'); $doc->addScript(Nooku::getUrl('js') . 'ajax.metadata.menus.js'); } }
public function onApplicationAfterDispatch(ArrayObject $args) { if (in_array(KInput::get('task', array('get', 'post'), 'cmd'), array('edit', 'add'))) { $doc = KFactory::get('lib.joomla.document'); $doc->addScript(Koowa::getUrl('js') . 'koowa.js'); $doc->addScript(Nooku::getUrl('js') . 'ajax.form.js'); } }
public function onApplicationAfterDispatch(ArrayObject $args) { parent::onApplicationAfterDispatch($args); if (in_array(KInput::get('task', array('get', 'post'), 'cmd'), array('edit', 'add'))) { $doc = KFactory::get('lib.joomla.document'); $doc->addScript(Nooku::getUrl('js') . 'ajax.metadata.content.js'); } }
public static function url($lang, $icons_url = null, $ext = '.png') { if (!$icons_url) { $icons_url = Nooku::getURL('media') . 'images/flags/'; } if (empty($lang->image)) { $result = $icons_url . KViewHelper::_('nooku.flag.country', $lang) . $ext; } else { $result = $icons_url . $lang->image; } return $result; }
public function getList() { if (!isset($this->_list)) { jimport('joomla.filesystem.folder'); $iso = KFactory::get('admin::com.nooku.model.isocountries'); $flagsdir = Nooku::getPath('flags'); $flagsurl = Nooku::getUrl('flags'); $files = JFolder::files($flagsdir, '(.*)\\.png'); foreach ($files as $file) { $code = basename($file, '.png'); $country = $iso->getCountry($code); $this->_list[$code] = $country ? $country : $code; } asort($this->_list); } return $this->_list; }
/** * 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(); } KViewHelper::_('behavior.modal'); $doc = KFactory::get('lib.joomla.document'); $css = ' .button2-left .translate { ' . ' background:transparent url( ' . Nooku::getURL('media') . 'images/button_translate.png) no-repeat scroll 100% 0pt;' . ' } '; $doc->addStyleDeclaration($css); $cid = KInput::get('cid', array('post', 'get'), 'array.ints'); $cid = (int) $cid[0]; if ($cid === 0) { $cid = KInput::get('id', array('post', 'get'), 'string', 'int'); } $button = new JObject(); $button->set('modal', true); $button->set('link', 'index.php?option=com_nooku&view=translate&tmpl=component&id=' . $cid . '&editor=' . $name); $button->set('text', JText::_('Translate')); $button->set('name', 'translate'); $button->set('options', "{handler: 'iframe', size: {x: 900, y: 600}}"); return $button; }
<?php /** $Id: default.php 745 2008-10-01 02:23:40Z Johan $ */ defined('_JEXEC') or die; ?> <?php @helper('stylesheet', 'grid.css', Nooku::getURL('css')); ?> <form action="<?php echo @route(); ?> " method="post" name="adminForm"> <table class="adminlist" style="clear: both;"> <thead> <tr> <th width="5"> <?php echo @text('NUM'); ?> </th> <th width="20"> <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count(@$tables); ?> );" /> </th> <th> <?php echo @helper('grid.sort', 'NAME', 'table_name', @$filter['direction'], @$filter['order']);
/** * Framework loader * * @author Johan Janssens <http://nooku.assembla.com/profile/johanjanssens> */ use Nooku\Library; //Installation check if (!file_exists(JPATH_ROOT . '/config/config.php') || filesize(JPATH_ROOT . '/config/config.php') < 10) { echo 'No configuration file found. Exciting...'; exit; } // Joomla : setup require_once JPATH_VENDOR . '/joomla/import.php'; jimport('joomla.environment.uri'); jimport('joomla.html.html'); jimport('joomla.html.parameter'); jimport('joomla.utilities.utility'); jimport('joomla.language.language'); // Koowa : setup require_once JPATH_ROOT . '/config/config.php'; $config = new JConfig(); require_once JPATH_ROOT . '/library/nooku.php'; \Nooku::getInstance(array('cache_prefix' => md5($config->secret) . '-cache-koowa', 'cache_enabled' => $config->caching)); unset($config); //Setup the component locator Library\ClassLoader::getInstance()->getLocator('com')->registerNamespaces(array('\\' => JPATH_APPLICATION . '/component', 'Nooku\\Component' => JPATH_ROOT . '/component')); //Add the different applications Library\ClassLoader::getInstance()->addApplication('site', JPATH_ROOT . '/application/site'); Library\ClassLoader::getInstance()->addApplication('admin', JPATH_ROOT . '/application/admin'); //Bootstrap the components Library\ObjectManager::getInstance()->getObject('lib:bootstrapper.application', array('directory' => JPATH_APPLICATION . '/component'))->bootstrap();
<?php /** $Id: default_footer.php 555 2008-06-30 20:36:21Z mathias $ */ defined('_JEXEC') or die('Restricted access'); ?> <div style="clear:both;text-align:center;padding-top:16px;"> <a href="http://www.nooku.org" target="_blank">Nooku</a> version <?php echo Nooku::getVersion(); ?> - Copyright (C) 2007 - <?php echo date('Y'); ?> <a href="http://www.joomlatools.org" target="_blank">Joomlatools</a>. All rights reserved. </div>
<?php /** $Id: default.php 787 2008-10-28 17:03:08Z mathias $ */ defined('_JEXEC') or die; ?> <?php @helper('stylesheet', 'translate.css', Nooku::getURL('css')); @helper('script', 'view.translate.js', Nooku::getURL('js')); ?> <script type="text/javascript"> function insertTranslation() { window.parent.tinyMCE.setContent(tinyMCE.getContent()); return false; } var article_id = <?php echo @$id; ?> ; </script> <fieldset style="width: 860px;"> <div class="configuration" style="float: left;"> <?php echo @text('Translate'); ?> </div> <div style="float: right;">
public static function flags() { $result = ''; $url = Nooku::getUrl('flags'); $flags = KFactory::get('admin::com.nooku.model.flags')->getList(); foreach ($flags as $code => $country) { $result .= '<a href="javascript:clickFlag(\'' . $code . '\')" class="flag_select_wrapper">' . '<img class="flag_select_img" src="' . $url . $code . '.png" />' . '<div class="flag_select_country">' . $country . '</div>' . '</a>' . PHP_EOL; } return $result; }
<?php /** $Id: form.php 852 2008-11-14 01:28:43Z mathias $ */ @helper('behavior.tooltip'); @helper('script', 'view.language.js', Nooku::getURL('js')); @helper('stylesheet', 'form.css', Nooku::getURL('css')); echo @helper('behavior.modal'); ?> <form action="<?php echo @route('id=' . @$language->id); ?> " method="post" class="adminform" name="adminForm"> <div class="col40"> <fieldset id="lang_langpack"> <legend><?php echo @text('Language pack'); ?> </legend> <dl> <dt><label><?php echo @text('Language pack'); ?> </label></dt> <dd> <?php echo @helper('nooku.select.langpacks', @$language->iso_code); ?> </dd> </dl> </fieldset>
<?php /** $Id: default.php 852 2008-11-14 01:28:43Z mathias $ */ defined('_JEXEC') or die; ?> <?php @helper('stylesheet', 'grid.css', Nooku::getURL('css')); @helper('stylesheet', 'nooku_admin.css', Nooku::getURL('css')); @helper('script', 'view.flags.js', Nooku::getURL('js')); ?> <fieldset> <div style="float: right"> <button type="button" onclick="window.parent.document.getElementById('sbox-window').close();"> <?php echo @text('Cancel'); ?> </button> </div> <div class="configuration" > <?php echo @text('Pick a flag'); ?> </div> </fieldset> <?php echo @helper('nooku.select.flags');