First, find the 2052 directory under the directory c: Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ layouts (this is the path of the Chinese version by default, the English version of moss is the 1033 directory), where there is a core. in the JS file of JS, Ms has reserved custom interfaces for us to implement our own menu definition, which are the following two functions:
Funtion addlistmenuitems (M, CTX)
{
If (typeof (custom_addlistmenuitems )! = "Undefined ")
{
If (custom_addlistmenuitems (M, CTX ))
}
}
Funtion adddoclibmenuitems (M, CTX)
{
If (typeof (custom_addlistmenuitems )! = "Undefined ")
{
If (custom_addlistmenuitems (M, CTX ))
}
}
We implement User-Defined FunctionsCustom_addlistmenuitems(List Library) orCustom_addlistmenuitems(Document Library)
Function custom_addlistmenuitems (M, CTX)
{
If (hasrights (0x0, 0x4 ))
{
VaR strdisplaytext = "Modify status ";
VaR straction = "stsnavigate ('" + CTX. editformurl + "? Id = "+ currentitemid +" & source = "+ getsource () + "')";
VaR strimagepath = CTX. imagespath + "edititem.gif ";
// If there is a level-2 menu, change the Parameter m of the following function to the corresponding parent menu
VaR menuoption = camopt (M, strdisplaytext, straction, strimagepath, null, 220 );
Menuoption. ID = "id_edititemupdate ";
}
}
Put the aboveCodeAdded to the corresponding list or document library to implement the right-click Menu customization