You are here

function _ldap_help_parse_status_to_text in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_help/ldap_help.status.inc \_ldap_help_parse_status_to_text()
  2. 7 ldap_help/ldap_help.status.inc \_ldap_help_parse_status_to_text()
1 call to _ldap_help_parse_status_to_text()
ldap_help_status in ldap_help/ldap_help.status.inc
@file status file for ldaphelp module

File

ldap_help/ldap_help.status.inc, line 169
status file for ldaphelp module

Code

function _ldap_help_parse_status_to_text($status, $heading, $replacements = array()) {
  $var_del = "\r\n------------------------------------------------\r\n";
  $section_del = "\r\n\r\n================================================\r\n";
  $name_val_del = ":\r\n";
  $lr = "\r\n";
  $replacements = array_merge($replacements, array(
    '<br/>' => $lr,
    '<ul>' => $lr,
    '</ul>' => $lr,
    '<li>' => $lr,
    '</li>' => "",
    "<code>" => "",
    "</code>" => "",
    "<strong>" => "",
    "</strong>" => "",
  ));
  $content = drupal_strtoupper($heading) . $lr;
  foreach ($status as $item) {

    //  $item['value'] = str_replace(array('<br/>','<ul>','</ul>','<li>','</li>',"<code>","</code>"),
    // array("\r\n","\r\n","\r\n","\r\n","\r\n"),$item['value'] );
    $item['value'] = str_replace(array_keys($replacements), array_values($replacements), $item['value']);
    $item['title'] = str_replace(array_keys($replacements), array_values($replacements), $item['title']);
    $content .= $item['title'] . $name_val_del . $item['value'] . $var_del;
  }
  return $content;
}