<commit_before><?php
// (c) Copyright 2002-2013 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$

function wikiplugin_box_info()
{
	return array(
		'name' => tra('Box'),
		'documentation' => 'PluginBox',
		'description' => tra('Creates a formatted box with a title bar'),
		'prefs' => array('wikiplugin_box'),
		'body' => tra('text'),
		'icon' => 'img/icons/layout_header.png',
		'tags' => array( 'basic' ),
                'validate' => 'arguments',
		'params' => array(
			'title' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Box title'),
				'description' => tra('Displayed above the content'),
				'default' => '',
			),
			'bg' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Background color'),
				'description' => tra('As defined by CSS, name or Hex code.'),
			),
			'width' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Box width'),
				'description' => tra('In pixels or percentage. Default value is 100%.'),
			),
			'align' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Text Alignment'),
				'description' => tra('Aligns the text within the box (left aligned by default)'),
				'filter' => 'alpha',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Right'), 'value' => 'right'),
					array('text' => tra('Center'), 'value' => 'center'),
				),
			),
			'float' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Float Position'),
				'description' => tra(
					'Set the alignment for the entire box. For elements with a width of less than 100%, other elements will wrap around it
					unless the clear parameter is appropriately set.)'
				),
				'filter' => 'alpha',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Left'), 'value' => 'left'),
					array('text' => tra('Right'), 'value' => 'right'),
				),
			),
			'clear' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Clear'),
				'description' => tra('Items are not allowed to wrap around the box if this parameter is set to.1 (Yes)'),
				'filter' => 'text',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Yes'), 'value' => 1),
					array('text' => tra('No'), 'value' => 0)
				),
			),
			'class' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('CSS Class'),
				'description' => tra('Apply custom CSS class to the box.'),
			),
                        'style' => array(
                                'required' => false,
                                'name' => tra('CSS Style'),
                                'description' => tra('Enter CSS styling tags for the div type used.'),
                                'filter' => 'text',
//                              'advanced' => true,
                                'default' => '',
                        ),
			'id' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('ID'),
				'description' => tra('ID'),
			),

		),
	);
}

function wikiplugin_box($data, $params)
{
	global $tikilib;

	// Remove first <ENTER> if exists...
	// if (substr($data, 0, 2) == "\r\n") $data = substr($data, 2);

	extract($params, EXTR_SKIP);
	$bg   = (isset($bg))    ? " background:$bg" : "";
	$id = (isset($id)) ? " id=\"$id\" ":'';
	$class = (isset($class))? ' '.$class: ' ';
	$w = (isset($width)) ? " width:$width"  : "";
	$f = (isset($float) && ($float == "left" || $float == "right")) ? " float:$float" : "";
	$c = (isset($clear))    ? " clear:both" : "";
	if (empty($float)) {
	$begin = "<div class='cbox$class' $id style='$bg;$f;margin:0;$w;$c;$style'>";
    } else {
	$begin = "<div class='cbox$class' $id style='$bg;$f;margin:1em;margin-$float:0;$w;$c;style'>";
	}

	if (isset($title)) {
		$begin .= "<div class='cbox-title'>$title</div>";
	}
	$begin.= "<div class='cbox-data'".(strlen($bg) > 0 ? " style=\"$bg\"" : "").">";
	$end = "</div></div>";
	// Prepend any newline char with br
	//$data = preg_replace("/\\n/", "<br />", $data);
	// Insert "\n" at data begin if absent (so start-of-line-sensitive syntaxes will be parsed OK)
	//if (substr($data, 0, 1) != "\n") $data = "\n".$data;
	//$data = $tikilib->parse_data($data);
	return $begin . $data . $end;
}<commit_msg>{REF] wiki-plugins/wikiplugin_box.php: cbox classes changed to Bootstrap's panel equivalents.<commit_after><?php
// (c) Copyright 2002-2013 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$

