changed en_ettente behaviour

This commit is contained in:
2017-03-03 17:58:05 +01:00
parent a66a41e2cd
commit 530ac38275
12 changed files with 324 additions and 179 deletions
@@ -47,6 +47,10 @@ function clameursmod_entity_info_alter(&$entity_info) {
'label' => t('Accueil'),
'custom settings' => TRUE,
);
$entity_info['node']['view modes']['attente'] = array(
'label' => t('attente'),
'custom settings' => TRUE,
);
}
@@ -130,9 +134,21 @@ function _clameursmod_thematiques(){
function theme_thematiques($vars){
$nodes = $vars['items'];
$view_mode = "accueil";
$entity_view = entity_view('node', $nodes, $view_mode);
return render($entity_view);
$rendered = "";
foreach ($nodes as $key => $node) {
// dsm($node, 'node');
switch ($node->workflow) {
case 7:
$view_mode = "accueil";
break;
default:
$view_mode = "attente";
break;
}
$entity_view = entity_view('node', array($node), $view_mode);
$rendered .= render($entity_view);
}
return $rendered;
}
// ___ __