コード例 #1
0
ファイル: html.php プロジェクト: nooku/nooku-files
 protected function _fetchData(KViewContext $context)
 {
     $state = $this->getModel()->getState();
     $container = $this->getModel()->getContainer();
     $config = new KObjectConfig($state->config);
     $config->append(array('router' => array('defaults' => array('option' => 'com_' . substr($container->slug, 0, strpos($container->slug, '-')), 'routed' => '1')), 'initial_response' => true))->append($this->getConfig()->config);
     if ($config->initial_response === true) {
         $count = 0;
         $query = $state->getValues();
         unset($query['config']);
         $query['thumbnails'] = $this->getModel()->getContainer()->getParameters()->thumbnails;
         if (strpos($this->getLayout(), 'compact') !== false) {
             $query['limit'] = 0;
             $count = ComFilesIteratorDirectory::countNodes(array('path' => $this->getModel()->getPath()));
         }
         if ($count < 100) {
             $controller = $this->getObject('com:files.controller.node');
             $controller->getRequest()->setQuery($query);
             $config->initial_response = $controller->format('json')->render();
         } else {
             unset($config->initial_response);
         }
     }
     $state->config = $config->toArray();
     $context->data->sitebase = trim(JURI::root(), '/');
     $context->data->token = $this->getObject('user')->getSession()->getToken();
     $context->data->container = $container;
     $context->data->debug = KClassLoader::getInstance()->isDebug();
     parent::_fetchData($context);
     $context->parameters = $state->getValues();
     $context->parameters->config = $config;
 }
コード例 #2
0
ファイル: html.php プロジェクト: daodaoliang/nooku-framework
 protected function _fetchData(KViewContext $context)
 {
     //Set the language information
     $language = JFactory::getApplication()->getCfg('language');
     $context->data->language = $language ? $language : 'en-GB';
     $context->data->direction = JFactory::getLanguage()->isRTL() ? 'rtl' : 'ltr';
     parent::_fetchData($context);
 }
コード例 #3
0
ファイル: html.php プロジェクト: great-minds/sales
 protected function _fetchData(KViewContext $context)
 {
     parent::_fetchData($context);
     $context->data->gateways = $this->getObject('com://site/sales.model.gateways')->enabled(1)->fetch();
     //Load plugin translations
     foreach ($context->data->gateways as $gateway) {
         $this->getObject('translator')->load('plg://site/' . $gateway->folder . '.' . $gateway->element);
     }
 }
コード例 #4
0
ファイル: html.php プロジェクト: nooku/nooku-files
 protected function _fetchData(KViewContext $context)
 {
     $state = $this->getModel()->getState();
     $container = $this->getObject('com:files.model.containers')->id($state->container)->fetch();
     $context->data->sitebase = trim(JURI::root(), '/');
     $context->data->token = $this->getObject('user')->getSession()->getToken();
     $context->data->container = $container->getIterator()->current();
     parent::_fetchData($context);
     $context->parameters->config = $this->getConfig()->config;
 }