Index: hosting.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/hosting/hosting.module,v
retrieving revision 1.74
diff -u -p -r1.74 hosting.module
--- hosting.module	29 Oct 2008 00:10:34 -0000	1.74
+++ hosting.module	29 Oct 2008 21:31:58 -0000
@@ -52,8 +52,15 @@ function hosting_menu($may_cache = true)
         ); 
       }
     }
-
-
+    
+    // Queue pages
+    
+    $items[] = array(
+       'path' => 'hosting/queues',
+       'callback' => 'hosting_queues',
+       'type' => MENU_CALLBACK,
+       'access' => user_access('administer hosting queues')
+      );
   }
   return $items;
 }
@@ -286,7 +293,7 @@ function hosting_queue_block() {
   $queues = hosting_get_queues();
   $output = '';
   foreach ($queues as $queue => $info) {
-    $func = 'hosting_'.$info['singular'].'_list';
+    $func = 'hosting_'.$info['singular'].'_summary';
     if (function_exists($func)) {
       $output .= $func();
     }
@@ -449,6 +456,34 @@ function _hosting_node_add($type = '') {
   return $output;
 }
 
+/**
+ * List queues or tasks in a queue if a key is provided
+ */
+
+function hosting_queues($key='') {
+  $queues = hosting_get_queues();
+
+  if ($queues[$key]) {
+    if ($queues[$key]['name'])
+    {
+      $output .= "<h1>".$queues[$key]['name']."</h1>";
+    }
+  
+    $func = 'hosting_'.$queues[$key]['singular'].'_list';
+    if (function_exists($func)) {
+      $output .= $func();
+    }
+  }
+  else
+  {
+    foreach($queues as $key => $queue) {
+      $item[] = l($queue['name'], 'hosting/queues/'.$key);
+    }
+    $output .= theme('item_list', $item, t('Queues'));
+  }
+  
+  return $output;
+}
 
 /**
  * Generate context sensitive breadcrumbs
Index: task/hosting_task.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/hosting/task/hosting_task.module,v
retrieving revision 1.27
diff -u -p -r1.27 hosting_task.module
--- task/hosting_task.module	28 Oct 2008 20:43:12 -0000	1.27
+++ task/hosting_task.module	29 Oct 2008 21:31:59 -0000
@@ -23,7 +23,6 @@ function hosting_task_menu($may_cache) {
             'type' => MENU_LOCAL_TASK,
             'weight' => ($task['weight']) ? $task['weight'] : 0, 
           );
-          
         }
      }
   }
@@ -446,6 +445,27 @@ function hosting_get_most_recent_task($r
   return false;
 }
 
+/**
+ * Retrieve tasks with specified criterias
+ */
+
+function hosting_get_tasks($filter_by = null, $filter_value = null, $element = 0) {
+  $node = array();
+  $args[] = 'task';
+  $cond = '';
+
+  if ($filter_by && $filter_value) {
+    $cond = ' AND t.' . $filter_by . ' = %d';
+    $args[] = $filter_value;
+  }
+  $result = pager_query(db_rewrite_sql("SELECT * FROM {node} n left join {hosting_task} t on n.vid=t.vid where type='%s'" . $cond . " ORDER BY n.nid DESC"), 5, $element, NULL, $args);
+  
+  while ($row = db_fetch_object($result)) {
+    $nodes[] = $row;
+  }
+  
+  return $nodes;
+}
 
 /**
  * Turn bitmask integer error code into associative array
@@ -492,31 +512,11 @@ function hosting_task_status_output($fil
  * Display list of tasks
  */
 function hosting_task_list($filter_by = null, $filter_value = null) {
-  $args[] = 'task';
-  $cond = '';
-
-  if ($filter_by && $filter_value) {
-    $cond = ' AND t.' . $filter_by . ' = %d';
-    $args[] = $filter_value;
-  }
-  $result = pager_query(db_rewrite_sql("SELECT * FROM {node} n left join {hosting_task} t on n.vid=t.vid where type='%s'" . $cond . " ORDER BY n.nid DESC"), 5, 0, NULL, $args);
-
-  if (!db_num_rows($result)) {
-    return t('No tasks available');
-  }
-
-  $rows = array();
-  while ($node = db_fetch_object($result)) {
-    $row = array();
-    $row['type'] = array('data' => l(drupal_ucfirst($node->task_type), 'node/' . $node->nid), 'class' => 'hosting-status');
-#    $row['rid'] = _hosting_node_link($node->rid);
-    $row['created'] = t("@interval ago", array('@interval' => format_interval(mktime() - $node->created, 1)));
-#    $row[] = format_interval(mktime() - $node->completed, 1);
-    $rows[] = array('data' => $row, 'class' => _hosting_task_list_class($node->task_status));
-  }
-  
-  return theme('table', array(t('Task'), t('Created')), $rows, array('class' => 'hosting-table')) . theme('pager', NULL, 5, 0);
+  return theme("hosting_task_list", hosting_get_tasks($filter_by, $filter_value));
+}
 
+function hosting_task_summary($filter_by = null, $filter_value = null) {
+  return theme("hosting_task_summary", hosting_get_tasks($filter_by, $filter_value,1));
 }
 
 function _hosting_task_list_class($status) {
@@ -528,3 +528,40 @@ function _hosting_task_list_class($statu
   }
   return 'hosting-error';
 }
+
+/**
+ * Theme functions
+ */
+ 
+function theme_hosting_task_list($nodes) {
+ if (!$nodes) {
+   return t('No tasks available');
+ }
+ else {
+     foreach ($nodes as $node) {
+       $row = array();
+       $row['type'] = array('data' => l(drupal_ucfirst($node->title), 'node/' . $node->nid), 'class' => 'hosting-status');
+   #    $row['rid'] = _hosting_node_link($node->rid);
+       $row['created'] = t("@interval ago", array('@interval' => format_interval(mktime() - $node->created, 1)));
+   #    $row[] = format_interval(mktime() - $node->completed, 1);
+       $rows[] = array('data' => $row, 'class' => _hosting_task_list_class($node->task_status));
+     }
+   
+   return theme('table', array(t('Task'), t('Created')), $rows, array('class' => 'hosting-table')) . theme('pager', NULL, 5, 0); 
+ }
+}
+ 
+function theme_hosting_task_summary($nodes) {
+ if (!$nodes) {
+   return t('No tasks available');
+ }
+ else {
+     foreach ($nodes as $node) {
+       $row = array();
+       $row['type'] = array('data' => l(drupal_ucfirst($node->title), 'node/' . $node->nid), 'class' => 'hosting-status');
+       $rows[] = array('data' => $row, 'class' => _hosting_task_list_class($node->task_status));
+     }
+   
+   return theme('table', array(t('Task')), $rows, array('class' => 'hosting-table')).l(t('Read more'),'hosting/queues/tasks'); 
+ }
+}
\ No newline at end of file
