You are here

function globallink_make_preview_link in GlobalLink Connect for Drupal 7.7

Function to create Preview link

1 call to globallink_make_preview_link()
globallink_all_active_form in ./globallink_workbench_all_active_submissions.inc
Builds form to show all active entity submissions.

File

./globallink_workbench_all_active_submissions.inc, line 1102

Code

function globallink_make_preview_link($link_text = '', $details, $id) {
  $sub_rid = $details['sub_rid'];
  $type = $details['type'];
  $target_lang = $details['target_lang'];
  drupal_add_js(array(
    'my-modal-style' => array(
      'modalSize' => array(
        'type' => 'fixed',
        'width' => 700,
        'height' => 400,
      ),
      'animation' => 'fadeIn',
    ),
  ), 'setting');

  // Set a default value if no text in supplied.
  if (empty($link_text)) {
    $link_text = 'Preview';
  }
  return '<div id="preview-link" style="text-align: left;" title="Click to Preview">' . l($link_text, 'admin/globallink-translations/workbench/' . $type . '/' . $sub_rid . '/' . $target_lang . '/preview/' . $id . '/nojs', array(
    'attributes' => array(
      'class' => 'ctools-use-modal ctools-modal-my-modal-style',
    ),
  )) . '</div>';
}