Add WebCms

This commit is contained in:
2016-11-07 12:56:17 -05:00
parent dfe92218f4
commit 15911f33c0
2750 changed files with 365672 additions and 133 deletions
+14
View File
@@ -0,0 +1,14 @@
<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %>
<%@ Page Language="c#" Codebehind="EditUser.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Users.EditUser" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Import Namespace="umbraco.cms.presentation.Trees" %>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc1:TabView ID="UserTabs" Width="400px" Visible="true" runat="server" />
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>
+27
View File
@@ -0,0 +1,27 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditUserType.aspx.cs" MasterPageFile="../masterpages/umbracoPage.Master"
Inherits="umbraco.cms.presentation.user.EditUserType" %>
<%@ Register TagPrefix="cc2" Namespace="umbraco.uicontrols" Assembly="controls" %>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc2:UmbracoPanel ID="pnlUmbraco" runat="server" hasMenu="true" Width="608px">
<cc2:Pane ID="pnl1" Style="padding: 10px; text-align: left;" runat="server">
<asp:HiddenField runat="server" ID="hidUserTypeID" />
<cc2:PropertyPanel ID="pp_name" runat="server">
<asp:TextBox runat="server" ID="txtUserTypeName" MaxLength="30"></asp:TextBox>
</cc2:PropertyPanel>
<cc2:PropertyPanel ID="pp_alias" runat="server">
<asp:Label runat="server" ID="lblUserTypeAlias"></asp:Label>
</cc2:PropertyPanel>
</cc2:Pane>
<cc2:Pane ID="pnl2" Style="padding: 10px; text-align: left;" runat="server">
<cc2:PropertyPanel ID="pp_rights" runat="server">
<asp:CheckBoxList ID="cbl_rights" runat="server" />
</cc2:PropertyPanel>
</cc2:Pane>
</cc2:UmbracoPanel>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>
+35
View File
@@ -0,0 +1,35 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="NodePermissions.ascx.cs" Inherits="umbraco.cms.presentation.user.NodePermissions" %>
<p class="umb-abstract">
<%=umbraco.ui.Text("user", "permissionSelectedPages")%>
<br/>
<asp:Literal runat="server" ID="lt_names" />
</p>
<asp:Panel ID="pnlReplaceChildren" runat="server">
<p>
<input type="checkbox" name="chkChildPermissions" id="chkChildPermissions" />
<strong>
<label for="chkChildPermissions" class="checkbox inline">
<%= umbraco.ui.Text("user", "permissionReplaceChildren")%>
</label>
</strong>
</p>
</asp:Panel>
<asp:Label runat="server" ID="lblMessage" />
<asp:Repeater runat="server" ID="rptPermissionsList">
<HeaderTemplate>
<ul id="nodepermissionsList">
</HeaderTemplate>
<ItemTemplate>
<li>
<input type="checkbox" name='<%#"chkPermission" + DataBinder.Eval(Container, "ItemIndex").ToString() %>' id='<%#"chkPermission" + DataBinder.Eval(Container, "ItemIndex").ToString() %>' value='<%#((AssignedPermission)Container.DataItem).Permission.Letter %>' <%#(((AssignedPermission)Container.DataItem).HasPermission ? "checked='true'" : "") %> />
<label for='<%#"chkPermission" + DataBinder.Eval(Container, "ItemIndex").ToString() %>' class='checkbox inline <%#(((AssignedPermission)Container.DataItem).HasPermission ? "activePermission" : "") %>'>
<%# umbraco.ui.GetText(((AssignedPermission)Container.DataItem).Permission.Alias) %>
</label>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
@@ -0,0 +1,47 @@
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../masterpages/umbracoPage.Master" CodeBehind="PermissionEditor.aspx.cs" Inherits="umbraco.cms.presentation.user.PermissionEditor" %>
<%@ Register Src="../controls/Tree/TreeControl.ascx" TagName="TreeControl" TagPrefix="umbraco" %>
<%@ Register Src="NodePermissions.ascx" TagName="NodePermissions" TagPrefix="user" %>
<%@ Register TagPrefix="ui" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="css/permissionsEditor.css" PathNameAlias="UmbracoRoot" />
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="css/umbracoGui.css" PathNameAlias="UmbracoRoot" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="PermissionsEditor.js" />
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<ui:UmbracoPanel ID="pnlUmbraco" runat="server" hasMenu="true" Text="Content Tree Permissions" Width="608px">
<ui:Pane ID="pnl1" Style="padding: 10px; text-align: left;" runat="server" Text="Select pages to modify their permissions">
<div id="treeContainer">
<umbraco:TreeControl runat="server" ID="JTree" App="content"
Mode="Checkbox" CssClass="clearfix"></umbraco:TreeControl>
</div>
<div id="permissionsPanel" style="margin-top: -35px">
<user:NodePermissions ID="nodePermissions" runat="server" />
</div>
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#<%=JTree.ClientID%>").PermissionsEditor({
userId: <%=Request.QueryString["id"] %>,
pPanelSelector: "#permissionsPanel",
replacePChkBoxSelector: "#chkChildPermissions"});
});
function SavePermissions() {
jQuery("#treeContainer .umbTree").PermissionsEditorAPI().beginSavePermissions();
}
</script>
</ui:Pane>
</ui:UmbracoPanel>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>
+144
View File
@@ -0,0 +1,144 @@
/// <reference path="/umbraco_client/Application/NamespaceManager.js" />
/// <reference path="/umbraco_client/ui/jquery.js" />
/// <reference path="PermissionsHandler.asmx" />
/// <reference name="MicrosoftAjax.js"/>
Umbraco.Sys.registerNamespace("Umbraco.Controls");
(function($) {
$.fn.PermissionsEditor = function(opts) {
return this.each(function() {
var conf = $.extend({
userId: -1,
pPanelSelector: "",
replacePChkBoxSelector: ""
}, opts);
new Umbraco.Controls.PermissionsEditor().init($(this), conf.userId, $(conf.pPanelSelector), conf.replacePChkBoxSelector);
});
};
$.fn.PermissionsEditorAPI = function() {
/// <summary>exposes the Permissions Editor API for the selected object</summary>
return $(this).data("PermissionsEditor") == null ? null : $(this).data("PermissionsEditor");
}
Umbraco.Controls.PermissionsEditor = function() {
/// <summary>
/// A class to perform the AJAX callback methods for the PermissionsEditor
/// </summary>
return {
//private members
_userID: -1,
_loadingContent: '<div align="center"><br/><br/><br/><br/><br/><br/><br/><img src="../../umbraco_client/images/progressBar.gif" /></div>',
_pPanel: null,
_tree: null,
_selectedNodes: new Array(),
_chkReplaceSelector: null,
init: function(tree, uId, pPanel, chkReplaceSelector) {
///<summary>constructor function</summary>
this._userID = parseInt(uId);
this._pPanel = pPanel;
this._tree = tree;
this._chkReplaceSelector = chkReplaceSelector;
//store the api object
tree.data("PermissionsEditor", this);
//bind the nodeClicked event
var _this = this;
var api = this._tree.UmbracoTreeAPI();
api.addEventHandler("nodeClicked", function(e, n) { _this.treeNodeChecked(e, n) });
},
//public methods
treeNodeChecked: function(e, data) {
var vals = "";
var nodeId = $(data).attr("id");
this._tree.find("li a.checked").each(function() {
var cNodeId = $(this).parent("li").attr("id");
//if the check box is not the one thats just been checked, add it
if (cNodeId != nodeId && parseInt(cNodeId) > 0) {
vals += cNodeId + ",";
}
});
this._selectedNodes = vals.split(",");
this._selectedNodes.pop(); //remove the last one as it will be empty
//add the one that was just checked to the end of the array if
if ($(data).children("a").hasClass("checked")) {
this._selectedNodes.push(nodeId);
}
if (this._selectedNodes.length > 0) {
this._beginShowNodePermissions(this._selectedNodes.join(","));
this._pPanel.show();
}
else {
this._pPanel.hide();
}
},
setReplaceChild: function(doReplace) {
alert(doReplace);
this._replaceChildren = doReplace;
},
beginSavePermissions: function() {
//ensure that there are nodes selected to save permissions against
if (this._selectedNodes.length == 0) {
alert("No nodes have been selected");
return;
}
else if (!confirm("Permissions will be changed for nodes: " + this._selectedNodes.join(",") + ". Are you sure?")) {
return;
}
//get the list of checked permissions
var checkedPermissions = "";
this._pPanel.find("input:checked").each(function() {
checkedPermissions += $(this).val();
});
var replaceChildren = $(this._chkReplaceSelector).is(":checked");
this._setUpdateProgress();
var _this = this;
setTimeout(function() { _this._savePermissions(_this._selectedNodes.join(","), checkedPermissions, replaceChildren); }, 10);
},
//private methods
_addItemToSelectedCollection: function(chkbox) {
if (chkbox.checked)
this._selectedNodes.push(chkbox.value);
else {
var joined = this._selectedNodes.join(',');
joined = joined.replace(chkbox.value, '');
this._selectedNodes = joined.split(',');
this._selectedNodes = ContentTreeControl_ReBuildArray(contentTreeControl_selected);
}
},
_beginShowNodePermissions: function(selectedIDs) {
this._setUpdateProgress();
var _this = this;
setTimeout(function() { _this._showNodePermissions(selectedIDs); }, 10);
//setTimeout("PermissionsEditor._showNodePermissions('" + selectedIDs + "');", 10);
},
_showNodePermissions: function(selectedIDs) {
var _this = this;
umbraco.cms.presentation.user.PermissionsHandler.GetNodePermissions(this._userID, selectedIDs, function(r) { _this._showNodePermissionsCallback(r); });
},
_showNodePermissionsCallback: function(result) {
this._pPanel.html(result);
},
_savePermissions: function(nodeIDs, selectedPermissions, replaceChildren) {
var _this = this;
umbraco.cms.presentation.user.PermissionsHandler.SaveNodePermissions(this._userID, nodeIDs, selectedPermissions, replaceChildren, function(r) { _this._savePermissionsHandler(r) });
},
_savePermissionsHandler: function(result) {
if (UmbClientMgr.mainWindow().UmbSpeechBubble != null)
UmbClientMgr.mainWindow().UmbSpeechBubble.ShowMessage("save", "Saved", "Permissions Saved");
this._pPanel.html(result);
},
_setUpdateProgress: function() {
this._pPanel.html(this._loadingContent);
}
}
}
})(jQuery);
@@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="PermissionsHandler.asmx.cs" Class="umbraco.cms.presentation.user.PermissionsHandler" %>