You are here

function _tableofcontents_toc_encode in Table of Contents 7.2

Encode the given 'toc' settings into a string

1 call to _tableofcontents_toc_encode()
_tableofcontents_filter_process in ./tableofcontents.filters.inc
Process the text for the table of content.

File

./tableofcontents.filters.inc, line 107
Table of Contents - Versatile system for generating Tables of Contents for fields - filters.

Code

function _tableofcontents_toc_encode($toc, $prefix = '') {
  static $encoded = '';
  foreach ($toc as $k => $v) {
    if (is_array($v)) {
      _tableofcontents_toc_encode($v, "{$prefix}{$k}::");
    }
    else {
      $encoded .= "{$prefix}{$k}=" . urlencode($v) . ' ';
    }
  }
  return $encoded;
}