Selaa lähdekoodia

pa #647: remontee de la liste des thematiques de premier niveau sur la home catalogue

FGM 14 vuotta sitten
vanhempi
sitoutus
c3a0cc94e6
3 muutettua tiedostoa jossa 27 lisäystä ja 17 poistoa
  1. 10 6
      fgcf.module
  2. 11 3
      theme/css/fgcf.css
  3. 6 8
      theme/fgcf-home.tpl.php

+ 10 - 6
fgcf.module

@@ -65,7 +65,7 @@ function fgcf_menu() {
     'page callback' => 'fgcf_page_odt',
     'access arguments' => array('create fgcf_fiche content'),
   );
-  
+
   return $items;
 }
 
@@ -82,7 +82,7 @@ function fgcf_perm() {
 function fgcf_theme($existing, $type, $theme, $path) {
   $ret = array(
     'fgcf_home' => array(
-      'arguments' => array('filter_form' => array()),
+      'arguments' => array('links' => array(), 'content' => NULL),
       'template'  => 'fgcf-home',
       'path'      => $path .'/theme',
     ),
@@ -135,7 +135,7 @@ function fgcf_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
       if ($a3 /* !teaser */  || !$a4 /* page */) {
         break;
       }
-      
+
       // Not redundant with hook_init: fgcf node pages are not on fgcf[/.*] URLs
       if (in_array($node->type, array_keys(fgcf_node_info()))) {
         drupal_add_css(drupal_get_path('module', 'fgcf') .'/theme/css/fgcf.css');
@@ -203,9 +203,11 @@ function fgcf_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
 function fgcf_page_home() {
   drupal_set_title('Catalogue des formations France Galop');
 
-  $filter_form = drupal_get_form('fgcf_filter_form');
-  $ret = theme('fgcf_home', $filter_form);
-
+  $links = array(
+    l(t('Formations par organisme'), 'fgcf/organisme'),
+    l(t('Formations par support'), 'fgcf/support'),
+  );
+  $ret = theme('fgcf_home', $links, fgcf_page_thematique());
   return $ret;
 }
 
@@ -516,6 +518,8 @@ function _fgcf_filter_form_translate_values() {
  * @todo : inefficient - replace with constants once the vocabs are deployed ?
  *
  * @param string $name
+ *
+ * @return int
  */
 function _fgcf_get_vocabulary_by_name($name) {
   static $matches = array();

+ 11 - 3
theme/css/fgcf.css

@@ -59,18 +59,26 @@ body {
 }
 
 /**
- * pa #644
+ * pa #644: logos sur la liste des thématiques de premier niveau
  */
 .view-fgcf-thematiques-premier-niveau td {
   background-color: white;
 }
 
 /**
- * pa #644
+ * pa #644: logos sur la liste des thématiques de premier niveau
  */
 .view-fgcf-thematiques-premier-niveau td.views-field-field-fgcf-thematique-logo-fid {
   margin-left: auto;
   margin-right: auto;
   float: none;
   text-align: center; 
-}
+}
+
+/**
+ * pa #647: reorganisation de la home du catalogue
+ */
+.fgcf-home-links .item-list,
+.fgcf-home-links .item-list li {
+  display: inline;
+}

+ 6 - 8
theme/fgcf-home.tpl.php

@@ -5,11 +5,9 @@
  * La page d'accueil de l'application de gestion des formations
  */
 ?>
-<?php echo $filter_form; ?>
-<div class="item-list">
-  <ul>
-    <li><?php print l(t('Thèmes de formation'),     'fgcf/theme'); ?></li>
-    <li><?php print l(t('Organismes de formation'), 'fgcf/organisme'); ?></li>
-    <li><?php print l(t('Support de formation'),    'fgcf/support'); ?></li>
-    </ul>
-  </div>
+<h3>Formations par thème</h3>
+<?php echo $content; ?>
+<h3>Autres recherches</h3>
+<div class="fgcf-home-links"><?php
+echo theme('item_list', $links);
+?></div>