<commit_before><?php
/**
 * Defines the Link page type
 */
class Link extends DataObject {
	static $db = array(
		'URL' => 'Text',
		'Title' => 'Text',
		'Description' => 'HTMLText',
		"LinkType" => "Enum('External,Internal')",
	);


	static $classesToAddLinksTo = array('Page');


	static $has_one = array(
		'LinksFolder' => 'LinksFolder',
		'InternalPage' => 'SiteTree'
	);

	public static $many_many = array(
		"Pages" => "SiteTree"
	);


	function getRequirementsForPopup() {
		Requirements::javascript( 'silverstripe-links/javascript/linkedit.js' );
	}


	function getCMSFields_forPopup() {

		$localeField = new HiddenField('Locale');
		$localeField->setValue($this->LinksFolder()->Locale);


		$fields = new FieldSet(
			new TextField('Title'),
			new DropdownField( 'LinkType', 'Internal or External Link',<commit_msg>UPGRADESS3: Now compliant with ss3<commit_after><?php
/**
 * Defines the Link page type
 */
class Link extends DataObject {
	static $db = array(
		'URL' => 'Text',
		'Title' => 'Text',
		'Description' => 'HTMLText',
		"LinkType" => "Enum('External,Internal')",
		   		  'SortOrder' => 'Int'

	);


	static $classesToAddLinksTo = array('Page');


	static $has_one = array(
		'LinksFolder' => 'LinksFolder',
		'InternalPage' => 'SiteTree'
	);

	public static $many_many = array(
		"Pages" => "SiteTree"
	);


	function getRequirementsForPopup() {
		Requirements::javascript( 'silverstripe-links/javascript/linkedit.js' );
	}


 	public function getCMSFields_forPopup() {

		$localeField = new HiddenField('Locale');
		$localeField->setValue($this->LinksFolder()->Locale);


		$fields = new FieldList(
			new TextField('Title', 'Link title'),
			new DropdownField( 'LinkType', 'Internal or External Link',
{'fraction_non_alphanumeric': 0.16657027183342973, 'fraction_numerical': 0.001156737998843262, 'mean_word_length': 4.616883116883117, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '1400132', 'n_tokens_mistral': 621, 'n_tokens_neox': 563, 'n_words': 126}