You are here

function theme_img_assist_textarea_link in Image Assist 5

Same name and namespace in other branches
  1. 6 img_assist.module \theme_img_assist_textarea_link()

Render a link text or button (underneath textareas).

Related topics

1 theme call to theme_img_assist_textarea_link()
img_assist_textarea in ./img_assist.module
Add image link underneath textareas.

File

./img_assist.module, line 1603
Image Assist module

Code

function theme_img_assist_textarea_link($element, $link) {
  $output = '<div class="img_assist-button">';
  if ($link == 'icon') {
    $link = theme('image', drupal_get_path('module', 'img_assist') . '/add-image.jpg', t('Add image'));
  }
  else {
    $link = t('Add image');
  }
  $attribs = array(
    'class' => 'img_assist-link',
    'id' => 'img_assist-link-' . $element['#id'],
    'title' => t('Click here to add images'),
    'onclick' => 'window.open(this.href, \'img_assist_link\', \'width=600,height=350,scrollbars=yes,status=yes,resizable=yes,toolbar=no,menubar=no\'); return false;',
  );
  $output .= l($link, 'img_assist/load/textarea', $attribs, 'textarea=' . $element['#name'], NULL, FALSE, TRUE);
  $output .= '</div>';
  return $output;
}