view.ctp 1.88 KB

<div class="surCategories view">
    <h2>Détail domaine</h2>
    <table style="margin-bottom: 30px;">
    
    	<tr><th style="width: 250px;"></th><th></th></tr>
    	
    	<?php 
    	
    	echo $this->Html->link(__('<i class="icon-pencil"></i> Editer ce domaine'),
    				['action' => 'edit', $surCategory->id],
    				['escape' => false,'onclick' => 'return true;']
    				);
    	echo $this->Form->postLink(__('<i class="icon-trash"></i> Supprimer ce domaine'),
    				['action' => 'delete', $surCategory->id],
    				['style'=>'margin-left: 110px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $surCategory->id)]
    				);
    	
    	$displayElement(__('Nom'), h($surCategory->nom));


    	?>

    </table>
    
    
        <h3 id="t_suivis" style="cursor: pointer;">
			<i class="icon-chevron-down" style="font-size: 14px;" id="i_suivis"></i> 
			<span style="text-decoration: underline;">Catégorie associé (<?= sizeof($categories) ?>)</span>
		</h3>
		<div id="suivis" style="margin-bottom: 20px;">

        <?php if (!empty($categories)) { ?>
        <table> 
		<tr> 
			<th><?= __('Nom') ?></th>
            <th style="width:50px;"><?= __('Détail') ?></th>
		</tr> 	
		<?php foreach ($categories as $category): ?>
		<tr>
		    <td><?= h($category->nom) ?></td>

            <td class="actions">
                <?= $this->Html->link(__('<i class="icon-search"></i>'), ['controller' => 'Categories', 'action' => 'view', $category->id], ['escape' => false, 'style' => 'margin:0']) ?>
			</td>
       </tr>
		<?php endforeach; ?> 
		</table> 
        <?php }else { echo 'Aucune catégorie lié à ce domaine.'; } ?>
    </div>
    
    
</div>

    	<div class="actions">
			<?php echo $this->element('menu') ?>
			<?php echo $this->element('menu_view', 
			[ 'pluralHumanName' => 'Domaines',
			'singularHumanName' => 'Domaine',
			'lien' => $surCategory->id ]) ?>
		</div>