<commit_before><?php
require_once('tiki-setup.php');

if (isset($_REQUEST['parse'])) {
	unset($_REQUEST['parse']);
	print_r( UniversalReports_Parser::load('Tracker')->apply($_REQUEST) );
	die;
}

global $headerlib, $smarty;

$headerlib->add_jsfile( 'lib/core/UniversalReports/Builder.js' );
$headerlib->add_jsfile( 'lib/core/UniversalReports/Parser.js' );

$headerlib->add_jq_onready("
	$('#universalReportsEditor')
		.universalReportsBuilder({
			definition: ".json_encode(UniversalReports_Builder::load('Tracker')->definition)."
		});
	
	$('#universalReportsUpdate').click(function() {
		$.post('tiki-edit_universal_reports.php?parse',$('#universalReportsEditor').universalReportsParser(), function(o) {
			$('#universalReportsDebug').text(o);
		});
		
		return false;
	});
");

$smarty->assign('mid', 'tiki_edit_universal_reports.tpl');
$smarty->display("tiki.tpl");<commit_msg>[NEW] Updates to demo trackers as array<commit_after><?php
require_once('tiki-setup.php');

if (isset($_REQUEST['parse'])) {
	print_r(
		UniversalReports_Builder::load('Tracker')->setValues(
			TikiFilter_PrepareInput::delimiter('_')->prepare(
				TikiFilter_PrepareInput::delimiter('_')->flatten(
					UniversalReports_Builder::load('Tracker')
						->setValuesFromRequest($_REQUEST['values'])
						->values
				)
			)
		)->outputArray()
	);
	die;
}

global $headerlib, $smarty;

$headerlib->add_jsfile( 'lib/core/UniversalReports/Builder.js' );
$headerlib->add_jsfile( 'lib/core/UniversalReports/Parser.js' );

$headerlib->add_jq_onready("
	$('#universalReportsEditor')
		.universalReportsBuilder({
			definition: ".json_encode(UniversalReports_Builder::load('Tracker')->input)."
		});
	
	$('#universalReportsUpdate').click(function() {
		$.post('tiki-edit_universal_reports.php', {
			values: $('#universalReportsEditor').serializeArray(),
			parse: true
		}, function(o) {
			$('#universalReportsDebug').text(o);
		});
		
		return false;
	});
");

$smarty->assign('mid', 'tiki_edit_universal_reports.tpl');
$smarty->display("tiki.tpl");
{'fraction_non_alphanumeric': 0.19006685768863418, 'fraction_numerical': 0.0, 'mean_word_length': 5.1982248520710055, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '6865036', 'n_tokens_mistral': 778, 'n_tokens_neox': 688, 'n_words': 72}