19 using erminas.SmartAPI.Utils;
21 namespace erminas.SmartAPI.CMS.Project.Pages.Elements
23 public interface IText : IValueElement<string>
25 string Description {
get; }
28 internal abstract class Text : AbstractValueElement<String>, IText
30 private string _description;
33 : base(project, guid, languageVariant)
37 protected Text(
IProject project, XmlElement xmlElement) : base(project, xmlElement)
40 IsInitialized =
false;
43 public override void Commit()
45 string htmlEncodedValue =
string.IsNullOrEmpty(_value)
46 ? RQL.SESSIONKEY_PLACEHOLDER
47 : HttpUtility.HtmlEncode(_value);
49 const string SAVE_TEXT_VALUE =
50 @"<ELT translationmode=""0"" extendedinfo="""" reddotcacheguid="""" action=""save"" guid=""{0}"" pageid=""{1}"" id="""" index="""" type=""{2}"">{3}</ELT>";
52 Project.Session.ExecuteRQLRaw(SAVE_TEXT_VALUE.RQLFormat(
this, Page.Id, (
int) Type, htmlEncodedValue),
53 RQL.IODataFormat.FormattedText);
56 public string Description
58 get {
return LazyLoad(ref _description); }
61 protected override string FromString(
string value)
66 protected override sealed
string FromXmlNodeValue(
string arg)
71 protected override sealed
void LoadWholeValueElement()
77 const string LOAD_VALUE =
@"<ELT action=""load"" guid=""{0}"" extendedinfo=""""/>";
79 _value = Project.Session.ExecuteRQLRaw(LOAD_VALUE.RQLFormat(
this), RQL.IODataFormat.FormattedText);
83 private void LoadXml()
85 InitIfPresent(ref _description,
"reddotdescription", x => x);