<commit_before><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2013 Timble CVBA and Contributors. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		git://git.assembla.com/nooku-framework.git
 */

namespace Nooku\Component\Ckeditor;

use Nooku\Library;

/**
 * Editor Html View Class
 *
 * @author  <NAME> <http://nooku.assembla.com/profile/terryvisser>
 * @package Nooku\Component\Ckeditor
 */
class ViewEditorHtml extends Library\ViewHtml
{
    protected function _initialize(Library\ObjectConfig $config)
    {
        $language = \JFactory::getLanguage();

        $config->append(array('settings' => array(
            'baseHref'		         => '/files/'.$this->getObject('application')->getSite().'/',
            'language'			     => substr($language->getTag(), 0, strpos( $language->getTag(), '-' )),
            'contentsLanguage'       => substr($language->getTag(), 0, strpos( $language->getTag(), '-' )),
			'contentsLangDirectiony' => $language->isRTL() ? 'rtl' : 'ltr',
			'height' 				 => '',
			'width'					 => '',
            'removeButtons'			 => '',
            'options'  => array(
                'autoheight'  => true,
                'toolbar'     => $this->toolbar ? $this->toolbar : 'standard',
            )
		)));

		parent::_initialize($config);
    }

    protected function _fetchData(Library\ViewContext $context)
	{
		if(!$context->data->id) {
		    $context->data->id = $context->data->name;
		}

        $settings = clone $this->getConfig()->settings;
        $settings->editor_selector = 'editable-'.$this->id;
        $settings->options->toolbar = $this->toolbar ? $this->toolbar : 'standard';

        if($this->removeButtons) {
            $settings->removeButtons = $this->removeButtons;
        }

		$context->data->settings = $settings;

		parent::_fetchData($context);
	}
}<commit_msg>re #386 : Fixed missing 'class' template variable.<commit_after><?php
/**
 * Nooku Framework - http://www.nooku.org
 *
 * @copyright	Copyright (C) 2011 - 2013 Timble CVBA and Contributors. (http://www.timble.net)
 * @license		GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link		git://git.assembla.com/nooku-framework.git
 */

namespace Nooku\Component\Ckeditor;

use Nooku\Library;

/**
 * Editor Html View Class
 *
 * @author  <NAME> <http://nooku.assembla.com/profile/terryvisser>
 * @package Nooku\Component\Ckeditor
 */
class ViewEditorHtml extends Library\ViewHtml
{
    protected function _initialize(Library\ObjectConfig $config)
    {
        $language = \JFactory::getLanguage();

        $config->append(array('settings' => array(
            'baseHref'		         => '/files/'.$this->getObject('application')->getSite().'/',
            'language'			     => substr($language->getTag(), 0, strpos( $language->getTag(), '-' )),
            'contentsLanguage'       => substr($language->getTag(), 0, strpos( $language->getTag(), '-' )),
			'contentsLangDirectiony' => $language->isRTL() ? 'rtl' : 'ltr',
			'height' 				 => '',
			'width'					 => '',
            'removeButtons'			 => '',
            'options'  => array(
                'autoheight'  => true,
                'toolbar'     => $this->toolbar ? $this->toolbar : 'standard',
            )
		)));

		parent::_initialize($config);
    }

    protected function _fetchData(Library\ViewContext $context)
	{
		if(!$context->data->id) {
		    $context->data->id = $context->data->name;
		}

        $settings = clone $this->getConfig()->settings;
        $settings->editor_selector = 'editable-'.$this->id;
        $settings->options->toolbar = $this->toolbar ? $this->toolbar : 'standard';

        if($this->removeButtons) {
            $settings->removeButtons = $this->removeButtons;
        }

		$context->data->settings = $settings;
        $context->data->class = isset($this->attribs['class']) ? $this->attribs['class'] : '';

		parent::_fetchData($context);
	}
}
{'fraction_non_alphanumeric': 0.1865520728008089, 'fraction_numerical': 0.006319514661274014, 'mean_word_length': 2.725988700564972, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 93, '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': '3733371', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1243, 'n_words': 199}