Mercurial > defr > drupal > scald > dnd
comparison 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 |
comparison
equal
deleted
inserted
replaced
7:e6378dbabe45 | 9:4626f7e31aa0 |
---|---|
103 /** | 103 /** |
104 * Completely contrived edit item theme function | 104 * Completely contrived edit item theme function |
105 */ | 105 */ |
106 function template_preprocess_dnd_library_item(&$variables) { | 106 function template_preprocess_dnd_library_item(&$variables) { |
107 $i = $variables['i']; | 107 $i = $variables['i']; |
108 $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $i .'-thumb.jpg'); | 108 |
109 if ($i % 3 == 0) { | |
110 $img = 3; | |
111 } | |
112 else if ($i % 2 == 0) { | |
113 $img = 2; | |
114 } | |
115 else { | |
116 $img = 1; | |
117 } | |
118 | |
119 $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $img .'-thumb.jpg'); | |
109 $variables['title'] = t('Lorem Ipsum @count', array('@count' => $i)); | 120 $variables['title'] = t('Lorem Ipsum @count', array('@count' => $i)); |
110 $variables['date'] = 'Feb 18 2009'; | 121 $variables['date'] = 'Feb 18 2009'; |
111 $variables['author'] = 'David Eads'; | 122 $variables['author'] = 'David Eads'; |
112 foreach(array(t('S'), t('M'), t('L')) as $size) { | 123 foreach(array(t('S'), t('M'), t('L')) as $size) { |
113 $sizes[] = l('<span>'. $size .'</span>', '', array( | 124 $sizes[] = l('<span>'. $size .'</span>', '', array( |
123 } | 134 } |
124 | 135 |
125 | 136 |
126 function template_preprocess_dnd_editor_item(&$variables) { | 137 function template_preprocess_dnd_editor_item(&$variables) { |
127 list($i, $size) = array($variables['i'], $variables['size']); | 138 list($i, $size) = array($variables['i'], $variables['size']); |
128 $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $i .'-'. $size .'.jpg'); | 139 |
140 if ($i % 3 == 0) { | |
141 $img = 3; | |
142 } | |
143 else if ($i % 2 == 0) { | |
144 $img = 2; | |
145 } | |
146 else { | |
147 $img = 1; | |
148 } | |
149 $variables['image'] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/item-'. $img .'-'. $size .'.jpg'); | |
129 } | 150 } |