<commit_before><?php
/**
 * @version     $Id$
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Groups
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Select Template Helper Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/gergoerdosi>
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Groups
 */

class ComGroupsTemplateHelperSelect extends KTemplateHelperSelect
{
	public function groups(array $config = array())
	{
		$config = new KConfig($config);
		$config->append(array(
		    'name' => 'group',
			'core' => null
		));
		
		$attribs = KHelperArray::toString($config->attribs);
		
		$groups  = $this->getService('com://admin/groups.model.groups')
            ->set('core', is_null($config->core) ? null : $config->core)
		    ->getList();
		
		if($config->exclude instanceof KDatabaseRowInterface && $config->exclude->id) 
		{
			foreach(clone $groups as $group) 
			{
				if($group->lft >= $config->exclude->lft && $group->rgt <= $config->exclude->rgt) {
					$groups->extract($group);
				}
			}
		}
		
		foreach($groups as $group) 
		{
			$checked = $config->selected == $group->id ? ' checked' : '';			
			
			if($group->depth) {
		        $html[] = '<div style="padding-left: '.($group->depth * 15).'px" class="clearfix">';
		        $html[] = '<input type="radio" name="'.$config->name.'" id="'.$config->name.$group->id.'" value="'.$group->id.'"'.$checked.' '.$attribs.'/>';
			    $html[] = '<label for="'.$config->name.$group->id.'">'.$group->name.'</label>';
			    $html[] = '</div>';
			} else {
				$html[] = '<h4>'.$group->name.'</h4>';
			}
		}
		
		return implode(PHP_EOL, $html);
	}
}<commit_msg>Synced markup with recent changes in Nooku Server<commit_after><?php
/**
 * @version     $Id$
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Groups
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Select Template Helper Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/gergoerdosi>
 * @category    Nooku
 * @package     Nooku_Server
 * @subpackage  Groups
 */

class ComGroupsTemplateHelperSelect extends KTemplateHelperSelect
{
	public function groups(array $config = array())
	{
		$config = new KConfig($config);
		$config->append(array(
		    'name' => 'group',
			'core' => null
		));
		
		$attribs = KHelperArray::toString($config->attribs);
		
		$groups  = $this->getService('com://admin/groups.model.groups')
            ->set('core', is_null($config->core) ? null : $config->core)
		    ->getList();
		
		if($config->exclude instanceof KDatabaseRowInterface && $config->exclude->id) 
		{
			foreach(clone $groups as $group) 
			{
				if($group->lft >= $config->exclude->lft && $group->rgt <= $config->exclude->rgt) {
					$groups->extract($group);
				}
			}
		}
		
		foreach($groups as $group) 
		{
			$checked = $config->selected == $group->id ? ' checked' : '';			
			$style   = $group->depth > 1 ? 'style="padding-left: '.($group->depth * 15).'px"' : '';
			
			if($group->depth) {
			    $html[] = '<label '.$style.' class="radio" for="'.$config->name.$group->id.'">';
			    $html[] = '<input type="radio" name="'.$config->name.'" id="'.$config->name.$group->id.'" value="'.$group->id.'"'.$checked.' '.$attribs.'/>';
			    $html[] = $group->name;
			    $html[] = '</label>';

			} else {
				$html[] = '<h3>'.$group->name.'</h3>';
			}
		}
		
		return implode(PHP_EOL, $html);
	}
}
{'fraction_non_alphanumeric': 0.21474530831099195, 'fraction_numerical': 0.007238605898123324, 'mean_word_length': 2.9733759318423854, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '6721391', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1272, 'n_words': 229}