<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="COB.SharePoint.Ribbon.CustomTab"
Location="CommandUI.Ribbon" RegistrationType="List" RegistrationId="101">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Tabs._children">
<Tab Id="COB.SharePoint.Ribbon.CustomTab" Title="Chris's custom tab" Description="Groups and controls will go in here" Sequence="501">
<Scaling Id="COB.SharePoint.Ribbon.CustomTab.Scaling">
<MaxSize Id="COB.SharePoint.Ribbon.CustomTab.NotificationGroup.MaxSize"
GroupId="COB.SharePoint.Ribbon.CustomTab.NotificationGroup"
Size="OneLarge"/>
<Scale Id="COB.SharePoint.Ribbon.CustomTab.NotificationGroup.Scaling.CustomTabScaling"
GroupId="COB.SharePoint.Ribbon.CustomTab.NotificationGroup"
Size="OneLarge" />
<MaxSize Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup.MaxSize"
GroupId="COB.SharePoint.Ribbon.CustomTab.StatusGroup"
Size="TwoMedium"/>
<Scale Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup.Scaling.CustomTabScaling"
GroupId="COB.SharePoint.Ribbon.CustomTab.StatusGroup"
Size="TwoMedium" />
<MaxSize Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup.MaxSize"
GroupId="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup"
Size="TwoLarge"/>
<Scale Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup.Scaling.CustomTabScaling"
GroupId="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup"
Size="TwoLarge" />
</Scaling>
<Groups Id="COB.SharePoint.Ribbon.CustomTab.Groups">
<Group
Id="COB.SharePoint.Ribbon.CustomTab.NotificationGroup"
Description="Contains notification items"
Title="Notification messages"
Sequence="52"
Template="Ribbon.Templates.OneLargeExample">
<Controls Id="COB.SharePoint.Ribbon.CustomTab.NotificationGroup.Controls">
<Button
Id="COB.SharePoint.Ribbon.CustomTab.NotificationGroup.Notify"
Command="COB.Command.Notify"
Sequence="15" Image16by16="/_layouts/images/NoteBoard_16x16.png" Image32by32="/_layouts/images/NoteBoard_32x32.png"
Description="Uses the notification area to display a message."
LabelText="Notify hello"
TemplateAlias="cust1"/>
</Controls>
</Group>
<Group
Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup"
Description="Contains 'add status' items"
Title="Add status messages"
Sequence="49"
Template="Ribbon.Templates.TwoMediumExample">
<Controls Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup.Controls">
<Button
Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup.AddStatusInfo"
Command="COB.Command.AddStatusInfo"
Sequence="17" Image16by16="/_layouts/images/info16by16.gif" Image32by32="/_layouts/images/info16by16.gif"
Description="Uses the status bar to display an info message."
LabelText="Info status"
TemplateAlias="cust2"/>
<Button
Id="COB.SharePoint.Ribbon.CustomTab.StatusGroup.AddStatusWarning"
Command="COB.Command.AddStatusWarning"
Sequence="17" Image16by16="/_layouts/images/warning16by16.gif" Image32by32="/_layouts/images/warning32by32.gif"
Description="Uses the status bar to display a warning message."
LabelText="Warning status"
TemplateAlias="cust3"/>
</Controls>
</Group>
<Group
Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup"
Description="Contains 'remove status' items"
Title="Remove status messages"
Sequence="52"
Template="Ribbon.Templates.TwoLargeExample">
<Controls Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup.Controls">
<Button
Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup.RemoveLastStatusButton"
Command="COB.Command.RemoveLastStatus"
Sequence="15" Image16by16="/_layouts/images/warning16by16.gif" Image32by32="/_layouts/images/CRIT_32.GIF"
Description="Removes the last message from the status bar."
LabelText="Remove last status message"
TemplateAlias="cust4"/>
<Button
Id="COB.SharePoint.Ribbon.CustomTab.RemoveStatusGroup.RemoveAllStatusButton"
Command="COB.Command.RemoveAllStatus"
Sequence="15" Image16by16="/_layouts/images/warning16by16.gif" Image32by32="/_layouts/images/CRIT_32.GIF"
Description="Removes all messages from the status bar."
LabelText="Remove all status messages"
TemplateAlias="cust5"/>
</Controls>
</Group>
</Groups>
</Tab>
</CommandUIDefinition>
<CommandUIDefinition Location="Ribbon.Templates._children">
<GroupTemplate Id="Ribbon.Templates.OneLargeExample">
<Layout Title="OneLarge" LayoutTitle="OneLarge">
<Section Alignment="Top" Type="OneRow">
<Row>
<ControlRef DisplayMode="Large" TemplateAlias="cust1" />
</Row>
</Section>
</Layout>
</GroupTemplate>
</CommandUIDefinition>
<CommandUIDefinition Location="Ribbon.Templates._children">
<GroupTemplate Id="Ribbon.Templates.TwoMediumExample">
<Layout Title="TwoMedium" LayoutTitle="TwoMedium">
<Section Alignment="Top" Type="TwoRow">
<Row>
<ControlRef DisplayMode="Medium" TemplateAlias="cust2" />
</Row>
<Row>
<ControlRef DisplayMode="Medium" TemplateAlias="cust3" />
</Row>
</Section>
</Layout>
</GroupTemplate>
</CommandUIDefinition>
<CommandUIDefinition Location="Ribbon.Templates._children">
<GroupTemplate Id="Ribbon.Templates.TwoLargeExample">
<Layout Title="TwoLarge" LayoutTitle="TwoLarge">
<Section Alignment="Top" Type="OneRow">
<Row>
<ControlRef DisplayMode="Large" TemplateAlias="cust4" />
<ControlRef DisplayMode="Large" TemplateAlias="cust5" />
</Row>
</Section>
</Layout>
</GroupTemplate>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="COB.Command.Notify"
CommandAction="javascript:
var notificationId = SP.UI.Notify.addNotification('Hello from the notification area');
" />
<CommandUIHandler
Command="COB.Command.AddStatusInfo"
CommandAction="javascript:
var statusId = SP.UI.Status.addStatus('Quite important status message');
latestId = statusId;
enableRemoveStatusButton();
" />
<CommandUIHandler
Command="COB.Command.AddStatusWarning"
CommandAction="javascript:
var statusId = SP.UI.Status.addStatus('Very important status message');
SP.UI.Status.setStatusPriColor(statusId, 'red');
latestId = statusId;
enableRemoveStatusButton();
" />
<CommandUIHandler
Command="COB.Command.RemoveLastStatus" EnabledScript="javascript:enableRemoveStatusButton();"
CommandAction="javascript:
SP.UI.Status.removeStatus(latestId);
latestId = '';
enableRemoveStatusButton();" />
<CommandUIHandler
Command="COB.Command.RemoveAllStatus" EnabledScript="javascript:enableRemoveStatusButton();"
CommandAction="javascript:
SP.UI.Status.removeAllStatus(true);
latestId = '';
enableRemoveStatusButton();" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="COB.Command.RemoveLastStatus.CheckEnable" Location="ScriptLink"
ScriptBlock="
var latestId = '';
function enableRemoveStatusButton()
{
if (latestId == '')
{
return false;
}
else
{
return true;
}
}"
/>
</Elements>