diff dnd_test/dnd_test.module @ 17:1a77f87927dd

Fixed :empty custom selector behavior in IE, a little refactoring, etc.
author David Eads <eads@chicagotech.org>
date Wed, 04 Mar 2009 13:29:31 -0600
parents 7a5f74482ee3
children 0d557e6e73f7
line wrap: on
line diff
--- a/dnd_test/dnd_test.module	Tue Mar 03 16:57:39 2009 -0600
+++ b/dnd_test/dnd_test.module	Wed Mar 04 13:29:31 2009 -0600
@@ -50,6 +50,10 @@
       'arguments' => array('i' => NULL), 
       'template'  => 'dnd-library-item',
     ),
+    'dnd_library_preview' => array(
+      'arguments' => array('i' => NULL),
+      'template'  => 'dnd-library-preview',
+    ),
   );
 }
 
@@ -63,6 +67,7 @@
     'header'  => '<h3>'. t('Test library: Page @page', array('@page' => $page)) .'</h3>',
     'library' => $test_library['library'],
     'editor_representations' => $test_library['editor_representations'],
+    'library_previews' => $test_library['library_previews'],
     'footer'  => '<div class="pager">'. l(t('1'), 'dnd-test/library') . ' '. l(t('2'), 'dnd-test/library', array('query' => array('page' => 2))) .'</div>',
   ));
 }
@@ -76,13 +81,16 @@
 
   $library = '';
   $editor_representations = array();
+  $library_previews = array();
   for ($i=$start + 1; $i < $end + 1; $i++) {
     $library .= theme('dnd_library_item', $i);
     $editor_representations += dnd_editor_items($i);
+    $library_previews['dnd-test-'. $i] = theme('dnd_library_preview', $i);
   }
   return array(
     'library' => $library,
     'editor_representations' => $editor_representations,
+    'library_previews' => $library_previews,
   );
 }
 
@@ -100,6 +108,19 @@
 }
 
 /**
+ * Completely contrived library preview theme function
+ */
+function template_preprocess_dnd_library_preview(&$variables) {
+  template_preprocess_dnd_library_item($variables);
+
+  $variables['id'] = 'dnd-preview-'. $variables['i'];
+  $variables['image'] = '<img src="http://'. $_SERVER['HTTP_HOST'] . base_path() . drupal_get_path('module', 'dnd_test') .'/img/item-'. $variables['img_num'] .'-M.jpg" class="drop" />';
+
+  $variables['description'] = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.';
+}
+
+
+/**
  * Completely contrived edit item theme function
  */
 function template_preprocess_dnd_library_item(&$variables) {
@@ -117,6 +138,8 @@
     $img = 1;
   }
 
+  $variables['img_num'] = $img;
+  $variables['id'] = 'dnd-test-'. $i;
   $variables['image'] = '<img src="http://'. $_SERVER['HTTP_HOST'] . base_path() . drupal_get_path('module', 'dnd_test') .'/img/item-'. $img .'-thumb.jpg?dnd_id='. $i .'-M" class="drop" />';
   $variables['title'] = t('Lorem Ipsum @count', array('@count' => $i));
   $variables['date'] = 'Feb 18 2009';