﻿From e4de37e3bdb9609170ac2f9bb20738063a2161a6 Tue, 19 Apr 2011 00:16:25 +0200
From: Bram Goffings <bramgoffings@gmail.com>
Date: Tue, 19 Apr 2011 00:16:14 +0200
Subject: [PATCH] node-type css coloring

diff --git a/fullcalendar_colors.module b/fullcalendar_colors.module
index 58e5ecd..d5b1ab2 100644
--- a/fullcalendar_colors.module
+++ b/fullcalendar_colors.module
@@ -69,3 +69,24 @@
       break;
   }
 }
+
+/**
+ * Implements hook_fullcalendar_classes().
+ */
+function fullcalendar_colors_fullcalendar_classes($entity) {
+  $classes = array();
+  $css = '';
+
+  /* node type css coloring */
+  if ($entity->entity_type == "node" && variable_get('fullcalendar_color_node_types_enabled', FALSE)) {
+    $className = "node-type-" . $entity->type;
+    $color = variable_get('fullcalendar_color_node_type_' . $entity->type, '#ffffff');
+    $css .= ' .' . $className . ' {background-color: ' . $color . '; border-color: ' . $color . ';}';
+    $css .= ' .' . $className . ' a' . ' {background-color: ' . $color . '; border-color: ' . $color . ';}';
+
+    $classes[] = $className;
+  }
+  drupal_add_css($css, 'inline');
+
+  return $classes;
+}
