<commit_before><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2014 <NAME>ens and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		http://github.com/nooku/nooku-platform for the canonical source repository
 */

use Nooku\Library;

/**
 * Modules Html View
 *   
 * @author  <NAME> <http://github.com/stipsan>
 * @package Component\Pages
 */
class PagesViewModulesHtml extends Library\ViewHtml
{
    protected function _actionRender(Library\ViewContext $context)
	{
        //Load a unique list of module positions
        $positions = array();
        $modules = $this->getObject('com:pages.model.modules')->application('site')->fetch();
        foreach($modules as $module) {
            $positions[] = $module->position;
        }

        $this->positions = array_unique($positions);

        return parent::_actionRender($context);
	}

    protected function _loadTranslations(Library\ViewContext $context)
    {
        //Load language files for each module
        if($this->getLayout() == 'list')
        {
            foreach($this->getModel()->fetch() as $module)
            {
                $package = $module->getIdentifier()->package;
                $domain  = $module->getIdentifier()->domain;

                if($domain) {
                    $identifier = 'com://'.$domain.'/'.$package;
                } else {
                    $identifier = 'com:'.$package;<commit_msg>Fixed positions assignment in PagesViewModulesHtml to add to $context->data rather than context itself<commit_after><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2014 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		http://github.com/nooku/nooku-platform for the canonical source repository
 */

use Nooku\Library;

/**
 * Modules Html View
 *   
 * @author  <NAME> <http://github.com/stipsan>
 * @package Component\Pages
 */
class PagesViewModulesHtml extends Library\ViewHtml
{
    protected function _actionRender(Library\ViewContext $context)
	{
        //Load a unique list of module positions
        $positions = array();
        $modules = $this->getObject('com:pages.model.modules')->application('site')->fetch();
        foreach($modules as $module) {
            $positions[] = $module->position;
        }

        $context->data->positions = array_unique($positions);

        return parent::_actionRender($context);
	}

    protected function _loadTranslations(Library\ViewContext $context)
    {
        //Load language files for each module
        if($this->getLayout() == 'list')
        {
            foreach($this->getModel()->fetch() as $module)
            {
                $package = $module->getIdentifier()->package;
                $domain  = $module->getIdentifier()->domain;

                if($domain) {
                    $identifier = 'com://'.$domain.'/'.$package;
                } else {
                    $identifier = 'com:'.$package;
{'fraction_non_alphanumeric': 0.14748784440842788, 'fraction_numerical': 0.005834683954619124, 'mean_word_length': 2.4327030033370414, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3223241', 'n_tokens_mistral': 905, 'n_tokens_neox': 863, 'n_words': 187}