You are here

function _mail_edit_list_row in Mail Editor 6

Same name and namespace in other branches
  1. 7 mail_edit.admin.inc \_mail_edit_list_row()

Build one row of the mail edit table.

Parameters

$template: The mail template for this row.

$languages: The languages to include.

Return value

array

1 call to _mail_edit_list_row()
mail_edit_list_filtered_form in ./mail_edit.admin.inc
Create $form array with filtered list.

File

./mail_edit.admin.inc, line 191
Administrative interface for the Mail Editor module.

Code

function _mail_edit_list_row($template, $languages, $display_language_names) {
  $module_list = _mail_edit_module_list(TRUE);
  $form['module'] = array(
    '#type' => 'markup',
    '#value' => isset($module_list[$template->module]) ? $module_list[$template->module] : check_plain($template->module),
  );
  $form['id'] = array(
    '#type' => 'value',
    '#value' => check_plain($template->id),
  );
  $form['mailkey'] = array(
    '#type' => 'markup',
    '#value' => check_plain($template->mailkey),
  );
  $form['description'] = array(
    '#type' => 'markup',
    '#value' => filter_xss_admin($template->description),
  );
  $form['operations'] = array(
    '#type' => 'markup',
    '#value' => '',
  );
  foreach ($languages as $lang_code => $lang_name) {
    $variable = array(
      '@language' => $lang_code,
    );
    if ($display_language_names) {
      $link_text = t(isset($template->languages[$lang_code]) ? 'Edit @language' : 'Add @language', $variable);
    }
    else {
      $link_text = t(isset($template->languages[$lang_code]) ? 'Edit' : 'Add');
    }
    $form[$lang_code] = array(
      '#type' => 'markup',
      '#value' => l($link_text, 'admin/build/mail-edit/' . $template->id . '/' . $lang_code),
    );
  }
  return $form;
}