if(primaryKeyAsInteger != null)
contentVO = ContentController.getContentController().getContentVOWithId(primaryKeyAsInteger);
if(contentVO != null && hasAccessTo(principal, "Common.PublishButton", true) && hasAccessTo(principal, "Repository.Read", "" + contentVO.getRepositoryId()))
{
buttons.add(new ToolbarButton("",
getLocalizedString(locale, "tool.common.publishing.publishButtonLabel"),
getLocalizedString(locale, "tool.common.publishing.publishButtonLabel"),
"submitToPublish('true');",
"css/images/v3/publishContentIcon.gif",
"left",
"publish",
true));
}
if(contentVO != null && hasAccessTo(principal, "Common.SubmitToPublishButton", true, false, false))
{
buttons.add(new ToolbarButton("",
getLocalizedString(locale, "tool.common.publishing.submitToPublishButtonLabel"),
getLocalizedString(locale, "tool.common.publishing.submitToPublishButtonLabel"),
"submitToPublish('false');",
"css/images/v3/publishContentIcon.gif",
"left",
"submitToPublish",
true));
}
buttons.add(new ToolbarButton("",
getLocalizedString(locale, "tool.common.cancelButton.label"),
getLocalizedString(locale, "tool.common.cancelButton.label"),
"if(parent && parent.closeInlineDiv) parent.closeInlineDiv(); else if(parent && parent.closeDialog) parent.closeDialog(); else window.close();",
"css/images/v3/cancelIcon.gif",
"left",