audio cartel ids now complete
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
use Drupal\Core\Url;
|
||||
use Drupal\Core\Link;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Template\Attribute;
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
@@ -164,58 +165,50 @@ function edlptheme_preprocess_node__enregistrement__compo(&$vars){
|
||||
|
||||
function edlptheme_preprocess_node__enregistrement__player_cartel(&$vars){
|
||||
// dpm($vars);
|
||||
$node = $vars['node'];
|
||||
|
||||
$vars['col_left'] = false;
|
||||
$vars['col_right'] = false;
|
||||
|
||||
// if transcript not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-transcript', 'ajax-link'],
|
||||
'viewmode'=>'transcript'
|
||||
)
|
||||
));
|
||||
$vars['link_transcript'] = array(
|
||||
'#title' => t("Lire le text."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options'=>array(
|
||||
$transcript = $node->get('field_transcript_vo');
|
||||
if(!$transcript->isEmpty()){
|
||||
$vars['col_left'] = true;
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$node->id()]);
|
||||
$url->setOptions(array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-transcript', 'ajax-link'],
|
||||
'viewmode'=>'transcript',
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// TODO: refacorize the link generator as following :
|
||||
// $url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term'=>$tid]);
|
||||
// $url->setOptions(array(
|
||||
// 'attributes' => array(
|
||||
// 'class' => ['index-link', 'ajax-link'],
|
||||
// 'viewmode'=>'index',
|
||||
// 'tid'=>$tid,
|
||||
// 'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
// )
|
||||
// ));
|
||||
// $entree['index_link'] = Link::fromTextAndUrl('index', $url);
|
||||
));
|
||||
$vars['link_transcript'] = Link::fromTextAndUrl(t("Lire le text."), $url);
|
||||
}
|
||||
|
||||
// if article not empty
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$vars['node']->id()], array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-article', 'ajax-link'],
|
||||
'viewmode'=>'article'
|
||||
)
|
||||
));
|
||||
$vars['link_article'] = array(
|
||||
'#title' => t("Lire l'article."),
|
||||
'#type' => 'link',
|
||||
'#url' => $url,
|
||||
'#options' => array(
|
||||
'attributes'=>array(
|
||||
$article = $node->get('body');
|
||||
if(!$article->isEmpty()){
|
||||
$vars['col_left'] = true;
|
||||
$url = Url::fromRoute('entity.node.canonical', ['node'=>$node->id()]);
|
||||
$url->setOptions(array(
|
||||
'attributes' => array(
|
||||
'class' => ['link-article', 'ajax-link'],
|
||||
'viewmode'=>'article',
|
||||
'data-drupal-link-system-path' => $url->getInternalPath()
|
||||
)
|
||||
)
|
||||
);
|
||||
// if article or transcript
|
||||
$vars['col_left'] = true;
|
||||
));
|
||||
$vars['link_article'] = Link::fromTextAndUrl(t("Lire l'article."), $url);
|
||||
}
|
||||
|
||||
// if
|
||||
$vars['col_right'] = true;
|
||||
// relations (defined in edlp_corpus.module)
|
||||
if(isset($vars['content']['relations'])){
|
||||
// dpm($relations);
|
||||
$vars['col_right'] = true;
|
||||
}
|
||||
|
||||
if($vars['col_left'] || $vars['col_right']){
|
||||
$vars['second_cartel'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user