From 0c4ecdef9b332ff88b2a52831bfd9ca4d2fdd3f7 Mon Sep 17 00:00:00 2001
From: Earl Miles <merlin@logrus.com>
Date: Thu, 26 Mar 2009 20:17:59 +0000
Subject: [PATCH] Fix ctools_css_clear() to do what the documentation says it
 does. Plus fix a couple of typos.

---
 css/dropdown.css | 2 +-
 includes/css.inc | 9 +++++++++
 js/modal.js      | 2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/css/dropdown.css b/css/dropdown.css
index 293dba7d..48c603d0 100644
--- a/css/dropdown.css
+++ b/css/dropdown.css
@@ -1,6 +1,6 @@
 /* $Id$ */
 html.js div.ctools-dropdown div.ctools-dropdown-container {
-  z-index: 999;
+  z-index: 1001;
   display: none;
   text-align: left;
   position: absolute;
diff --git a/includes/css.inc b/includes/css.inc
index e1a4fccd..3123b7e9 100644
--- a/includes/css.inc
+++ b/includes/css.inc
@@ -106,6 +106,15 @@ function ctools_css_retrieve($id) {
  * Remove stored CSS and any associated file.
  */
 function ctools_css_clear($id) {
+  $cache = db_fetch_object(db_query("SELECT * FROM {ctools_css_cache} WHERE cid = '%s'", $id));
+  if (!$cache) {
+    return;
+  }
+
+  if (file_exists($cache->filename)) {
+    file_delete($cache->filename);
+  }
+
   db_query("DELETE FROM {ctools_css_cache} WHERE cid = '%s'", $id);
 }
 
diff --git a/js/modal.js b/js/modal.js
index 0f112405..f5260a61 100644
--- a/js/modal.js
+++ b/js/modal.js
@@ -132,7 +132,7 @@ Drupal.behaviors.CToolsModal = function(context) {
     $('form:not(.ctools-use-modal-processed)', context)
       .addClass('ctools-use-modal-processed')
       .submit(Drupal.CTools.Modal.submitAjaxForm)
-      .append('<input type="hidden" name="op" value=""');
+      .append('<input type="hidden" name="op" value="">');
     // add click handlers so that we can tell which button was clicked,
     // because the AJAX submit does not set the values properly.
     $('input[type="submit"]:not(.ctools-use-modal-processed)', context)
-- 
GitLab