<commit_before><?php
	abstract class Library_Gallery
	{
		public static function getFolderTemplate(Model_Users $owner, $id_parent, $on_own_gallery = false, $name, $tags = null, $baseURL = null)
		{
			$tpl_gallery		=	null;
			$tpl_delete			=	null;
			$tpl_adding_form	=	null;
			$documents			=	$owner->getDocuments($id_parent); // Get folders AND files
			
			$hierarchy = '';
			$parent = Model_Files::getById($id_parent);
			if(!empty($parent))
			{
				while($parent = $parent->getParentFile())
				{
					$hierarchy = ' >> <a href="' . $baseURL . 'spritecomics/gallery/details/' . $parent->getId() . '">' . $parent->prop('name') . '</a>' . $hierarchy;
				}
				$hierarchy = '<a href="' . $baseURL . 'spritecomics/gallery/' . $owner->getId() . '">' . Library_i18n::get('spritecomics.gallery.details.root') . '</a>' . $hierarchy;
			}
			
			if($documents->isEmpty())
				$tpl_gallery	=	\Eliya\Tpl::get('spritecomics/gallery/empty');
			else
			{
				foreach($documents as $document)
				{
					$type			=	$document->prop('is_dir') ? 'folder' : 'file';
					$tpl_gallery	.=	\Eliya\Tpl::get('spritecomics/gallery/'.$type, ['document' => $document]);
				}
			}

			if($on_own_gallery)
			{
				$tpl_adding_form	=	\Eliya\Tpl::get('spritecomics/gallery/add', ['parent_file_id' => $id_parent]);

				if( ! empty($id_parent))
					$tpl_delete			=	\Eliya\Tpl::get('spritecomics/gallery/delete', ['id_to_delete' => $id_parent]);
			}
			
			$tpl_tags	=	\Eliya\Tpl::get('spritecomics/gallery/tags', ['tags' => $tags, 'is_index' => empty($id_parent)]);

			return \Eliya\Tpl::get('spritecomics/gallery', [
				'tpl_gallery' 		=>	$tpl_gallery,
				'tpl_delete'	 	=>	$tpl_delete,
				'tpl_adding_form' 	=>	$tpl_adding_form,
				'tpl_tags'			=>	$tpl_tags,
				'on_own_gallery'	=>	$on_own_gallery,
				'owner'				=>	$owner,
				'folder_name'		=>	$name,
				'hierarchy'			=>	$hierarchy,<commit_msg>Fix tab issue<commit_after><?php
	abstract class Library_Gallery
	{
		public static function getFolderTemplate(Model_Users $owner, $id_parent, $on_own_gallery = false, $name, $tags = null, $baseURL = null)
		{
			$tpl_gallery		=	null;
			$tpl_delete			=	null;
			$tpl_adding_form	=	null;
			$documents			=	$owner->getDocuments($id_parent); // Get folders AND files
			
			$hierarchy = '';
			$parent = Model_Files::getById($id_parent);
			if(!empty($parent))
			{
				while($parent = $parent->getParentFile())
				{
					$hierarchy = ' >> <a href="' . $baseURL . 'spritecomics/gallery/details/' . $parent->getId() . '">' . $parent->prop('name') . '</a>' . $hierarchy;
				}
				$hierarchy = '<a href="' . $baseURL . 'spritecomics/gallery/' . $owner->getId() . '">' . Library_i18n::get('spritecomics.gallery.details.root') . '</a>' . $hierarchy;
			}
			
			if($documents->isEmpty())
				$tpl_gallery	=	\Eliya\Tpl::get('spritecomics/gallery/empty');
			else
			{
				foreach($documents as $document)
				{
					$type			=	$document->prop('is_dir') ? 'folder' : 'file';
					$tpl_gallery	.=	\Eliya\Tpl::get('spritecomics/gallery/'.$type, ['document' => $document]);
				}
			}

			if($on_own_gallery)
			{
				$tpl_adding_form	=	\Eliya\Tpl::get('spritecomics/gallery/add', ['parent_file_id' => $id_parent]);

				if( ! empty($id_parent))
					$tpl_delete			=	\Eliya\Tpl::get('spritecomics/gallery/delete', ['id_to_delete' => $id_parent]);
			}
			
			$tpl_tags	=	\Eliya\Tpl::get('spritecomics/gallery/tags', ['tags' => $tags, 'is_index' => empty($id_parent)]);

			return \Eliya\Tpl::get('spritecomics/gallery', [
				'tpl_gallery'		=>	$tpl_gallery,
				'tpl_delete'		=>	$tpl_delete,
				'tpl_adding_form'	=>	$tpl_adding_form,
				'tpl_tags'  		=>	$tpl_tags,
				'on_own_gallery'	=>	$on_own_gallery,
				'owner' 			=>	$owner,
				'folder_name'		=>	$name,
				'hierarchy' 		=>	$hierarchy,
{'fraction_non_alphanumeric': 0.1973474801061008, 'fraction_numerical': 0.0010610079575596816, 'mean_word_length': 3.5270108043217285, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 55, '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': '6794082', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1510, 'n_words': 207}