<commit_before><?php
/*
PhpLayers in tikiwiki !

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

*/
function smarty_function_phplayers($params, &$smarty) {
	global $tikilib;
	extract($params);

	$types['tree'] = 'treemenu.inc.php';
	$types['phptree'] = 'phptreemenu.inc.php';
	$types['plain'] = 'phptreemenu.inc.php';

	$classes['tree'] = 'TreeMenu';
	$classes['phptree'] = 'PHPTreeMenu';
	$classes['plain'] = 'PlainMenu';

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

	include_once ("lib/phplayers/lib/PHPLIB.php");
	include_once ("lib/phplayers/lib/layersmenu-common.inc.php");
	include_once ("lib/phplayers/lib/".$types["$type"]);
	// beware ! that below is a variable class declaration
	$class = $classes["$type"];
	$phplayers = new $class();
	$phplayers->dirroot = "lib/phplayers";
	$phplayers->libjsdir = "lib/phplayers/libjs/";
	$phplayers->imgdir = "lib/phplayers/images/";
	$phplayers->imgwww = "lib/phplayers/images/";
	$phplayers->tpldir = "lib/phplayers/templates/";
	
	if (!empty($id)) {
		$menu_info = $tikilib->get_menu($id);
		$channels = $tikilib->list_menu_options($id,0,-1,'position_asc','');<commit_msg>fixed wrapping of phplayers<commit_after><?php
/*
PhpLayers in tikiwiki !

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

*/
function smarty_function_phplayers($params, &$smarty) {
	global $tikilib;
	extract($params);

	$types['tree'] = 'treemenu.inc.php';
	$types['phptree'] = 'phptreemenu.inc.php';
	$types['plain'] = 'phptreemenu.inc.php';

	$classes['tree'] = 'TreeMenu';
	$classes['phptree'] = 'PHPTreeMenu';
	$classes['plain'] = 'PlainMenu';

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

	include_once ("lib/phplayers/lib/PHPLIB.php");
	include_once ("lib/phplayers/lib/layersmenu-common.inc.php");
	include_once ("lib/phplayers/lib/".$types["$type"]);
	// beware ! that below is a variable class declaration
	$class = $classes["$type"];
	$phplayers = new $class();
	$phplayers->setDirrootCommon("lib/phplayers");
	$phplayers->setLibjsdir("lib/phplayers/libjs/");
	$phplayers->setImgdir("lib/phplayers/images/");
	$phplayers->setImgwww("lib/phplayers/images/");
	$phplayers->setTpldirCommon("lib/phplayers/templates/");
	
	if (!empty($id)) {
		$menu_info = $tikilib->get_menu($id);
		$channels = $tikilib->list_menu_options($id,0,-1,'position_asc','');
{'fraction_non_alphanumeric': 0.20283400809716598, 'fraction_numerical': 0.0024291497975708503, 'mean_word_length': 5.7146739130434785, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '242574', 'n_tokens_mistral': 986, 'n_tokens_neox': 961, 'n_words': 153}