<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;
}

function smarty_function_menu($params, &$smarty)
{
    global $tikilib, $user, $headerlib, $prefs;
    extract($params);
    // Param = zone

    $smarty->caching = true;
	if (empty($link_on_section) || $link_on_section == 'y') {
		$smarty->assign('link_on_section', 'y');
	} else {
		 $smarty->assign('link_on_section', 'n');
	}
//REYES problema al crear directorios con nombres demasiado largos
    if ($user) {
    	$uid = md5($tikilib->get_user_cache_id($user));
        $cache_id = "menu$id|" . $uid;
        
        //$cache_id = "menu$id|" . $tikilib->get_user_cache_id($user);
    } else {
	$cache_id = "menu$id";
    }
		if (isset($css)) {
			$headerlib->add_cssfile('css/cssmenu.css',50);
			$tpl = 'tiki-user_cssmenu.tpl';
		} else {
			$tpl = 'tiki-user_menu.tpl';
		}
    if (!$smarty->is_cached($tpl, "$cache_id")) {
       $menu_info = $tikilib->get_menu($id);
       $channels = $tikilib->list_menu_options($id,0,-1,'position_asc','','',isset($prefs['mylevel'])?$prefs['mylevel']:0);
       $channels = $tikilib->sort_menu_options($channels);
       $smarty->assign('channels',$channels['data']);
       $smarty->assign('menu_info',$menu_info);
    }
    $smarty->display($tpl, "$cache_id");
    $smarty->caching = false;
}

function compare_menu_options($a, $b) { return strcmp(tra($a['name']), tra($b['name'])); }

?>
<commit_msg>[mod]suckerfish menus: {menu id=1 css=y type=horiz}, {menu id=1 css=y type=vert} - styles are very rudimentatry - {menu id=1 css=y} is broken<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;
}

function smarty_function_menu($params, &$smarty)
{
    global $tikilib, $user, $headerlib, $prefs;
    extract($params);
    // Param = zone

    $smarty->caching = false;
	if (empty($link_on_section) || $link_on_section == 'y') {
		$smarty->assign('link_on_section', 'y');
	} else {
		 $smarty->assign('link_on_section', 'n');
	}
//REYES problema al crear directorios con nombres demasiado largos
    if ($user) {
    	$uid = md5($tikilib->get_user_cache_id($user));
        $cache_id = "menu$id|" . $uid;
        
        //$cache_id = "menu$id|" . $tikilib->get_user_cache_id($user);
    } else {
	$cache_id = "menu$id";
    }
		if (isset($css)) {
			if (isset($type) && ($type == 'vert' || $type == 'horiz')) {
				$css = "cssmenu_$type.css";
			} else {
				$css = 'cssmenu.css';
				$type = '';
			}
			$headerlib->add_cssfile("css/$css", 50);
			$tpl = 'tiki-user_cssmenu.tpl';
			$smarty->assign('type', $type);
		} else {
			$tpl = 'tiki-user_menu.tpl';
		}
    if (!$smarty->is_cached($tpl, "$cache_id")) {
       $menu_info = $tikilib->get_menu($id);
       $channels = $tikilib->list_menu_options($id,0,-1,'position_asc','','',isset($prefs['mylevel'])?$prefs['mylevel']:0);
       $channels = $tikilib->sort_menu_options($channels);
       $smarty->assign('channels',$channels['data']);
       $smarty->assign('menu_info',$menu_info);
    }
    $smarty->display($tpl, "$cache_id");
    $smarty->caching = false;
}

function compare_menu_options($a, $b) { return strcmp(tra($a['name']), tra($b['name'])); }

?>

{'fraction_non_alphanumeric': 0.2081513828238719, 'fraction_numerical': 0.004366812227074236, 'mean_word_length': 3.9367816091954024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 34, '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': '1059281', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1296, 'n_words': 221}