You are here

function theme_asset_wizard_textfield_preview in Asset 6

Same name and namespace in other branches
  1. 5.2 asset_wizard.module \theme_asset_wizard_textfield_preview()
1 theme call to theme_asset_wizard_textfield_preview()
asset_wizard_textfield2 in ./asset_wizard.module
The #process callback function for the textfield

File

./asset_wizard.module, line 237
Wizard-style interface for Asset.

Code

function theme_asset_wizard_textfield_preview($element) {
  if ($element['#value']) {
    $asset = asset_load($element['#value']);
    $text = theme('asset_icon', $asset);
    $text = '<span class="icon">' . asset_icon($asset, 100) . '</span><br/>' . '<span class="caption">' . ($asset->link_title ? $asset->link_title : $asset->title) . '</span>';
  }
  else {
    $path = drupal_get_path('module', 'asset_wizard') . '/icons/select.png';
    $alt = t('Click to start');
    $icon = theme('image', $path, $alt, $alt);
    $text = '<div class="icon-empty">' . $icon . '</div>' . '<div class="caption">' . t('Click to start') . '</div>';
  }
  return theme('asset_wizard_textarea_link', $element, $text);
}