<commit_before><?php
/**
 * contentinum - accessibility websites
 *
 * LICENSE
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category contentinum backend
 * @package View
 * @author <NAME>, <EMAIL>
 * @copyright Copyright (c) 2009-2013 jochum-mediaservices, Katja Jochum (http://www.jochum-mediaservices.de)
 * @license http://www.opensource.org/licenses/bsd-license
 * @since contentinum version 5.0
 * @link      https://github.com/Mikel1961/contentinum-components
 * @version   1.0.0
 */
use ContentinumComponents\Html\HtmlTable;
use ContentinumComponents\Html\Table\FactoryTable;
// prepare content, create a table
$tableFactory = new HtmlTable ( new FactoryTable () );
$ctrlpath = 'content';
// set table tag attributes
$tableFactory->setAttributes ( 'class', 'table table-hover table-nomargin table-striped dataTable dataTable-tools' );
$i = 0;
$iClass = 0;
$headlines = array (
        '#' => array(),
		'Headline' => array (),
		'Publish' => array (),
		'Last change' => array (
				'head' => array (
						'class' => 'hide-for-small text-right' 
				),
				'body' => array (
						'class' => 'hide-for-small text-right' 
				) 
		)
		 
);
$ihead = count ( $headlines );
foreach ( $headlines as $column => $attributes ) {
	$columns [] = $this->translate ( $column );
	if (is_array ( $attributes ) && ! empty ( $attributes )) {
		foreach ( $attributes as $area => $attribute ) {
			switch ($area) {
				case 'head' :
					$tableFactory->setHeadlineAttributtes ( 'class', $attribute ['class'], $i );
					break;
				case 'body' :
					$tableFactory->setTagAttributtes ( 'class', $attribute ['class'], $i );
					break;
				default :
					break;
			}
		}
	}
	$i ++;
}
$tableFactory->setHeadline ( $columns );
$i = 0;
foreach ( $this->entries as $entry ) {
        $i ++;
        $tableedit = '';
        if ( isset($this->tableeditcontent) ){
        	$links = array();
        	$links = array (
        			'edit' =>
        			array (
        					'href' => '/mcwork/'.$ctrlpath.'/edit/' .$entry->id,
        			),
        			'delete' =>
        			array (
        					'href' =>'/mcwork/'.$ctrlpath.'/delete/' .$entry->id,
        					'attribs' => array (
        							'data-name' => $entry->headline,
        							'data-ident' => 'row'.$i,
        					)
        			)
        	);
        	$tableedit = $this->mcworkToolbar($links,true,$this->tableeditcontent->toArray());
        }
        $tbl = array (
        		'edit' =>
        		array (
        				'label' => 'Edit',
        				'href' => '/mcwork/'.$ctrlpath.'/edit/' .$entry->id,
        				'attribs' => array (
        						'title' => 'Edit item',
        						'class' => 'small button'
        				)
        		),
                'delete' =>
                array (
                		'label' => 'Delete',
                		'href' => '/mcwork/'.$ctrlpath.'/delete',
                		'attribs' => array (
                		        'data-name' => $entry->headline,
                		        'data-ident' => 'row'.$i,
                				'title' => 'Delete item',
                				'class' => 'small button alert deleteitem'
                		)
                )                
        );
        $rowContent = array ();
		$rowContent[] = '<input id="row'.$i.'" type="checkbox" value="'.$entry->id.'" name="cb[]">';
		$rowContent[] = $entry->headline . $this->mcworkTableEdit ( $tbl );
		$rowContent[] = $entry->publish;
		$rowContent[] = $entry->upDate->format('d F Y H:i:s'); // date ( "d.m.Y H:i:s", $entry->registerDate );
		$tableFactory->setHtmlContent ( $rowContent );
}
$html = $tableFactory->display ();
$html .= $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'content' ) );
$toolbar = '';
if ( isset($this->toolbarcontent) ){
	$links = array(
			'add' => array(
					'href' => '/mcwork/'.$ctrlpath.'/add',
			),
			'edit' => array(
					'href' => '/mcwork/'.$ctrlpath.'/edit',
			),
			'delete' => array(
					'href' => '/mcwork/'.$ctrlpath.'/delete',
			),
	);
	$toolbar = $this->mcworkToolbar($links,true,$this->toolbarcontent->toArray());
}
// output, display content
if (isset ( $this->widget )) {
	$content = str_replace ( '{TEMPLATE_HEADER}', $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'subheadline' ) ) . $toolbar, $this->widget );
	echo str_replace ( '{TEMPLATE_CONTENT}', $html, $content );
} else {
	echo $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'subheadline' ) );
	echo $html;
}
?><commit_msg>Remove small BUGS from view script contribution<commit_after><?php
/**
 * contentinum - accessibility websites
 *
 * LICENSE
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @category contentinum backend
 * @package View
 * @author <NAME>, <EMAIL>
 * @copyright Copyright (c) 2009-2013 jochum-mediaservices, Katja Jochum (http://www.jochum-mediaservices.de)
 * @license http://www.opensource.org/licenses/bsd-license
 * @since contentinum version 5.0
 * @link      https://github.com/Mikel1961/contentinum-components
 * @version   1.0.0
 */
