Index: tagadelic.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tagadelic/tagadelic.module,v
retrieving revision 1.32
diff -u -r1.32 tagadelic.module
--- tagadelic.module 28 Jul 2006 10:20:07 -0000 1.32
+++ tagadelic.module 19 Sep 2006 08:00:37 -0000
@@ -6,8 +6,6 @@
*/
function tagadelic_help($section) {
switch ($section) {
- case 'admin/modules#description':
- return t('Tagadelic makes a page with weighted folksonomy. Folksonomys with lots of articles under them get a big font-size, folksonomy without them, get a small size.');
case 'admin/help#tagadelic':
return t('tagadelic offers dynamic urls.
Visit example.com/tagadelic/list/2,1,5 to get the vocabularies 2,1 and 5 listed as tag groups.
Visit example.com/tagadelic/chunk/2,1,5 to get a tag cloud of the terms in the vocabularies 2,1 and 5.
Note that we limit to five vocabularies.');
}
@@ -19,8 +17,7 @@
function tagadelic_menu($may_cache) {
$items = array();
- $stylesheet = drupal_get_path('module','tagadelic') .'/tagadelic.css';
- theme_add_style($stylesheet, 'all');
+ drupal_add_css(drupal_get_path('module', 'tagadelic') .'/tagadelic.css', 'module', 'all');
if ($may_cache) {
$items[] = array(
@@ -50,12 +47,20 @@
'type' => MENU_SUGGESTED_ITEM);
}
}
+ else {
+ $items[] = array(
+ 'path' => 'admin/settings/tagadelic',
+ 'title' => t('tagadelic configuration'),
+ 'description' => t('Set the number of tags, and the depth of the cloud tags.'),
+ 'callback' => 'tagadelic_settings',
+ 'access' => user_access('administer site configuration'));
+ }
return $items;
}
/**
* Implementation of hook_nodeapi
- * Yuo will have a nice variable in $node available for processing tags!
+ * You will have a nice variable in $node available for processing tags!
*/
function tagadelic_nodeapi($node, $op) {
if ($op == 'load') {
@@ -65,9 +70,16 @@
}
/**
- * Implementation of hook_settings
+ * Menu callback. Admin setting page for tagadelic.
*/
function tagadelic_settings() {
+ return drupal_get_form('tagadelic_settings_form');
+}
+
+/**
+ * Form builder for the tagadelic settings.
+ */
+function tagadelic_settings_form() {
$options = array('weight,asc' => t('by weight, ascending'), 'weight,desc' => t('by weight, descending'), 'title,asc' => t('by title, ascending'), 'title,desc' => t('by title, descending'), 'random,none' => t('random'));
$form['tagadelic_sort_order'] = array(
'#type' => 'radios',
@@ -90,14 +102,13 @@
'#default_value' => variable_get('tagadelic_levels', 6),
'#description' => t('The number of levels between the least popular tags and the most popular ones. Different levels will be assigned a different class to be themed in tagadelic.css'),
);
- return $form;
+ return system_settings_form($form);
}
-
+
/**
* menu callback renders a tagadelic page
*/
-function tagadelic_page_chunk() {
- $vocs = arg(2);
+function tagadelic_page_chunk($vocs = NULL) {
if (is_numeric($vocs)) {
$vocs = array($vocs);
@@ -125,8 +136,7 @@
/**
* menu callback renders a tagadelic page with listed items: each voc
*/
-function tagadelic_page_list() {
- $vocs = arg(2);
+function tagadelic_page_list($vocs = NULL) {
if (is_numeric($vocs)) {
$vocs = array($vocs);
@@ -150,8 +160,7 @@
return drupal_not_found();
}
- $stylesheet = drupal_get_path('module','tagadelic') .'/tagadelic.css';
- theme_add_style($stylesheet, 'all');
+ drupal_add_css(drupal_get_path('module', 'tagadelic') .'/tagadelic.css', 'module', 'all');
$output = "