Add link from Template to DocumentType into toolbar
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
//macro split button
|
||||
jQuery('#sbMacro').splitbutton({menu:'#macroMenu'});
|
||||
|
||||
@@ -98,6 +100,9 @@
|
||||
});
|
||||
|
||||
}
|
||||
//document types split button
|
||||
jQuery('#sbDocType').splitbutton({menu:'#docTypeMenu'});
|
||||
jQuery("#splitButtonDocType").appendTo("#splitButtonDocTypePlaceHolder");
|
||||
|
||||
//razor macro split button
|
||||
jQuery('#sb').splitbutton({menu:'#codeTemplateMenu'});
|
||||
@@ -110,6 +115,8 @@
|
||||
insertCodeBlockFromTemplate(jQuery(this).attr("rel"));
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function doSubmit() {
|
||||
@@ -291,6 +298,29 @@
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<div id="splitButtonDocType" style="display: inline; height: 23px; vertical-align: top;">
|
||||
<a href="#" onclick="return false;" id="sbDocType" class="sbLink">
|
||||
<img alt="Document Types that Use this Template" src="../images/editor/documentType.gif" title="Document Types that Use this Template"
|
||||
style="vertical-align: top;">
|
||||
</a>
|
||||
</div>
|
||||
<div id="docTypeMenu" style="width: 285px">
|
||||
<div class="documenttype">
|
||||
<strong>Document Types that Use this Template</strong>
|
||||
</div>
|
||||
<div class="documenttype" runat="server" id="uxNoDocumentTypes">
|
||||
None
|
||||
</div>
|
||||
<asp:Repeater ID="splitButtonDocumentTypesRepeater" runat="server">
|
||||
<ItemTemplate>
|
||||
<div class="documenttype">
|
||||
<%# DataBinder.Eval(Container, "DataItem.Text")%>
|
||||
|
||||
<%#umbraco.cms.helpers.DeepLink.GetAnchor(umbraco.cms.helpers.DeepLinkType.DocumentType, string.Format("{0}",DataBinder.Eval(Container,"DataItem.Id")), true)%>
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
@@ -11,6 +11,7 @@ using umbraco.cms.presentation.Trees;
|
||||
using umbraco.DataLayer;
|
||||
using umbraco.IO;
|
||||
using umbraco.uicontrols;
|
||||
using System.Linq;
|
||||
|
||||
namespace umbraco.cms.presentation.settings
|
||||
{
|
||||
@@ -77,6 +78,7 @@ namespace umbraco.cms.presentation.settings
|
||||
|
||||
LoadScriptingTemplates();
|
||||
LoadMacros();
|
||||
LoadDocTypes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +131,6 @@ namespace umbraco.cms.presentation.settings
|
||||
|
||||
Panel1.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40);
|
||||
|
||||
|
||||
if (UmbracoSettings.UseAspNetMasterPages)
|
||||
{
|
||||
Panel1.Menu.InsertSplitter();
|
||||
@@ -169,6 +170,8 @@ namespace umbraco.cms.presentation.settings
|
||||
"','canvas')";
|
||||
}
|
||||
|
||||
Panel1.Menu.InsertSplitter();
|
||||
Panel1.Menu.NewElement("div", "splitButtonDocTypePlaceHolder", "sbPlaceHolder", 40);
|
||||
|
||||
// Help
|
||||
Panel1.Menu.InsertSplitter();
|
||||
@@ -220,6 +223,14 @@ namespace umbraco.cms.presentation.settings
|
||||
macroRenderings.Close();
|
||||
}
|
||||
|
||||
private void LoadDocTypes()
|
||||
{
|
||||
var data = _template.GetDocumentTypes();
|
||||
splitButtonDocumentTypesRepeater.DataSource = data;
|
||||
splitButtonDocumentTypesRepeater.DataBind();
|
||||
uxNoDocumentTypes.Visible = !data.Any();
|
||||
}
|
||||
|
||||
public string DoesMacroHaveSettings(string macroId)
|
||||
{
|
||||
if (
|
||||
|
||||
@@ -137,5 +137,23 @@ namespace umbraco.cms.presentation.settings {
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rpt_macros;
|
||||
|
||||
/// <summary>
|
||||
/// uxNoDocumentTypes control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlGenericControl uxNoDocumentTypes;
|
||||
|
||||
/// <summary>
|
||||
/// splitButtonDocumentTypesRepeater control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater splitButtonDocumentTypesRepeater;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user