<commit_before><?php
	/**
	 * @class  image_gallery
	 * @author NHN (<EMAIL>)
	 * @brief Making images uploaded to the image gallery
	 **/

	class image_gallery extends EditorHandler { 
		// editor_sequence from the editor must attend mandatory wearing ....
		var $editor_sequence = 0;
		var $component_path = '';

		/**
		 * @brief editor_sequence and components out of the path
		 **/
		function image_gallery($editor_sequence, $component_path) {
			$this->editor_sequence = $editor_sequence;
			$this->component_path = $component_path;
		}

		/**
		 * @brief popup window to display in popup window request is to add content
		 **/
		function getPopupContent() {
			// Pre-compiled source code to compile template return to
			$tpl_path = $this->component_path.'tpl';
			$tpl_file = 'popup.html';

			Context::set("tpl_path", $tpl_path);

			$oTemplate = &TemplateHandler::getInstance();
			return $oTemplate->compile($tpl_path, $tpl_file);
		}

		/**
		 * @brief Editor of the components separately if you use a unique code to the html code for a method to change
		 *
		 * Images and multimedia, seolmundeung unique code is required for the editor component added to its own code, and then
		 * DocumentModule:: transContent() of its components transHtml() method call to change the html code for your own
		 **/
		function transHTML($xml_obj) {
			$gallery_info = new stdClass();
			$gallery_info->srl = rand(111111, 999999);
			$gallery_info->border_thickness = (int)$xml_obj->attrs->border_thickness;
			$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
			$gallery_info->border_color = $xml_obj->attrs->border_color;
			$gallery_info->bg_color = $xml_obj->attrs->bg_color;
			$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
			
			if(!in_array($gallery_info->gallery_align, array('left', 'center', 'right')))
			{
				$gallery_info->gallery_align = 'center';
			}

			$images_list = $xml_obj->attrs->images_list;
			$images_list = preg_replace('/\.(gif|jpe?g|png) /i', ".\\1\n", $images_list);
			$images_list = explode("\n", trim($images_list));
			$gallery_info->images_list = preg_grep("/^[a-z0-9\/]+\.(gif|jpe?g|png)+$/", $images_list);
			
			// If you set the output to output the XML code generated a list of the image
			if(Context::getResponseMethod() == 'XMLRPC') {
				$output = '';
				for($i=0;$i<count($gallery_info->images_list);$i++) {
					$output .= sprintf('<img src="%s" alt="" /><br />', $gallery_info->images_list[$i]);
				}
				return $output;
			}
			// HTML gallery output, the output settings via the template for the conversion to generate the html code should
			preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
			$gallery_info->width = trim($matches[3][0]);
			if(!$gallery_info->width) $gallery_info->width = 400;

			Context::set('gallery_info', $gallery_info);

			$tpl_path = $this->component_path.'tpl';
			Context::set("tpl_path", $tpl_path);

			if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
			else $tpl_file = 'slide_gallery.html';

			$oTemplate = &TemplateHandler::getInstance();
			return $oTemplate->compile($tpl_path, $tpl_file);
		}

	}<commit_msg>확장자가 대문자로 된 이미지의 썸네일을 생성할 수 없는 문제 수정<commit_after><?php
	/**
	 * @class  image_gallery
	 * @author NHN (<EMAIL>)
	 * @brief Making images uploaded to the image gallery
	 **/

	class image_gallery extends EditorHandler { 
		// editor_sequence from the editor must attend mandatory wearing ....
		var $editor_sequence = 0;
		var $component_path = '';

		/**
		 * @brief editor_sequence and components out of the path
		 **/
		function image_gallery($editor_sequence, $component_path) {
			$this->editor_sequence = $editor_sequence;
			$this->component_path = $component_path;
		}

		/**
		 * @brief popup window to display in popup window request is to add content
		 **/
		function getPopupContent() {
			// Pre-compiled source code to compile template return to
			$tpl_path = $this->component_path.'tpl';
			$tpl_file = 'popup.html';

			Context::set("tpl_path", $tpl_path);

			$oTemplate = &TemplateHandler::getInstance();
			return $oTemplate->compile($tpl_path, $tpl_file);
		}

		/**
		 * @brief Editor of the components separately if you use a unique code to the html code for a method to change
		 *
		 * Images and multimedia, seolmundeung unique code is required for the editor component added to its own code, and then
		 * DocumentModule:: transContent() of its components transHtml() method call to change the html code for your own
		 **/
		function transHTML($xml_obj) {
			$gallery_info = new stdClass();
			$gallery_info->srl = rand(111111, 999999);
			$gallery_info->border_thickness = (int)$xml_obj->attrs->border_thickness;
			$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
			$gallery_info->border_color = $xml_obj->attrs->border_color;
			$gallery_info->bg_color = $xml_obj->attrs->bg_color;
			$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
			
			if(!in_array($gallery_info->gallery_align, array('left', 'center', 'right')))
			{
				$gallery_info->gallery_align = 'center';
			}

			$images_list = $xml_obj->attrs->images_list;
			$images_list = preg_replace('/\.(gif|jpe?g|png) /i', ".\\1\n", $images_list);
			$images_list = explode("\n", trim($images_list));
			$gallery_info->images_list = preg_grep("/^[a-z0-9\/]+\.(gif|jpe?g|png)+$/i", $images_list);
			
			// If you set the output to output the XML code generated a list of the image
			if(Context::getResponseMethod() == 'XMLRPC') {
				$output = '';
				for($i=0;$i<count($gallery_info->images_list);$i++) {
					$output .= sprintf('<img src="%s" alt="" /><br />', $gallery_info->images_list[$i]);
				}
				return $output;
			}
			// HTML gallery output, the output settings via the template for the conversion to generate the html code should
			preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
			$gallery_info->width = trim($matches[3][0]);
			if(!$gallery_info->width) $gallery_info->width = 400;

			Context::set('gallery_info', $gallery_info);

			$tpl_path = $this->component_path.'tpl';
			Context::set("tpl_path", $tpl_path);

			if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
			else $tpl_file = 'slide_gallery.html';

			$oTemplate = &TemplateHandler::getInstance();
			return $oTemplate->compile($tpl_path, $tpl_file);
		}

	}
{'fraction_non_alphanumeric': 0.15671641791044777, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 4.221590909090909, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '4554535', 'n_tokens_mistral': 2451, 'n_tokens_neox': 2102, 'n_words': 495}