<commit_before><?php
/**
 * Kodekit - http://timble.net/kodekit
 *
 * @copyright   Copyright (C) 2007 - 2016 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license     MPL v2.0 <https://www.mozilla.org/en-US/MPL/2.0>
 * @link        https://github.com/timble/kodekit for the canonical source repository
 */

namespace Kodekit\Library;

/**
 * Grid Template Helper
 *
 * @author  <NAME> <https://github.com/johanjanssens>
 * @package Kodekit\Library\Template\Helper
 */
class TemplateHelperGrid extends TemplateHelperAbstract implements TemplateHelperParameterizable
{
    /**
     * Render a radio field
     *
     * @param   array   $config An optional array with configuration options
     * @return  string  Html
     */
    public function radio($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity'  => null,
            'attribs' => array()
        ));

        if($config->entity->isLockable() && $config->entity->isLocked())
        {
            $html = $this->createHelper('behavior')->tooltip();
            $html .= $this->buildElement('span', [
                'class' => 'k-icon-lock-locked',
                'data-k-tooltip' => true,
                'title' => $this->creaateHelper('grid')->lock_message(array('entity' => $config->entity))
            ]);
        }
        else
        {
            $column = $config->entity->getIdentityColumn();
            $value  = StringEscaper::attr($config->entity->{$column});

            $html = $this->buildElement('input', array_merge([
                'type' => 'radio',
                'class' => 'k-js-grid-checkbox',
                'name'  => $column.'[]',
                'value' => $value,
            ], ObjectConfig::unbox($config->attribs)));
        }

        return $html;
    }
    /**
     * Render a checkbox field
     *
     * @param array $config An optional array with configuration options
     * @return  string  Html
     */
    public function checkbox($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity'  => null,
            'attribs' => array()
        ))->append(array(
            'column' => $config->entity->getIdentityKey()
        ));

        if($config->entity->isLockable() && $config->entity->isLocked())
        {
            $html = $this->createHelper('behavior')->tooltip();

            $html .= $this->buildElement('span', [
                'class' => 'k-icon-lock-locked',
                'data-k-tooltip' => true,
                'title' => $this->creaateHelper('grid')->lock_message(array('entity' => $config->entity))
            ]);
        }
        else
        {
            $column = $config->column;
            $value  = StringEscaper::attr($config->entity->{$column});

            $html = $this->buildElement('input', array_merge([
                'type' => 'checkbox',
                'class' => 'k-js-grid-checkbox',
                'name'  => $column.'[]',
                'value' => $value,
            ], ObjectConfig::unbox($config->attribs)));
        }

        return $html;
    }<commit_msg>#64 Fix typo<commit_after><?php
/**
 * Kodekit - http://timble.net/kodekit
 *
 * @copyright   Copyright (C) 2007 - 2016 <NAME> and Timble CVBA. (http://www.timble.net)
 * @license     MPL v2.0 <https://www.mozilla.org/en-US/MPL/2.0>
 * @link        https://github.com/timble/kodekit for the canonical source repository
 */

namespace Kodekit\Library;

/**
 * Grid Template Helper
 *
 * @author  <NAME> <https://github.com/johanjanssens>
 * @package Kodekit\Library\Template\Helper
 */
class TemplateHelperGrid extends TemplateHelperAbstract implements TemplateHelperParameterizable
{
    /**
     * Render a radio field
     *
     * @param   array   $config An optional array with configuration options
     * @return  string  Html
     */
    public function radio($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity'  => null,
            'attribs' => array()
        ));

        if($config->entity->isLockable() && $config->entity->isLocked())
        {
            $html = $this->createHelper('behavior')->tooltip();
            $html .= $this->buildElement('span', [
                'class' => 'k-icon-lock-locked',
                'data-k-tooltip' => true,
                'title' => $this->createHelper('grid')->lock_message(array('entity' => $config->entity))
            ]);
        }
        else
        {
            $column = $config->entity->getIdentityColumn();
            $value  = StringEscaper::attr($config->entity->{$column});

            $html = $this->buildElement('input', array_merge([
                'type' => 'radio',
                'class' => 'k-js-grid-checkbox',
                'name'  => $column.'[]',
                'value' => $value,
            ], ObjectConfig::unbox($config->attribs)));
        }

        return $html;
    }
    /**
     * Render a checkbox field
     *
     * @param array $config An optional array with configuration options
     * @return  string  Html
     */
    public function checkbox($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'entity'  => null,
            'attribs' => array()
        ))->append(array(
            'column' => $config->entity->getIdentityKey()
        ));

        if($config->entity->isLockable() && $config->entity->isLocked())
        {
            $html = $this->createHelper('behavior')->tooltip();

            $html .= $this->buildElement('span', [
                'class' => 'k-icon-lock-locked',
                'data-k-tooltip' => true,
                'title' => $this->createHelper('grid')->lock_message(array('entity' => $config->entity))
            ]);
        }
        else
        {
            $column = $config->column;
            $value  = StringEscaper::attr($config->entity->{$column});

            $html = $this->buildElement('input', array_merge([
                'type' => 'checkbox',
                'class' => 'k-js-grid-checkbox',
                'name'  => $column.'[]',
                'value' => $value,
            ], ObjectConfig::unbox($config->attribs)));
        }

        return $html;
    }
{'fraction_non_alphanumeric': 0.1689540937056318, 'fraction_numerical': 0.004101593311247831, 'mean_word_length': 1.891016871865025, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 125, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '2619335', 'n_tokens_mistral': 1852, 'n_tokens_neox': 1777, 'n_words': 328}