Everything that Christian Lescuyer wrote is correct. Notice, however, that he said "I would" and not "you should". The choice is not that easy.
First of all, security is not an issue in the choice. You should have security check on server when you execute an action. Which code decides to show/hide the button that leads to the action is irrelevant.
That leaves us with only one drawback of doing show/hide logic in Javascript - the HTML sent to user is bigger than necessary. This may not be a big deal.
Having show/hide logic in PHP does have a minus, though. The PHP code required is usually a tag soup. Akira's code provides a good example of how it is usually done.
Corresponding Javascript code would probably look something like this:
if (logged())
{
elementSecretArea.style.display = "list-item";
}
(assuming that elements that could be hidden have display:none by default).
This style also allows nice "Ajax" scenario: user sees a page w/o secret area, inputs password, sees the secret area all without refreshing the page.
So, if you already have a script that runs when your document load for other reasons, I would seriously consider having show/hide logic there.