$this->definition['preset'], 'translatable' => FALSE, ); return $options; } /** * Choose a preset */ function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); $options = array('0' => t('None')); foreach (imagecache_presets() as $pid => $preset) { $options[$pid] = $preset['presetname']; } $form['preset'] = array( '#type' => 'select', '#title' => t('Imagecache preset'), '#options' => $options, '#default_value' => isset($this->options['preset']) ? $this->options['preset'] : '0', ); } function admin_summary() { $pid = $this->options['preset']; if ($pid) { $preset = imagecache_preset($pid); $ret = $preset['presetname']; } else { $ret = t('Raw'); } return $ret; } function render($values) { $pid = $this->options['preset']; if ($pid) { $preset = imagecache_preset($pid); return theme_imagecache($preset['presetname'], $this->get_value($values)); } else { return parent::render($values); } } }