Browse Source

#642, #668: 'thematique' devient 'theme'

FGM 13 years ago
parent
commit
1fc60fa8cb

+ 2 - 2
fgcf.features.inc

@@ -67,9 +67,9 @@ function fgcf_node_info() {
       'help' => '',
     ),
     'fgcf_thematique' => array(
-      'name' => t('FG Thématique de formation'),
+      'name' => t('FG Thème de formation'),
       'module' => 'features',
-      'description' => t('Thématique de formation, correspondant à un terme de premier niveau du vocabulaire des thématiques.'),
+      'description' => t('Théme de formation, correspondant à un terme de premier niveau du vocabulaire des thèmes.'),
       'has_title' => '1',
       'title_label' => t('Titre'),
       'has_body' => '1',

+ 14 - 1
fgcf.install

@@ -5,7 +5,7 @@
  */
 function fgcf_install() {
   $vocabulary = array(
-    'name' => 'FGCF Thématique',
+    'name' => 'FGCF Thème',
     'description' => '',
     'multiple' => 0,
     'required' => 1,
@@ -68,4 +68,17 @@ function fgcf_install() {
     'nodes' => array(),
   );
   taxonomy_save_vocabulary($vocabulary);
+}
+
+/**
+ * Implements hook_update_N().
+ *
+ * Rename "FGCF Thématique" vocabulary to "FGCF Thème", as per issue #642
+ *
+ * @return array
+ */
+function fgcf_update_6101() {
+  $sq = "UPDATE {vocabulary} SET name = 'FGCF Thème' WHERE name = 'FGCF Thématique'";
+  $ret = update_sql($sq);
+  return $ret;
 }

+ 14 - 14
fgcf.module

@@ -54,9 +54,9 @@ function fgcf_menu() {
     'page callback' => 'fgcf_page_organisme',
     'access arguments' => $read_access,
   );
-  $items['fgcf/thematique'] = array(
+  $items['fgcf/theme'] = array(
     'type' => MENU_CALLBACK,
-    'title' => 'Formations par thématique',
+    'title' => 'Formations par thème',
     'page callback' => 'fgcf_page_thematique',
     'access arguments' => $read_access,
   );
@@ -99,8 +99,8 @@ function fgcf_theme($existing, $type, $theme, $path) {
 function fgcf_term_path($term) {
   $vocabulary = taxonomy_vocabulary_load($term->vid);
   switch ($vocabulary->vid) {
-    case _fgcf_get_vocabulary_by_name('FGCF Thématique'):
-      return 'fgcf/thematique/'. $term->tid;
+    case _fgcf_get_vocabulary_by_name('FGCF Théme'):
+      return 'fgcf/theme/'. $term->tid;
       break;
 
     case _fgcf_get_vocabulary_by_name('FGCF Format de cours'):
@@ -181,9 +181,9 @@ function fgcf_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
 
           $bc = drupal_get_breadcrumb();
           $bc[] = l(t('Catalogue formations'), 'fgcf');
-          $bc[] = l(t('Thématiques'), 'fgcf/thematique');
-          $bc[] = l($cats[0]->description, 'fgcf/thematique/'. $cats[0]->tid);
-          $bc[] = l($cats[1]->description, 'fgcf/thematique/'. $cats[1]->tid);
+          $bc[] = l(t('Thèmes'), 'fgcf/theme');
+          $bc[] = l($cats[0]->description, 'fgcf/theme/'. $cats[0]->tid);
+          $bc[] = l($cats[1]->description, 'fgcf/theme/'. $cats[1]->tid);
           drupal_set_breadcrumb($bc);
 
           unset($cats, $parents, $tid, $term);
@@ -265,10 +265,10 @@ function fgcf_page_thematique($thematique = 0) {
 
   // The views itself doesn't mention vocab ids, which might be different in dev
   // and in production.
-  // We limit to terms in the 'Thématique' vocab outside the view.
-  $vid = _fgcf_get_vocabulary_by_name('FGCF Thématique');
+  // We limit to terms in the 'Thème' vocab outside the view.
+  $vid = _fgcf_get_vocabulary_by_name('FGCF Thème');
   if (empty($thematique)) {
-    // Afficher liste des thématiques de 1er niveau.
+    // Afficher liste des thèmes de 1er niveau.
     $ret .= views_embed_view('fgcf_thematiques_premier_niveau', 'default', $vid);
   }
   else {
@@ -280,21 +280,21 @@ function fgcf_page_thematique($thematique = 0) {
       $description = '';
     }
     else {
-      $bc[] = l(t('Thématiques'), 'fgcf/thematique');
+      $bc[] = l(t('Thèmes'), 'fgcf/theme');
       $parents = taxonomy_get_parents($thematique);
       $description = $term->description;
     }
 
     if (empty($parents)) {
       // Top category: display list of sub-categories.
-      drupal_set_title(t('Thématique : @term', array('@term' => $description)));
+      drupal_set_title(t('Thème : @term', array('@term' => $description)));
       $ret .= views_embed_view('fgcf_thematique_deuxieme_niveau', 'default', $thematique);
     }
     else {
       // Sub-category: display list of nodes.
       $parent = current($parents);
-      $bc[] = l($parent->description, 'fgcf/thematique/'. $parent->tid);
-      drupal_set_title(t('Thématique : @term', array('@term' => $description)));
+      $bc[] = l($parent->description, 'fgcf/theme/'. $parent->tid);
+      drupal_set_title(t('Thème : @term', array('@term' => $description)));
 
       $values = _fgcf_filter_form_translate_values();
       $ret .= views_embed_view('fgcf_formations_par_thematique', 'default', $thematique, $values['dif'], $values['modalites']);

+ 3 - 3
fgcf.odt.inc

@@ -56,8 +56,8 @@ function fgcf_odt_export_formations($filename) {
   // Identify replacement segment in the template.
   $thematique_1_boucle = $odf->setSegment('thematique_1_boucle');
 
-  // Iterate over top-level terms in 'Thematique' vocab.
-  $vid = _fgcf_get_vocabulary_by_name('FGCF Thématique');
+  // Iterate over top-level terms in 'Thème' vocab.
+  $vid = _fgcf_get_vocabulary_by_name('FGCF Thème');
   $tree = taxonomy_get_tree($vid);
   foreach ($tree as $term) {
     if ($term->depth == 0) {
@@ -227,7 +227,7 @@ function fgcf_odt_replace_node_formation($segment, $node) {
   // formation_thematique
   $values = array();
   foreach ((array) $node->taxonomy as $term) {
-    if ($term->vid == _fgcf_get_vocabulary_by_name('FGCF Thématique')) {
+    if ($term->vid == _fgcf_get_vocabulary_by_name('FGCF Thème')) {
       $parents = taxonomy_get_parents($term->tid);
       if ($parents) {
         $parent = current($parents);

+ 5 - 5
help/pages.html

@@ -1,15 +1,15 @@
 <ul>
   <li><a href="&base_url&fgcf">fgcf</a>: page d'accueil du module</li>
-  <li><a href="&base_url&fgcf/thematique">fgcf/thematique</a>: liste des thématiques de formation</li>
-  <li><a href="&base_url&fgcf/thematique/(cat)">fgcf/thematique/(cat)</a>: les sous-catégories de la catégorie (cat)</li>
-  <li><a href="&base_url&fgcf/thematique/(cat)/(scat)">fgcf/thematique/(cat)/(scat)</a>: les formations de la sous-thématique &lt;cat/scat&gt;</li>
+  <li><a href="&base_url&fgcf/theme">fgcf/theme</a>: liste des thèmes de formation</li>
+  <li><a href="&base_url&fgcf/theme/(cat)">fgcf/theme/(cat)</a>: les sous-catégories de la catégorie (cat)</li>
+  <li><a href="&base_url&fgcf/theme/(cat)/(scat)">fgcf/theme/(cat)/(scat)</a>: les formations du sous-thème &lt;cat/scat&gt;</li>
   <li><a href="&base_url&fgcf/prestataire">fgcf/prestataire</a>: liste des prestataires de formation</li>
   <li><a href="&base_url&fgcf/format">fgcf/format</a>: la liste des formats de formation</li>
   <li><a href="&base_url&fgcf/format/(format)">fgcf/format/(format)</a>: la liste des formations du format choisi</li>
   <li><a href="&base_url&node/(nid)">node/(nid)</a>:
     <ul>
-      <li>type fgcf_fiche: page de fiche de formation, avec le logo de la 
-        thématique, et les liens vers thématique et sous-thématique</li>
+      <li>type fgcf_fiche: page de fiche de formation, avec le logo du thème,
+        et les liens vers thème et sous-thème</li>
       <li>type fgcf_prestataire: page de prestataire de formation, avec logo,
         url et descriptions, et en-dessous la liste des formations proposées</li>
       </ul>

+ 1 - 1
theme/fgcf-home.tpl.php

@@ -8,7 +8,7 @@
 <?php echo $filter_form; ?>
 <div class="item-list">
   <ul>
-    <li><?php print l(t('Thématiques de formation'), 'fgcf/thematique'); ?></li>
+    <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('Formats de formation'), 'fgcf/format'); ?></li>
   </ul>

+ 3 - 3
views/fgcf_formations_par_format.php

@@ -90,7 +90,7 @@ $handler->override_option('fields', array(
       'alter_text' => 0,
       'text' => '',
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid]',
+      'path' => 'fgcf/theme/[tid]',
       'link_class' => '',
       'alt' => '',
       'prefix' => '',
@@ -155,7 +155,7 @@ $handler->override_option('fields', array(
       'alter_text' => 0,
       'text' => '',
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid_1]',
+      'path' => 'fgcf/theme/[tid_1]',
       'link_class' => '',
       'alt' => '',
       'prefix' => '',
@@ -179,7 +179,7 @@ $handler->override_option('fields', array(
     'relationship' => 'none',
   ),
   'nothing' => array(
-    'label' => 'Thématique',
+    'label' => 'Thème',
     'alter' => array(
       'text' => '[name] / [description]',
       'make_link' => 0,

+ 4 - 4
views/fgcf_formations_par_organisme.php

@@ -52,7 +52,7 @@ $handler->override_option('fields', array(
     'alter' => array(
       'alter_text' => 0,
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid]',
+      'path' => 'fgcf/theme/[tid]',
       'trim' => 0,
       'word_boundary' => 1,
       'ellipsis' => 1,
@@ -88,9 +88,9 @@ $handler->override_option('fields', array(
     'exclude' => TRUE,
     'alter' => array(
       'alter_text' => 0,
-      'text' => '[description] / <a href="/fgcf/thematique/[tid_1]">[description_1]</a>',
+      'text' => '[description] / <a href="/fgcf/theme/[tid_1]">[description_1]</a>',
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid_1]',
+      'path' => 'fgcf/theme/[tid_1]',
       'trim' => 0,
       'word_boundary' => 1,
       'ellipsis' => 1,
@@ -104,7 +104,7 @@ $handler->override_option('fields', array(
     'id' => 'nothing',
     'table' => 'views',
     'field' => 'nothing',
-    'label' => 'Thématique',
+    'label' => 'Thème',
     'alter' => array(
       'text' => '[name] / [description_1]',
       'make_link' => 0,

+ 2 - 2
views/fgcf_formations_par_thematique.php

@@ -2,12 +2,12 @@
 // $Id$
 /**
  * @file
- * Liste des formations pour une thématique passée en argument..
+ * Liste des formations pour un thème passé en argument..
  */
 
 $view = new view;
 $view->name = 'fgcf_formations_par_thematique';
-$view->description = 'Liste des formations correpsondant à une thématique donnée';
+$view->description = 'Liste des formations correpsondant à un thème donné';
 $view->tag = 'FGCF';
 $view->view_php = '';
 $view->base_table = 'node';

+ 4 - 4
views/fgcf_thematique_deuxieme_niveau.php

@@ -2,13 +2,13 @@
 // $Id$
 /**
  * @file
- * Liste des sous-thématiques d'une thématique passée en argument.
+ * Liste des sous-thèmes d'un thème passé en argument.
  */
 
 $view = new view;
 $view->name = 'fgcf_thematique_deuxieme_niveau';
-$view->description = 'Liste des thématiques de 2e niveau pour une thématique donnée';
-$view->tag = '';
+$view->description = 'Liste des thèmes de 2e niveau pour un théme donné';
+$view->tag = 'FGCF';
 $view->view_php = '';
 $view->base_table = 'term_data';
 $view->is_cacheable = FALSE;
@@ -57,7 +57,7 @@ $handler->override_option('fields', array(
       'alter_text' => 0,
       'text' => '',
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid]',
+      'path' => 'fgcf/theme/[tid]',
       'link_class' => '',
       'alt' => '',
       'prefix' => '',

+ 4 - 4
views/fgcf_thematiques_premier_niveau.php

@@ -2,13 +2,13 @@
 // $Id$
 /**
  * @file
- * Liste des thématiques de 1er niveau.
+ * Liste des thèmes de 1er niveau.
  */
 
 $view = new view;
 $view->name = 'fgcf_thematiques_premier_niveau';
-$view->description = 'Liste des thématiques de 1er niveau';
-$view->tag = '';
+$view->description = 'Liste des thèmes de 1er niveau';
+$view->tag = 'FGCF';
 $view->view_php = '';
 $view->base_table = 'term_data';
 $view->is_cacheable = FALSE;
@@ -67,7 +67,7 @@ $handler->override_option('fields', array(
       'alter_text' => 0,
       'text' => '',
       'make_link' => 1,
-      'path' => 'fgcf/thematique/[tid]',
+      'path' => 'fgcf/theme/[tid]',
       'link_class' => '',
       'alt' => '',
       'prefix' => '',