// Override $links output // NOTE: change function name to match theme name eg. change mbacc_links to chameleon_links if using the chameleon theme function _nextquote($s, $off) { $idx1 = strpos($s, '"', $off); $idx2 = strpos($s, "'", $off); if ($idx1 && ($idx2===false)) return $idx1; else if ($idx2 && ($idx1===false)) return $idx2; else if ($idx1 && $idx2) return ($idx1<$idx2)?$idx1:$idx2; else return false; } function amword_links($links, $delimiter = ' | ') { if (!is_array($links)) { return ''; } /* Maps a link to it's associated class */ $link_to_id = array( t('add new comment') => 'comment', t('printer friendly version') => 'print', t('email this page') => 'email', t('delete') => 'delete', t('edit') => 'edit', t('reply') => 'reply', t('calendar') => 'calendar', ); $new_links = array(); foreach ($links as $link) { foreach ($link_to_id as $text => $id) { if (strpos($link, $text)) { $classidx = strpos('class', $link); if ($classidx !== false) { $q1 = _nextquote($link, $classidx); $q2 = _nextquote($link, $q1+1); $first = substr($link, 0, $q1+1); $last = substr($link, $q2); $classes = substr($link, $q1+1, $q2-$q1-1); $classes .= " lti-$id"; $link = $first . $classes . $last; } else { $link = str_replace('