forked from nbrightproject/NBrightPL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeta.ascx.cs
69 lines (58 loc) · 2.74 KB
/
Meta.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// --- Copyright (c) notice NevoWeb ---
// Copyright (c) 2014 SARL NevoWeb. www.nevoweb.com. The MIT License (MIT).
// Author: D.C.Lee
// ------------------------------------------------------------------------
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// ------------------------------------------------------------------------
// This copyright notice may NOT be removed, obscured or modified without written consent from the author.
// --- End copyright notice ---
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.UI.Skins;
using NBrightCore.common;
using NBrightCore.render;
using NBrightDNN;
using DotNetNuke.Entities.Portals;
using NBrightPL.common;
using Nevoweb.DNN.NBrightPL.Base;
namespace Nevoweb.DNN.NBrightPL
{
public partial class Meta : SkinObjectBase
{
protected override void OnLoad(EventArgs e)
{
try
{
var objCtrl = new NBrightDataController();
var dataRecord = objCtrl.GetByGuidKey(PortalSettings.Current.PortalId, -1, "PL", PortalSettings.ActiveTab.TabID.ToString(""));
if (dataRecord != null)
{
var dataRecordLang = objCtrl.GetDataLang(dataRecord.ItemID, Utils.GetCurrentCulture());
if (dataRecordLang != null)
{
var bPage = (DotNetNuke.Framework.CDefault) this.Page;
if (dataRecordLang.GetXmlProperty("genxml/textbox/pagetitle") != "")
bPage.Title = dataRecordLang.GetXmlProperty("genxml/textbox/pagetitle");
if (dataRecordLang.GetXmlProperty("genxml/textbox/tagwords") != "")
bPage.KeyWords = dataRecordLang.GetXmlProperty("genxml/textbox/tagwords");
if (dataRecordLang.GetXmlProperty("genxml/textbox/pagedescription") != "")
bPage.Description = dataRecordLang.GetXmlProperty("genxml/textbox/pagedescription");
}
}
}
catch (Exception exc)
{
//ignore
}
}
}
}