R
ragtek
Guest
How do you add own links to the visitor tab (template hook navigator_visitor_tab_links1)?
i'm using str_replace (had to change it now to preg_replace) to search </ul> and replace it with mine code...
Is this ok?
Problem is, that there is at least 1 add-on which adds a own <ul> list there.
So if my add-on runs AFTER this, it will find 2 ul lists, and insert the link 2 times. (so i had to run preg_replace instead of str_replace, but isn't inserting a second ul list false because then you have at least 3 ul lists which aren't in the right position??
i'm using str_replace (had to change it now to preg_replace) to search </ul> and replace it with mine code...
PHP:
if ($name == 'navigation_visitor_tab_links1') {
if (Ragtek_Invite_Helper::perm('canUse')) {
$search = '</ul>';
$replace = $template->create('ragtek_invite_visitortab') .'</ul>';
$contents = str_replace($search, $replace, $contents);
}
}
Problem is, that there is at least 1 add-on which adds a own <ul> list there.
So if my add-on runs AFTER this, it will find 2 ul lists, and insert the link 2 times. (so i had to run preg_replace instead of str_replace, but isn't inserting a second ul list false because then you have at least 3 ul lists which aren't in the right position??