显示隐藏SiteActions菜单项_第1页
显示隐藏SiteActions菜单项_第2页
显示隐藏SiteActions菜单项_第3页
免费预览已结束,剩余12页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、显示隐藏 Site Actions 菜单项SharePoint 2010 使用“ Site Actions" 菜单替换了原来的MOSS 2007 “ Site Settings”菜单,它默认的子菜单项有很多, 比如“ New Page”,“More Options ”,“View All Site Content 等等,当然我们也可以通过Feature 创建自己的 Site Actions菜单项,这不是我们所有讨论的问题,本文主要讨论如何通 过简单的方式(用户权限 /Javascript 脚本)来显示 /隐藏某些 Site Actions 菜单项。Site Actions 菜单项构成

2、首先我们来了解一下 SharePoint 默认 Site Actions 菜单项, 我们可以通过查看母版页的源代码看到这些菜单项,这里简 单贴一下部分代码:查看 Site Action 代码asp:Content ID="Content1"ContentPlaceHolderID="SPNavigation" runat="server"> sharepoint:uiversionedcontent uiversion="4"runat="server">ContentTemplat

3、e>div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">div id="s4-ribboncont">SharePoint:SPRibbon runat="server" CssFile = ""PlaceholderElementId="RibbonContainer"FixedPositioningEnabled="true"PermissionsString="

4、;EditListItems, AddAndCustomizePages"PermissionMode="Any"ApplyPermissionsToRibbonOnly="false">SharePoint:SPRibbonPeripheralContentrunat="server"Location="TabRowLeft"CssClass="ms-siteactionscontainer s4-notdlg">span class="ms-siteactio

5、nsmenu"id="siteactiontd">SharePoint:SiteActions runat="server" accesskey="" id="SiteActionsMenuMain" PrefixHtml="" SuffixHtml=""MenuNotVisibleHtml=" ">CustomTemplate>SharePoint:FeatureMenuTemplate runat=

6、"server"FeatureScope="Site"Location="Microsoft.SharePoint.StandardMenu"GroupId="SiteActions"UseShortId="true">SharePoint:MenuItemTemplate runat="server"id="MenuItem_EditPage"Text=""Description=HHImageUrl="/_layou

7、ts/images/ActionsEditPage.png" MenuGroupId="100" Sequence="110" ClientOnClickNavigateUrl="javascript:ChangeLayoutMode(false);" />SharePoint:MenuItemTemplate runat="server" id="MenuItem_TakeOffline" Text=""Description=HHImageUrl=&quo

8、t;/_layouts/images/connecttospworkspace32.png"MenuGroupId="100"Sequence="120" />SharePoint:MenuItemTemplaterunat="server" id="MenuItem_CreatePage" Text=""Description=""ImageUrl="/_layouts/images/NewContentPageHH.png"MenuGr

9、oupId="200"Sequence="210"UseShortId="true"ClientOnClickScriptContainingPrefixedUrl="if(LaunchCreateHandler('Page') OpenCreateWebPageDialog('site/_layouts/createwebpage.aspx' ) "PermissionsString="AddListItems, EditListItems"Permission

10、Mode="All" />SharePoint:MenuItemTemplate runat="server"id="MenuItem_CreateDocLib"Text=""Description=""ImageUrl="/_layouts/images/NewDocLibHH.png"MenuGroupId="200"Sequence="220"UseShortId="true"ClientOnClickS

11、criptContainingPrefixedUrl="if(LaunchCreateHandler('DocLib') GoToPage('site/_layouts/new.aspx?FeatureId=00bfea71-e717-4e80-aa17-d0c71b360101&ListTemplate=101') "PermissionsString="ManageLists"PermissionMode="Any"VisibilityFeatureId="00BFEA71

12、-E717-4E80-AA17-D0C71B360101" />SharePoint:MenuItemTemplaterunat="server" id="MenuItem_CreateSite"Text=""Description=""ImageUrl="/_layouts/images/newweb32.png"MenuGroupId="200"Sequence="230"UseShortId="true"Clien

