From 3c3c7dffbcb3a28c40f47c2a44c069c0d2777d49 Mon Sep 17 00:00:00 2001
From: John Bintz <bintz@nerdyguy.stsci.edu>
Date: Thu, 11 Jun 2009 09:09:13 -0400
Subject: [PATCH] remove caption as an option

---
 classes/DailyImageWidget.php  | 13 +++----------
 hubblesite-styles.css         |  2 +-
 test/DailyImageWidgetTest.php |  7 -------
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/classes/DailyImageWidget.php b/classes/DailyImageWidget.php
index f9d17e9..fd911fd 100644
--- a/classes/DailyImageWidget.php
+++ b/classes/DailyImageWidget.php
@@ -14,11 +14,10 @@ class DailyImageWidget {
     
     $this->has_simplexml = class_exists('SimpleXMLElement');
     
-    $this->_valid_column_names = array('title', 'caption', 'date', 'image_url', 'gallery_url', 'credits');
+    $this->_valid_column_names = array('title', 'date', 'image_url', 'gallery_url', 'credits');
     $this->_valid_options = array(
       "image"   => __("Daily Image", "hubblesite-daily-image-widget"),
       "title"   => __("Image Title", "hubblesite-daily-image-widget"),
-      "caption" => __("Image Caption", "hubblesite-daily-image-widget"),
       "credits" => __("Credits", "hubblesite-daily-image-widget"),
       "styles"  => __("HubbleSite Styles", "hubblesite-daily-image-widget"),
     );
@@ -113,7 +112,7 @@ class DailyImageWidget {
         
         if (in_array("image", $options)) {
           echo '<a href="' . $this->data['gallery_url'] . '" title="' . $this->data['title'] . '">';
-            echo '<img src="' . $this->data['image_url'] . '" alt="' . $this->data['title'] . '" />';
+            echo '<img src="' . $this->data['image_url'] . '" alt="' . $this->data['title'] . '" width="100%" />';
           echo '</a>';
         }
         
@@ -123,12 +122,6 @@ class DailyImageWidget {
           echo '</a>';
         }
 
-        if (in_array("caption", $options)) {
-          echo '<div id="hubblesite-daily-image-caption">';
-            echo $this->data['caption'];
-          echo '</div>';
-        }
-
         if (in_array("credits", $options)) {
           echo '<div id="hubblesite-daily-image-credits">';
             echo $this->data['credits'];
@@ -254,4 +247,4 @@ function the_hubblesite_daily_image_widget() {
   $diw->render();
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/hubblesite-styles.css b/hubblesite-styles.css
index ba7bca7..61efba4 100644
--- a/hubblesite-styles.css
+++ b/hubblesite-styles.css
@@ -25,4 +25,4 @@ p#hubblesite-daily-image-header {
   color: #666;
   margin: 0;
   padding: 0;
-}
\ No newline at end of file
+}
diff --git a/test/DailyImageWidgetTest.php b/test/DailyImageWidgetTest.php
index b182e13..74e461f 100644
--- a/test/DailyImageWidgetTest.php
+++ b/test/DailyImageWidgetTest.php
@@ -15,7 +15,6 @@ class DailyImageWidgetTest extends PHPUnit_Framework_TestCase {
     
     $this->sample_data = array(
       'title' => 'title',
-      'caption' => 'caption',
       'date' => '12345',
       'image_url' => 'image_url',
       'gallery_url' => 'gallery_url',
@@ -77,12 +76,6 @@ class DailyImageWidgetTest extends PHPUnit_Framework_TestCase {
           '//style[@type="text/css"]' => true
         )
       ),
-      array(
-        "caption",
-        array(
-          '//div/div[@id="hubblesite-daily-image-caption"]' => 'caption'
-        )
-      ),
       array(
         "credits",
         array(