Index: technorati.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/technorati/technorati.install,v
retrieving revision 1.2
diff -u -r1.2 technorati.install
--- technorati.install 27 Jul 2008 16:28:34 -0000 1.2
+++ technorati.install 27 Jul 2008 20:51:38 -0000
@@ -31,6 +31,9 @@
// delete variables
variable_del('technorati_display_type');
+ variable_del('technorati_unify_tags');
+ variable_del('technorati_sort_tags');
+ variable_del('technorati_hide_notags');
foreach (node_get_types() as $node_type => $node_name) {
variable_del('technorati_node_type_'. $node_type);
}
Index: technorati.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/technorati/technorati.module,v
retrieving revision 1.11
diff -u -r1.11 technorati.module
--- technorati.module 27 Jul 2008 16:28:34 -0000 1.11
+++ technorati.module 27 Jul 2008 20:51:39 -0000
@@ -27,6 +27,10 @@
define('TECHNORATI_DISPLAY_FULL', 2);
define('TECHNORATI_DISPLAY_BOTH', 3);
+define('TECHNORATI_UNIFY_TAGS', 'technorati_unify_tags');
+define('TECHNORATI_SORT_TAGS', 'technorati_sort_tags');
+define('TECHNORATI_HIDE_NOTAGS', 'technorati_hide_notags');
+
/**
* Implementation of hook_help().
*/
@@ -78,7 +82,12 @@
TECHNORATI_MODE_BOTH => t('Both'),
);
- $form[TECHNORATI_DISPLAY_TYPE] = array(
+ $form['display'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Technorati tag display settings'),
+ );
+
+ $form['display'][TECHNORATI_DISPLAY_TYPE] = array(
'#type' => 'select',
'#title' => t('How to display the technorati tags'),
'#default_value' => variable_get(TECHNORATI_DISPLAY_TYPE, TECHNORATI_DISPLAY_FULL),
@@ -86,6 +95,27 @@
'#description' => t('Select how to display the tags.
- None: means that the module will not display the tags. The theme can use the $node->technorati object to display the tags anywhere.
- Teaser: means that the tags will only be displayed when the node is in teaser view.
- Full page: means that the tags will only be displayed when the node is in full page view.
- Both: means the tags will be displayed in both teaser and full view.
'),
);
+ $form['display'][TECHNORATI_UNIFY_TAGS] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Unify technorati tags'),
+ '#default_value' => variable_get(TECHNORATI_UNIFY_TAGS, 0),
+ '#description' => t('Use this option if you want to have only one occurrence of each choosen tag.'),
+ );
+
+ $form['display'][TECHNORATI_SORT_TAGS] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Sort technorati tags'),
+ '#default_value' => variable_get(TECHNORATI_SORT_TAGS, 0),
+ '#description' => t('Sort the tags when displaying Technorati links.'),
+ );
+
+ $form['display'][TECHNORATI_HIDE_NOTAGS] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Hide technorati display if empty'),
+ '#default_value' => variable_get(TECHNORATI_HIDE_NOTAGS, 0),
+ '#description' => t('Hide the display of the Technorati icon and the Technorati Tags label, if there are no tags assigned to a node.'),
+ );
+
$form['types'] = array(
'#type' => 'fieldset',
'#title' => t('Content types'),
@@ -159,7 +189,7 @@
function technorati_theme() {
return array(
'technorati_tags' => array(
- 'arguments' => array('tags' => NULL),
+ 'arguments' => array('tags' => NULL),
),
);
}
@@ -235,6 +265,9 @@
* Theme function for registered theme 'technorati_tags'.
*/
function theme_technorati_tags($tags) {
+ if (empty($tags) && variable_get(TECHNORATI_HIDE_NOTAGS, 0)) {
+ return '';
+ }
$path = base_path() . drupal_get_path('module', 'technorati') .'/technobubble.gif';
$output = '