<commit_before><?php
/**
 * HTML class for common data
 *
 * @author       <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006, Telaxus LLC
 * @version 1.0
 * @license MIT
 * @package epesi-utils
 * @subpackage CommonData
 */
require_once('HTML/QuickForm/select.php');

class HTML_QuickForm_commondata extends HTML_QuickForm_select {
	var $_cd = null;
	var $_add_empty_fields = false;
	var $_order = 'value';

	function HTML_QuickForm_commondata($elementName=null, $elementLabel=null, $commondata=null, $options=null, $attributes=null) {
		$this->HTML_QuickForm_select($elementName, $elementLabel, array(), $attributes);
		$this->_persistantFreeze = true;
		$this->_type = 'commondata';
		$this->_appendName = true;

		if(isset($commondata)) {
			if(is_array($commondata)) {
				$this->_cd = $commondata;
			} elseif(is_string($commondata))
				$this->_cd = array($commondata);
		}

		if (isset($options['empty_option']))
			$this->_add_empty_fields = $options['empty_option'];
		
		if (isset($options['order']))
			$this->_order = Utils_CommonDataCommon::validate_order($options['order']);		
		elseif (isset($options['order_by_key'])) //legacy check
			$this->_order = Utils_CommonDataCommon::validate_order($options['order_by_key']);
		<commit_msg>Use PHP5 constructor in CommonData<commit_after><?php
/**
 * HTML class for common data
 *
 * @author       <NAME> <<EMAIL>>
 * @copyright Copyright &copy; 2006, Telaxus LLC
 * @version 1.0
 * @license MIT
 * @package epesi-utils
 * @subpackage CommonData
 */

class HTML_QuickForm_commondata extends HTML_QuickForm_select {
	var $_cd = null;
	var $_add_empty_fields = false;
	var $_order = 'value';

	function __construct($elementName=null, $elementLabel=null, $commondata=null, $options=null, $attributes=null) {
		parent::__construct($elementName, $elementLabel, array(), $attributes);
		$this->_persistantFreeze = true;
		$this->_type = 'commondata';
		$this->_appendName = true;

		if(isset($commondata)) {
			if(is_array($commondata)) {
				$this->_cd = $commondata;
			} elseif(is_string($commondata))
				$this->_cd = array($commondata);
		}

		if (isset($options['empty_option']))
			$this->_add_empty_fields = $options['empty_option'];
		
		if (isset($options['order']))
			$this->_order = Utils_CommonDataCommon::validate_order($options['order']);		
		elseif (isset($options['order_by_key'])) //legacy check
			$this->_order = Utils_CommonDataCommon::validate_order($options['order_by_key']);
		
{'fraction_non_alphanumeric': 0.16157916157916158, 'fraction_numerical': 0.005291005291005291, 'mean_word_length': 5.468421052631579, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '3806979', 'n_tokens_mistral': 861, 'n_tokens_neox': 806, 'n_words': 151}