You would put the php code you find in the example you posted into the javascript you're using for your menu, for example:
[null, 'Contact Us', null, '_self', 'Contact Us']
would become:
[null, 'Contact Us', '<?php echo url('/contact'); ?>', '_self', 'Contact Us']
And where you want to have the admin menu, you would use the php if to wrap the entire drop down, so it wouldn't show for other users.