|
@@ -31,76 +31,30 @@ class BlockEntrees extends BlockBase {
|
|
// dsm($terms);
|
|
// dsm($terms);
|
|
foreach ($terms as $term) {
|
|
foreach ($terms as $term) {
|
|
// dpm($term->toArray());
|
|
// dpm($term->toArray());
|
|
-
|
|
|
|
$tid = $term->id();
|
|
$tid = $term->id();
|
|
$name = $term->getName();
|
|
$name = $term->getName();
|
|
|
|
|
|
- $term_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
|
|
- $term_link = Link::fromTextAndUrl($name, $term_url)->toRenderable();
|
|
|
|
- $term_link['#prefix'] = '<span class="oblique-wrapper">';
|
|
|
|
- $term_link['#suffix'] = "</span>";
|
|
|
|
- $term_link["#attributes"] = array(
|
|
|
|
- "class" => array('term-'.$term->id(), 'term-link'),
|
|
|
|
- "tid" => $term->id()
|
|
|
|
|
|
+ $entree = array(
|
|
|
|
+ 'tid'=>$tid
|
|
);
|
|
);
|
|
|
|
|
|
- $index_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
|
|
- $index_link = Link::fromTextAndUrl('index', $index_url)->toRenderable();
|
|
|
|
- $index_link['#prefix'] = '<span class="oblique-wrapper">';
|
|
|
|
- $index_link['#suffix'] = "</span>";
|
|
|
|
- $index_link['#attributes'] = array(
|
|
|
|
- 'class' => array('index-link'),
|
|
|
|
- "tid" => $term->id()
|
|
|
|
- );
|
|
|
|
|
|
+ $term_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
|
|
+ $entree['term_link'] = Link::fromTextAndUrl($name, $term_url);
|
|
|
|
|
|
|
|
+ $index_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
|
|
+ $entree['index_link'] = Link::fromTextAndUrl('index', $index_url);
|
|
|
|
|
|
$notice_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
$notice_url = Url::fromRoute('entity.taxonomy_term.canonical', ['taxonomy_term' => $tid]);
|
|
- $notice_link = Link::fromTextAndUrl('notice', $notice_url)->toRenderable();
|
|
|
|
- $notice_link['#prefix'] = '<span class="oblique-wrapper">';
|
|
|
|
- $notice_link['#suffix'] = "</span>";
|
|
|
|
- $notice_link['#attributes'] = array(
|
|
|
|
- 'class' => array('notice-link'),
|
|
|
|
- "tid" => $term->id()
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- $description = $term->get('description')->value;
|
|
|
|
- // dpm($description);
|
|
|
|
-
|
|
|
|
- // TODO: output block through twig and preprocess function
|
|
|
|
- // TODO: load corpus map libraries only with this block
|
|
|
|
- $entree = array(
|
|
|
|
- '#wrapper_attributes' => array(
|
|
|
|
- 'class' => array('term-'.$term->id(), 'entree'),
|
|
|
|
- 'tid' => $term->id()
|
|
|
|
- ),
|
|
|
|
- 'term_link' => $term_link,
|
|
|
|
- 'entree_content' => array(
|
|
|
|
- '#type' => 'container',
|
|
|
|
- '#attributes' => array(
|
|
|
|
- 'class' => 'entree-content'
|
|
|
|
- ),
|
|
|
|
- 'index_link' => $index_link,
|
|
|
|
- 'notice_link' => $notice_link,
|
|
|
|
- 'description' => array(
|
|
|
|
- '#type' => 'container',
|
|
|
|
- '#markup' => $description,
|
|
|
|
- '#attributes' => array('class'=>'term-description')
|
|
|
|
- )
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // if (isset($entrees) && count($entrees) == count($terms)-3) {
|
|
|
|
- // $entree['#wrapper_attributes']['class'][] = 'opened';
|
|
|
|
- // }
|
|
|
|
|
|
+ $entree['notice_link'] = Link::fromTextAndUrl('notice', $notice_url);
|
|
|
|
|
|
- // dpm($entree);
|
|
|
|
|
|
+ $entree['description'] = $term->get('description')->value;
|
|
|
|
|
|
$entrees[] = $entree;
|
|
$entrees[] = $entree;
|
|
}
|
|
}
|
|
|
|
|
|
return array (
|
|
return array (
|
|
- '#theme' => 'item_list',
|
|
|
|
- '#items' => $entrees,
|
|
|
|
|
|
+ '#theme' => 'blockentrees',
|
|
|
|
+ '#entrees_items' => $entrees,
|
|
'#attached'=>array(
|
|
'#attached'=>array(
|
|
'library' => array('edlp_corpus/corpus'),
|
|
'library' => array('edlp_corpus/corpus'),
|
|
'drupalSettings' => array(
|
|
'drupalSettings' => array(
|