<commit_before><?php
	// De Class Menu word de opmaak van Menu gebouwd,
	// Deze word met behulp van Javascript, jQuarry, Bootstrap opgebouwd
	
	// Main doel van de class is om makkelijk de where i am te highlighten 
	// En op een CMS manier het menu op bouwen
	function cmp($a, $b) {
		return  $b->prio - $a->prio;
	}
	
	class Menu {
		
		var $items;
		
		public function __construct($menuLocation) {
			$this->items = array();
			$this->loadMenu($menuLocation);
		}
		
		private function loadMenu($menuLocation) {
			foreach(scandir($menuLocation) as $file) {
				if($file == "." || $file == "..") {
					continue;
				}
				array_push($this->items, new MenuItem(MktUtils::file(array($menuLocation ,$file))));
			}
			usort($this->items, "cmp");
		}
		
		public function getAmount() {
			return count($this->items);
		}
		
		public function printMenu() {
			$ret = PHP_EOL . '<ul class="ulMainMenu">' . PHP_EOL
			. '<li class="menuImg"> <img src="Pictures/menu.svg" alt="" /> </li>' . PHP_EOL;
			foreach($this->items as $menuEntry) {
				$ret .= '<li class="menuItem" id="Menu_' . $menuEntry->name . '">';
				$ret .= '<a href="' . $menuEntry->href . '">' . $menuEntry->name . '</a>';
				$ret .= '</li>' . PHP_EOL;
			}
			$ret .= '</ul>' . PHP_EOL;
			return $ret;
		}
		
		public static function getMainMenu($MktPage){
			return new Menu(MktUtils::file(array('.', 'Content', 'MainMenu')));
		}
	}
	class MenuItem {
		
		var $uuid;
		var $name;
		var $alt;
		var $href;
		var $prio;
		var $errorMessage;
		
		public function __construct($FileLocation) {
			$errorMessage = "";
			libxml_use_internal_errors(true);
			$xml = file_get_contents($FileLocation);
			$xml = str_replace("&", "\\quot\\", $xml);
			$xml = simplexml_load_string($xml);
			$xmlError = libxml_get_errors();
			foreach($xmlError as $error) {
				$this->errorMessage .= '<div class="error"><b>XML ERROR:</b> <br /> File: ' . $FileLocation . 
							'.xml <br /> &nbsp;&nbsp;at line ' . $error->line . ' (' . $error->message . ')<br /></div>';
			}<commit_msg>Ik haat die spatie<commit_after><?php
	// De Class Menu word de opmaak van Menu gebouwd,
	// Deze word met behulp van Javascript, jQuarry, Bootstrap opgebouwd
	
	// Main doel van de class is om makkelijk de where i am te highlighten 
	// En op een CMS manier het menu op bouwen
	function cmp($a, $b) {
		return  $b->prio - $a->prio;
	}
	
	class Menu {
		
		var $items;
		
		public function __construct($menuLocation) {
			$this->items = array();
			$this->loadMenu($menuLocation);
		}
		
		private function loadMenu($menuLocation) {
			foreach(scandir($menuLocation) as $file) {
				if($file == "." || $file == "..") {
					continue;
				}
				array_push($this->items, new MenuItem(MktUtils::file(array($menuLocation ,$file))));
			}
			usort($this->items, "cmp");
		}
		
		public function getAmount() {
			return count($this->items);
		}
		
		public function printMenu() {
			$ret = PHP_EOL . '<ul class="ulMainMenu">' . PHP_EOL
			. '<li class="menuImg"> <img src="Pictures/menu.svg" alt="" /> </li>' . PHP_EOL;
			foreach($this->items as $menuEntry) {
				$ret .= '<li class="menuItem" id="Menu_' . str_replace(" ", "-", $menuEntry->name) . '">';
				$ret .= '<a href="' . $menuEntry->href . '">' . $menuEntry->name . '</a>';
				$ret .= '</li>' . PHP_EOL;
			}
			$ret .= '</ul>' . PHP_EOL;
			return $ret;
		}
		
		public static function getMainMenu($MktPage){
			return new Menu(MktUtils::file(array('.', 'Content', 'MainMenu')));
		}
	}
	class MenuItem {
		
		var $uuid;
		var $name;
		var $alt;
		var $href;
		var $prio;
		var $errorMessage;
		
		public function __construct($FileLocation) {
			$errorMessage = "";
			libxml_use_internal_errors(true);
			$xml = file_get_contents($FileLocation);
			$xml = str_replace("&", "\\quot\\", $xml);
			$xml = simplexml_load_string($xml);
			$xmlError = libxml_get_errors();
			foreach($xmlError as $error) {
				$this->errorMessage .= '<div class="error"><b>XML ERROR:</b> <br /> File: ' . $FileLocation . 
							'.xml <br /> &nbsp;&nbsp;at line ' . $error->line . ' (' . $error->message . ')<br /></div>';
			}
{'fraction_non_alphanumeric': 0.1915568570034163, 'fraction_numerical': 0.0, 'mean_word_length': 3.1404040404040403, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, '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': '5475045', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1426, 'n_words': 346}