Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
_generateItems.php
1 <?php if( $items['controllers']!==array() ): ?>
2 
3  <?php foreach( $items['controllers'] as $key=>$item ): ?>
4 
5  <?php if( isset($item['actions'])===true && $item['actions']!==array() ): ?>
6 
7  <?php $controllerKey = isset($moduleName)===true ? ucfirst($moduleName).'.'.$item['name'] : $item['name']; ?>
8  <?php $controllerExists = isset($existingItems[ $controllerKey.'.*' ]); ?>
9 
10  <tr class="controller-row <?php echo $controllerExists===true ? 'exists' : ''; ?>">
11  <td class="checkbox-column"><?php echo $controllerExists===false ? $form->checkBox($model, 'items['.$controllerKey.'.*]') : ''; ?></td>
12  <td class="name-column"><?php echo ucfirst($item['name']).'.*'; ?></td>
13  <td class="path-column"><?php echo substr($item['path'], $basePathLength+1); ?></td>
14  </tr>
15 
16  <?php $i=0; foreach( $item['actions'] as $action ): ?>
17 
18  <?php $actionKey = $controllerKey.'.'.ucfirst($action['name']); ?>
19  <?php $actionExists = isset($existingItems[ $actionKey ]); ?>
20 
21  <tr class="action-row<?php echo $actionExists===true ? ' exists' : ''; ?><?php echo ($i++ % 2)===0 ? ' odd' : ' even'; ?>">
22  <td class="checkbox-column"><?php echo $actionExists===false ? $form->checkBox($model, 'items['.$actionKey.']') : ''; ?></td>
23  <td class="name-column"><?php echo $action['name']; ?></td>
24  <td class="path-column"><?php echo substr($item['path'], $basePathLength+1).(isset($action['line'])===true?':'.$action['line']:''); ?></td>
25  </tr>
26 
27  <?php endforeach; ?>
28 
29  <?php endif; ?>
30 
31  <?php endforeach; ?>
32 
33 <?php else: ?>
34 
35  <tr><th class="no-items-row" colspan="3"><?php echo Rights::t('core', 'No actions found.'); ?></th></tr>
36 
37 <?php endif; ?>
38 
39 <?php if( $items['modules']!==array() ): ?>
40 
41  <?php if( $displayModuleHeadingRow===true ): ?>
42 
43  <tr><th class="module-heading-row" colspan="3"><?php echo Rights::t('core', 'Modules'); ?></th></tr>
44 
45  <?php endif; ?>
46 
47  <?php foreach( $items['modules'] as $moduleName=>$moduleItems ): ?>
48 
49  <tr><th class="module-row" colspan="3"><?php echo ucfirst($moduleName).'Module'; ?></th></tr>
50 
51  <?php $this->renderPartial('_generateItems', array(
52  'model'=>$model,
53  'form'=>$form,
54  'items'=>$moduleItems,
55  'existingItems'=>$existingItems,
56  'moduleName'=>$moduleName,
57  'displayModuleHeadingRow'=>false,
58  'basePathLength'=>$basePathLength,
59  )); ?>
60 
61  <?php endforeach; ?>
62 
63 <?php endif; ?>