diff dnd_test/dnd_test.module @ 10:5d2ae5b8eae2

Trying out pure image solution.
author David Eads <eads@chicagotech.org>
date Fri, 27 Feb 2009 00:37:24 -0600
parents 4626f7e31aa0
children a5b2b9fa2a1a
line wrap: on
line diff
--- a/dnd_test/dnd_test.module	Thu Feb 26 22:12:29 2009 -0600
+++ b/dnd_test/dnd_test.module	Fri Feb 27 00:37:24 2009 -0600
@@ -20,7 +20,6 @@
   return array('access dnd test library');
 }
 
-
 /**
  * Implementation of hook_form_alter().
  *
@@ -71,7 +70,7 @@
 /**
  * Create contrived output
  */
-function dnd_test_generate_library($page = 1, $limit = 5) {
+function dnd_test_generate_library($page = 1, $limit = 12) {
   $start = ($page * $limit) - ($limit); 
   $end   = $page * $limit;
 
@@ -89,7 +88,7 @@
 
 /**
  * Theme wrapper that spins out multiple library representations for a given
- * editor representation.  This is because we want to demonstrate how to allow
+ ;[''''* editor representation.  This is because we want to demonstrate how to allow
  * for multiple versions (i.e. different sizes) of a single item
  */
 function dnd_editor_items($i) {
@@ -121,14 +120,11 @@
   $variables['date'] = 'Feb 18 2009';
   $variables['author'] = 'David Eads';
   foreach(array(t('S'), t('M'), t('L')) as $size) {
-    $sizes[] = l('<span>'. $size .'</span>', '', array( 
-      'html'       => TRUE,
-      'attributes' => array(
-        'class' => 'drop size-'. $size, 
-        'id' => 'item-'. $i .'-'. $size,
-      ),
-      'query' => array('dnd_id' => 'item-'. $i .'-'. $size),
-    ));
+    $attributes = array(
+      'class' => 'drop size-'. $size, 
+      'id' => 'item-'. $i .'-'. $size,
+    );
+    $sizes[] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/icon/'. $size .'.png', $size, $size, $attributes);
   }
   $variables['sizes'] = '<ul><li>'. implode('</li><li>', $sizes) .'</li></ul>';
 }