//public string AdditionalLinkClassIfActive(string path1ToCheck, string path2ToCheck) //{ // string url = Request.Url.AbsolutePath; // url = url.ToLower(); // path1ToCheck = path1ToCheck.ToLower(); // path2ToCheck = path2ToCheck.ToLower(); // if (url.IndexOf(path1ToCheck) > -0 && url.IndexOf(path2ToCheck) > -0) // { // return "class=\"active\""; // } // else // { return ""; } //} #region ----------------BuildStaticPagesLinks--------------- //---------------------------------------------------------- //BuildStaticPagesLinks //---------------------------------------------------------- public string BuildStaticPagesLinks() { ItemsModulesOptions SitePagesModule = ItemsModulesOptions.GetType((int)StandardItemsModuleTypes.SitePages); string links = ""; string folder = SitePagesModule.Identifire.ToString(); if (SitePagesModule.IsAvailabe && ZecurityManager.CheckFolderPermission("/AdminCP/Items/" + folder + "/")) { links += "<li " + AdditionalLinkClassIfActive("/AdminCP/Items/" + folder + "/") + "><a href=\"#\"><i class=\"icon-stack2\"></i><span>" + Resources.AdminText.StaticContents + "</span></a>"; links += "<ul>"; //------------------------------------------------------------------- SiteModulesManager siteModules = SiteModulesManager.Instance; foreach (SitePageOptions page in siteModules.SitePagesList) { if (page.IsAvailabe && page.AddInAdminMenuAutmaticly && !page.HasComments) { links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/StaticContents.aspx?id=" + page.PageID) + "><a href=\"/AdminCP/Items/" + folder + "/StaticContents.aspx?id=" + page.PageID + "\">" + page.Title + "</a></li>"; } } //------------------------------------------------------------------- links += "</ul>"; } return(links); }
//-------------------------------------------------------- #endregion #region --------------EditCommand-------------- //--------------------------------------------------------- //EditCommand //--------------------------------------------------------- protected void EditCommand(DataGrid dg, Label lblResult, object source, DataGridCommandEventArgs e) { ImageButton lbtnUserActivation = (ImageButton)e.Item.FindControl("lbtnUserActivation"); int ModuleTypeID = (int)dg.DataKeys[e.Item.ItemIndex]; ItemsModulesOptions moduleOptions = ItemsModulesOptions.GetType(ModuleTypeID); SiteModulesManager sm = SiteModulesManager.Instance; if (moduleOptions.IsAvailabe) { //----------------------------------------------------------------------- moduleOptions.IsAvailabe = false; sm.SaveModule(moduleOptions); //----------------------------------------------------------------------- lblResult.CssClass = "operation_error"; lblResult.Text = "Êã ÅáÛÇÁ ÇáÊÝÚíá"; lbtnUserActivation.ImageUrl = "/Content/images/Boolean/false.gif"; } else { //----------------------------------------------------------------------- moduleOptions.IsAvailabe = true; sm.SaveModule(moduleOptions); //----------------------------------------------------------------------- lblResult.CssClass = "operation_done"; lblResult.Text = "Êã ÇáÊÝÚíá"; lbtnUserActivation.ImageUrl = "/Content/images/Boolean/True.gif"; } }
//----------------------------------------------- //Page_Load //----------------------------------------------- public void Page_Load(object sender, System.EventArgs e) { //------------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- lblResult.Text = ""; //--------------------------------------------------------- //Load Cart //--------------------------------------------------------- if (Session["Cart"] == null) { Session["Cart"] = new List <ItemsOrdersDetailsModel>(); } CartList = (List <ItemsOrdersDetailsModel>)Session["Cart"]; //--------------------------------------------------------- if (!IsPostBack) { LoadData(); } }
//[OutputCache(Duration = int.MaxValue, VaryByParam = "*")] public ActionResult Details(int?id, string module) { //module ItemsModulesOptions currentModule = ItemsModulesOptions.GetType(module); if (id.HasValue) { ViewBag.Message = "Your application description page."; FrontItemsModel currentItem = FrontItemsController.GetItemObject(id.Value, SiteSettings.GetCurrentLanguage()); ViewData["CurrentItem"] = currentItem; ViewData["CurrentItemsModule"] = currentModule; ViewBag.CurrentModule = currentModule; NavigationManager.Instance.BuilDetailsPathesLinks(currentModule, currentItem); ViewBag.Title = NavigationManager.Instance.PageTitle; if (id.HasValue) { ViewBag.ActiveID = id.Value; } return(View("~/Views/" + module + "/details.cshtml", currentItem)); } else { return(HttpNotFound()); } }
//---------------------------------------------------------------------------------------------------------- public static void AddProfilePageDetails(UsersDataEntity usersDataObject) { ItemsEntity page = new ItemsEntity(); page.ModuleTypeID = (int)ModuleTypes.UsersProfiles; page.OwnerID = usersDataObject.UserId; //----------------------------------------------------- //AddDetails //---------------------------- ItemsDetailsEntity itemDetailsObject; if (SiteSettings.Languages_HasArabicLanguages) { itemDetailsObject = new ItemsDetailsEntity(); itemDetailsObject.LangID = Languages.Ar; itemDetailsObject.Title = DynamicResource.GetText("Modules", "PageTitle_UserProfilePage"); itemDetailsObject.ExtraData.Add(""); page.Details[Languages.Ar] = itemDetailsObject; } if (SiteSettings.Languages_HasEnglishLanguages) { itemDetailsObject = new ItemsDetailsEntity(); itemDetailsObject.LangID = Languages.En; itemDetailsObject.Title = DynamicResource.GetText("Modules", "PageTitle_UserProfilePage"); itemDetailsObject.ExtraData.Add(""); page.Details[Languages.En] = itemDetailsObject; } //----------------------------------------------------- ItemsModulesOptions UsersProfilesModule = ItemsModulesOptions.GetType((int)ModuleTypes.UsersProfiles); ItemsFactory.Create(page, UsersProfilesModule); //----------------------------------------------------- usersDataObject.ProfilePageID = page.ItemID; }
//---------------------------------------------------------------------------------------------------------- public static int AddSubSitePageDetails(int PageNo, UsersDataEntity usersDataObject) { ItemsEntity page = new ItemsEntity(); page.ModuleTypeID = (int)ModuleTypes.SubSitePages; page.OwnerID = usersDataObject.UserId; //----------------------------------------------------- //AddDetails //---------------------------- ItemsDetailsEntity itemDetailsObject; if (SiteSettings.Languages_HasArabicLanguages) { itemDetailsObject = new ItemsDetailsEntity(); itemDetailsObject.LangID = Languages.Ar; itemDetailsObject.Title = DynamicResource.GetText("SubSites", "Page_" + PageNo); itemDetailsObject.ExtraData.Add(""); page.Details[Languages.Ar] = itemDetailsObject; } if (SiteSettings.Languages_HasEnglishLanguages) { itemDetailsObject = new ItemsDetailsEntity(); itemDetailsObject.LangID = Languages.En; itemDetailsObject.Title = DynamicResource.GetText("SubSites", "Page_" + PageNo); itemDetailsObject.ExtraData.Add(""); page.Details[Languages.En] = itemDetailsObject; } //----------------------------------------------------- ItemsModulesOptions subSitePagesModule = ItemsModulesOptions.GetType((int)ModuleTypes.SubSitePages); ItemsFactory.Create(page, subSitePagesModule); //----------------------------------------------------- return(page.ItemID); }
//------------------------------------------ #endregion #region ---------------Page_Load--------------- //----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); PrepareValidation(); //------------------------------------------------------------------------ //New code for pages //------------------------------ if (currentModule.ModuleTypeID == (int)StandardItemsModuleTypes.SitePages || currentModule.ModuleTypeID == (int)StandardItemsModuleTypes.StaticContents) { if (ItemID <= 0 && MoversFW.Components.UrlManager.ChechIsValidIntegerParameter("id")) { ItemID = Convert.ToInt32(Request.QueryString["id"]); currentModule = SitePageOptions.GetPage(ItemID); } } //------------------------------------------------------------------------ if (!IsPostBack) { PrepareValidation(); //trTitle.Visible = ViewTitle; txtShortDescription.Attributes.Add("onfocus", "return ismaxlength(this,document.forms[0]." + txtSDLengthControler.ClientID + ")"); txtShortDescription.Attributes.Add("onkeyup", "return ismaxlength(this,document.forms[0]." + txtSDLengthControler.ClientID + ")"); LoadData(); } }
//---------------------------------------------------------- //UpdateTestingDataForStaticPages //---------------------------------------------------------- public void UpdateTestingDataForStaticPages() { ItemsModulesOptions SitePagesModule = ItemsModulesOptions.GetType((int)StandardItemsModuleTypes.SitePages); //------------------------------------------------------------- InitialItem.CategoryID = 0; InitialItem.ModuleTypeID = SitePagesModule.ModuleTypeID; //------------------------------------------------------------- foreach (SitePageOptions page in SiteModulesManager.Instance.SitePagesList) { if (page.IsAvailabe) { InitialItem.ItemID = page.PageID; if (SiteSettings.Languages_HasArabicLanguages) { InitialItem.Details[Languages.Ar] = InitialItemArDetails; } if (SiteSettings.Languages_HasEnglishLanguages) { InitialItem.Details[Languages.En] = InitialItemEnDetails; } ExecuteCommandStatus status = ItemsFactory.Update(InitialItem, SitePagesModule); if (status == ExecuteCommandStatus.Done) { if (page.HasComments) { AddComments(SitePagesModule.ModuleTypeID, page.PageID, ModuleBaseTypes.Items); } } } } }
//---------------------------------------------------------- #endregion #region ----------------BuildStaticPagesLinks--------------- //---------------------------------------------------------- //BuildStaticPagesLinks //---------------------------------------------------------- public string BuildStaticPagesLinks() { ItemsModulesOptions SitePagesModule = ItemsModulesOptions.GetType((int)StandardItemsModuleTypes.SitePages); string links = ""; string folder = SitePagesModule.Identifire.ToString(); if (SitePagesModule.IsAvailabe && ZecurityManager.CheckFolderPermission("/AdminCP/Items/" + folder + "/")) { links += "<tr><td class=\"menuheader expandable\">" + Resources.AdminText.StaticContents + "</td></tr>"; links += "<tr><td><ul class=\"categoryitems\">"; //------------------------------------------------------------------- SiteModulesManager siteModules = SiteModulesManager.Instance; foreach (SitePageOptions page in siteModules.SitePagesList) { if (page.IsAvailabe && page.AddInAdminMenuAutmaticly && !page.HasComments) { links += "<li><a href=\"/AdminCP/Items/" + folder + "/StaticContents.aspx?id=" + page.PageID + "\">" + page.Title + "</a></li>"; } } //------------------------------------------------------------------- links += "</ul></td></tr>"; } return(links); }
protected void Page_Load(object sender, EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); if (!IsPostBack) { HandleOptionalControls(); LoadData(); } }
//------------------------------------------ #endregion #region ---------------Page_Load--------------- //----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); MLangsDetails1.ModuleTypeID = ModuleTypeID; lblResult.Text = ""; if (!IsPostBack) { PrepareValidation(); LoadData(); } }
//----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); MLangsDetails1.ModuleTypeID = ModuleTypeID; MLangsDetails1.TypeOfDetails = DetailsTypes.Category; lblResult.Text = ""; if (!IsPostBack) { LoadData(); } }
//--------------------------------------------------------------------------------------------- public static string CreateItemsModuleLink(int ModuleTypeID) { if (ModuleTypeID < 500) { ItemsModulesOptions currentModule = ItemsModulesOptions.GetType(ModuleTypeID); return(string.Format(ItemsModuleLink, new string[] { currentModule.Identifire })); } else { return(SiteUrls.HomePage); } }
//-------------------------------------------------- protected void Page_Load(object sender, EventArgs e) { //--------------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //--------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- if (!IsPostBack) { LoadData(); } }
//[OutputCache(Duration = int.MaxValue, VaryByParam = "*")] public ActionResult Defaule(int?pageId, string module) { int pageIndex = 1; if (pageId.HasValue) { pageIndex = pageId.Value; } ItemsModulesOptions currentModule = ItemsModulesOptions.GetType(module); ViewBag.PageIndex = pageIndex; ViewBag.CurrentModule = currentModule; //pageIndex = (int)ViewData["PageIndex"]; NavigationManager.Instance.BuilDefaultPathesLinks(currentModule); ViewBag.Title = NavigationManager.Instance.PageTitle; return(View("~/Views/" + module + "/index.cshtml")); }
//----------------------------------------------- //Page_Load //----------------------------------------------- public void Page_Load(object sender, System.EventArgs e) { //--------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- if (!IsPostBack) { PagerManager.PrepareUserPager(pager); pager.Visible = false; trPagerContainer.Visible = false; LoadData(); } }
//------------------------------------------ #endregion public static MasterModule GetType(int moduleType) { if (moduleType < 500) { return((MasterModule)ItemsModulesOptions.GetType(moduleType)); } else if (moduleType < 600) { return((MasterModule)MessagesModuleOptions.GetType(moduleType)); } else if (moduleType < 700) { return((MasterModule)UsersDataGlobalOptions.GetType(moduleType)); } else { return(new MasterModule()); } }
//----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); lblResult.Text = ""; if (!IsPostBack) { PagerManager.PrepareAdminPager(pager); pager.Visible = false; HandleOptionalControls(); SetTexts(); LoadData(); dgItems.Columns[1].Visible = currentModule.HasTitle; dgItems.Columns[5].Visible = currentModule.HasMultiPhotos; dgItems.Columns[6].Visible = currentModule.HasComments; dgItems.Columns[7].Visible = currentModule.HasComments; dgItems.Columns[8].Visible = currentModule.HasMessages; dgItems.Columns[9].Visible = currentModule.HasMessages; } }
//---------------------------------------------------------- #region ----------------InsertTestingDataForItemsModule--------------- //---------------------------------------------------------- //InsertTestingDataForItemsModule //---------------------------------------------------------- public void InsertTestingDataForItemsModule(int ModuleTypeID) { ItemsModulesOptions itemsModule = ItemsModulesOptions.GetType(ModuleTypeID); // int parentCategoryID=0; //int CategoryID=0; //int ItemID=0; if (itemsModule.CategoryLevel > 1 || itemsModule.CategoryLevel < 0) { AddParentCategories(itemsModule, ModuleBaseTypes.Items); } else if (itemsModule.CategoryLevel == 1) { AddCategories(itemsModule, 0, ModuleBaseTypes.Items); } else { AddItems(itemsModule, 0); } }
//------------------------------------------ #endregion protected void Page_Load(object sender, EventArgs e) { currentModule = ItemsModulesOptions.GetType(ModuleTypeID); //------------------------------------------------------------------------ //New code for pages //------------------------------ if (currentModule.ModuleTypeID == (int)StandardItemsModuleTypes.SitePages || currentModule.ModuleTypeID == (int)StandardItemsModuleTypes.StaticContents) { if (ItemID <= 0 && MoversFW.Components.UrlManager.ChechIsValidIntegerParameter("id")) { ItemID = Convert.ToInt32(Request.QueryString["id"]); currentModule = SitePageOptions.GetPage(ItemID); } } //------------------------------------------------------------------------ if (!IsPostBack) { CheckVisibility(); } }
//----------------------------------------------- //Page_Load //----------------------------------------------- public void Page_Load(object sender, System.EventArgs e) { //------------------------------------------------- currentModule = ItemsModulesOptions.GetType(ModuleTypeID); siteUrls = DCSiteUrls.Instance; //------------------------------------------------- //Prepaare user control CatchControls(); Prepare(); //------------------------------------------------- lblResult.Text = ""; //--------------------------------------------------------- //Load Cart //--------------------------------------------------------- CartList = ShoppingCart.GetCartList(); //--------------------------------------------------------- if (!IsPostBack) { LoadData(); } }
//---------------------------------------------------------- //InsertTestingDataForMessageModule //---------------------------------------------------------- public void InsertTestingDataForMessageModule(int ModuleTypeID) { //---------------------------------------------------------- MessagesModuleOptions MsgModule = MessagesModuleOptions.GetType(ModuleTypeID); //---------------------------------------------------------- ItemsModulesOptions CategoriesModule = ItemsModulesOptions.GetType(ModuleTypeID); //---------------------------------------------------------- bool TempAllowDublicateTitlesInCategories = true; bool TempAllowDublicateTitlesInItems = true; //---------------------------------------------------------- if (MsgModule.CategoryLevel != 0) { TempAllowDublicateTitlesInCategories = CategoriesModule.AllowDublicateTitlesInCategories; TempAllowDublicateTitlesInItems = CategoriesModule.AllowDublicateTitlesInItems; // CategoriesModule.AllowDublicateTitlesInCategories = true; CategoriesModule.AllowDublicateTitlesInItems = true; //--------------------------- CategoriesModule = ItemsModulesOptions.GetType(ModuleTypeID); } //---------------------------------------------------------- if (MsgModule.CategoryLevel > 1 || MsgModule.CategoryLevel < 0) { AddParentCategories(CategoriesModule, ModuleBaseTypes.Messages); CategoriesModule.AllowDublicateTitlesInCategories = TempAllowDublicateTitlesInCategories; CategoriesModule.AllowDublicateTitlesInItems = TempAllowDublicateTitlesInItems; } else if (MsgModule.CategoryLevel == 1) { AddCategories(CategoriesModule, 0, ModuleBaseTypes.Messages); CategoriesModule.AllowDublicateTitlesInCategories = TempAllowDublicateTitlesInCategories; CategoriesModule.AllowDublicateTitlesInItems = TempAllowDublicateTitlesInItems; } else { AddMessages(MsgModule, 0); } }
public static string GetModuleIdentifire(object moduleTypeID) { int moduleid = (int)moduleTypeID; if (moduleid < 500) { ItemsModulesOptions itemModule = ItemsModulesOptions.GetType(moduleid); if (itemModule != null) { return(itemModule.Identifire); } } else { MessagesModuleOptions msgmodule = MessagesModuleOptions.GetType(moduleid); if (msgmodule != null) { return(msgmodule.Identifire); } } return(""); }
//----------------------------------------------- //Page_Load //----------------------------------------------- private void Page_Load(object sender, System.EventArgs e) { lblResult.Text = ""; currentModule = ItemsModulesOptions.GetType(ModuleTypeID); if (!IsPostBack) { #region ---------------lblFileText--------------- switch (FileType) { case ItemFileTypes.Photo: lblFileText.Text = Resources.ItemsFiles.ItemFileType_Photo; break; case ItemFileTypes.File: lblFileText.Text = Resources.ItemsFiles.ItemFileType_File; break; case ItemFileTypes.Audio: lblFileText.Text = Resources.ItemsFiles.ItemFileType_Audio; break; case ItemFileTypes.Video: lblFileText.Text = Resources.ItemsFiles.ItemFileType_Video; break; default: lblFileText.Text = Resources.ItemsFiles.ItemFileType_File; break; } //---------------------------------------- #endregion LoadData(); //if (currentModule.ModuleTypeID != 101) { TrTitle.Visible = false; } } }
//--------------------------------------------------------- //BuildCategoriesPathLinksInSubFolder //--------------------------------------------------------- public bool BuildCategoriesPathLinksInSubFolder(int categoryID, bool lastLink, bool setTags) { bool hasLinks = false; if (categoryID > 0) { List <ItemCategoriesEntity> cdp = ItemCategoriesFactory.GetFullPath(categoryID); if (cdp.Count > 0) { hasLinks = true; ItemCategoriesEntity lastCat = null; ItemsModulesOptions currentModule = ItemsModulesOptions.GetType(cdp[0].ModuleTypeID); string url = ""; for (int i = 0; i < cdp.Count; i++) { if (lastLink && i == cdp.Count - 1) { lastCat = cdp[i]; _PathControl.AddLink(lastCat.Title, null); if (setTags) { DCMetaBuilder metaBuilder = DCMetaBuilder.Instance; metaBuilder.SubSection = lastCat.Title; metaBuilder.Title = lastCat.Title; } } else { //url = "../default.aspx?id=" + cdp[i].CategoryID; DCSiteUrls.Instance.BuildItemCategoriesLink(cdp[i].CategoryID, cdp[i].Title, currentModule); _PathControl.AddLink(cdp[i].Title, url); } } } } return(hasLinks); }
public static string GetText(int moduleType, string resourceKey) { ItemsModulesOptions itemsModule = ItemsModulesOptions.GetType(moduleType); return(GetText(itemsModule, resourceKey)); }
//---------------------------------------------------------- #region ----------------BuildItemsModuleLinks--------------- //---------------------------------------------------------- //BuildItemsModuleLinks //---------------------------------------------------------- public string BuildItemsModuleLinks(int moduleType) { ItemsModulesOptions itemsModule = ItemsModulesOptions.GetType(moduleType); string moduleTitleText = itemsModule.GetModuleTitle(); string categoriesAddText = Resources.Modules.Module_CategoriesAdd; string categoriesDefaultText = Resources.Modules.Module_CategoriesDefault; string itemsAddText = Resources.Modules.Module_ItemsAdd; string itemsDefaultText = Resources.Modules.Module_ItemsDefault; string itemsPhotosAddText = Resources.Modules.Module_ItemsPhotosAdd; //string Module_NewMessage = DynamicResource.GetText(itemsModule, "Module_NewMessage"); //string Module_AllMessage = DynamicResource.GetText(itemsModule, "Module_AllMessage"); string commentsInactiveText = Resources.Modules.Module_CommentsInactive; string newMessageText = Resources.Modules.Module_NewMessage; string allMessageText = Resources.Modules.Module_AllMessage; if (itemsModule.HasSpecialAdminText) { //moduleTitleText = itemsModule.GetModuleTitle(); categoriesAddText = DynamicResource.GetText(itemsModule, "Module_CategoriesAdd"); categoriesDefaultText = DynamicResource.GetText(itemsModule, "Module_CategoriesDefault"); itemsAddText = DynamicResource.GetText(itemsModule, "Module_ItemsAdd"); itemsDefaultText = DynamicResource.GetText(itemsModule, "Module_ItemsDefault"); itemsPhotosAddText = DynamicResource.GetText(itemsModule, "Module_ItemsPhotosAdd"); commentsInactiveText = DynamicResource.GetText(itemsModule, "Module_CommentsInactive"); newMessageText = DynamicResource.GetText(itemsModule, "Module_NewMessage"); allMessageText = DynamicResource.GetText(itemsModule, "Module_AllMessage"); } string links = ""; string folder = itemsModule.Identifire.ToString(); if (ZecurityManager.CheckFolderPermission("/AdminCP/Items/" + folder + "/")) { links += "<li " + AdditionalLinkClassIfActive("/AdminCP/Items/" + folder + "/") + "><a href=\"#\"><i class=\"icon-stack2\"></i><span>" + itemsModule.GetModuleTitle() + "</span></a>"; links += "<ul>"; if (itemsModule.CategoryLevel != 0 && itemsModule.DisplayCategoriesInAdminMenue) { links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Cats/Add.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Cats/Add.aspx\">" + categoriesAddText + "</a></li>"; links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Cats/default.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Cats/default.aspx\">" + categoriesDefaultText + "</a></li>"; } links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Add.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Add.aspx\">" + itemsAddText + "</a></li>"; links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/default.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/default.aspx\">" + itemsDefaultText + "</a></li>"; if (itemsModule.HasMultiPhotos) { links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/AddPhoto.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/AddPhoto.aspx\">" + itemsPhotosAddText + "</a></li>"; } if (itemsModule.MessagesModuleID > 0) { links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Messages/New.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Messages/New.aspx\">" + newMessageText + "</a></li>"; links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Messages/default.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Messages/default.aspx\">" + DynamicResource.GetText(itemsModule, "Module_AllMessage") + "</a></li>"; } if (itemsModule.HasComments) { int inactiveCommentsCount = ItemsCommentsFactory.GetCount(-1, Languages.Unknowen, itemsModule.ModuleTypeID, true, false, false, SitesHandler.GetOwnerIDAsGuid()); links += "<li " + AdditionalLinkClassIfActive("/Items/" + folder + "/Comments/InActive.aspx") + "><a href=\"/AdminCP/Items/" + folder + "/Comments/InActive.aspx\">" + commentsInactiveText + " -" + inactiveCommentsCount + "</a></li>"; links += " "; } links += "</ul>"; } return(links); }
public string BuildDynamicModulesLinks() { //------------------------------------------------------------------ string links = ""; string folder = ""; string linkIdentifire = ""; int availableItemsModulesCount = 0; int availableMsgsModulesCount = 0; int availableUsersModulesCount = 0; int availableStaticPagesCount = 0; //------------------------------------------------------------------ string itemsModulesLinks = ""; string msgsModulesLinks = ""; string usersModulesLinks = ""; string staticPagesLinks = ""; //------------------------------------------------------------------ SiteModulesManager siteModules = SiteModulesManager.Instance; if (siteModules.AllModules.Count > 0) { itemsModulesLinks += "<tr><td class=\"menuheader expandable\">موديولات العرض</td></tr>"; itemsModulesLinks += "<tr><td><ul class=\"categoryitems\">"; itemsModulesLinks += "<li><a href=\"/\">الرئيسية</a></li>"; foreach (ItemsModulesOptions module in siteModules.SiteItemsModulesList) { if (module.IsAvailabe) { availableItemsModulesCount += 1; folder = module.Identifire.ToString(); linkIdentifire = "1-" + module.ModuleTypeID + "-0-1"; //itemsModulesLinks += "<li><a href=\"/WebSite/" + folder + "/default.aspx\">" + module.GetModuleTitle() + "</a></li>"; //news/1-12-0-1/maskaznews.aspx itemsModulesLinks += "<li><a href=\"/" + folder + "/" + linkIdentifire + "/" + folder + ".aspx\">" + module.GetModuleTitle() + "</a></li>"; } } itemsModulesLinks += "</ul></td></tr>"; //------------------------------------------------------------------ if (availableItemsModulesCount == 0) { itemsModulesLinks = ""; } //------------------------------------------------------------------ } //------------------------------------------------------------------ //------------------------------------------------------------------ if (siteModules.SiteMessagesModulesList.Count > 0) { msgsModulesLinks += "<tr><td class=\"menuheader expandable\">موديولات المراسلة</td></tr>"; msgsModulesLinks += "<tr><td><ul class=\"categoryitems\">"; foreach (MessagesModuleOptions module in siteModules.SiteMessagesModulesList) { if (module.IsAvailabe) { availableMsgsModulesCount += 1; folder = module.Identifire.ToString(); if (module.HasIsAvailable) { msgsModulesLinks += "<li><a href=\"/WebSite/" + folder + "/Default.aspx\">" + module.GetModuleTitle() + "</a></li>"; } else { msgsModulesLinks += "<li><a href=\"/WebSite/" + folder + "/Send.aspx\">" + module.GetModuleTitle() + "</a></li>"; } } } msgsModulesLinks += "</ul></td></tr>"; //------------------------------------------------------------------ if (availableMsgsModulesCount == 0) { msgsModulesLinks = ""; } //------------------------------------------------------------------ } //------------------------------------------------------------------ //------------------------------------------------------------------ if (siteModules.SiteUsersDataModulesList.Count > 0) { usersModulesLinks += "<tr><td class=\"menuheader expandable\">موديولات التسجيل</td></tr>"; usersModulesLinks += "<tr><td><ul class=\"categoryitems\">"; foreach (UsersDataGlobalOptions module in siteModules.SiteUsersDataModulesList) { if (module.IsAvailabe) { availableUsersModulesCount += 1; folder = module.Identifire.ToString(); usersModulesLinks += "<li><a href=\"/WebSite/UsersData/" + folder + "/ViewMembers.aspx\">" + module.GetModuleTitle() + "</a></li>"; } } usersModulesLinks += "</ul></td></tr>"; //------------------------------------------------------------------ if (availableUsersModulesCount == 0) { usersModulesLinks = ""; } //------------------------------------------------------------------ } //------------------------------------------------------------------ ItemsModulesOptions SitePagesModule = ItemsModulesOptions.GetType((int)StandardItemsModuleTypes.SitePages); if (siteModules.SitePagesList.Count > 0) { staticPagesLinks += "<tr><td class=\"menuheader expandable\">الصفحات الثابتة</td></tr>"; staticPagesLinks += "<tr><td><ul class=\"categoryitems\">"; foreach (SitePageOptions page in siteModules.SitePagesList) { if (page.IsAvailabe) { availableStaticPagesCount += 1; staticPagesLinks += "<li><a href=\"/WebSite/SitePages/page.aspx?id=" + page.PageID + "\">" + page.Title + "</a></li>"; } } staticPagesLinks += "</ul></td></tr>"; //------------------------------------------------------------------ if (availableStaticPagesCount == 0) { staticPagesLinks = ""; } //------------------------------------------------------------------ } links += staticPagesLinks; links += itemsModulesLinks; links += msgsModulesLinks; links += usersModulesLinks; return(links); }