Use this javascript
<script language="JavaScript">
_spBodyOnLoadFunctionNames.push("HideNewIcons");
function HideNewIcons()
{
var doc = document.getElementsByTagName('ie:menuitem');
for(var i=0;i<doc.length;i++)
{
if(doc(i).id.match('MultipleUpload'))
{
doc(i).style.visibility="hidden";
}
}
}
</script>
Following are few examples of how to add a new menu to EditControlBlock,SiteSettings Gallary,SiteActions menu.
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="NewEditItemMenu"
RegistrationType="List"
RegistrationId="101"
Location="EditControlBlock"
Sequence="106"
Title="MY ECB ITEM">
<UrlAction Url="/_layouts/viewlsts.aspx"/>
</CustomAction>
<CustomAction
Id="NewSiteSettingsGallary"
GroupId="Galleries"
Location="Microsoft.SharePoint.SiteSettings"
Sequence="106"
Title="MY ECB ITEM">
<UrlAction Url="/_layouts/viewlsts.aspx"/>
</CustomAction>
<CustomAction
Id="NewSiteActionsMenu"
GroupId="SiteActions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="106"
Title="MY ECB ITEM">
<UrlAction Url="/_layouts/viewlsts.aspx"/>
</CustomAction>
</Elements>
Using ControlAssembly to Add New Menus to any GroupId
Check my other blogpostAlternatives
- If you want to hide a menu on perticular page then use CEWP(Content Editor WebPart) and put javascript in Source Editor to hide the menu. The id of the menu can be found using ViewSource from the browser. For example to hide siteactions menu from a perticular page use below javascript. Note that to execute any javascript after onload you haveto use _spBodyOnLoadFunctionNames function.
<script language="JavaScript">
_spBodyOnLoadFunctionNames.push("HideNewIcons");
function HideNewIcons()
{
var doc = document.getElementById('siteactiontd');
doc.style.visibility="hidden";
}
</script>
Modify default.master page and put it inside that file.
Use a Feature.
If you want to control the hiding of the menus by using a Feature so you can turn them on and off at will, and at the farm, application, site collection or site level the you have a little more work to do, but not too much.
I will return here later and add a full step by step, but here's the code you will need:
A SharePoint Delegate control:
Add this to the bottom of your Master Page just before the </body> tag (The ControlId is up to you, but needs to match the Id used in the elements file):
<SharePoint:DelegateControl runat="server" ControlId="MiscControls" AllowMultipleControls="true"/>
A .Net User Control: HideMenus.ascx
<%@ Control Language="C#" ClassName="HideMenus" %>
<script language="JavaScript">
var doc = document.getElementsByTagName('ie:menuitem');
for (var i = 0; i < doc.length; i++){
itm = doc(i)
if (itm.id.match('MultipleUpload')!=null itm.id.match('OpenInExplorer')!=null)
{
itm.hidden=true;
}
}
</script>
A feature file: Feature.xml
<Feature
Id="531F15CD-A646-45e5-AB61-4F8DF89C29D9"
Title="Hide Menus"
Description="Sample feature to hide selected menus (MAX Technical Training demo)"
Scope="Web"
Hidden="FALSE"
xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests>
<ElementManifest Location="elements.xml" />
</ElementManifests>
</Feature>
An elements file: Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Control ControlSrc="~/_controltemplates/HideMenus.ascx" Sequence="100"
Id="MiscControls">
</Control>
</Elements>
| Id | GroupId | Location | Sequence | RegistrationType | RegistrationId |
|---|---|---|---|---|---|
| ReportListActionsMenuCustomizer | SiteActions | Microsoft.SharePoint.StandardMenu | |||
| Extend | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| Unextend | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| Delete | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 30 | ||
| ManagedPaths | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 60 | ||
| EmailSettings | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 70 | ||
| GeneralSettings | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 80 | ||
| ManageContentDatabases | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 90 | ||
| ManageWebAppFeatures | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 110 | ||
| ListWebApplications | WebApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 120 | ||
| CreateSite | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| DeleteSite | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| SiteUse | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 40 | ||
| QuotaDefinition | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 50 | ||
| SiteQuota | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 60 | ||
| SiteOwners | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 70 | ||
| ListSiteCollections | SiteManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 80 | ||
| WebPartSecurity | ApplicationSecurity | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| SelfService | ApplicationSecurity | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| WebApplicationSecurity | ApplicationSecurity | Microsoft.SharePoint.Administration.ApplicationManagement | 30 | ||
| ManagePolicy | ApplicationSecurity | Microsoft.SharePoint.Administration.ApplicationManagement | 40 | ||
| ManageAuthenticationProviders | ApplicationSecurity | Microsoft.SharePoint.Administration.ApplicationManagement | 50 | ||
| OfficialFile | ExternalService | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| HtmlViewer | ExternalService | Microsoft.SharePoint.Administration.ApplicationManagement | 30 | ||
| DocConversion | ExternalService | Microsoft.SharePoint.Administration.ApplicationManagement | 40 | ||
| WorkflowManagement | WorkflowManagement | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| FarmServers | Topology | Microsoft.SharePoint.Administration.Operations | 10 | ||
| TopologyServices | Topology | Microsoft.SharePoint.Administration.Operations | 20 | ||
| IncomingEmailServer | Topology | Microsoft.SharePoint.Administration.Operations | 40 | ||
| ApproveDGs | Topology | Microsoft.SharePoint.Administration.Operations | 50 | ||
| EmailConfiguration | Topology | Microsoft.SharePoint.Administration.Operations | 40 | ||
| RunningJobs | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 10 | ||
| JobDefinitions | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 20 | ||
| AlternateAccessMappings | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 30 | ||
| ManageFarmFeatures | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 50 | ||
| Solutions | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 60 | ||
| ServiceAccount | Security | Microsoft.SharePoint.Administration.Operations | 10 | ||
| Irm | Security | Microsoft.SharePoint.Administration.Operations | 15 | ||
| Antivirus | Security | Microsoft.SharePoint.Administration.Operations | 20 | ||
| BlockedFileTypes | Security | Microsoft.SharePoint.Administration.Operations | 30 | ||
| AdministrationRoles | Security | Microsoft.SharePoint.Administration.Operations | 40 | ||
| Backup | BackupRestore | Microsoft.SharePoint.Administration.Operations | 10 | ||
| BackupHistory | BackupRestore | Microsoft.SharePoint.Administration.Operations | 20 | ||
| Restore | BackupRestore | Microsoft.SharePoint.Administration.Operations | 30 | ||
| BackupStatus | BackupRestore | Microsoft.SharePoint.Administration.Operations | 40 | ||
| DiagnosticLogging | LoggingAndReporting | Microsoft.SharePoint.Administration.Operations | 10 | ||
| UsageAnalysis | LoggingAndReporting | Microsoft.SharePoint.Administration.Operations | 20 | ||
| DefaultDatabase | DataConfiguration | Microsoft.SharePoint.Administration.Operations | 10 | ||
| DataRetrieval | DataConfiguration | Microsoft.SharePoint.Administration.Operations | 20 | ||
| SiteUpgradeStatus | Upgrade | Microsoft.SharePoint.Administration.Operations | 10 | ||
| FinalizeUpgrade | Upgrade | Microsoft.SharePoint.Administration.Operations | 20 | ||
| CreateSite | Links | Microsoft.SharePoint.Administration.ApplicationCreated | 10 | ||
| HomePage | Links | Microsoft.SharePoint.Administration.ApplicationCreated | 20 | ||
| ManageAnalytics | PortalAnalytics | Office.Server.ServiceProvider.Administration | 10 | ||
| PortalSiteUsage | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 30 | ||
| PortalWebUsage | SiteAdministration | Microsoft.SharePoint.SiteSettings | 30 | ||
| AddBDCApp | BDC | Office.Server.ServiceProvider.Administration | 101 | ||
| BDCApplications | BDC | Office.Server.ServiceProvider.Administration | 102 | ||
| BDCEntities | BDC | Office.Server.ServiceProvider.Administration | 103 | ||
| MNGPerms | BDC | Office.Server.ServiceProvider.Administration | 104 | ||
| BDCProfPage | BDC | Office.Server.ServiceProvider.Administration | 105 | ||
| 6a9c4822-504f-42fa-b356-817f821f623b | ActionsMenu | Microsoft.SharePoint.StandardMenu | List | 107 | |
| ExportEventToolbarButton | DisplayFormToolbar | List | 106 | ||
| ExportContactToolbarButton | DisplayFormToolbar | List | 105 | ||
| ChangeNameDescription | General | Microsoft.SharePoint.ContentTypeSettings | 10 | ||
| ChangeOptionalSettings | General | Microsoft.SharePoint.ContentTypeSettings | 20 | ||
| ChangeWorkflowSettings | General | Microsoft.SharePoint.ContentTypeSettings | 30 | ||
| RemoveContentType | General | Microsoft.SharePoint.ContentTypeSettings | 100 | ||
| AddField | Fields | Microsoft.SharePoint.ContentTypeSettings | 10 | ||
| ReorderFields | Fields | Microsoft.SharePoint.ContentTypeSettings | 20 | ||
| ChangeNameDescriptionGroup | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 10 | ||
| ChangeOptionalSettings | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 20 | ||
| ChangeWorkflowSettings | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 40 | ||
| RemoveContentType | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 100 | ||
| AddField | Fields | Microsoft.SharePoint.ContentTypeTemplateSettings | 10 | ||
| Fields | Microsoft.SharePoint.ContentTypeTemplateSettings | 15 | |||
| ReorderFields | Fields | Microsoft.SharePoint.ContentTypeTemplateSettings | 20 | ||
| SiteActionsToolbar | SiteActions | Microsoft.SharePoint.StandardMenu | 2001 | ||
| DeployManage | ContentDeployment | Microsoft.SharePoint.Administration.Operations | 10 | ||
| DeploySettings | ContentDeployment | Microsoft.SharePoint.Administration.Operations | 20 | ||
| DeployStatus | ContentDeployment | Microsoft.SharePoint.Administration.Operations | 30 | ||
| ChangeDMSettings | General | Microsoft.SharePoint.ContentTypeSettings | 100 | ContentType | 0x0101 |
| ChangeDMSettings | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 100 | ContentType | 0x0101 |
| ExcelServerSettings | ExcelServer | Office.Server.ServiceProvider.Administration | 51 | ||
| ExcelServerFileTrustedLocations | ExcelServer | Office.Server.ServiceProvider.Administration | 52 | ||
| ExcelServerTrustedDcls | ExcelServer | Office.Server.ServiceProvider.Administration | 53 | ||
| ExcelServerSafeDataProviders | ExcelServer | Office.Server.ServiceProvider.Administration | 54 | ||
| ExcelServerUserDefinedFunctions | ExcelServer | Office.Server.ServiceProvider.Administration | 55 | ||
| ewrViewAsHtmlFromForm | DisplayFormToolbar | 2500 | FileType | xlsx | |
| ewrViewAsHtmlFromForm | DisplayFormToolbar | 2500 | FileType | xlsb | |
| ewrViewAsHtmlFromForm | EditFormToolbar | 2500 | FileType | xlsx | |
| ewrViewAsHtmlFromForm | EditFormToolbar | 2500 | FileType | xlsb | |
| ewrViewAsHtmlFromEcb | EditControlBlock | 255 | FileType | xlsx | |
| ewrViewAsHtmlFromEcb | EditControlBlock | 255 | FileType | xlsb | |
| ewrViewSnapshotInExcel | EditControlBlock | 256 | FileType | xlsx | |
| ewrViewSnapshotInExcel | EditControlBlock | 256 | FileType | xlsb | |
| FeaturePushdown | Upgrade | Microsoft.SharePoint.Administration.Operations | 70 | ||
| HoldECBItem | EditControlBlock | 100 | ContentType | 0x01 | |
| IPFSApplicationConfigurationManage | IPFSApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| IPFSApplicationConfigurationConfig | IPFSApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| IPFSApplicationConfigurationUpload | IPFSApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 30 | ||
| IPFSApplicationConfigurationManageDataConnectionFiles | IPFSApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 40 | ||
| IPFSApplicationConfigurationManageFormsServiceProxy | IPFSApplicationConfiguration | Microsoft.SharePoint.Administration.ApplicationManagement | 50 | ||
| FormServerEcbItemOpenXsn | EditControlBlock | 255 | FileType | xsn | |
| FormServerEcbItemOpenInfoPathDocument | EditControlBlock | 255 | ProgId | InfoPath.Document | |
| FormServerEcbItemOpenInfoPathDocument2 | EditControlBlock | 255 | ProgId | InfoPath.Document.2 | |
| FormServerEcbItemOpenInfoPathDocument3 | EditControlBlock | 255 | ProgId | InfoPath.Document.3 | |
| FormServerEcbItemOpenInfoPathDocument4 | EditControlBlock | 255 | ProgId | InfoPath.Document.4 | |
| EnableAudienceTargeting | GeneralSettings | Microsoft.SharePoint.ListEdit | 10 | ||
| SiteDirSettings | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 21 | ||
| MasterSiteDirectorySettings | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 21 | ||
| SiteDirectoryLinksCheckerJob | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 22 | ||
| Migration | Upgrade | Microsoft.SharePoint.Administration.Operations | 50 | ||
| AreaNavigationSettings | Customization | Microsoft.SharePoint.SiteSettings | 10 | ||
| SearchServiceManagement | SearchGroup | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| configureEnhacedSearch | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 1 | ||
| ManageScopes | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 2 | ||
| ManageSpecialTerms | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 3 | ||
| SearchSettings | Search | Office.Server.ServiceProvider.Administration | 10 | ||
| SspSearchAnalytics | Search | Office.Server.ServiceProvider.Administration | 30 | ||
| ManageSSP | OfficeServerCoreServices | Microsoft.SharePoint.Administration.ApplicationManagement | 10 | ||
| ManageInterFarmServices | OfficeServerCoreServices | Microsoft.SharePoint.Administration.ApplicationManagement | 20 | ||
| CheckFarmServices | OfficeServerCoreServices | Microsoft.SharePoint.Administration.ApplicationManagement | 30 | ||
| SessionState | OfficeServerCoreServices | Microsoft.SharePoint.Administration.ApplicationManagement | 40 | ||
| QuiesceFarm | GlobalConfiguration | Microsoft.SharePoint.Administration.Operations | 50 | ||
| LicenseConversion | Upgrade | Microsoft.SharePoint.Administration.Operations | 80 | ||
| ChangeCTConverterSettings | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 100 | ||
| SchedulingLink | GeneralSettings | Microsoft.SharePoint.ListEdit.DocumentLibrary | 10 | ||
| AreaTemplateSettings | Customization | Microsoft.SharePoint.SiteSettings | 10 | ||
| CmsMasterPageCatalog | Galleries | Microsoft.SharePoint.SiteSettings | 100 | ||
| AreaWelcomePage | Customization | Microsoft.SharePoint.SiteSettings | 10 | ||
| AreaCacheSettings | SiteAdministration | Microsoft.SharePoint.SiteSettings | 200 | ||
| SiteCacheSettings | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 200 | ||
| SiteCacheProfiles | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 200 | ||
| ObjectCacheSettings | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 200 | ||
| CreatePublishingPage | WebPages | Microsoft.SharePoint.Create | 100 | ||
| PublishingSiteActionsMenuCustomizer | SiteActions | Microsoft.SharePoint.StandardMenu | |||
| AreaChromeSettings | Customization | Microsoft.SharePoint.SiteSettings | 10 | ||
| SiteManagement | SiteAdministration | Microsoft.SharePoint.SiteSettings | 210 | ||
| NoCrawlSettingsPage | Customization | Microsoft.SharePoint.SiteSettings | 210 | ||
| SiteManagerLogs | SiteAdministration | Microsoft.SharePoint.SiteSettings | 250 | ||
| VariationSettings | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 210 | ||
| VariationLabels | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 220 | ||
| VariationLogs | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 230 | ||
| TranslatableSettingsPage | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 230 | ||
| PolicyTemplate | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 90 | ||
| ListPolicySettings | Permissions | Microsoft.SharePoint.ListEdit | 100 | ||
| ContentTypePolicySettings | General | Microsoft.SharePoint.ContentTypeSettings | 100 | ||
| ContentTypeTemplatePolicySettings | General | Microsoft.SharePoint.ContentTypeTemplateSettings | 100 | ||
| AuditSettings | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 70 | ||
| PolicyRptConfiguration | LoggingAndReporting | Microsoft.SharePoint.Administration.Operations | 40 | ||
| PolicyFeaturesConfig | Security | Microsoft.SharePoint.Administration.Operations | 50 | ||
| RelLinksSettings | SiteAdministration | Microsoft.SharePoint.SiteSettings | 100 | ||
| AuditReporting | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 71 | ||
| WorkflowReporting | LeftNavBarLinks | Microsoft.SharePoint.Workflows | 100 | ||
| PeopleAndGroups | UsersAndPermissions | Microsoft.SharePoint.SiteSettings | 10 | ||
| SiteCollectionAdministrators | UsersAndPermissions | Microsoft.SharePoint.SiteSettings | 20 | ||
| User | UsersAndPermissions | Microsoft.SharePoint.SiteSettings | 40 | ||
| ProjectSettings | Customization | Microsoft.SharePoint.SiteSettings | 10 | ||
| NavOptions | Customization | Microsoft.SharePoint.SiteSettings | 20 | ||
| Theme | Customization | Microsoft.SharePoint.SiteSettings | 30 | ||
| TopNav | Customization | Microsoft.SharePoint.SiteSettings | 40 | ||
| QuickLaunch | Customization | Microsoft.SharePoint.SiteSettings | 50 | ||
| SaveAsTemplate | Customization | Microsoft.SharePoint.SiteSettings | 60 | ||
| ReGhost | Customization | Microsoft.SharePoint.SiteSettings | 80 | ||
| MasterPageCatalog | Galleries | Microsoft.SharePoint.SiteSettings | 10 | ||
| ManageCType | Galleries | Microsoft.SharePoint.SiteSettings | 20 | ||
| ManageField | Galleries | Microsoft.SharePoint.SiteSettings | 30 | ||
| SiteTemplates | Galleries | Microsoft.SharePoint.SiteSettings | 40 | ||
| ListTemplates | Galleries | Microsoft.SharePoint.SiteSettings | 50 | ||
| WebParts | Galleries | Microsoft.SharePoint.SiteSettings | 60 | ||
| Workflows | Galleries | Microsoft.SharePoint.SiteSettings | 70 | ||
| RegionalSettings | SiteAdministration | Microsoft.SharePoint.SiteSettings | 10 | ||
| LibrariesAndLists | SiteAdministration | Microsoft.SharePoint.SiteSettings | 20 | ||
| WebUsage | SiteAdministration | Microsoft.SharePoint.SiteSettings | 30 | ||
| UserAlerts | SiteAdministration | Microsoft.SharePoint.SiteSettings | 40 | ||
| RSS | SiteAdministration | Microsoft.SharePoint.SiteSettings | 60 | ||
| SrchVis | SiteAdministration | Microsoft.SharePoint.SiteSettings | 65 | ||
| ManageSubWebs | SiteAdministration | Microsoft.SharePoint.SiteSettings | 70 | ||
| ManageSiteFeatures | SiteAdministration | Microsoft.SharePoint.SiteSettings | 80 | ||
| DeleteWeb | SiteAdministration | Microsoft.SharePoint.SiteSettings | 90 | ||
| DeletedItems | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 10 | ||
| SiteCollectionUsage | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 30 | ||
| Storage | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 40 | ||
| ManageSiteCollectionFeatures | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 45 | ||
| Hierarchy | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 50 | ||
| Portal | SiteCollectionAdmin | Microsoft.SharePoint.SiteSettings | 60 | ||
| SkuUpgrade | Upgrade | Microsoft.SharePoint.Administration.Operations | 60 | ||
| CmsCheckSpellingEditForm | EditFormToolbar | 10 | ContentType | 0x01 | |
| CmsCheckSpellingNewForm | NewFormToolbar | 10 | ContentType | 0x01 | |
| SingleSignon | Security | Microsoft.SharePoint.Administration.Operations | 50 | ||
| ManageProf | UAP | Office.Server.ServiceProvider.Administration | 11 | ||
| ManagePriv | UAP | Office.Server.ServiceProvider.Administration | 13 | ||
| ManagePS | UAP | Office.Server.ServiceProvider.Administration | 14 | ||
| TrustedPersLinks | UAP | Office.Server.ServiceProvider.Administration | 15 | ||
| ManagePubLinks | UAP | Office.Server.ServiceProvider.Administration | 16 | ||
| ManagePersLinks | UAP | Office.Server.ServiceProvider.Administration | 17 | ||
| ManagePermissions | UAP | Office.Server.ServiceProvider.Administration | 18 | ||
| ManageAud | AUD | Office.Server.ServiceProvider.Administration | 21 |
Adding CustomMenu to any Group in SharePoint using CustomAction & ControlAssembly
Posted by milap shahCreating Hierarchical Menus with a CustomAction in SharePoint
It’s a fairly known technique to make use of CustomActions to add elements to the out-of-the-box user interface of SharePoint: you can add menu items to the Site Actions menu, you can add links on the Site Settings page, etc. The following piece of XML is the manifest of a feature that will add a new menu item to the Site Actions menu:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="{B0B5A0CB-7FBE-4dd6-9B2A-2B1E1321B8F9}"
Location="Microsoft.SharePoint.StandardMenu"
GroupId="SiteActions"
Title="Dummy Menu Item">
<UrlAction
Url="/_layouts/dummy.aspx"/>
</CustomAction>
</Elements>
For a more detailed description of CustomActions, I recommend following articles:
- Custom Action Element (MSDN)
- Sample CustomActions for SharePoint
- SharePoint Custom Action Identifiers
Another variation on this technique is to provide a reference to a class, instead of having fixed UI element specified in the XML. The following piece of XML points to the class ListSettingsMenu in the DemoCustomAction assembly.
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="{42550415-FD08-4f1f-BAE6-93CCB2A2DE60}"
Location="Microsoft.SharePoint.StandardMenu"
GroupId="SiteActions"
ControlAssembly="DemoCustomAction"
ControlClass="DemoCustomAction.ListSettingsMenu">
</CustomAction>
</Elements>
The cool thing is that you now can write code that will render the UI element; it’s even possible to create a hierarchical menu. The following implementation of the ListSettingsMenu class, in combination with the XML from above, is adding one extra menu item to the Site Actions menu (List Settings). This new menu item will contain a sub menu item for every list on the site, these sub menu items will point to the settings pages of the corresponding lists. The ListSettingsMenu class inherits from the WebControl class, by overriding the CreateChildControls method, you can instantiate SubMenuTemplate and MenuItemTemplate instances, and add them to the Controls collection. An instance of the SubMenuItemTemplate class corresponds with a menu item that contains sub menu items. These sub menu items are instances of the MenuItemTemplate class. By setting the Text, Description and ImageUrl properties of these classes, you can specify how the menu items will be rendered in the SharePoint UI. The ClientOnClickNavigateUrl of the MenuItemTemplate class specifies the URL for the menu item itself.
namespace DemoCustomAction
{
public class ListSettingsMenu: System.Web.UI.WebControls.WebControl
{
protected override void CreateChildControls()
{
SubMenuTemplate listSettings = new SubMenuTemplate();
listSettings.Text = "List Settings";
listSettings.Description = "Manage settings for lists on this site";
listSettings.ImageUrl = "/_layouts/images/lg_ICASCX.gif";
foreach (SPList list in SPContext.Current.Web.Lists)
{
if (!list.Hidden)
{
MenuItemTemplate listItem = new MenuItemTemplate();
listItem.Text = list.Title;
listItem.Description = string.Format(
"Manage settings for {0}", list.Title);
listItem.ImageUrl = list.ImageUrl;
string url = string.Format(
"{0}/_layouts/listedit.aspx?List={{{1}}}",
SPContext.Current.Web.Url, list.ID.ToString());
listItem.ClientOnClickNavigateUrl = url;
listSettings.Controls.Add(listItem);
}
}
this.Controls.Add(listSettings);
}
}
}
To deploy all of this first of all the assembly (DLL) that contains the ListSettingsMenu should be built and copied either to the Global Assembly Cache or the BIN folder of the SharePoint site where you’d like to use it. Secondly the feature should be installed by copying the feature files and running STSADM -o installfeature -n featurename. Finally a SafeControl element must be added to the web.config, so the ListSettingsMenu control is marked as safe. If you forget the last step, you won’t get an error, but the extra menu item won’t be rendered. Here is a screenshot of the result:
The only caveat for this technique seems to be that you can’t use it to add a hierarchical menu in a EditControlBlock (ECB) CustomAction. The menu items of the ECB are rendered using Javascript. If you want to see a full blown example of what you can accomplish, check out the latest addition to the SmartTools project: the Enhanced Site Actions menu.
Check this link http://www.chandima.net/Blog/archive/2008/08/09/how-do-i-list-all-my-sharepoint-sites-in-the-site-gallery.aspx for step by step instructions for configuring Site Directories.
Many clients ask whether they should be using Windows SharePoint Services 3.0 (WSS 3.0) or SharePoint Server 2007. Here is a high level list that I use to help them make this decision.
A high level question to answer is: "Is the organization serious about using SharePoint technologies as part of the tool set that is provided to the end user community." In almost every case where the organization answers "yes" they end up selecting the SP Server 2007 product.
Questions to consider:
- Is there budget for the project. WSS 3.0 is free, and no CALs are required, while SP Server 2007 costs money per server, typically uses SQL 2005 servers to store the data, and the CALs cost money. So there is a big delta in cost between the two. The Server version of the product can be evaluated before the commitment is made.
- Are My Sites needed? They're only available in the SP Server 2007.
- Is a Site Directory needed? The Site Directory feature is only available in the Server 2007 product and can be very helpful if a large number of sites will be created.
- Are user profiles needed? the Server version of the product can connect to AD and pull in user information which is then stored in the profiles db.> Is there a need to search and index content sources outside of the SharePoint content dbs? If so SP Server 2007 is needed and it can index file shares, web sites, Exchange Public Folders and other sources out of the box.
- Will the organization be using workflows for production processes? WSS 3.0 is very limited in out of the box workflows, while SP Server 2007 offers more flexibility with Approval, Collect Feedback, Collect Signatures and Disposition Approval workflows.
- Is integration with MS Information Rights Management (IRM) needed? If so, you need the SP Server 2007 product.
- Are retention and auditing policies needed? If so, you need the SP Server 2007 product.
- Will the more advanced branding and publishing tools be needed? SP Server 2007 provides master pages and page layouts that can be used to brand the look and feel of the top-level and subsites.
- Are policies, auditing and compliance features needed? SP Server 2007 allows for the creation of document retention and expiration policies, workflow processes to define expiration, tacking and auditing and other tools.
- Are browser-based forms required? If the Enterprise features are enabled with SP Server 2007, browser based forms can be published (so InfoPath is NOT required to fill out a form).
- Will the organization be using Excel Services? This feature is only available in SP Server 2007.
- Is the Business Data Catalog required? The Business Data Catalog allows SP to mine data from external databases via application definition files. A number of dedicated web parts then enable SP Server 2007 to display this data to form advanced dashboards.
- Is Single Sign-On of interest? Again, this is only available with SP Server 2007.
