<commit_before><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
  header("location: index.php");
  exit;
}

/*
PhpLayers in tikiwiki !

That smarty function is mostly intended to be used in .tpl files
syntax: {phplayers [type=tree|phptree|plain|hort|vert] [id=1] [file=/path/to/menufile]}

*/
function smarty_function_phplayers($params, &$smarty) {
	global $feature_phplayers;
	global $tikiphplayers; include_once('lib/phplayers_tiki/tiki-phplayers.php');
	if ($feature_phplayers != 'y') {
	  echo tra("phplayers are not available on this site");
	  return;
	}
	//$smarty->assign('uses_phplayers','y'); doesn't seem to be use
	extract($params);

	if (empty($type)) {
		$type = 'tree';
	}

	if (!empty($id)) {
		$output = $tikiphplayers->mkMenuEntry($id);
	}
	$name = 'usermenu'.$id;

	echo $tikiphplayers->mkmenu($output, $name, $type, $file);
}
?><commit_msg>better to use the same case<commit_after><?php

//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
  header("location: index.php");
  exit;
}

/*
PhpLayers in tikiwiki !

That smarty function is mostly intended to be used in .tpl files
syntax: {phplayers [type=tree|phptree|plain|hort|vert] [id=1] [file=/path/to/menufile]}

*/
function smarty_function_phplayers($params, &$smarty) {
	global $feature_phplayers;
	global $tikiphplayers; include_once('lib/phplayers_tiki/tiki-phplayers.php');
	if ($feature_phplayers != 'y') {
	  echo tra("phplayers are not available on this site");
	  return;
	}
	//$smarty->assign('uses_phplayers','y'); doesn't seem to be use
	extract($params);

	if (empty($type)) {
		$type = 'tree';
	}

	if (!empty($id)) {
		$output = $tikiphplayers->mkMenuEntry($id);
	}
	$name = 'usermenu'.$id;

	echo $tikiphplayers->mkMenu($output, $name, $type, $file);
}
?>
{'fraction_non_alphanumeric': 0.16889804325437693, 'fraction_numerical': 0.0010298661174047373, 'mean_word_length': 5.110062893081761, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3001230', 'n_tokens_mistral': 733, 'n_tokens_neox': 717, 'n_words': 171}