use ContentinumComponents\Html\HtmlTable;
use ContentinumComponents\Html\Table\FactoryTable;
// prepare content, create a table
$tableFactory = new HtmlTable ( new FactoryTable () );
$ctrlpath = 'contribution';
// set table tag attributes
$tableFactory->setAttributes ( 'class', 'table table-hover table-nomargin table-striped dataTable dataTable-tools' );
$i = 0;
$iClass = 0;
$headlines = array (
        '#' => array(),
		'Headline' => array (),
		'Publish' => array (),
		'Last change' => array (
				'head' => array (
						'class' => 'hide-for-small text-right' 
				),
				'body' => array (
						'class' => 'hide-for-small text-right' 
				) 
		)
		 
);
$ihead = count ( $headlines );
foreach ( $headlines as $column => $attributes ) {
	$columns [] = $this->translate ( $column );
	if (is_array ( $attributes ) && ! empty ( $attributes )) {
		foreach ( $attributes as $area => $attribute ) {
			switch ($area) {
				case 'head' :
					$tableFactory->setHeadlineAttributtes ( 'class', $attribute ['class'], $i );
					break;
				case 'body' :
					$tableFactory->setTagAttributtes ( 'class', $attribute ['class'], $i );
					break;
				default :
					break;
			}
		}
	}
	$i ++;
}
$tableFactory->setHeadline ( $columns );
$i = 0;
foreach ( $this->entries as $entry ) {
        $i ++;
        $tableedit = '';
        if ( isset($this->tableeditcontent) ){
        	$links = array();
        	$links = array (
        			'edit' =>
        			array (
        					'href' => '/mcwork/'.$ctrlpath.'/edit/' .$entry->id,
        			),
        			'delete' =>
        			array (
        					'href' =>'/mcwork/'.$ctrlpath.'/delete/' .$entry->id,
        					'attribs' => array (
        							'data-name' => $entry->headline,
        							'data-ident' => 'row'.$i,
        					)
        			)
        	);
        	$tableedit = $this->mcworkToolbar($links,true,$this->tableeditcontent->toArray());
        }
        $tbl = array (
        		'edit' =>
        		array (
        				'label' => 'Edit',
        				'href' => '/mcwork/'.$ctrlpath.'/edit/' .$entry->id,
        				'attribs' => array (
        						'title' => 'Edit item',
        						'class' => 'small button'
        				)
        		),
                'delete' =>
                array (
                		'label' => 'Delete',
                		'href' => '/mcwork/'.$ctrlpath.'/delete',
                		'attribs' => array (
                		        'data-name' => $entry->headline,
                		        'data-ident' => 'row'.$i,
                				'title' => 'Delete item',
                				'class' => 'small button alert deleteitem'
                		)
                )                
        );
        $rowContent = array ();
		$rowContent[] = '<input id="row'.$i.'" type="checkbox" value="'.$entry->id.'" name="cb[]">';
		$rowContent[] = $entry->headline . $this->mcworkTableEdit ( $tbl );
		$rowContent[] = $entry->publish;
		$rowContent[] = $entry->upDate->format('d F Y H:i:s'); // date ( "d.m.Y H:i:s", $entry->registerDate );
		$tableFactory->setHtmlContent ( $rowContent );
}
$html = $tableFactory->display ();
$html .= $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'content' ) );
$toolbar = '';
if ( isset($this->toolbarcontent) ){
	$links = array(
			'add' => array(
					'href' => '/mcwork/'.$ctrlpath.'/add',
			),
			'edit' => array(
					'href' => '/mcwork/'.$ctrlpath.'/edit',
			),
			'delete' => array(
					'href' => '/mcwork/'.$ctrlpath.'/delete',
			),
	);
	$toolbar = $this->mcworkToolbar($links,true,$this->toolbarcontent->toArray());
}
// output, display content
if (isset ( $this->widget )) {
	$content = str_replace ( '{TEMPLATE_HEADER}', $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'subheadline' ) ) . $toolbar, $this->widget );
	echo str_replace ( '{TEMPLATE_CONTENT}', $html, $content );
} else {
	echo $this->translate ( $this->mcworkContent ( $this->page, $this->pagecontent, 'subheadline' ) );
	echo $html;
}
?>
{'fraction_non_alphanumeric': 0.17140682963949397, 'fraction_numerical': 0.0038048130885570248, 'mean_word_length': 2.4780019847833277, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 169, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '1682638', 'n_tokens_mistral': 3707, 'n_tokens_neox': 3326, 'n_words': 794}