<commit_before><?php


function get_theme_config_file($theme){
	$a = get_app();
	$base_theme = $a->theme_info['extends'];
	
	if (file_exists("view/theme/$theme/config.php")){
		return "view/theme/$theme/config.php";
	} 
	if (file_exists("view/theme/$base_theme/config.php")){
		return "view/theme/$base_theme/config.php";
	}
	return null;
}

function settings_init(&$a) {
	// These lines provide the javascript needed by the acl selector

	$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;

	$a->page['htmlhead'] .= <<< EOT

	$(document).ready(function() {

		$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
			var selstr;
			$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
				selstr = $(this).text();
				$('#jot-perms-icon').removeClass('unlock').addClass('lock');
				$('#jot-public').hide();
			});
			if(selstr == null) { 
				$('#jot-perms-icon').removeClass('lock').addClass('unlock');
				$('#jot-public').show();
			}

		}).trigger('change');

	});

	</script>
EOT;



	$tabs = array(
		array(
			'label'	=> t('Account settings'),
			'url' 	=> $a->get_baseurl(true).'/settings',
			'selected'	=> (($a->argc == 1)?'active':''),
		),	
		array(
			'label'	=> t('Display settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/display',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
		),	
		
		array(
			'label'	=> t('Connector settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/connectors',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
		),
		array(
			'label'	=> t('Plugin settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/addon',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
		),
		array(
			'label' => t('Connected apps'),
			'url' => $a->get_baseurl(true) . '/settings/oauth',
			'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
		),
		array(
			'label' => t('Export personal data'),
			'url' => $a->get_baseurl(true) . '/uexport',
			'selected' => ''
		)
	);
	
	$tabtpl = get_markup_template("generic_links_widget.tpl");
	$a->page['aside'] = replace_macros($tabtpl, array(
		'$title' => t('Settings'),
		'$items' => $tabs,
	));

}


function settings_post(&$a) {<commit_msg>add link "remove account" to /mod/settings.php<commit_after><?php


function get_theme_config_file($theme){
	$a = get_app();
	$base_theme = $a->theme_info['extends'];
	
	if (file_exists("view/theme/$theme/config.php")){
		return "view/theme/$theme/config.php";
	} 
	if (file_exists("view/theme/$base_theme/config.php")){
		return "view/theme/$base_theme/config.php";
	}
	return null;
}

function settings_init(&$a) {
	// These lines provide the javascript needed by the acl selector

	$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;

	$a->page['htmlhead'] .= <<< EOT

	$(document).ready(function() {

		$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
			var selstr;
			$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
				selstr = $(this).text();
				$('#jot-perms-icon').removeClass('unlock').addClass('lock');
				$('#jot-public').hide();
			});
			if(selstr == null) { 
				$('#jot-perms-icon').removeClass('lock').addClass('unlock');
				$('#jot-public').show();
			}

		}).trigger('change');

	});

	</script>
EOT;



	$tabs = array(
		array(
			'label'	=> t('Account settings'),
			'url' 	=> $a->get_baseurl(true).'/settings',
			'selected'	=> (($a->argc == 1)?'active':''),
		),	
		array(
			'label'	=> t('Display settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/display',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
		),	
		
		array(
			'label'	=> t('Connector settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/connectors',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
		),
		array(
			'label'	=> t('Plugin settings'),
			'url' 	=> $a->get_baseurl(true).'/settings/addon',
			'selected'	=> (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
		),
		array(
			'label' => t('Connected apps'),
			'url' => $a->get_baseurl(true) . '/settings/oauth',
			'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
		),
		array(
			'label' => t('Export personal data'),
			'url' => $a->get_baseurl(true) . '/uexport',
			'selected' => ''
		),
		array(
			'label' => t('Remove account'),
			'url' => $a->get_baseurl(true) . '/removeme',
			'selected' => ''
		)
	);
	
	$tabtpl = get_markup_template("generic_links_widget.tpl");
	$a->page['aside'] = replace_macros($tabtpl, array(
		'$title' => t('Settings'),
		'$items' => $tabs,
	));

}


function settings_post(&$a) {
{'fraction_non_alphanumeric': 0.25950010160536474, 'fraction_numerical': 0.003657793131477342, 'mean_word_length': 4.111111111111111, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 97, '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': '5676307', 'n_tokens_mistral': 2065, 'n_tokens_neox': 1870, 'n_words': 291}