I have a document library where we only want people to see the default filtered view. To stop users from seeing all the files, I had hidden the Open In Windows Explorer button using the following code in a Content Editor Web Part:
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideToolbarItem()");
function hideToolbarItem() {
var doc = document.getElementsByTagName('ie:menuitem');
for (var i = 0; i < doc.length; i++) {
itm = doc[i];
if (itm.id.match('OpenInExplorer')!=null)
{ itm.hidden=true; }
if (itm.id.match('OfflineButton')!=null)
{ itm.hidden=true; }
}
}
</script>
However, the button has recently re-appeared :-S I have admin powers to my sub-site, but not any higher powers so I don't know if anything higher up has changed.
Is there anything wrong with my code?