<commit_before><?php
namespace Craft;

class FruitLinkItFieldType extends BaseFieldType
{
    public function getName()
    {
        return Craft::t('Link It');
    }

    public function defineContentAttribute()
    {
        return array(AttributeType::Mixed);
    }

    public function getSettingsHtml()
    {
        return craft()->templates->render('fruitlinkit/_fieldtype/settings', array(
          'settings'                  => $this->getSettings(),
          'types'                     => $this->_getAvaiableLinkItTypes(),
          'elementSources'            => craft()->fruitLinkIt->getLinkItElementSources(),
          'thirdPartyElementTypes'    => craft()->fruitLinkIt->getThirdPartyElementTypes(),
        ));
    }

    public function getInputHtml($name, $value)
    {
        // CSS
        craft()->templates->includeCssResource('fruitlinkit/css/linkit.css');

        // Javascript
        $id = craft()->templates->formatInputId($name);
        craft()->templates->includeJsResource('fruitlinkit/js/FruitLinkIt.js');
        craft()->templates->includeJs('new FruitLinkIt("'.craft()->templates->namespaceInputId($id).'");');

    	// Settings
    	$settings = $this->getSettings();

    	// LinkIt Types
		$availableTypes = $this->_getLinkItTypes();
		$types = array('' => Craft::t('Link To...'));

       	if(is_array($settings['types']))
    	{
			foreach($settings['types'] as $type)
			{
				$types[$type] = $availableTypes[$type];
			}
    	}
    	else
    	{
	    	$types = $types + $availableTypes;
    	}

        // current selected CP locale
        $locale = isset($this->element->locale) ? $this->element->locale : craft.locale;

        // Element Select Options
        $elementSelectSettings = array(
            'entry' => array(
                'elementType' => new ElementTypeVariable( craft()->elements->getElementType(ElementType::Entry) ),
                'elements' => $value && $value->entry ? array($value->entry) : null,
                'sources' => $settings->entrySources,
                'criteria' => array(
                    'status' => null,<commit_msg>Updated craft.locale to craft()->language<commit_after><?php
namespace Craft;

class FruitLinkItFieldType extends BaseFieldType
{
    public function getName()
    {
        return Craft::t('Link It');
    }

    public function defineContentAttribute()
    {
        return array(AttributeType::Mixed);
    }

    public function getSettingsHtml()
    {
        return craft()->templates->render('fruitlinkit/_fieldtype/settings', array(
          'settings'                  => $this->getSettings(),
          'types'                     => $this->_getAvaiableLinkItTypes(),
          'elementSources'            => craft()->fruitLinkIt->getLinkItElementSources(),
          'thirdPartyElementTypes'    => craft()->fruitLinkIt->getThirdPartyElementTypes(),
        ));
    }

    public function getInputHtml($name, $value)
    {
        // CSS
        craft()->templates->includeCssResource('fruitlinkit/css/linkit.css');

        // Javascript
        $id = craft()->templates->formatInputId($name);
        craft()->templates->includeJsResource('fruitlinkit/js/FruitLinkIt.js');
        craft()->templates->includeJs('new FruitLinkIt("'.craft()->templates->namespaceInputId($id).'");');

    	// Settings
    	$settings = $this->getSettings();

    	// LinkIt Types
		$availableTypes = $this->_getLinkItTypes();
		$types = array('' => Craft::t('Link To...'));

       	if(is_array($settings['types']))
    	{
			foreach($settings['types'] as $type)
			{
				$types[$type] = $availableTypes[$type];
			}
    	}
    	else
    	{
	    	$types = $types + $availableTypes;
    	}

        // current selected CP locale
        $locale = isset($this->element->locale) ? $this->element->locale : craft()->language;

        // Element Select Options
        $elementSelectSettings = array(
            'entry' => array(
                'elementType' => new ElementTypeVariable( craft()->elements->getElementType(ElementType::Entry) ),
                'elements' => $value && $value->entry ? array($value->entry) : null,
                'sources' => $settings->entrySources,
                'criteria' => array(
                    'status' => null,
{'fraction_non_alphanumeric': 0.1577835172575722, 'fraction_numerical': 0.0, 'mean_word_length': 2.418940609951846, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2266225', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1141, 'n_words': 192}