<commit_before><?php

	if( !defined('__IN_SYMPHONY__') ) die('<h2>Symphony Error</h2><p>You cannot directly access this file</p>');



	require_once(EXTENSIONS.'/url_field/fields/field.url.php');
	require_once(EXTENSIONS.'/frontend_localisation/lib/class.FLang.php');



	class FieldMultilingual_URL extends FieldURL
	{

		/*------------------------------------------------------------------------------------------------*/
		/*  Definition  */
		/*------------------------------------------------------------------------------------------------*/

		public function __construct(){
			parent::__construct();

			$this->_name = 'Multilingual URL';
			$this->field_types = array('multilingual_entry_url');
		}



		/*------------------------------------------------------------------------------------------------*/
		/*  Publish  */
		/*------------------------------------------------------------------------------------------------*/

		public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $prefix = null, $postfix = null){
			parent::displayPublishPanel($wrapper, $data, $flagWithError, $prefix, $postfix);

			$wrapper->setAttribute('class', $wrapper->getAttribute('class').' field-url');
		}



		/*------------------------------------------------------------------------------------------------*/
		/*  Output  */
		/*------------------------------------------------------------------------------------------------*/

		public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) {
			if(!is_array($data) || empty($data) || is_null($data['value'])) return;

			$result = new XMLElement($this->get('element_name'));
			$result->setAttribute('type',$data['url_type']);

			switch( $data['url_type'] ){
				case 'external':
					$result->setValue($data['value']);
					break;

				case 'internal':
					$lc = FLang::getLangCode();
					$result->setAttribute('id',$data['value']);
					$related_value = $this->findRelatedValues(array($data['value']), $lc);
					$result->setValue($related_value[0]['value']);
					break;<commit_msg>Respect Symphony installation in subfolder.<commit_after><?php

	if( !defined('__IN_SYMPHONY__') ) die('<h2>Symphony Error</h2><p>You cannot directly access this file</p>');



	require_once(EXTENSIONS.'/url_field/fields/field.url.php');
	require_once(EXTENSIONS.'/frontend_localisation/lib/class.FLang.php');



	class FieldMultilingual_URL extends FieldURL
	{

		/*------------------------------------------------------------------------------------------------*/
		/*  Definition  */
		/*------------------------------------------------------------------------------------------------*/

		public function __construct(){
			parent::__construct();

			$this->_name = 'Multilingual URL';
			$this->field_types = array('multilingual_entry_url');
		}



		/*------------------------------------------------------------------------------------------------*/
		/*  Publish  */
		/*------------------------------------------------------------------------------------------------*/

		public function displayPublishPanel(XMLElement &$wrapper, $data = null, $flagWithError = null, $prefix = null, $postfix = null){
			parent::displayPublishPanel($wrapper, $data, $flagWithError, $prefix, $postfix);

			$wrapper->setAttribute('class', $wrapper->getAttribute('class').' field-url');
		}



		/*------------------------------------------------------------------------------------------------*/
		/*  Output  */
		/*------------------------------------------------------------------------------------------------*/

		public function appendFormattedElement(XMLElement &$wrapper, $data, $encode = false, $mode = null, $entry_id = null) {
			if(!is_array($data) || empty($data) || is_null($data['value'])) return;

			$result = new XMLElement($this->get('element_name'));
			$result->setAttribute('type',$data['url_type']);

			switch( $data['url_type'] ){
				case 'external':
					$result->setValue($data['value']);
					break;

				case 'internal':
					$lc = FLang::getLangCode();
					$result->setAttribute('id',$data['value']);
					$related_value = $this->findRelatedValues(array($data['value']), $lc);
					$result->setValue(URL . $related_value[0]['value']);
					break;
{'fraction_non_alphanumeric': 0.4097674418604651, 'fraction_numerical': 0.0013953488372093023, 'mean_word_length': 1.4732604945370902, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, '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': '6867012', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1038, 'n_words': 172}