? lightbox2_viewsproblem.patch
Index: lightbox2.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/lightbox2/lightbox2.module,v
retrieving revision 1.16.2.16.2.150
diff -u -p -r1.16.2.16.2.150 lightbox2.module
--- lightbox2.module	2 May 2009 00:53:23 -0000	1.16.2.16.2.150
+++ lightbox2.module	3 Jun 2009 22:43:52 -0000
@@ -1369,3 +1369,12 @@ function lightbox2_link_alter(&$links, $
     }
   }
 }
+
+/**
+ * Implementation of hook_views_api().
+ */
+function lightbox2_views_api() {
+  return array(
+    'api' => '2.0',
+  );
+}
Index: lightbox2.views.inc
===================================================================
RCS file: lightbox2.views.inc
diff -N lightbox2.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lightbox2.views.inc	3 Jun 2009 22:43:52 -0000
@@ -0,0 +1,43 @@
+<?php
+// $Id: $
+/**
+ * @file
+ *
+ */
+
+/**
+ * Implementation of hook_views_data()
+ */
+function lightbox2_views_data() {
+  $data['lightbox2']['table']['group'] = t('Lightbox');
+  $data['lightbox2']['table']['join'] = array(
+    '#global' => array(),
+  );
+  $data['lightbox2']['lightbox2'] = array(
+    'group' => t('Lightbox'),
+    'title' => t('Lightbox text'),
+    'help' => t('Provide custom text or link.'),
+    'field' => array(
+      'handler' => 'lightbox2_handler_field_lightbox2',
+    ),
+  );
+
+  return $data;
+}
+
+/**
+ * Implementation of hook_views_handlers() to register all of the basic handlers
+ * views uses.
+ */
+function lightbox2_views_handlers() {
+  return array(
+    'info' => array(
+      'path' => drupal_get_path('module', 'lightbox2'),
+    ),
+    'handlers' => array(
+      'lightbox2_handler_field_lightbox2' => array(
+        'parent' => 'views_handler_field',
+      ),
+    ),
+  );
+}
Index: lightbox2_handler_field_lightbox2.inc
===================================================================
RCS file: lightbox2_handler_field_lightbox2.inc
diff -N lightbox2_handler_field_lightbox2.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ lightbox2_handler_field_lightbox2.inc	3 Jun 2009 22:43:52 -0000
@@ -0,0 +1,78 @@
+<?php
+// $Id: $
+
+/**
+ * @file
+ *
+ *
+ * This module is for Drupal 6.x only.
+ */
+
+
+/**
+ * A handler to provide a field that is completely custom by the administrator.
+ *
+ * @ingroup views_field_handlers
+ */
+class lightbox2_handler_field_lightbox2 extends views_handler_field {
+//  function query() {
+//    // do nothing -- to override the parent query.
+//  }
+
+  function option_definition() {
+    $options = parent::option_definition();
+
+    // Override the alter text option to always alter the text.
+    //$options['alter']['contains']['alter_text'] = array('default' => TRUE);
+    return $options;
+  }
+
+  //Don't hardcode lightbox2
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $fields = array('' => t('<None>'));
+    foreach ($this->view->display_handler->get_handlers('field') as $field => $handler) {
+      if($field != 'lightbox2'){
+        $fields[$field] = $field;
+      }
+    }
+
+    $form['field'] = array(
+      '#type' => 'select',
+      '#title' => t('Fields'),
+      '#options' => $fields,
+      '#default_value' => $this->options['field'],
+      '#weight' => -10,
+    );
+
+    $form['popup'] = array(
+      '#type' => 'textarea',
+      '#title' => t('Popup'),
+      '#default_value' => $this->options['popup'],
+      '#weight' => -9,
+    );
+
+
+    // Remove the checkbox
+    unset($form['alter']['alter_text']);
+    unset($form['alter']['make_link']);
+    unset($form['alter']['text']);
+    unset($form['alter']['path']);
+    unset($form['alter']['alt']);
+    unset($form['alter']['prefix']);
+    unset($form['alter']['suffix']);
+    unset($form['alter']['text']['#dependency']);
+    unset($form['alter']['text']['#process']);
+  }
+
+  function render($values) {
+//    $field = $values->{$this->field_alias};
+//    if (!empty($this->items[$field])) {
+//      return theme('item_list', $this->items[$field], NULL, $this->options['type']);
+//    }
+//    else if (!empty($this->options['empty'])) {
+//      return $this->options['empty'];
+//    }
+    return;
+  }
+}
