Open ows.js, and replace the following functions:
function AddDocLibMenuItems(m, ctx)
{
if (typeof(Custom_AddDocLibMenuItems) != "undefined")
{
if (Custom_AddDocLibMenuItems(m, ctx))
return;
}
var RootFolder = GetRootFolder(ctx);
setupMenuContext(ctx);
if (currentItemFileUrl == null)
currentItemFileUrl = itemTable.ServerUrl;
if (currentItemFSObjType == null)
currentItemFSObjType = itemTable.FSObjType;
var currentItemEscapedFileUrl = escapeProperly(
unescapeProperly(currentItemFileUrl));
if (currentItemFSObjType != 1)
{
strDisplayText = L_ViewProperties_Text;
strAction = "STSNavigate('" + ctx.displayFormUrl+"?ID="+
currentItemID +
"&Source=" + GetSource() + RootFolder + "')";
strImagePath = "";
CAMOpt(m, strDisplayText, strAction, strImagePath);
}
strDisplayText = L_EditProperties_Text;
strAction = "STSNavigate('" + ctx.editFormUrl+"?ID="+
currentItemID +
"&Source=" + GetSource() + RootFolder + "')";
strImagePath = ctx.imagesPath + "edititem.gif";
CAMOpt(m, strDisplayText, strAction, strImagePath);
if (currentItemFSObjType != 1)
{
if (ctx.isWebEditorPreview == 0)
{
if (ctx.listTemplate == LISTTEMPLATE_IMAGE_LIBRARY &&
itemTable.IsImage == "1")
{
strDisplayText = L_EditInOIS_Text;
strAction = "EditSingleImage('" + currentItemID
+ "')";
strImagePath = ctx.imagesPath + "oisweb.gif";
CAMOpt(m, strDisplayText, strAction, strImagePath);
}
else
{
setDocType();
if (currentItemAppName != "" &&
currentItemOpenControl != "")
{
strDisplayText = StBuildParam(L_EditIn_Text,
currentItemAppName);
//strAction = "editDocumentWithProgID2('" +
currentItemFileUrl + "', '" + currentItemProgId + "', '" +
currentItemOpenControl + "')";
strAction = "editDocumentWithProgID2('" +
currentItemFileUrl + "', '" + currentItemProgId + "', '" +
currentItemOpenControl + "', '" + ctx.HttpRoot + "')";
strImagePath = ctx.imagesPath + currentItemIcon;
CAMOpt(m, strDisplayText, strAction,
strImagePath);
}
}
}
}
strDisplayText = L_DeleteDocItem_Text;
strAction = "DeleteDocLibItem('" +
ctx.HttpPath + "&Cmd=Delete&List=" + ctx.listName +
"&ID=" + currentItemID + "&owsfileref=" +
currentItemEscapedFileUrl + "&NextUsing=" + GetSource()
+ "')";
strImagePath = ctx.imagesPath + "delitem.gif";
CAMOpt(m, strDisplayText, strAction, strImagePath);
if (ctx.isModerated == true)
{
strDisplayText = L_ModerateItem_Text;
strAction = "STSNavigate('" + ctx.editFormUrl+"?ID="+
currentItemID + "&ChangeApproval=TRUE&Source=" +
GetSource() + RootFolder + "')";
strImagePath = "";
CAMOpt(m, strDisplayText, strAction, strImagePath);
}
if (currentItemFSObjType != 1 && ctx.listTemplate ==
LISTTEMPLATE_IMAGE_LIBRARY)
{
strAction = "DownloadOriginalImage(" + currentItemID + ")";
strImagePath = ctx.imagesPath + "download.gif";
strDisplayText = L_DownloadOriginal_Text;
CAMOpt(m, strDisplayText, strAction, strImagePath);
}
if (currentItemFSObjType != 1)
{
CAMSep(m);
AddCheckinCheckoutMenuItem(m, ctx, currentItemEscapedFileUrl);
AddVersionsMenuItem(m, ctx, currentItemEscapedFileUrl);
CAMSep(m);
if (ctx.PortalUrl != null)
{
strDisplayText = L_AddToMyLinks_Text;
strAction = "Portal_Tasks('PinToMyPage')"; ;
strImagePath = "";
CAMOpt(m, strDisplayText, strAction, strImagePath);
strDisplayText = L_AddToCategory_Text;
strAction = "Portal_Tasks('Categorize')"; ;
strImagePath = "";
CAMOpt(m, strDisplayText, strAction, strImagePath);
CAMSep(m);
}
}
strDisplayText = L_Subscribe_Text;
strAction = "NavigateToSubNewAspx('" + ctx.HttpRoot + "', 'List="
+ ctx.listName + "&ID=" + currentItemID + "')";
strImagePath = "";
CAMOpt(m, strDisplayText, strAction, strImagePath);
if (currentItemFSObjType != 1)
{
strDisplayText = L_Discuss_Text;
strAction = "STSNavigate('" + ctx.HttpPath
+ "&Cmd=COMMFRMS&URL=";
if (ctx.isWebEditorPreview == 0)
strAction += currentItemEscapedFileUrl;
strAction += "')";
strImagePath = ctx.imagesPath + "icdisc.gif";
CAMOpt(m, strDisplayText, strAction, strImagePath);
if (ctx.listTemplate != LISTTEMPLATE_IMAGE_LIBRARY)
AddWorkspaceMenuItem(m, ctx);
}
}
function editDocumentWithProgID2(strDocument, varProgID, varEditor,
strHttpRoot)
{
if (currentItemCheckedOutUserId ==
null)
currentItemCheckedOutUserId =
itemTable.COUId;
if (currentItemCheckedOutUserId == "")
{
SubmitFormPost(strHttpRoot
+ "/_layouts/" + L_Language_Text + "/Checkin.aspx?FileName=" +
strDocument + "&Checkout=true&Source=" + GetSource());
}
var objEditor;
if (strDocument.charAt(0) == "/" || strDocument.substr
(0,3).toLowerCase() == "%2f")
strDocument = document.location.protocol + "//" +
document.location.host + strDocument;
try
{
objEditor = new ActiveXObject(varEditor + ".2");
if (!objEditor.EditDocument2(window, strDocument, varProgID))
alert(L_EditDocumentRuntimeError_Text);
window.onfocus = RefreshOnNextFocus;
return;
}
catch (e)
{
}
try
{
objEditor = new ActiveXObject(varEditor + ".1");
window.onfocus = null;
if (SzExtension(strDocument) == "ppt" && varProgID == "")
varProgID = "PowerPoint.Slide";
if (!objEditor.EditDocument(strDocument, varProgID))
alert(L_EditDocumentRuntimeError_Text);
SetWindowRefreshOnFocus();
return;
}
catch (e)
{
alert(L_EditDocumentProgIDError_Text);
}
}