学习自定义moss菜单

最近觉得可以自定义moss菜单很有意思,上网一看,相关文档还真是不少。有谈论“网站操作”部分添加的,有“文档库”操作下面添加的,还有对于相关文档的。我呢,在这里引用一下前辈们的成果,也做了一下自定义moss菜单的展示。(我这里主要是介绍对于文档库和列表库的,

参考源文档 <http://hgm654.blog.51cto.com/368545/73600> )

测试效果如下图:

image

image

首先定义一个feature.xml,如下:

<?xml version="1.0" encoding="utf-8" ?>

<Feature Id="CFEC088A-A7C9-4de6-961B-964B2AAFBBB4" Title="myaction" Description="my custom action"

               Scope="Web" Hidden="False" ImageUrl="menuprofile.gif" DefaultResourceFile="customDocumentLibrary"

              xmlns="http://schemas.microsoft.com/sharepoint/">

      <ElementManifests>

              <ElementManifest Location="elements.xml"></ElementManifest>

     </ElementManifests>

</Feature>

然后定义一个elements.xml,如下:

 

<?xml version="1.0" encoding="utf-8" ?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">

     <!--文档库新建菜单下-->

      <CustomAction Id="NewActionDocLib" GroupId="NewMenu" RegistrationType="List" RegistrationId="101" Rights="ManagePermissions"

                               Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="我的新建文档"

                              Description="my Newactions" ImageUrl="/_layouts/images/ACL16.GIF">

            <UrlAction Url="/_layouts/litwarefeaturelab.aspx?command=NewDocCommand"></UrlAction>

    </CustomAction>

    <!--列表库的新建菜单下-->

   <CustomAction Id="NewActionList" GroupId="NewMenu" RegistrationType="List" RegistrationId="100" Rights="ManagePermissions"

                              Location="Microsoft.SharePoint.StandardMenu" Sequence="1000" Title="我的新建列表"

                              Description="myNewactions"  ImageUrl="/_layouts/images/ACL16.GIF">

          <UrlAction Url="/_layouts/litwarefeaturelab.aspx?command=DocLibCommand"></UrlAction>

</CustomAction>

</Elements>

其实上面对于文档库和列表库的操作唯一的不同点就是RegistrationId,对于文档库是101,列表库是100,学习中,正好碰到一个老外总结的这个部分,和大家分享一下(http://datacogs.com/datablogs/archive/2008/03/26/913.aspx)

InvalidType = -1

GenericList = 100

DocumentLibrary = 101

Survey = 102

Links = 103

Announcements = 104

Contacts = 105

Events = 106

Tasks = 107

DiscussionBoard = 108

PictureLibrary = 109

DataSources = 110

WebTemplateCatalog = 111

UserInformation = 112

WebPartCatalog = 113

ListTemplateCatalog = 114

XMLForm = 115

MasterPageCatalog = 116

NoCodeWorkflows = 117

WorkflowProcess = 118

WebPageLibrary = 119

CustomGrid = 120

DataConnectionLibrary = 130

WorkflowHistory = 140

GanttTasks = 150

Meetings = 200

Agenda = 201

MeetingUser = 202

Decision = 204

MeetingObjective = 207

TextBox = 210

ThingsToBring = 211

HomePageLibrary = 212

Posts = 301

Comments = 302

Categories = 303

Pages = 850 (thanks to Anders Jacobsen for this one)

IssueTracking = 1100

AdminTasks = 1200

转载于:https://www.cnblogs.com/fanwenxuan/archive/2008/06/19/1226103.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值