SharePoint 2010 Ribbon的实现
转:http://blog.csdn.net/wang4237/article/details/5306335
if (current !=
null)
{
current.CommandUIVisible
= true;
current.MakeTabAvailable("Ribbon.Read");
current.MakeTabAvailable("Ribbon.WebApp");
current.InitialTabId
= "Ribbon.WebApp";
current.Minimized
= false;
SPRibbonScriptManager manager = new
SPRibbonScriptManager();
List<IRibbonCommand>
commands = new List<IRibbonCommand>();
bool admin = base.GlobalAdmin.IsCurrentUserMachineAdmin();
commands.Add(new
SPRibbonCommand("WebAppTab"));
......
ULSITv: ;
//SP.UI.Admin.ServiceApplicationPageComponent.initializeBase(this);
};
return true;
};
SP.UI.Admin.TestPageComponent.TestNavigate = function(a, b, c) {
var b = SP.UI.$create_DialogOptions();
b.url = a; b.dialogReturnValueCallback = SP.UI.Admin.TestPageComponent.$5_1;
SP.UI.ModalDialog.showModalDialog(b)
};
getFocusedCommands: function() {
ULSITv: ; return []
},
getGlobalCommands: function() {
ULSITv: ;
return getGlobalCommands()
},
isFocusable: function() {
ULSITv: ;
return true
},
receiveFocus: function() {
ULSITv: ;
return true
},
yieldFocus: function() {
ULSITv: ;
return true
},
canHandleCommand: function(a) {
ULSITv: ;
return commandEnabled(a)
},
handleCommand: function(b, a, c) {
ULSITv: ;
return handleCommand(b, a, c)
},
getId: function() {
ULSITv: ;
return "TestPageComponent"
},
init: function() {
ULSITv: ;
},
};
{
public TestCommand(string commandId, string target, TestNavigateOptions options, bool admin)
: base(commandId, null, null)
{
base.HandlerStatement = string.Format(CultureInfo.InvariantCulture, "SP.UI.Admin.TestPageComponent.TestNavigate('{0}', {1}, {2})", new object[] { SPHttpUtility.EcmaScriptStringLiteralEncode(target), "true", "true");
base.EnabledStatement = "SP.UI.Admin.TestPageComponent.TestIsEnabled(0)";
}
}
{
base.OnPreRender(e);
if (current != null)
{
current.CommandUIVisible = true;
current.MakeTabAvailable("Ribbon.Read");
current.MakeTabAvailable("Ribbon.Test");
current.InitialTabId = "Ribbon.Test";
current.Minimized = false;
SPRibbonScriptManager manager = new SPRibbonScriptManager();
List<IRibbonCommand> commands = new List<IRibbonCommand>();
bool admin = base.GlobalAdmin.IsCurrentUserMachineAdmin();
commands.Add(new SPRibbonCommand("TestG1Group"));
commands.Add(new TestCommand("Test_New", "test.aspx", TestNavigateOptions.AppendSelectionIdParameter, admin));
commands.Add(new TestCommand("Test_Extend", "extendwebfarm.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_DeleteTop", "DeleteWebApplication.aspx?WebApplicationId=", TestNavigateOptions.DisableForCentralAdmin | TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Delete", "DeleteWebApplication.aspx?WebApplicationId=", TestNavigateOptions.DisableForCentralAdmin | TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog | TestNavigateOptions.Privileged,
admin));
commands.Add(new TestCommand("Test_DeleteIIS", "unextendvs.aspx?WebApplicationId=", TestNavigateOptions.DisableForCentralAdmin | TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog | TestNavigateOptions.Privileged,
admin));
commands.Add(new SPRibbonCommand("TestG2Group"));
commands.Add(new TestCommand("Test_SettingsTop", "vsgeneralsettings.aspx?type=gen&WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Settings", "vsgeneralsettings.aspx?type=gen&WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_ResourceThrottling", "vsgeneralsettings.aspx?type=res&WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Workflow", "workflowAdmin.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Outgoing", "VSEmail.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_OutgoingXms", "VSXms.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Features", "ManageWebAppFeatures.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Paths", "scprefix.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_Connections", "ApplicationAssociationsDialog.aspx?Editable=false&ApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
commands.Add(new TestCommand("Test_SharePointDesigner", "SharePointDesignerAdmin.aspx?WebApplicationId=", TestNavigateOptions.AppendSelectionIdParameter | TestNavigateOptions.ModalDialog, admin));
manager.RegisterCommandEnabledFunction(this, "commandEnabled", commands);
manager.RegisterHandleCommandFunction(this, "handleCommand", commands);
MethodInfo mi = type.GetMethod("RegisterPageComponent", BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(manager, new object[] { this, "SP.UI.Admin.js", "/_layouts/SP.UI.Admin.js", "SP.UI.Admin.TestPageComponent" });
}
}
?>
return true;
}
function TestNavigate(a, b, c) {
var b = SP.UI.$create_DialogOptions();
b.url = a;
SP.UI.ModalDialog.showModalDialog(b)
}
SharePoint 2010 Ribbon的实现的更多相关文章
- SharePoint 2010 Ribbon with wrong style in Chrome and Safari
When we add custom ribbon to SharePoint 2010, it may display well in IE but not in Chrome and Safari ...
- How to: Hide the Ribbon in SharePoint 2010
转:http://blogs.msdn.com/b/sharepointdev/archive/2012/04/30/how-to-hide-the-ribbon-in-sharepoint-2010 ...
- [转]SharePoint 2010 Download as Zip File Custom Ribbon Action
在SharePoint 2010文档库中,结合单选框,在Ribbon中提供了批量处理文档的功能,比如,批量删除.批量签出.批量签入等,但是,很遗憾,没有提供批量下载,默认的只能一个个下载,当选择多个文 ...
- Sharepoint 2010 根据用户权限隐藏Ribbon菜单(利用css)
本文介绍的是根据用户权限隐藏整个Ribbon菜单项. 操作环境:Windows Server 2008 r2+ SharePoint 2010 1.关于SharePoint 权限详细请参考:http ...
- sharepoint 2010 显示和隐藏Ribbon区域条
在sharepoint 2010的页面中,我们在页面的最上方,有一条深灰色的Ribbon工具栏,如下图,这里可以通过下面的脚本,做一些脚本,来控制它的隐藏和显示. 最后把这些脚本,放在v4.maste ...
- sharepoint 2010 怎样在Ribbon区加入功能button
继续前面的一篇博客,sharepoint 2010 怎样在列表中加入功能菜单操作项.这次主要是记录下,在Ribbon区域加入功能button.比如加入收藏button.例如以下图所看到的: 1. 还是 ...
- SharePoint 2010 master page 控件介绍(2):ribbon (一同事读听着像泪奔)
转:http://blog.csdn.net/lgm97/article/details/6409208 <!-- ===== 开始Ribbon ======================= ...
- Upgrade from SharePoint 2010 to SharePoint 2016
[转]http://nikcharlebois.com/upgrade-from-sharepoint-2010-to-sharepoint-2016/ In this blog, I will go ...
- 使用SharePoint 2010 母版页
SharePoint 2010母版页所用的还是ASP.NET 2.0中的技术.通过该功能,实现了页面框架布局与实际内容的分离.虽然在本质上自定义母版页的过程和以前版本的SharePoint大致相同,但 ...
随机推荐
- SQL Server2008数据库导入导出兼容性处理
使用场景:SQL Server 的高版本数据库恢复到低版本则可能会有兼容性问题,为了解决此类问题进行数据库脚本模式处理,数据库结构,及数据存储更换版本等. 1. 选择要导出的数据库,右键任务,生成脚 ...
- PHP常见算法-面试篇(2)
1.顺序查找 思路分析: 从数组的第一个元素开始一个一个向下查找,如果有和目标一致的元素,查找成功:如果到最后一个元素仍没有目标元素,则查找失败. 代码实现: <?php function se ...
- 挑战Python-20160826
给你一字典a,如a={1:1,2:2,3:3},输出字典a的key,以','链接,如‘1,2,3'.
- Oracle 事务相关的一些测试
1.sqlplus 客户端正常退出 SQL> desc t; 名称 是否为空? 类型 ----------------------------------------- -------- --- ...
- opengl混合效果
效果如下图:
- Static File Middleware
[ASP.NET Core] Static File Middleware 前言 本篇文章介绍ASP.NET Core里,用来处理静态档案的Middleware,为自己留个纪录也希望能帮助到有需要 ...
- python 下载安装及setuptools应用
1.首先下载python安装程序,下载地址:https://www.python.org/download/releases/2.7.8/ 如下图: 因为我的机器是32位的就选择了Windows x8 ...
- ACM-进阶之路
ACM进阶计划 ACM队不是为了一场比赛而存在的,为的是队员的整体提高. 大学期间,ACM队队员必须要学好的课程有: l C/C++两种语言 l 高等数学 l 线性代数 l 数据结构 l 离散数学 l ...
- Computer Vision的尴尬---by林达华
Computer Vision的尴尬---by林达华 Computer Vision是AI的一个非常活跃的领域,每年大会小会不断,发表的文章数以千计(单是CVPR每年就录取300多,各种二流会议每年的 ...
- Design Tutorial: Make It Nondeterministic
Codeforces Round #270:C;http://codeforces.com/contest/472 题意:水题 题解:贪心即可. #include<iostream> #i ...