<commit_before><?php 

add_filter("ampforwp_extension_pagebuilder_module_template", 'ampforwp_code_module_replacement',10,3);
function ampforwp_code_module_replacement($moduleFrontHtml,$moduleTemplate, $contentArray){
	if($moduleTemplate['name']==='code'){
		if(isset($moduleTemplate['fields']) && count($moduleTemplate['fields']) > 0) {
			foreach ($moduleTemplate['fields'] as $key => $field) {
				if(!empty($contentArray) && !isset($contentArray[$field['name']])){
					$replace = getdefaultValue($field['name'], $moduleTemplate['fields']);
				}else{
					 $replace = $contentArray[$field['name']];
				}
				
				$moduleFrontHtml = str_replace('{{'.$field['name'].'}}',  $replace, $moduleFrontHtml);
				$moduleFrontHtml = ampforwp_replaceIfContentConditional($field['name'], $replace, $moduleFrontHtml);
			}
			$moduleFrontHtml = htmlspecialchars_decode($moduleFrontHtml);
			$moduleFrontHtml = ampforwp_runCompleteCode($moduleFrontHtml);
		}
		
	}
	return $moduleFrontHtml;
}
function ampforwp_runCompleteCode($moduleFrontHtml){
	if(!empty($moduleFrontHtml)){
		return eval( "?>". $moduleFrontHtml . "<?php " );
	}
}

$output = '{{code_content}}';
$css = '
';
return array(
		'label' =>'Code',
		'name' =>'code',
		'default_tab'=> 'customizer',
		'tabs' => array(
              'customizer'=>'Content',
              'design'=>'Design',
              'advanced' => 'Advanced'
            ),
		'fields' => array(
						array(		
		 						'type'		=>'textarea',		
		 						'name'		=>"code_content",		
		 						'label'		=>'Enter your code here',
		           				'tab'     =>'customizer',
		 						'default'	=>'',	
		           				'content_type'=>'html',
	 						),
			),
		'front_template'=> $output,
		'front_css'=> $css,
		'front_common_css'=>'',
	);


?><commit_msg>#2165 only Html will be Added in code module<commit_after><?php 

add_filter("ampforwp_extension_pagebuilder_module_template", 'ampforwp_code_module_replacement',10,3);
function ampforwp_code_module_replacement($moduleFrontHtml,$moduleTemplate, $contentArray){
	if($moduleTemplate['name']==='code'){
		if(isset($moduleTemplate['fields']) && count($moduleTemplate['fields']) > 0) {
			foreach ($moduleTemplate['fields'] as $key => $field) {
				if(!empty($contentArray) && !isset($contentArray[$field['name']])){
					$replace = getdefaultValue($field['name'], $moduleTemplate['fields']);
				}else{
					 $replace = $contentArray[$field['name']];
				}
				
				$moduleFrontHtml = str_replace('{{'.$field['name'].'}}',  $replace, $moduleFrontHtml);
				$moduleFrontHtml = ampforwp_replaceIfContentConditional($field['name'], $replace, $moduleFrontHtml);
			}
			$moduleFrontHtml = htmlspecialchars_decode($moduleFrontHtml);
		}
		
	}
	return $moduleFrontHtml;
}
function ampforwp_runCompleteCode($moduleFrontHtml){
	if(!empty($moduleFrontHtml)){
		return eval( "?>". $moduleFrontHtml . "<?php " );
	}
}

$output = '{{code_content}}';
$css = '
';
return array(
		'label' =>'Code',
		'name' =>'code',
		'default_tab'=> 'customizer',
		'tabs' => array(
              'customizer'=>'Content',
              'design'=>'Design',
              'advanced' => 'Advanced'
            ),
		'fields' => array(
						array(		
		 						'type'			=> 'textarea',		
		 						'name'			=> "code_content",		
		 						'label'			=> 'Enter your code here',
		           				'tab'     		=> 'customizer',
		 						'default'		=> '',	
		 						'helpmessage'	=> 'please Insert only HTML Codes',
		           				'content_type'	=> 'html',
	 						),
			),
		'front_template'=> $output,
		'front_css'=> $css,
		'front_common_css'=>'',
	);


?>
{'fraction_non_alphanumeric': 0.1895734597156398, 'fraction_numerical': 0.003345413994981879, 'mean_word_length': 3.7586206896551726, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 46, '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': '6869784', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1166, 'n_words': 177}