<?php
$this->breadcrumbs = array(
    // 'Rights' => Rights::getBaseUrl(),
	'Rights',
    Rights::t('core', 'Generate items'),
);
//$rg = new RGenerator();
//$tree = $rg->getModulesTree();
//CVarDumper::dump($tree, 10, true);
//exit;
?>
<div id="generator">
    <div class="page-header"><h1><?php echo Rights::t('core', 'Generate items'); ?></h1></div>
    <p><?php echo Rights::t('core', 'Please select which items you wish to generate.'); ?></p>
    <div class="col-xs-12">
	<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm'); ?>
	<table class="items generate-item-table table table-striped table-bordered table-hover table-condensed" border="0" cellpadding="0" cellspacing="0">
	    <tbody>
		<tr class="application-heading-row">
		    <th colspan="3">
	    <h3 class="no-margin red">
		<?php echo Rights::t('core', 'Application'); ?>
	    </h3>
	    </th>
	    </tr>
	    <?php
	    $this->renderPartial('_generateItems', array(
		'model' => $model,
		'form' => $form,
		'items' => $items,
		'existingItems' => $existingItems,
		'displayModuleHeadingRow' => true,
		'basePathLength' => strlen(Yii::app()->basePath),
	    ));
	    ?>
	    </tbody>
	</table>
	<?php
	echo CHtml::link(Rights::t('core', 'Select all'), '#', array(
	    'onclick' => "jQuery('.generate-item-table').find(':checkbox').attr('checked', 'checked'); return false;",
	    'class' => 'selectAllLink'));
	?>
	/
	<?php
	echo CHtml::link(Rights::t('core', 'Select none'), '#', array(
	    'onclick' => "jQuery('.generate-item-table').find(':checkbox').removeAttr('checked'); return false;",
	    'class' => 'selectNoneLink'));
	?>
	<?php
	echo TbHtml::formActions(array(
	    CHtml::submitButton(Rights::t('core', 'Generate'), array('class' => 'btn btn-primary'))
	));
	?>
	<?php $this->endWidget(); ?>
    </div>
</div>