Selaa lähdekoodia

pa #647, #677: supprimer l'acces direct a la formation par support, restaurer le filtre sur la page par organisme

FGM 13 vuotta sitten
vanhempi
säilyke
f59d7c048f
3 muutettua tiedostoa jossa 70 lisäystä ja 20 poistoa
  1. 22 8
      fgcf.module
  2. 33 5
      theme/css/fgcf.css
  3. 15 7
      theme/fgcf-home.tpl.php

+ 22 - 8
fgcf.module

@@ -225,9 +225,12 @@ function fgcf_page_home() {
 
   $links = array(
     l(t('Formations par organisme'), 'fgcf/organisme'),
-    l(t('Formations par support'), 'fgcf/support'),
+    // Désactivé pa #647
+    // l(t('Formations par support'), 'fgcf/support'),
   );
-  $ret = theme('fgcf_home', $links, fgcf_page_thematique());
+  $links = theme('item_list', $links, NULL, 'ul', array('class' => 'fgcf-home-links'));
+
+  $ret = theme('fgcf_home', $links, fgcf_page_thematique(0, $links));
   return $ret;
 }
 
@@ -273,19 +276,19 @@ function fgcf_page_organisme() {
 
   $filter_form = drupal_get_form('fgcf_filter_form');
 
-  $ret = views_embed_view('fgcf_organismes_de_formation');
-
+  $ret = $filter_form;
+  $ret .= views_embed_view('fgcf_organismes_de_formation');
   return $ret;
 }
 
 /**
  * Page callback : 'Formations par thematique'.
  */
-function fgcf_page_thematique($thematique = 0) {
+function fgcf_page_thematique($thematique = 0, $filter_post = NULL) {
   $bc = drupal_get_breadcrumb();
   $bc[] = l(t('Catalogue formations'), 'fgcf');
 
-  $filter_form = drupal_get_form('fgcf_filter_form');
+  $filter_form = drupal_get_form('fgcf_filter_form', $filter_post);
 
   $ret = $filter_form;
 
@@ -442,7 +445,7 @@ function fgcf_mail($key, &$message, $params) {
  *
  * @return array
  */
-function fgcf_filter_form($form_state) {
+function fgcf_filter_form($form_state, $post = NULL) {
 
   $form['filtre'] = array(
     '#title' => t('Filtrer les formations'),
@@ -468,7 +471,7 @@ function fgcf_filter_form($form_state) {
       ? $_SESSION['fgcf']['modalite']
       : array();
   $form['filtre']['modalite'] = array(
-    '#title'   => t('Modalité de formation'),
+    '#title'   => t('Modalité<br />de formation'),
     '#type'    => 'checkboxes',
     '#options' => array(
       '1'    => t('Intra-entreprise'),
@@ -484,6 +487,17 @@ function fgcf_filter_form($form_state) {
     '#value' => t('Appliquer le filtre'),
   );
 
+  if (!is_null($post)) {
+    $form['post'] = array(
+      '#type'  => 'markup',
+      '#value' => $post,
+    );
+  }
+
+  $form = array(
+    '#type' => 'fieldset',
+    $form,
+  );
   return $form;
 }
 

+ 33 - 5
theme/css/fgcf.css

@@ -5,7 +5,7 @@ body {
   border-top: groove orange;
 }
 
-.group-prestataire-branding, .fgcf-filtre {
+.group-prestataire-branding, .fgcf-post {
   float: right;
   margin: 0 0 1em 1em;
   background-image: none;
@@ -35,21 +35,37 @@ body {
   background-image: none; /* override garland list styling */
 }
 
+/**
+ * pa #677: filtre sur la page des formations
+ */
 .view-fgcf-organismes-de-formation td {
   text-align: center;
   border-bottom: solid #e0e0e0;
-  padding: 0.5em 3em 0.2em 3em;
+  padding: 0.5em 0.5em 0.2em 0.5em;
 }
 
+/**
+ * pa #677: filtre sur la page des formations
+ */
 .view-fgcf-organismes-de-formation table,
 .view-fgcf-formations-par-format table { 
   width: auto;
 }
 
+/**
+ * pa #677: filtre sur la page des formations
+ */
 .view-fgcf-organismes-de-formation div.views-field-field-fgcf-prestataire-logo-fid {
   height: 48px;
 }
 
+/**
+ * pa #677: filtre sur la page des formations
+ */
+.view-fgcf-organismes-de-formation .item-list .pager {
+  text-align: left;
+}
+
 .group-fgcf-fiche-meta legend {
   display: none;
 }
@@ -78,7 +94,19 @@ body {
 /**
  * pa #647: reorganisation de la home du catalogue
  */
-.fgcf-home-links .item-list,
-.fgcf-home-links .item-list li {
-  display: inline;
+#fgcf-filter-form {
+  float: right;
+  margin: 0 0 1em 1em;
+  background-image: none;
+}
+
+/**
+ * pa #647: reorganisation de la home du catalogue
+ */
+.item-list .fgcf-home-links ,
+.item-list .fgcf-home-links li {
+  list-style-type: none;
+  margin-left: auto;
+  margin-right: auto;
+  text-align: center;
 }

+ 15 - 7
theme/fgcf-home.tpl.php

@@ -3,11 +3,19 @@
 /**
  * @file
  * La page d'accueil de l'application de gestion des formations
+ *
+ * Elle est devenue vide à la suite de l'évolution de la demande pa #647
+ *
+ * Variables:
+ *
+ * - $content
+ *   Le contenu principal de page, incluant le coeur de page et le formulaire
+ *   de filtre
+ * - $links
+ *   Un tableau de liens pouvant être ajoutés dans la mise en page. Une
+ *   alternative, utilisée dans cet exemple, consiste à les passer en paramètre
+ *   de fgcf_filter_form().
  */
-?>
-<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>
+
+echo $content;
+