<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$

// Includes a poll
// Usage:
// {POLL(pollId=>1)}Title{POLL}

function wikiplugin_poll_help() {
	$help = tra("Displays the output of a poll, fields are indicated with numeric ids.").":\n";
	$help.= "~np~{POLL(pollId=>1)}Good Poll{POLL}~/np~";
	return $help;
}

function wikiplugin_poll_info() {
	return array(
		'name' => tra('Poll'),
		'documentation' => 'PluginPoll',
		'description' => tra("Displays the output of a poll, fields are indicated with numeric ids."),
		'prefs' => array( 'feature_polls', 'wikiplugin_poll' ),
		'body' => tra('Title'),
		'params' => array(
			'pollId' => array(
				'required' => true,
				'name' => tra('Poll'),
				'description' => tra('Poll ID'),
			),
			'showtitle' => array(
				'required' => false,
				'name' => tra('Show title'),
				'description' => 'y|n',
				'default' => 'y',
			),
		),
	);
}

function wikiplugin_poll($data, $params) {
	global $smarty, $polllib, $trklib, $tikilib, $dbTiki, $userlib, $tiki_p_admin, $prefs, $_REQUEST, $user;
	$default = array('showtitle' => 'y');
	$params = array_merge($default, $params);

	extract ($params,EXTR_SKIP);

	if (!isset($pollId)) {
	    $smarty->assign('msg', tra("missing poll ID for plugin POLL"));<commit_msg>Add options, default fields and other cleanup to plugin info for use in plugin edit popup and plugin manager<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$

// Includes a poll
// Usage:
// {POLL(pollId=>1)}Title{POLL}

function wikiplugin_poll_help() {
	$help = tra("Displays the output of a poll, fields are indicated with numeric ids.").":\n";
	$help.= "~np~{POLL(pollId=>1)}Good Poll{POLL}~/np~";
	return $help;
}

function wikiplugin_poll_info() {
	return array(
		'name' => tra('Poll'),
		'documentation' => tra('PluginPoll'),
		'description' => tra('Displays the output of a poll, fields are indicated with numeric ids.'),
		'prefs' => array( 'feature_polls', 'wikiplugin_poll' ),
		'body' => tra('Title'),
		'params' => array(
			'pollId' => array(
				'required' => true,
				'name' => tra('Poll'),
				'description' => tra('Numeric value representing the poll ID'),
				'default' => ''
			),
			'showtitle' => array(
				'required' => false,
				'name' => tra('Show Title'),
				'description' => tra('Show poll title (shown by default).'),
				'default' => 'y',
				'options' => array(
					array('text' => '', 'value' => ''), 
					array('text' => tra('Yes'), 'value' => 'y'), 
					array('text' => tra('No'), 'value' => 'n')
				)
			)
		)
	);
}

function wikiplugin_poll($data, $params) {
	global $smarty, $polllib, $trklib, $tikilib, $dbTiki, $userlib, $tiki_p_admin, $prefs, $_REQUEST, $user;
	$default = array('showtitle' => 'y');
	$params = array_merge($default, $params);

	extract ($params,EXTR_SKIP);

	if (!isset($pollId)) {
	    $smarty->assign('msg', tra("missing poll ID for plugin POLL"));
{'fraction_non_alphanumeric': 0.18830584707646178, 'fraction_numerical': 0.005997001499250375, 'mean_word_length': 4.077625570776256, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 49, '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': '1670813', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1155, 'n_words': 323}