function tft_theme_add_content_links in Taxonomy File Tree 7.2
Helper function to render the content addition links.
Parameters
array $links:
Return value
string
Related topics
2 calls to tft_theme_add_content_links()
- tft in includes/
tft.pages.inc - Page callback: file content list.
- tft_ajax_get_folder in includes/
tft.ajax.inc - Page callback: get folder content via AJAX.
File
- ./
tft.module, line 1091 - Hook implementations and module logic for TFT.
Code
function tft_theme_add_content_links($links) {
// We don't use the theme('links') Drupal function, as we want to set custom classes and IDs on the <li>s.
// This is not possible (without a lot of overhead) with theme('links').
$html = '<ul id="folder-add-content-links">';
foreach ($links as $link) {
$html .= '<li class="folder-add-content-link" id="' . (isset($link['attributes']['id']) ? $link['attributes']['id'] : '') . '">';
// Change the ID for the <a>.
if (isset($link['attributes']['id'])) {
$link['attributes']['id'] .= '-link';
}
$html .= l($link['title'], $link['href'], $link);
$html .= '</li>';
}
$html .= '</ul>';
return $html;
}