function wikiplugin_box_info()
{
	return array(
		'name' => tra('Box'),
		'documentation' => 'PluginBox',
		'description' => tra('Creates a formatted box with a title bar'),
		'prefs' => array('wikiplugin_box'),
		'body' => tra('text'),
		'icon' => 'img/icons/layout_header.png',
		'tags' => array( 'basic' ),
                'validate' => 'arguments',
		'params' => array(
			'title' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Box title'),
				'description' => tra('Displayed above the content'),
				'default' => '',
			),
			'bg' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Background color'),
				'description' => tra('As defined by CSS, name or Hex code.'),
			),
			'width' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Box width'),
				'description' => tra('In pixels or percentage. Default value is 100%.'),
			),
			'align' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Text Alignment'),
				'description' => tra('Aligns the text within the box (left aligned by default)'),
				'filter' => 'alpha',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Right'), 'value' => 'right'),
					array('text' => tra('Center'), 'value' => 'center'),
				),
			),
			'float' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Float Position'),
				'description' => tra(
					'Set the alignment for the entire box. For elements with a width of less than 100%, other elements will wrap around it
					unless the clear parameter is appropriately set.)'
				),
				'filter' => 'alpha',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Left'), 'value' => 'left'),
					array('text' => tra('Right'), 'value' => 'right'),
				),
			),
			'clear' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('Clear'),
				'description' => tra('Items are not allowed to wrap around the box if this parameter is set to.1 (Yes)'),
				'filter' => 'text',
				'default' => '',
				'options' => array(
					array('text' => '', 'value' => ''),
					array('text' => tra('Yes'), 'value' => 1),
					array('text' => tra('No'), 'value' => 0)
				),
			),
			'class' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('CSS Class'),
				'description' => tra('Apply custom CSS class to the box.'),
			),
                        'style' => array(
                                'required' => false,
                                'name' => tra('CSS Style'),
                                'description' => tra('Enter CSS styling tags for the div type used.'),
                                'filter' => 'text',
//                              'advanced' => true,
                                'default' => '',
                        ),
			'id' => array(
				'required' => false,
				'safe' => true,
				'name' => tra('ID'),
				'description' => tra('ID'),
			),

		),
	);
}

function wikiplugin_box($data, $params)
{
	global $tikilib;

	// Remove first <ENTER> if exists...
	// if (substr($data, 0, 2) == "\r\n") $data = substr($data, 2);

	extract($params, EXTR_SKIP);
	$bg   = (isset($bg))    ? " background:$bg" : "";
	$id = (isset($id)) ? " id=\"$id\" ":'';
	$class = (isset($class))? ' '.$class: ' ';
	$w = (isset($width)) ? " width:$width"  : "";
	$f = (isset($float) && ($float == "left" || $float == "right")) ? " float:$float" : "";
	$c = (isset($clear))    ? " clear:both" : "";
	if (empty($float)) {
	$begin = "<div class='panel panel-default$class' $id style='$bg;$f;margin:0;$w;$c;$style'>";
    } else {
	$begin = "<div class='panel panel-default$class' $id style='$bg;$f;margin:1em;margin-$float:0;$w;$c;style'>";
	}

	if (isset($title)) {
		$begin .= "<div class='panel-heading'>$title</div>";
	}
	$begin.= "<div class='panel-body'".(strlen($bg) > 0 ? " style=\"$bg\"" : "").">";
	$end = "</div></div>";
	// Prepend any newline char with br
	//$data = preg_replace("/\\n/", "<br />", $data);
	// Insert "\n" at data begin if absent (so start-of-line-sensitive syntaxes will be parsed OK)
	//if (substr($data, 0, 1) != "\n") $data = "\n".$data;
	//$data = $tikilib->parse_data($data);
	return $begin . $data . $end;
}
{'fraction_non_alphanumeric': 0.22579948141745895, 'fraction_numerical': 0.0056179775280898875, 'mean_word_length': 2.6287730301842416, 'pattern_counts': {'":': 2, '<': 23, '<?xml version=': 0, '>': 193, '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': '6020361', 'n_tokens_mistral': 3582, 'n_tokens_neox': 3067, 'n_words': 816}