|
@@ -7,6 +7,23 @@
|
|
|
*/
|
|
|
include_once('fgcf.features.inc');
|
|
|
|
|
|
+/**
|
|
|
+ * Implementation of hook_field_formatter_info().
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ function fgcf_field_formatter_info() {
|
|
|
+ $ret = array(
|
|
|
+ 'fgcf_support_page_link' => array(
|
|
|
+ 'label' => t('As FGCF Support Page Link'),
|
|
|
+ 'field types' => array('content_taxonomy'),
|
|
|
+ 'description' => t('Link to a FGCF Support page instead of a default taxonomy page.'),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+
|
|
|
+ return $ret;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Implementation of hook_init().
|
|
|
*/
|
|
@@ -89,6 +106,9 @@ function fgcf_theme($existing, $type, $theme, $path) {
|
|
|
'fgcf_thematiques' => array(
|
|
|
'arguments' => array('terms' => array()),
|
|
|
),
|
|
|
+ 'fgcf_formatter_fgcf_support_page_link' => array(
|
|
|
+ 'arguments' => array('element' => NULL),
|
|
|
+ ),
|
|
|
);
|
|
|
|
|
|
return $ret;
|
|
@@ -537,3 +557,12 @@ function _fgcf_get_vocabulary_by_name($name) {
|
|
|
|
|
|
return $matches[$name];
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Theming functions.
|
|
|
+ */
|
|
|
+function theme_fgcf_formatter_fgcf_support_page_link($element) {
|
|
|
+ $term = taxonomy_get_term($element['#item']['value']);
|
|
|
+ $ret = l($term->name, 'fgcf/support/'. $term->tid); // can only be a tid
|
|
|
+ return $ret;
|
|
|
+}
|