function portal_generate_child_links($parent_link) { $links = portal_get_child_links($parent_link); $list = ''; if (count($links) > 0) { $list .= ' <ul class="child-link-list"> '; for ($i = 0; $i < count($links); $i++) { $url = $links[$i]['link_href']; if ($url == '') { $url = '/links/' . $links[$i]['link_id'] . '/'; } $list .= ' <li style="' . $links[$i]['link_style'] . '"> <a href="' . $url . '">' . $links[$i]['link_title'] . '</a> <div>' . $links[$i]['link_description'] . '</div> </li> '; } $list .= ' </ul> '; } return $list; }
function portal_generate_link_navigation() { // select the names of the top level items and generate the linked list $results = portal_get_child_links(0); $links = array(); for ($i = 0; $i < count($results); $i++) { $url = $results[$i]['link_href']; if ($url == '') { $url = '/links/' . $results[$i]['link_id'] . '/'; } $al = '<a href="' . $url . '" title="' . $results[$i]['link_title'] . '">'; $ar = '</a>'; if ($GLOBALS['_PORTAL']['section'] == 'links' && $GLOBALS['_PORTAL']['activity'] == $results[$i]['link_id']) { // don't "link" this link $al = '<strong>'; $ar = '</strong>'; } $links[] = '<li>' . $al . $results[$i]['link_nav_title'] . $ar . '</li>'; } return $links; }