From de040b46eaca94b7b6e7b7b9517e3c0ef7bfbe41 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 23 Jun 2015 16:33:05 +0200 Subject: [PATCH] re-add linked materials on actuality page for visitors, in big card viewmode --- .../gui/materiobasemod/materio_search_api.pages.inc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sites/all/modules/gui/materiobasemod/materio_search_api.pages.inc b/sites/all/modules/gui/materiobasemod/materio_search_api.pages.inc index 4e67b84c..2a2a88a7 100755 --- a/sites/all/modules/gui/materiobasemod/materio_search_api.pages.inc +++ b/sites/all/modules/gui/materiobasemod/materio_search_api.pages.inc @@ -402,7 +402,12 @@ function materio_search_api_actuality(){ // dsm(date('d m y', $date_limit)); } - $viewmode = isset($user->data['materiosearchapi_viewmode']) ? $user->data['materiosearchapi_viewmode'] : variable_get('defaultviewmode', 'full'); + $viewmode = isset($user->data['materiosearchapi_viewmode']) + ? $user->data['materiosearchapi_viewmode'] + : user_access('access to materio database') + ? variable_get('defaultviewmode', 'cardmedium') + : 'cardbig'; + $limit = 10;//variable_get($viewmode.'_limite', '10'); $offset = pager_find_page() * $limit; // dsm($offset); @@ -444,7 +449,7 @@ function materio_search_api_actuality(){ continue; $items[] = $breve; - if(user_access('access to materio database')){ + // if(user_access('access to materio database')){ $materiaux = field_get_items('node',$breve,'field_materiau_ref'); // dsm($materiaux, 'materiaux'); if($materiaux){ @@ -454,7 +459,7 @@ function materio_search_api_actuality(){ $items[] = $materiau; } } - } + // } } }