13、tOnClickScriptContainingPrefixedUrl="if(LaunchCreateHandler('Site') STSNavigate('site/_layouts/newsbweb.aspx') "PermissionsString="ManageSubwebs" PermissionMode="Any" /> SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create&quo

14、t; Text=""Description=""MenuGroupId="200"Sequence="240" UseShortId="true"ClientOnClickScriptContainingPrefixedUrl="if (LaunchCreateHandler('All') STSNavigate('site/_layouts/create.aspx') "PermissionsString="ManageLists,

15、 ManageSubwebs" PermissionMode="Any" />SharePoint:MenuItemTemplate runat="server"id="MenuItem_ViewAllSiteContents"Text=""Description=""ImageUrl="/_layouts/images/allcontent32.png"MenuGroupId="300"Sequence="302"Us

16、eShortId="true"ClientOnClickNavigateUrl="site/_layouts/viewlsts.aspx"PermissionsString="ViewFormPages"PermissionMode="Any" />SharePoint:MenuItemTemplaterunat="server" id="MenuItem_EditSite" Text=""Description=""ImageU

17、rl="/_layouts/images/SharePointDesigner32.png"MenuGroupId="300"Sequence="304"UseShortId="true"ClientOnClickScriptContainingPrefixedUrl="EditInSPD('site/', true);"PermissionsString="AddAndCustomizePages"PermissionMode="Any"

18、 />SharePoint:MenuItemTemplaterunat="server"id="MenuItem_SiteWorkflow"Text=""Description=""ImageUrl="/_layouts/images/ManageWorkflow32.png"MenuGroupId="300"Sequence="305"UseShortId="true"ClientOnClickNavigateUrl="

19、;site/_layouts/workflow.aspx"PermissionsString="EditListItems, AddAndCustomizePages"PermissionMode="Any" /> SharePoint:MenuItemTemplate runat="server"id="MenuItem_SitePermissions"Text=""Description=""ImageUrl="/_layouts/images/

20、Permissions32.png"MenuGroupId="300" Sequence="310" UseShortId="true"ClientOnClickNavigateUrl="site/_layouts/user.aspx"PermissionsString="EnumeratePermissions" PermissionMode="Any" />SharePoint:MenuItemTemplate runat="server&quo

21、t; id="MenuItem_Settings" Text="" Description=""ImageUrl="/_layouts/images/settingsIcon.png" MenuGroupId="300" Sequence="320" UseShortId="true"ClientOnClickNavigateUrl="site/_layouts/settings.aspx"PermissionsString="

22、;EnumeratePermissions,ManageWeb,Manag eSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlertsManageLists,ViewUsageData" PermissionMode="Any" /> SharePoint:MenuItemTemplate runat="server"id="MenuItem_CommitNewUI"Text=""Description=""Ima

23、geUrl="/_layouts/images/visualupgradehh.png"MenuGroupId="300" Sequence="330" UseShortId="true"layouts/prjsetng.aspx')"PermissionsString="ManageWeb"PermissionMode="Any"ShowOnlyIfUIVersionConfigurationEnabled="true" />Sh

24、arePoint:FeatureMenuTemplate>CustomTemplate>SharePoint:SiteActions>span>SharePoint:SPRibbonPeripheralContent>SharePoint:SPRibbon>div>div>div id="notificationArea" class="s4-noti">div>SharePoint:DelegateControl runat="server"ControlId="

25、PublishingConsole">SharePoint:DelegateControl>div>WebPartPages:WebPartAdderID="WebPartAdder" runat="server" />div>ContentTemplate>sharepoint:uiversionedcontent>asp:Content>从代码中我们可以看出,Site Actions的菜单项是通过一个个 SharePoint:MenuItemTemplate /> 来是实现的, 而且我们发现 MenuItemTemplate 的两个重要的属性PermissionsString 和 Perm i s s i o n Mode ,通过对这两

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论