<commit_before><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

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

/*
 * smarty_block_ajax_href creates the href for a link in Smarty accoring to AJAX prefs
 * 
 * Params:
 * 
 * 	template	-	template to load (e.g. tiki-admin.tpl)
 * 	htmlelement	-	destination div (usually) to load request into
 * 	function	-	xajax registered function to call - default: loadComponent
 * 	scrollTo	-	x,y coords to scroll to on click (e.g. "0,0")
 * 	_onclick	-	extra JS to run first onclick
 */


function smarty_block_ajax_href($params, $content, &$smarty, $repeat) {
    global $prefs, $user, $info;
    if ( $repeat ) return;

	if ( !empty($params['_onclick']) ) {
		$onclick = $params['_onclick'];
		if (substr($onclick, -1) != ';') {
			$onclick .= ';';
		}
	} else {
		$onclick = '';
    }
    $url = $content;
    $template = $params['template'];
	if ( !empty($params['htmlelement']) ) {
		$htmlelement = $params['htmlelement'];
	} else {
		$htmlelement = 'role_main';
	}
	$def_func = (isset($params['scrollTo']) ? 'window.scrollTo('.$params['scrollTo'].');' : '') . 'loadComponent';
    $func = isset($params['function']) ? $params['function']: $def_func;	// preserve previous behaviour
    $last_user = htmlspecialchars($user);

    																		// temporary switch to not do ajax for ckeditor button - not reliable in tiki 6
// Actually in tiki 6 even when not ckeditor if you edit while in tiki-index vs editpage the plugin help breaks as well, you get blank help
    if ( $prefs['ajax_xajax'] !== 'y' || $prefs['javascript_enabled'] == 'n' || ($template === 'tiki-editpage.tpl') {<commit_msg>[FIX] Workaround problem where xajax loading of editor within tiki-index leads to plugin help breaking, i.e. no content shown for plugin help (sorry, bracket problem in prev commit)<commit_after><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki CMS Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

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

/*
 * smarty_block_ajax_href creates the href for a link in Smarty accoring to AJAX prefs
 * 
 * Params:
 * 
 * 	template	-	template to load (e.g. tiki-admin.tpl)
 * 	htmlelement	-	destination div (usually) to load request into
 * 	function	-	xajax registered function to call - default: loadComponent
 * 	scrollTo	-	x,y coords to scroll to on click (e.g. "0,0")
 * 	_onclick	-	extra JS to run first onclick
 */


function smarty_block_ajax_href($params, $content, &$smarty, $repeat) {
    global $prefs, $user, $info;
    if ( $repeat ) return;

	if ( !empty($params['_onclick']) ) {
		$onclick = $params['_onclick'];
		if (substr($onclick, -1) != ';') {
			$onclick .= ';';
		}
	} else {
		$onclick = '';
    }
    $url = $content;
    $template = $params['template'];
	if ( !empty($params['htmlelement']) ) {
		$htmlelement = $params['htmlelement'];
	} else {
		$htmlelement = 'role_main';
	}
	$def_func = (isset($params['scrollTo']) ? 'window.scrollTo('.$params['scrollTo'].');' : '') . 'loadComponent';
    $func = isset($params['function']) ? $params['function']: $def_func;	// preserve previous behaviour
    $last_user = htmlspecialchars($user);

    																		// temporary switch to not do ajax for ckeditor button - not reliable in tiki 6
// Actually in tiki 6 even when not ckeditor if you edit while in tiki-index vs editpage the plugin help breaks as well, you get blank help
    if ( $prefs['ajax_xajax'] !== 'y' || $prefs['javascript_enabled'] == 'n' || $template === 'tiki-editpage.tpl' ) {
{'fraction_non_alphanumeric': 0.1469035045607297, 'fraction_numerical': 0.006240998559769563, 'mean_word_length': 3.650669642857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4721020', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1349, 'n_words': 437}