diff dnd_test/dnd_test.module @ 9:4626f7e31aa0

Switching to using modulus to make managing assets easy.
author David Eads <eads@chicagotech.org>
date Thu, 26 Feb 2009 22:12:29 -0600
parents c2eb995212bf
children 5d2ae5b8eae2
line wrap: on
line diff
--- a/dnd_test/dnd_test.module	Thu Feb 19 14:10:13 2009 -0500
+++ b/dnd_test/dnd_test.module	Thu Feb 26 22:12:29 2009 -0600
@@ -105,7 +105,18 @@
  */
 function template_preprocess_dnd_library_item(&$variables) {
   $i = $variables['i'];
-  $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $i .'-thumb.jpg');
+
+  if ($i % 3 == 0) {
+    $img = 3;
+  }
+  else if ($i % 2 == 0) {
+    $img = 2;
+  }
+  else {
+    $img = 1;
+  }
+
+  $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $img .'-thumb.jpg');
   $variables['title'] = t('Lorem Ipsum @count', array('@count' => $i));
   $variables['date'] = 'Feb 18 2009';
   $variables['author'] = 'David Eads';
@@ -125,5 +136,15 @@
 
 function template_preprocess_dnd_editor_item(&$variables) {
   list($i, $size) = array($variables['i'], $variables['size']);
-  $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $i .'-'. $size .'.jpg');
+
+  if ($i % 3 == 0) {
+    $img = 3;
+  }
+  else if ($i % 2 == 0) {
+    $img = 2;
+  }
+  else {
+    $img = 1;
+  }
+  $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $img .'-'. $size .'.jpg');
 }