Index: panels_mini/plugins/content_types/panels_mini.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/panels/panels_mini/plugins/content_types/panels_mini.inc,v
retrieving revision 1.1.2.4
diff -u -9 -p -r1.1.2.4 panels_mini.inc
--- panels_mini/plugins/content_types/panels_mini.inc	13 Jul 2009 19:51:23 -0000	1.1.2.4
+++ panels_mini/plugins/content_types/panels_mini.inc	4 May 2010 14:16:14 -0000
@@ -12,50 +12,70 @@
 
 /**
  * Specially named hook. for .inc file. This looks a little silly due to the
  * redundancy, but that's really just because the content type shares a
  * name with the module.
  */
 function panels_mini_panels_mini_ctools_content_types() {
   return array(
     'title' => t('Mini panels'),
+    'content type' => 'panels_mini_panels_mini_content_type_content_type',
   );
 }
 
 /**
  * Return each available mini panel available as a subtype.
  */
+function panels_mini_panels_mini_content_type_content_type($subtype_id, $plugin) {
+  $mini = panels_mini_load($subtype_id);
+  return _panels_mini_panels_mini_content_type_content_type($mini);
+}
+
+/**
+ * Return each available mini panel available as a subtype.
+ */
 function panels_mini_panels_mini_content_type_content_types($plugin) {
   $types = array();
   foreach (panels_mini_load_all() as $mini) {
-    if (!empty($mini->disabled)) {
-      continue;
-    }
-
-    $types[$mini->name] = array(
-      'title' => filter_xss_admin($mini->title),
-      // For now mini panels will just use the contrib block icon.
-      'icon' => 'icon_mini_panel.png',
-      'description' => filter_xss_admin($mini->title),
-      'category' => !empty($mini->category) ? filter_xss_admin($mini->category) : t('Mini panel'),
-    );
-    if (!empty($mini->requiredcontexts)) {
-      $types[$mini->name]['required context'] = array();
-      foreach ($mini->requiredcontexts as $context) {
-        $info = ctools_get_context($context['name']);
-        // TODO: allow an optional setting
-        $types[$mini->name]['required context'][] = new ctools_context_required($context['identifier'], $info['context name']);
-      }
+    $type = _panels_mini_panels_mini_content_type_content_type($mini);
+    if ($type) {
+      $types[$mini->name] = $type;
     }
   }
   return $types;
 }
 
+/**
+ * Return an info array describing a single mini panel.
+ */
+function _panels_mini_panels_mini_content_type_content_type($mini) {
+  if (!empty($mini->disabled)) {
+    return;
+  }
+
+  $title = filter_xss_admin($mini->title);
+  $type = array(
+    'title' => $title,
+    // For now mini panels will just use the contrib block icon.
+    'icon' => 'icon_mini_panel.png',
+    'description' => $title,
+    'category' => !empty($mini->category) ? $mini->category : t('Mini panel'),
+  );
+  if (!empty($mini->requiredcontexts)) {
+    $type['required context'] = array();
+    foreach ($mini->requiredcontexts as $context) {
+      $info = ctools_get_context($context['name']);
+      // TODO: allow an optional setting
+      $type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']);
+    }
+  }
+  return $type;
+}
 
 /**
  * Render a mini panel called from a panels display.
  */
 function panels_mini_panels_mini_content_type_render($subtype, $conf, $panel_args, &$contexts) {
   static $viewing = array();
   $mini = panels_mini_load($subtype);
   if (!$mini) {
     return FALSE;
