home > news Hide Open in windows Explorer options from Action menu

Hide Open in windows Explorer options from Action menu




I was looking for JavaScript to hide this "Open in Windows Explorer" for document library. I found quite a few posts with javascript, which I tried and no success. Then I went back to my ideal JavaScript framework J query( Yes I dont like learning all script details when I got J query's accessibility functions) anyway still no luck and then I found this post about hiding "upload Single Documents" options

http://asadewa.wordpress.com/2008/02/23/removing-single-file-upload-menu-from-document-library-toolbar-moss-2007/

And I figured the problem I had with my code. I was not adding the script during the onload event. Anyway below is the modfied code to use for hiding "open in Windows Explorer" and also using spBodyOnLoadFunctionNames  to push Function for onLoad event. 

<script> 

 function GetElementByText(tagName, title)
    {
        var a = document.getElementsByTagName(tagName);

        for (var i=0; i < a.length; i++)
        {
            if (aIdea.text)
            {
                if (aIdea.text === title)
                {
                    return aIdea;
                }
            }
        }

        return null;
    }
function hideWinExp()
{
 var o = GetElementByText("ie:menuitem","Open with Windows Explorer");
            if (o)
            {
                o.disabled = true;
            }
}
_spBodyOnLoadFunctionNames.push("hideWinExp");

</script>
 

Note :

replace  

Idea =  [  i  ]  no spaces or copy it into text file


Posted on SharePoint Blogs







FFTF News Archives :
News Articles Archives: Apr 2005 | Aug 2005 | Dec 2005 | Feb 2005 | Jul 2005 | Jun 2005 | Mar 2005 | May 2005 | Nov 2005 | Oct 2005 | Sep 2005 | Oct 2005 | Nov 2005 | Dec 2005 | Jan 2006 | Feb 2006 | Mar 2006 | Apr 2006 | May 2006 | Jun 2006 | July 2006 | August 2006 | September 2006 | October 2006 |  
SharePoint Blogs