Updating code style, removes obsolete files, now we can move the tree to the Translation section

This commit is contained in:
Sebastiaan Janssen
2018-06-13 15:17:31 +02:00
parent 9c33f1b1c9
commit d66e951b68
25 changed files with 315 additions and 611 deletions

View File

@@ -92,12 +92,7 @@
/// alias for the dictionary tree.
/// </summary>
public const string Dictionary = "dictionary";
/// <summary>
/// The dictionary obsolete.
/// </summary>
public const string DictionaryObsolete = "dictionary-obsolete";
public const string Stylesheets = "stylesheets";
/// <summary>
@@ -140,4 +135,4 @@
}
}
}

View File

@@ -3,7 +3,7 @@
* @name umbraco.resources.dictionaryResource
* @description Loads in data for dictionary items
**/
function dictionaryResource($q, $http, umbRequestHelper, umbDataFormatter) {
function dictionaryResource($q, $http, $location, umbRequestHelper, umbDataFormatter) {
/**
* @ngdoc method
@@ -146,12 +146,41 @@ function dictionaryResource($q, $http, umbRequestHelper, umbDataFormatter) {
"Failed to get list");
}
/**
* @ngdoc method
* @name umbraco.resources.dictionaryResource#getSection
* @methodOf umbraco.resources.dictionaryResource
*
* @description
* Gets the current section that the dictionary tree is in (only settings and translation are allowed currently)
*
* ##usage
* <pre>
* var section = dictionaryResource.getSection();
* </pre>
*
* @returns string.
*
**/
function getSection() {
var section = $location.$$path;
if (section.startsWith("/")) {
section = section.substring(1, section.length);
}
var firstSlash = section.indexOf("/");
if (firstSlash !== -1) {
section = section.substring(0, firstSlash);
}
return section;
}
var resource = {
deleteById: deleteById,
create: create,
getById: getById,
save: save,
getList : getList
getList : getList,
getSection: getSection
};
return resource;
@@ -159,4 +188,4 @@ function dictionaryResource($q, $http, umbRequestHelper, umbDataFormatter) {
}
angular.module("umbraco.resources").factory("dictionaryResource", dictionaryResource);
angular.module("umbraco.resources").factory("dictionaryResource", dictionaryResource);

View File

@@ -7,37 +7,38 @@
* The controller for creating dictionary items
*/
function DictionaryCreateController($scope, $location, dictionaryResource, navigationService, notificationsService, formHelper) {
vm = this;
var vm = this;
vm.itemKey = '';
vm.itemKey = "";
function createItem() {
function createItem() {
var node = $scope.dialogOptions.currentNode;
var node = $scope.dialogOptions.currentNode;
dictionaryResource.create(node.id, vm.itemKey).then(function(data) {
navigationService.hideMenu();
dictionaryResource.create(node.id, vm.itemKey).then(function (data) {
navigationService.hideMenu();
// set new item as active in tree
var currPath = node.path ? node.path : "-1";
navigationService.syncTree({ tree: "dictionary", path: currPath + "," + data, forceReload: true, activate: true });
// set new item as active in tree
var currPath = node.path ? node.path : "-1";
navigationService.syncTree({ tree: "dictionary", path: currPath + "," + data, forceReload: true, activate: true });
// reset form state
formHelper.resetForm({ scope: $scope });
// reset form state
formHelper.resetForm({ scope: $scope });
// navigate to edit view
$location.path("/settings/dictionary/edit/" + data);
// navigate to edit view
var section = dictionaryResource.getSection();
$location.path("/" + section + "/dictionary/edit/" + data);
},function(err) {
if (err.data && err.data.message) {
notificationsService.error(err.data.message);
navigationService.hideMenu();
}
});
}
vm.createItem = createItem;
}, function (err) {
if (err.data && err.data.message) {
notificationsService.error(err.data.message);
navigationService.hideMenu();
}
});
}
vm.createItem = createItem;
}
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.CreateController", DictionaryCreateController);
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.CreateController", DictionaryCreateController);

View File

@@ -7,43 +7,44 @@
* The controller for deleting dictionary items
*/
function DictionaryDeleteController($scope, $location, dictionaryResource, treeService, navigationService) {
vm = this;
var vm = this;
function cancel() {
navigationService.hideDialog();
}
function cancel() {
navigationService.hideDialog();
}
function performDelete() {
// stop from firing again on double-click
if ($scope.busy) { return false; }
function performDelete() {
// stop from firing again on double-click
if ($scope.busy) { return false; }
//mark it for deletion (used in the UI)
$scope.currentNode.loading = true;
$scope.busy = true;
//mark it for deletion (used in the UI)
$scope.currentNode.loading = true;
$scope.busy = true;
dictionaryResource.deleteById($scope.currentNode.id).then(function () {
$scope.currentNode.loading = false;
dictionaryResource.deleteById($scope.currentNode.id).then(function () {
$scope.currentNode.loading = false;
// get the parent id
var parentId = $scope.currentNode.parentId;
// get the parent id
var parentId = $scope.currentNode.parentId;
treeService.removeNode($scope.currentNode);
treeService.removeNode($scope.currentNode);
navigationService.hideMenu();
navigationService.hideMenu();
if (parentId !== "-1") {
// set the view of the parent item
$location.path("/settings/dictionary/edit/" + parentId);
} else {
// we have no parent, so redirect to section
$location.path("/settings/");
}
});
}
var section = dictionaryResource.getSection();
if (parentId !== "-1") {
// set the view of the parent item
$location.path("/" + section + "/dictionary/edit/" + parentId);
} else {
// we have no parent, so redirect to section
$location.path("/" + section + "/");
}
vm.cancel = cancel;
vm.performDelete = performDelete;
});
}
vm.cancel = cancel;
vm.performDelete = performDelete;
}
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.DeleteController", DictionaryDeleteController);
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.DeleteController", DictionaryDeleteController);

View File

@@ -7,7 +7,7 @@
* The controller for editing dictionary items
*/
function DictionaryEditController($scope, $routeParams, dictionaryResource, treeService, navigationService, appState, editorState, contentEditingHelper, formHelper, notificationsService, localizationService) {
vm = this;
var vm = this;
//setup scope vars
vm.nameDirty = false;
@@ -17,7 +17,7 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
vm.page.menu = {};
vm.page.menu.currentSection = appState.getSectionState("currentSection");
vm.page.menu.currentNode = null;
vm.description = '';
vm.description = "";
function loadDictionary() {
@@ -42,8 +42,8 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
}
function bindDictionary(data) {
localizationService.localize('dictionaryItem_description').then(function (value) {
vm.description = value.replace('%0%', data.name);
localizationService.localize("dictionaryItem_description").then(function (value) {
vm.description = value.replace("%0%", data.name);
});
// create data for umb-property displaying
@@ -104,7 +104,7 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
$scope.$watch("vm.content.name", function (newVal, oldVal) {
//when the value changes, we need to set the name dirty
if (newVal && (newVal !== oldVal) && typeof(oldVal) !== 'undefined') {
if (newVal && (newVal !== oldVal) && typeof(oldVal) !== "undefined") {
vm.nameDirty = true;
}
});
@@ -112,4 +112,4 @@ function DictionaryEditController($scope, $routeParams, dictionaryResource, tree
onInit();
}
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.EditController", DictionaryEditController);
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.EditController", DictionaryEditController);

View File

@@ -7,8 +7,8 @@
* The controller for listting dictionary items
*/
function DictionaryListController($scope, $location, dictionaryResource, localizationService) {
vm = this;
vm.title = 'Dictionary overview';
var vm = this;
vm.title = "Dictionary overview";
vm.loading = false;
vm.items = [];
@@ -26,13 +26,14 @@ function DictionaryListController($scope, $location, dictionaryResource, localiz
}
function clickItem(id) {
$location.path("/settings/dictionary/edit/" + id);
var section = dictionaryResource.getSection();
$location.path("/" + section + "/dictionary/edit/" + id);
}
vm.clickItem = clickItem;
function onInit() {
localizationService.localize('dictionaryItem_overviewTitle').then(function (value) {
localizationService.localize("dictionaryItem_overviewTitle").then(function (value) {
vm.title = value;
});
@@ -43,4 +44,4 @@ function DictionaryListController($scope, $location, dictionaryResource, localiz
}
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.ListController", DictionaryListController);
angular.module("umbraco").controller("Umbraco.Editors.Dictionary.ListController", DictionaryListController);

View File

@@ -16,8 +16,9 @@
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
<add application="settings" alias="scripts" title="Scripts" type="Umbraco.Web.Trees.ScriptTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4" />
<add application="settings" alias="languages" title="Languages" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.LanguageTreeController, umbraco" sortOrder="5" />
<add application="settings" alias="dictionary" title="Dictionary" type="umbraco.loadDictionary, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<add application="translation" alias="dictionary" title="Dictionary" type="Umbraco.Web.Trees.SettingsDictionaryTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<add initialize="true" sortOrder="7" alias="mediaTypes" application="settings" title="Media Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MediaTypeTreeController, umbraco" />
<add initialize="true" sortOrder="8" alias="contentBlueprints" application="settings" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.ContentBlueprintTreeController, umbraco" />
<!--Developer-->
<add initialize="true" sortOrder="0" alias="packager" application="developer" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.PackagesTreeController, umbraco" />
@@ -44,4 +45,4 @@
<!--<add application="myApplication" alias="myTree" title="Me Tree" type="MyNamespace.myTree, MyAssembly"
iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="10" />-->
</trees>
</trees>

View File

@@ -14,8 +14,7 @@
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
<add application="settings" alias="scripts" title="Scripts" type="Umbraco.Web.Trees.ScriptTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4" />
<add application="settings" alias="languages" title="Languages" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.LanguageTreeController, umbraco" sortOrder="5" />
<add application="settings" alias="dictionary-obsolete" title="Dictionary" type="umbraco.loadDictionary, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<add application="settings" alias="dictionary" title="Dictionary" type="Umbraco.Web.Trees.DictionaryTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<add application="settings" alias="dictionary" title="Dictionary" type="Umbraco.Web.Trees.SettingsDictionaryTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<add initialize="true" sortOrder="7" alias="mediaTypes" application="settings" title="Media Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MediaTypeTreeController, umbraco" />
<add initialize="true" sortOrder="8" alias="contentBlueprints" application="settings" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.ContentBlueprintTreeController, umbraco" />
<!--Developer-->
@@ -24,21 +23,22 @@
<add initialize="true" sortOrder="2" alias="macros" application="developer" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MacroTreeController, umbraco" />
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4" />
<add initialize="true" sortOrder="5" alias="xslt" application="developer" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.XsltTreeController, umbraco" />
<add application="developer" alias="partialViewMacros" type="Umbraco.Web.Trees.PartialViewMacrosTreeController, umbraco" silent="false" initialize="true" sortOrder="6" title="Partial View Macro Files" iconClosed="icon-folder" iconOpen="icon-folder" />
<!--Users-->
<add initialize="true" sortOrder="0" alias="users" application="users" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.UserTreeController, umbraco" />
<!--Members-->
<add initialize="true" sortOrder="0" alias="member" application="member" title="Members" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MemberTreeController, umbraco" />
<add initialize="true" sortOrder="1" alias="memberTypes" application="member" title="Member Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MemberTypeTreeController, umbraco" />
<add application="member" sortOrder="2" alias="memberGroups" title="Member Groups" type="umbraco.loadMemberGroups, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" />
<!--Translation-->
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadOpenTasks, umbraco" />
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadYourTasks, umbraco" />
<!-- Custom -->
<add application="developer" alias="partialViewMacros" type="Umbraco.Web.Trees.PartialViewMacrosTreeController, umbraco" silent="false" initialize="true" sortOrder="6" title="Partial View Macro Files" iconClosed="icon-folder" iconOpen="icon-folder" />
<!--Users-->
<add initialize="true" sortOrder="0" alias="users" application="users" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.UserTreeController, umbraco" />
<!--Members-->
<add initialize="true" sortOrder="0" alias="member" application="member" title="Members" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MemberTreeController, umbraco" />
<add initialize="true" sortOrder="1" alias="memberTypes" application="member" title="Member Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MemberTypeTreeController, umbraco" />
<add application="member" sortOrder="2" alias="memberGroups" title="Member Groups" type="umbraco.loadMemberGroups, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" />
<!--Translation-->
<add silent="false" initialize="true" sortOrder="1" alias="openTasks" application="translation" title="Tasks assigned to you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadOpenTasks, umbraco" />
<add silent="false" initialize="true" sortOrder="2" alias="yourTasks" application="translation" title="Tasks created by you" iconClosed="icon-folder" iconOpen="icon-folder" type="umbraco.loadYourTasks, umbraco" />
<add application="translation" alias="dictionary" title="Dictionary" type="Umbraco.Web.Trees.TranslationDictionaryTreeController, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="6" />
<!-- Custom -->
<!--<add application="myApplication" alias="myTree" title="Me Tree" type="MyNamespace.myTree, MyAssembly"
iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="10" />-->
<add initialize="true" sortOrder="2" alias="datasource" application="forms" title="Datasources" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.DataSourceTreeController, Umbraco.Forms.Web" />
<add initialize="true" sortOrder="0" alias="form" application="forms" title="Forms" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.FormTreeController, Umbraco.Forms.Web" />
<add initialize="true" sortOrder="3" alias="prevaluesource" application="forms" title="Prevalue sources" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.PreValueSourceTreeController, Umbraco.Forms.Web" />
<add initialize="true" sortOrder="3" alias="formsecurity" application="users" title="Forms Security" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Forms.Web.Trees.FormSecurityTreeController, Umbraco.Forms.Web" />
</trees>
</trees>

View File

@@ -14,7 +14,7 @@
<!-- automatically updates dimension, filesize and extension attributes on upload -->
<autoFillImageProperties>
<uploadField alias="umbracoFile">
<widthFieldAlias>umbracoWidth</widthFieldAlias>
<widthFieldAlias>umbracoWidth</widthFieldAlias>
<heightFieldAlias>umbracoHeight</heightFieldAlias>
<lengthFieldAlias>umbracoBytes</lengthFieldAlias>
<extensionFieldAlias>umbracoExtension</extensionFieldAlias>

View File

@@ -1,23 +1,21 @@
namespace Umbraco.Web.Editors
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using AutoMapper;
using Umbraco.Core.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.UI;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
using Notification = Umbraco.Web.Models.ContentEditing.Notification;
namespace Umbraco.Web.Editors
{
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using AutoMapper;
using Umbraco.Core.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
using Umbraco.Web.UI;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
/// <inheritdoc />
/// <summary>
/// The API controller used for editing dictionary items
/// </summary>
@@ -39,15 +37,14 @@
[HttpPost]
public HttpResponseMessage DeleteById(int id)
{
var foundDictionary = this.Services.LocalizationService.GetDictionaryItemById(id);
var foundDictionary = Services.LocalizationService.GetDictionaryItemById(id);
if (foundDictionary == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
Services.LocalizationService.Delete(foundDictionary, Security.CurrentUser.Id);
this.Services.LocalizationService.Delete(foundDictionary, Security.CurrentUser.Id);
return this.Request.CreateResponse(HttpStatusCode.OK);
return Request.CreateResponse(HttpStatusCode.OK);
}
/// <summary>
@@ -66,19 +63,16 @@
public HttpResponseMessage Create(int parentId, string key)
{
if (string.IsNullOrEmpty(key))
{
return this.Request
return Request
.CreateNotificationValidationErrorResponse("Key can not be empty;"); // TODO translate
}
if (this.Services.LocalizationService.DictionaryItemExists(key))
if (Services.LocalizationService.DictionaryItemExists(key))
{
var message = this.Services.TextService.Localize(
var message = Services.TextService.Localize(
"dictionaryItem/changeKeyError",
this.Security.CurrentUser.GetUserCulture(this.Services.TextService),
Security.CurrentUser.GetUserCulture(Services.TextService),
new Dictionary<string, string> { { "0", key } });
return this.Request.CreateNotificationValidationErrorResponse(message);
return Request.CreateNotificationValidationErrorResponse(message);
}
try
@@ -86,22 +80,20 @@
Guid? parentGuid = null;
if (parentId > 0)
{
parentGuid = this.Services.LocalizationService.GetDictionaryItemById(parentId).Key;
}
parentGuid = Services.LocalizationService.GetDictionaryItemById(parentId).Key;
var item = this.Services.LocalizationService.CreateDictionaryItemWithIdentity(
var item = Services.LocalizationService.CreateDictionaryItemWithIdentity(
key,
parentGuid,
string.Empty);
return this.Request.CreateResponse(HttpStatusCode.OK, item.Id);
return Request.CreateResponse(HttpStatusCode.OK, item.Id);
}
catch (Exception exception)
{
this.Logger.Error(this.GetType(), "Error creating dictionary", exception);
return this.Request.CreateNotificationValidationErrorResponse("Error creating dictionary item");
Logger.Error(GetType(), "Error creating dictionary", exception);
return Request.CreateNotificationValidationErrorResponse("Error creating dictionary item");
}
}
@@ -119,12 +111,10 @@
/// </exception>
public DictionaryDisplay GetById(int id)
{
var dictionary = this.Services.LocalizationService.GetDictionaryItemById(id);
var dictionary = Services.LocalizationService.GetDictionaryItemById(id);
if (dictionary == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
return Mapper.Map<IDictionaryItem, DictionaryDisplay>(dictionary);
}
@@ -141,54 +131,55 @@
public DictionaryDisplay PostSave(DictionarySave dictionary)
{
var dictionaryItem =
this.Services.LocalizationService.GetDictionaryItemById(int.Parse(dictionary.Id.ToString()));
Services.LocalizationService.GetDictionaryItemById(int.Parse(dictionary.Id.ToString()));
if (dictionaryItem != null)
if (dictionaryItem == null)
throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Dictionary item does not exist"));
var userCulture = Security.CurrentUser.GetUserCulture(Services.TextService);
if (dictionary.NameIsDirty)
{
var userCulture = this.Security.CurrentUser.GetUserCulture(this.Services.TextService);
// if the name (key) has changed, we need to check if the new key does not exist
var dictionaryByKey = Services.LocalizationService.GetDictionaryItemByKey(dictionary.Name);
if (dictionary.NameIsDirty)
if (dictionaryByKey != null && dictionaryItem.Id != dictionaryByKey.Id)
{
// if the name (key) has changed, we need to check if the new key does not exist
var dictionaryByKey = this.Services.LocalizationService.GetDictionaryItemByKey(dictionary.Name);
if (dictionaryByKey != null && dictionaryItem.Id != dictionaryByKey.Id)
{
var message = this.Services.TextService.Localize(
"dictionaryItem/changeKeyError",
userCulture,
new Dictionary<string, string> { { "0", dictionary.Name } });
this.ModelState.AddModelError("Name", message);
throw new HttpResponseException(this.Request.CreateValidationErrorResponse(ModelState));
}
dictionaryItem.ItemKey = dictionary.Name;
var message = Services.TextService.Localize(
"dictionaryItem/changeKeyError",
userCulture,
new Dictionary<string, string> { { "0", dictionary.Name } });
ModelState.AddModelError("Name", message);
throw new HttpResponseException(Request.CreateValidationErrorResponse(ModelState));
}
foreach (var translation in dictionary.Translations)
{
this.Services.LocalizationService.AddOrUpdateDictionaryValue(dictionaryItem, this.Services.LocalizationService.GetLanguageById(translation.LanguageId), translation.Translation);
}
try
{
this.Services.LocalizationService.Save(dictionaryItem);
var model = Mapper.Map<IDictionaryItem, DictionaryDisplay>(dictionaryItem);
model.Notifications.Add(new Models.ContentEditing.Notification(this.Services.TextService.Localize("speechBubbles/dictionaryItemSaved", userCulture), string.Empty, SpeechBubbleIcon.Success));
return model;
}
catch (Exception e)
{
this.Logger.Error(this.GetType(), "Error saving dictionary", e);
throw new HttpResponseException(this.Request.CreateNotificationValidationErrorResponse("Something went wrong saving dictionary"));
}
dictionaryItem.ItemKey = dictionary.Name;
}
throw new HttpResponseException(this.Request.CreateNotificationValidationErrorResponse("Dictionary item does not exist"));
foreach (var translation in dictionary.Translations)
{
Services.LocalizationService.AddOrUpdateDictionaryValue(dictionaryItem,
Services.LocalizationService.GetLanguageById(translation.LanguageId), translation.Translation);
}
try
{
Services.LocalizationService.Save(dictionaryItem);
var model = Mapper.Map<IDictionaryItem, DictionaryDisplay>(dictionaryItem);
model.Notifications.Add(new Notification(
Services.TextService.Localize("speechBubbles/dictionaryItemSaved", userCulture), string.Empty,
SpeechBubbleIcon.Success));
return model;
}
catch (Exception e)
{
Logger.Error(GetType(), "Error saving dictionary", e);
throw new HttpResponseException(Request.CreateNotificationValidationErrorResponse("Something went wrong saving dictionary"));
}
}
/// <summary>
@@ -201,15 +192,15 @@
{
var list = new List<DictionaryOverviewDisplay>();
var level = 0;
const int level = 0;
foreach (var dictionaryItem in this.Services.LocalizationService.GetRootDictionaryItems())
foreach (var dictionaryItem in Services.LocalizationService.GetRootDictionaryItems())
{
var item = Mapper.Map<IDictionaryItem, DictionaryOverviewDisplay>(dictionaryItem);
item.Level = 0;
list.Add(item);
this.GetChildItemsForList(dictionaryItem, level + 1, list);
GetChildItemsForList(dictionaryItem, level + 1, list);
}
return list;
@@ -229,14 +220,14 @@
/// </param>
private void GetChildItemsForList(IDictionaryItem dictionaryItem, int level, List<DictionaryOverviewDisplay> list)
{
foreach (var childItem in this.Services.LocalizationService.GetDictionaryItemChildren(
foreach (var childItem in Services.LocalizationService.GetDictionaryItemChildren(
dictionaryItem.Key))
{
var item = Mapper.Map<IDictionaryItem, DictionaryOverviewDisplay>(childItem);
item.Level = level;
list.Add(item);
this.GetChildItemsForList(childItem, level + 1, list);
GetChildItemsForList(childItem, level + 1, list);
}
}
}

View File

@@ -1,9 +1,9 @@
namespace Umbraco.Web.Models.ContentEditing
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// The dictionary display model
/// </summary>
@@ -19,6 +19,7 @@
this.Translations = new List<DictionaryTranslationDisplay>();
}
/// <inheritdoc />
/// <summary>
/// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.
/// </summary>

View File

@@ -1,8 +1,8 @@
namespace Umbraco.Web.Models.ContentEditing
{
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// The dictionary overview display.
/// </summary>
@@ -14,7 +14,7 @@
/// </summary>
public DictionaryOverviewDisplay()
{
this.Translations = new List<DictionaryOverviewTranslationDisplay>();
Translations = new List<DictionaryOverviewTranslationDisplay>();
}
/// <summary>

View File

@@ -1,7 +1,7 @@
namespace Umbraco.Web.Models.ContentEditing
{
using System.Runtime.Serialization;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// The dictionary translation overview display.
/// </summary>

View File

@@ -1,9 +1,9 @@
namespace Umbraco.Web.Models.ContentEditing
{
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <summary>
/// Dictionary Save model
/// </summary>

View File

@@ -1,7 +1,8 @@
namespace Umbraco.Web.Models.ContentEditing
{
using System.Runtime.Serialization;
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
/// <inheritdoc />
/// <summary>
/// The dictionary translation display model
/// </summary>

View File

@@ -1,7 +1,7 @@
using System.Runtime.Serialization;
namespace Umbraco.Web.Models.ContentEditing
{
using System.Runtime.Serialization;
/// <summary>
/// The dictionary translation save model
/// </summary>
@@ -26,4 +26,4 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "languageId")]
public int LanguageId { get; set; }
}
}
}

View File

@@ -1,17 +1,16 @@
namespace Umbraco.Web.Models.Mapping
using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Mapping;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Mapping
{
using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Mapping;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
/// <inheritdoc />
/// <summary>
/// The dictionary model mapper.
/// </summary>
@@ -42,9 +41,8 @@
// TODO check if there is a better way
if (src.ParentId.HasValue)
{
var ids = new List<int>();
var ids = new List<int> { -1 };
ids.Add(-1);
var parentIds = new List<int>();
@@ -95,7 +93,7 @@
var translation = src.Translations.FirstOrDefault(x => x.LanguageId == langId);
dest.Translations.Add(
new DictionaryOverviewTranslationDisplay()
new DictionaryOverviewTranslationDisplay
{
DisplayName = lang.CultureInfo.DisplayName,
HasTranslation = translation != null && string.IsNullOrEmpty(translation.Value) == false
@@ -104,8 +102,6 @@
});
}
/// <summary>
/// Goes up the dictoinary tree to get all parent ids
/// </summary>
@@ -122,15 +118,13 @@
{
var dictionary = localizationService.GetDictionaryItemById(parentId);
if (dictionary != null)
{
ids.Add(dictionary.Id);
if (dictionary == null)
return;
if (dictionary.ParentId.HasValue)
{
this.GetParentId(dictionary.ParentId.Value, localizationService, ids);
}
}
ids.Add(dictionary.Id);
if (dictionary.ParentId.HasValue)
GetParentId(dictionary.ParentId.Value, localizationService, ids);
}
}
}

View File

@@ -1,38 +1,15 @@
namespace Umbraco.Web.Trees
using System;
using System.Linq;
using System.Net.Http.Formatting;
using umbraco.BusinessLogic.Actions;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
using System;
using System.Linq;
using System.Net.Http.Formatting;
using global::umbraco;
using global::umbraco.BusinessLogic.Actions;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
[UmbracoTreeAuthorize(Constants.Trees.Dictionary)]
[Tree(Constants.Applications.Settings, Constants.Trees.Dictionary, null, sortOrder: 3)]
[Mvc.PluginController("UmbracoTrees")]
[CoreTree]
[LegacyBaseTree(typeof(loadDictionary))]
public class DictionaryTreeController : TreeController
public class DictionaryTreeBaseController : TreeController
{
/// <summary>
/// Helper method to create a root model for a tree
/// </summary>
/// <returns></returns>
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
// this will load in a custom UI instead of the dashboard for the root node
root.RoutePath = string.Format("{0}/{1}/{2}", Constants.Applications.Settings, Constants.Trees.Dictionary, "list");
return root;
}
/// <summary>
/// The method called to render the contents of the tree structure
/// </summary>
@@ -48,42 +25,37 @@
{
var intId = id.TryConvertTo<int>();
if (intId == false)
{
throw new InvalidOperationException("Id must be an integer");
}
var nodes = new TreeNodeCollection();
if (id == Constants.System.Root.ToInvariantString())
{
nodes.AddRange(
this.Services.LocalizationService.GetRootDictionaryItems().Select(
x => this.CreateTreeNode(
Services.LocalizationService.GetRootDictionaryItems().Select(
x => CreateTreeNode(
x.Id.ToInvariantString(),
id,
queryStrings,
x.ItemKey,
"icon-book-alt",
true)));
Services.LocalizationService.GetDictionaryItemChildren(x.Key).Any())));
}
else
{
// maybe we should use the guid as url param to avoid the extra call for getting dictionary item
var parentDictionary = this.Services.LocalizationService.GetDictionaryItemById(intId.Result);
var parentDictionary = Services.LocalizationService.GetDictionaryItemById(intId.Result);
if (parentDictionary == null)
{
return nodes;
}
nodes.AddRange(this.Services.LocalizationService.GetDictionaryItemChildren(parentDictionary.Key).ToList().OrderByDescending(item => item.Key).Select(
x => this.CreateTreeNode(
nodes.AddRange(Services.LocalizationService.GetDictionaryItemChildren(parentDictionary.Key).ToList().OrderByDescending(item => item.Key).Select(
x => CreateTreeNode(
x.Id.ToInvariantString(),
id,
queryStrings,
x.ItemKey,
"icon-book-alt",
true)));
Services.LocalizationService.GetDictionaryItemChildren(x.Key).Any())));
}
return nodes;
@@ -101,14 +73,14 @@
{
var menu = new MenuItemCollection();
menu.Items.Add<ActionNew>(this.Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias)));
menu.Items.Add<ActionNew>(Services.TextService.Localize($"actions/{ActionNew.Instance.Alias}"));
if (id != Constants.System.Root.ToInvariantString())
{
menu.Items.Add<ActionDelete>(this.Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias)), true);
}
menu.Items.Add<ActionDelete>(Services.TextService.Localize(
$"actions/{ActionDelete.Instance.Alias}"), true);
menu.Items.Add<RefreshNode, ActionRefresh>(this.Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true);
menu.Items.Add<RefreshNode, ActionRefresh>(Services.TextService.Localize(
$"actions/{ActionRefresh.Instance.Alias}"), true);
return menu;
}

View File

@@ -0,0 +1,24 @@
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Web.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Dictionary)]
[Tree(Constants.Applications.Settings, Constants.Trees.Dictionary, null, sortOrder: 3)]
[Mvc.PluginController("UmbracoTrees")]
[CoreTree]
public class SettingsDictionaryTreeController : DictionaryTreeBaseController
{
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
// this will load in a custom UI instead of the dashboard for the root node
root.RoutePath = $"{Constants.Applications.Settings}/{Constants.Trees.Dictionary}/list";
return root;
}
}
}

View File

@@ -0,0 +1,24 @@
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Web.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Dictionary)]
[Tree(Constants.Applications.Translation, Constants.Trees.Dictionary, null, sortOrder: 3)]
[Mvc.PluginController("UmbracoTrees")]
[CoreTree]
public class TranslationDictionaryTreeController : DictionaryTreeBaseController
{
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
// this will load in a custom UI instead of the dashboard for the root node
root.RoutePath = $"{Constants.Applications.Translation}/{Constants.Trees.Dictionary}/list";
return root;
}
}
}

View File

@@ -528,12 +528,14 @@
<Compile Include="Models\Mapping\PropertyTypeGroupResolver.cs" />
<Compile Include="Security\Identity\PreviewAuthenticationMiddleware.cs" />
<Compile Include="SingletonHttpContextAccessor.cs" />
<Compile Include="Trees\DictionaryTreeBaseController.cs" />
<Compile Include="Trees\SettingsDictionaryTreeController.cs" />
<Compile Include="Trees\TranslationDictionaryTreeController.cs" />
<Compile Include="Trees\MacroTreeController.cs" />
<Compile Include="Trees\UserTreeController.cs" />
<Compile Include="Suspendable.cs" />
<Compile Include="Trees\ContentBlueprintTreeController.cs" />
<Compile Include="Trees\ContentTypeTreeController.cs" />
<Compile Include="Trees\DictionaryTreeController.cs" />
<Compile Include="Trees\PackagesTreeController.cs" />
<Compile Include="Trees\MediaTypeTreeController.cs" />
<Compile Include="Trees\MemberTypeTreeController.cs" />
@@ -1621,13 +1623,6 @@
<Compile Include="umbraco.presentation\umbraco\settings\DictionaryItemList.aspx.designer.cs">
<DependentUpon>DictionaryItemList.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\settings\EditDictionaryItem.aspx.cs">
<DependentUpon>EditDictionaryItem.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\settings\EditDictionaryItem.aspx.designer.cs">
<DependentUpon>EditDictionaryItem.aspx</DependentUpon>
</Compile>
<Compile Include="umbraco.presentation\umbraco\settings\editLanguage.aspx.cs">
<DependentUpon>editLanguage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -1714,7 +1709,6 @@
<Compile Include="umbraco.presentation\umbraco\Trees\loadContent.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadcontentItemType.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadDataTypes.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadDictionary.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadLanguages.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadMacros.cs" />
<Compile Include="umbraco.presentation\umbraco\Trees\loadMedia.cs" />
@@ -1929,9 +1923,6 @@
<Content Include="umbraco.presentation\umbraco\schemas\umbraco.xsd">
<SubType>Designer</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\settings\EditDictionaryItem.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\settings\editLanguage.aspx" />
<!--<Content Include="umbraco.presentation\umbraco\users\PermissionEditor.aspx" />-->
<Content Include="umbraco.presentation\umbraco\webservices\CacheRefresher.asmx">

View File

@@ -1,99 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.IO;
using System.Text;
using System.Web;
using System.Xml;
using System.Configuration;
using umbraco.BasePages;
using umbraco.BusinessLogic;
using umbraco.businesslogic;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.cache;
using umbraco.cms.businesslogic.contentitem;
using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.language;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic.member;
using umbraco.cms.businesslogic.property;
using umbraco.cms.businesslogic.web;
using umbraco.interfaces;
using umbraco.DataLayer;
using umbraco.BusinessLogic.Utils;
using umbraco.cms.presentation.Trees;
using umbraco.BusinessLogic.Actions;
using Umbraco.Core;
namespace umbraco
{
[Tree(Constants.Applications.Settings, Constants.Trees.DictionaryObsolete, "Dictionary", action: "openDictionary()", sortOrder: 3)]
public class loadDictionary : BaseTree
{
public loadDictionary(string application) : base(application) { }
protected override void CreateRootNode(ref XmlTreeNode rootNode)
{
rootNode.NodeType = "init" + TreeAlias;
rootNode.NodeID = "init";
rootNode.Action = "javascript:openDictionary()";
}
protected override void CreateAllowedActions(ref List<IAction> actions)
{
actions.Clear();
actions.Add(ActionNew.Instance);
actions.Add(ActionDelete.Instance);
actions.Add(ContextMenuSeperator.Instance);
actions.Add(ActionRefresh.Instance);
}
public override void RenderJS(ref StringBuilder Javascript)
{
Javascript.Append(
@"
function openDictionary() {
UmbClientMgr.contentFrame('settings/DictionaryItemList.aspx');
}
function openDictionaryItem(id) {
UmbClientMgr.contentFrame('settings/editDictionaryItem.aspx?id=' + id);
}");
}
public override void Render(ref XmlTree tree)
{
Dictionary.DictionaryItem[] tmp;
if (this.id == this.StartNodeID)
tmp = Dictionary.getTopMostItems;
else
tmp = new Dictionary.DictionaryItem(this.id).Children;
foreach (Dictionary.DictionaryItem di in tmp.OrderBy(a => a.key))
{
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = di.id.ToString(); //dictionary_ + id..
xNode.Text = di.key;
xNode.Action = string.Format("javascript:openDictionaryItem({0});", di.id);
xNode.Icon = "icon-book-alt";
xNode.NodeType = "DictionaryItem"; //this shouldn't be like this, it should be this.TreeAlias but the ui.config file points to this name.
xNode.Source = this.GetTreeServiceUrl(di.id);
xNode.HasChildren = di.hasChildren;
OnBeforeNodeRender(ref tree, ref xNode, EventArgs.Empty);
if (xNode != null)
{
tree.Add(xNode);
OnAfterNodeRender(ref tree, ref xNode, EventArgs.Empty);
}
}
}
}
}

View File

@@ -1,15 +0,0 @@
<%@ Register Namespace="umbraco" TagPrefix="umb" Assembly="umbraco" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoPage.Master" ValidateRequest="false"
CodeBehind="EditDictionaryItem.aspx.cs" AutoEventWireup="True" Inherits="umbraco.settings.EditDictionaryItem" %>
<asp:Content ContentPlaceHolderID="body" runat="server">
<cc1:UmbracoPanel ID="Panel1" runat="server" Width="408px" Height="264px">
</cc1:UmbracoPanel>
<script type="text/javascript">
jQuery(document).ready(function () {
UmbClientMgr.appActions().bindSaveShortCut();
});
</script>
</asp:Content>

View File

@@ -1,184 +0,0 @@
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic;
using umbraco.cms.presentation.Trees;
using Umbraco.Core;
namespace umbraco.settings
{
/// <summary>
/// Summary description for EditDictionaryItem.
/// </summary>
[WebformsPageTreeAuthorize(Constants.Trees.Dictionary)]
public partial class EditDictionaryItem : BasePages.UmbracoEnsuredPage
{
protected LiteralControl keyTxt = new LiteralControl();
protected uicontrols.TabView tbv = new uicontrols.TabView();
private System.Collections.ArrayList languageFields = new System.Collections.ArrayList();
private cms.businesslogic.Dictionary.DictionaryItem currentItem;
protected TextBox boxChangeKey;
protected Label labelChangeKey;
protected Literal txt;
protected User currentUser;
protected void Page_Load(object sender, System.EventArgs e)
{
currentItem = new cms.businesslogic.Dictionary.DictionaryItem(int.Parse(Request.QueryString["id"]));
currentUser = getUser();
// Put user code to initialize the page here
Panel1.hasMenu = true;
Panel1.Text = ui.Text("editdictionary") + ": " + currentItem.key;
var save = Panel1.Menu.NewButton();
save.Text = ui.Text("save");
save.Click += save_Click;
save.ToolTip = ui.Text("save");
save.ID = "save";
save.ButtonType = uicontrols.MenuButtonType.Primary;
uicontrols.Pane p = new uicontrols.Pane();
boxChangeKey = new TextBox
{
ID = "changeKey-" + currentItem.id,
CssClass = "umbEditorTextField",
Text = currentItem.key
};
labelChangeKey = new Label
{
ID = "changeKeyLabel",
CssClass = "text-error"
};
p.addProperty(new Literal
{
Text = "<p>" + ui.Text("dictionaryItem", "changeKey", currentUser) + "</p>"
});
p.addProperty(boxChangeKey);
p.addProperty(labelChangeKey);
txt = new Literal();
txt.Text = "<br/><p>" + ui.Text("dictionaryItem", "description", currentItem.key, currentUser) + "</p><br/>";
p.addProperty(txt);
foreach (cms.businesslogic.language.Language l in cms.businesslogic.language.Language.getAll)
{
TextBox languageBox = new TextBox();
languageBox.TextMode = TextBoxMode.MultiLine;
languageBox.ID = l.id.ToString();
languageBox.CssClass = "umbEditorTextFieldMultiple";
if (!IsPostBack)
languageBox.Text = currentItem.Value(l.id);
languageFields.Add(languageBox);
p.addProperty(l.FriendlyName, languageBox);
}
if (!IsPostBack)
{
var path = BuildPath(currentItem);
ClientTools
.SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree<loadDictionary>().Tree.Alias)
.SyncTree(path, false);
}
Panel1.Controls.Add(p);
}
private string BuildPath(cms.businesslogic.Dictionary.DictionaryItem current)
{
var parentPath = current.IsTopMostItem() ? "" : BuildPath(current.Parent) + ",";
return parentPath + current.id;
}
void save_Click(object sender, EventArgs e)
{
foreach (TextBox t in languageFields)
{
//check for null but allow empty string!
// http://issues.umbraco.org/issue/U4-1931
if (t.Text != null)
{
currentItem.setValue(int.Parse(t.ID), t.Text);
}
}
labelChangeKey.Text = ""; // reset error text
var newKey = boxChangeKey.Text;
if (string.IsNullOrWhiteSpace(newKey) == false && newKey != currentItem.key)
{
// key already exists, save but inform
if (Dictionary.DictionaryItem.hasKey(newKey) == true)
{
labelChangeKey.Text = ui.Text("dictionaryItem", "changeKeyError", newKey, currentUser);
boxChangeKey.Text = currentItem.key; // reset key
}
else
{
// set the new key
currentItem.setKey(newKey);
// update the title with the new key
Panel1.title.InnerHtml = ui.Text("editdictionary") + ": " + newKey;
// sync the content tree
var path = BuildPath(currentItem);
ClientTools.SyncTree(path, true);
}
}
txt.Text = "<br/><p>" + ui.Text("dictionaryItem", "description", currentItem.key, currentUser) + "</p><br/>";
ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "dictionaryItemSaved"), "");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
private class languageTextbox : TextBox
{
private int _languageid;
public int languageid
{
set { _languageid = value; }
get { return _languageid; }
}
public languageTextbox(int languageId) : base()
{
this.TextMode = TextBoxMode.MultiLine;
this.Rows = 10;
this.Columns = 40;
this.Attributes.Add("style", "margin: 3px; width: 98%;");
this.languageid = languageId;
}
}
}
}

View File

@@ -1,24 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.settings {
public partial class EditDictionaryItem {
/// <summary>
/// Panel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::umbraco.uicontrols.UmbracoPanel Panel1;
}
}