? views-510920.patch
? views-528906.patch
? views-allow-disable.patch
? views-language.patch
? views-user-picture-sort.patch
Index: views.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/views.module,v
retrieving revision 1.332.2.8
diff -u -p -r1.332.2.8 views.module
--- views.module	25 Jun 2009 22:01:23 -0000	1.332.2.8
+++ views.module	15 Aug 2009 17:44:37 -0000
@@ -9,6 +9,8 @@
  * incoming page and block requests.
  */
 
+define('VIEWS_STATUS_DISABLED', 1);
+
 /**
  * Advertise the current views api version
  */
@@ -857,6 +859,21 @@ function views_get_view($name, $reset = 
   return $view->clone_view();
 }
 
+/**
+ * Disable a view.
+ *
+ * @param $name
+ *   The name of the view.
+ */
+function views_disable_view($name) {
+  $views_status = variable_get('views_defaults', array());
+  $views_status[$name] = VIEWS_STATUS_DISABLED; // True is disabled
+  variable_set('views_defaults', $views_status);
+  // Rebuild caches.
+  views_invalidate_cache();
+  menu_rebuild();
+}
+
 
 // ------------------------------------------------------------------
 // Views debug helper functions
