本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.UpdateModule方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.UpdateModule方法的具体用法?C# ModuleController.UpdateModule怎么用?C# ModuleController.UpdateModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Modules.ModuleController
的用法示例。
在下文中一共展示了ModuleController.UpdateModule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Init
/////////////////////////////////////////////////////////////////////////////////
// EVENT HANDLERS
protected void Page_Init(object sender, EventArgs e)
{
if (ModuleConfiguration.DisplayTitle) {
ModuleConfiguration.DisplayTitle = false;
if (ModuleConfiguration.EndDate == DateTime.MaxValue)
ModuleConfiguration.EndDate = Null.NullDate;
ModuleController modCtrl = new ModuleController();
modCtrl.UpdateModule(ModuleConfiguration);
}
}
示例2: UpdateModuleTitle
protected void UpdateModuleTitle (string title)
{
// replace module title
var mctrl = new ModuleController ();
var module = mctrl.GetModule (ModuleId);
if (module.ModuleTitle != title)
{
module.ModuleTitle = title;
mctrl.UpdateModule (module);
}
}
示例3: cmdUpdate_Click
protected void cmdUpdate_Click(object sender, EventArgs e)
{
try
{
var controller = new ModuleController();
var module = controller.GetModule(ModuleId);
module.ModuleTitle = Title.Text;
module.DesktopModule.Description = txtDescription.Text;
controller.UpdateModule(module);
Response.Redirect(Globals.NavigateURL(), true);
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
示例4: lblTitle_UpdateLabel
protected void lblTitle_UpdateLabel( object source, DNNLabelEditEventArgs e )
{
if( CanEditModule() )
{
ModuleController objModule = new ModuleController();
PortalModuleBase objPortalModule = Container.GetPortalModuleBase( this );
ModuleInfo objModInfo = objModule.GetModule(objPortalModule.ModuleId, objPortalModule.TabId, false);
objModInfo.ModuleTitle = e.Text;
objModule.UpdateModule( objModInfo );
}
}
示例5: submitTranslation_Click
protected void submitTranslation_Click(object sender, EventArgs e)
{
var modCtrl = new ModuleController();
var tabCtrl = new TabController();
foreach (TabInfo localizedTab in Tab.LocalizedTabs.Values)
{
//Make Deep copies of all modules
var moduleCtrl = new ModuleController();
foreach (KeyValuePair<int, ModuleInfo> kvp in moduleCtrl.GetTabModules(Tab.TabID))
{
ModuleInfo sourceModule = kvp.Value;
ModuleInfo localizedModule = null;
//Make sure module has the correct culture code
if (string.IsNullOrEmpty(sourceModule.CultureCode))
{
sourceModule.CultureCode = Tab.CultureCode;
moduleCtrl.UpdateModule(sourceModule);
}
if (!sourceModule.LocalizedModules.TryGetValue(localizedTab.CultureCode, out localizedModule))
{
if (!sourceModule.IsDeleted)
{
//Shallow (Reference Copy)
{
if (sourceModule.AllTabs)
{
foreach (ModuleInfo m in moduleCtrl.GetModuleTabs(sourceModule.ModuleID))
{
//Get the tab
TabInfo allTabsTab = tabCtrl.GetTab(m.TabID, m.PortalID, false);
TabInfo localizedAllTabsTab = null;
if (allTabsTab.LocalizedTabs.TryGetValue(localizedTab.CultureCode, out localizedAllTabsTab))
{
moduleCtrl.CopyModule(m, localizedAllTabsTab, Null.NullString, true);
}
}
}
else
{
moduleCtrl.CopyModule(sourceModule, localizedTab, Null.NullString, true);
}
}
//Fetch new module
localizedModule = moduleCtrl.GetModule(sourceModule.ModuleID, localizedTab.TabID);
//Convert to deep copy
moduleCtrl.LocalizeModule(localizedModule, LocaleController.Instance.GetLocale(localizedTab.CultureCode));
}
}
}
var users = new Dictionary<int, UserInfo>();
//Give default translators for this language and administrators permissions
tabCtrl.GiveTranslatorRoleEditRights(localizedTab, users);
//Send Messages to all the translators of new content
foreach (var translator in users.Values.Where(user => user.UserID != PortalSettings.AdministratorId))
{
AddTranslationSubmittedNotification(localizedTab, translator);
}
}
//Redirect to refresh page (and skinobjects)
Response.Redirect(Request.RawUrl, true);
}
示例6: UpdateTitle
private void UpdateTitle(object source, DNNLabelEditEventArgs e)
{
if (CanEditModule())
{
var moduleController = new ModuleController();
ModuleInfo moduleInfo = moduleController.GetModule(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, false);
moduleInfo.ModuleTitle = e.Text;
moduleController.UpdateModule(moduleInfo);
}
}
示例7: CreateModuleDefinition
//.........这里部分代码省略.........
var objDesktopModule = new DesktopModuleInfo();
objDesktopModule.DesktopModuleID = Null.NullInteger;
objDesktopModule.ModuleName = GetClassName();
objDesktopModule.FolderName = GetFolderName();
objDesktopModule.FriendlyName = txtModule.Text;
objDesktopModule.Description = txtDescription.Text;
objDesktopModule.IsPremium = false;
objDesktopModule.IsAdmin = false;
objDesktopModule.Version = "01.00.00";
objDesktopModule.BusinessControllerClass = "";
objDesktopModule.CompatibleVersions = "";
objDesktopModule.Dependencies = "";
objDesktopModule.Permissions = "";
objDesktopModule.PackageID = objPackage.PackageID;
objDesktopModule.DesktopModuleID = objDesktopModules.AddDesktopModule(objDesktopModule);
objDesktopModule = objDesktopModules.GetDesktopModule(objDesktopModule.DesktopModuleID);
//Add OwnerName to the DesktopModule taxonomy and associate it with this module
var vocabularyId = -1;
var termId = -1;
var objTermController = DotNetNuke.Entities.Content.Common.Util.GetTermController();
var objTerms = objTermController.GetTermsByVocabulary("Module_Categories");
foreach (Term term in objTerms)
{
vocabularyId = term.VocabularyId;
if (term.Name == txtOwner.Text)
{
termId = term.TermId;
}
}
if (termId == -1)
{
termId = objTermController.AddTerm(new Term(vocabularyId) { Name = txtOwner.Text });
}
var objTerm = objTermController.GetTerm(termId);
var objContentController = DotNetNuke.Entities.Content.Common.Util.GetContentController();
var objContent = objContentController.GetContentItem(objDesktopModule.ContentItemId);
objTermController.AddTermToContent(objTerm, objContent);
//Add desktopmodule to all portals
DesktopModuleController.AddDesktopModuleToPortals(objDesktopModule.DesktopModuleID);
//Create module definition
var objModuleDefinition = new ModuleDefinitionInfo();
objModuleDefinition.ModuleDefID = Null.NullInteger;
objModuleDefinition.DesktopModuleID = objDesktopModule.DesktopModuleID;
// need core enhancement to have a unique DefinitionName
objModuleDefinition.FriendlyName = GetClassName();
//objModuleDefinition.FriendlyName = txtModule.Text;
//objModuleDefinition.DefinitionName = GetClassName();
objModuleDefinition.DefaultCacheTime = 0;
objModuleDefinition.ModuleDefID = ModuleDefinitionController.SaveModuleDefinition(objModuleDefinition, false, true);
//Create modulecontrol
var objModuleControl = new ModuleControlInfo();
objModuleControl.ModuleControlID = Null.NullInteger;
objModuleControl.ModuleDefID = objModuleDefinition.ModuleDefID;
objModuleControl.ControlKey = "";
objModuleControl.ControlSrc = "DesktopModules/" + GetFolderName() + "/" + controlName;
objModuleControl.ControlTitle = "";
objModuleControl.ControlType = SecurityAccessLevel.View;
objModuleControl.HelpURL = "";
objModuleControl.IconFile = "";
objModuleControl.ViewOrder = 0;
objModuleControl.SupportsPartialRendering = false;
objModuleControl.SupportsPopUps = false;
ModuleControlController.AddModuleControl(objModuleControl);
//Update current module to reference new moduledefinition
var objModules = new ModuleController();
var objModule = objModules.GetModule(ModuleId, TabId, false);
objModule.ModuleDefID = objModuleDefinition.ModuleDefID;
objModule.ModuleTitle = txtModule.Text;
//HACK - need core enhancement to be able to update ModuleDefID
DotNetNuke.Data.DataProvider.Instance().ExecuteSQL("Update dbo.Modules set ModuleDefID = " + objModule.ModuleDefID.ToString() + " where ModuleID = " + ModuleId.ToString());
objModules.UpdateModule(objModule);
return true;
}
else
{
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TemplateProblem.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning);
return false;
}
}
else
{
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("AlreadyExists.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning);
return false;
}
}
catch (Exception exc)
{
Exceptions.LogException(exc);
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, exc.ToString(), ModuleMessage.ModuleMessageType.RedError);
return false;
}
}
示例8: UpgradeToVersion610
private static void UpgradeToVersion610()
{
AddModuleCategories();
//update languages module
int moduleDefId = GetModuleDefinition("Languages", "Languages");
AddModuleControl(moduleDefId, "LocalizePages", "Localize Pages", "DesktopModules/Admin/Languages/LocalizePages.ascx", "~/images/icon_language_32px.gif", SecurityAccessLevel.Edit, 0, Null.NullString, true);
//add store control
moduleDefId = AddModuleDefinition("Extensions", "", "Extensions");
AddModuleControl(moduleDefId, "Store", "Store Details", "DesktopModules/Admin/Extensions/Store.ascx", "~/images/icon_extensions_32px.png", SecurityAccessLevel.Host, 0);
EnableModalPopUps();
var tabController = new TabController();
var tab = tabController.GetTabByName("Portals", Null.NullInteger);
tab.TabName = "Site Management";
tabController.UpdateTab(tab);
var moduleController = new ModuleController();
foreach (var module in moduleController.GetTabModules(tab.TabID).Values)
{
if (module.ModuleTitle == "Portals")
{
module.ModuleTitle = "Site Management";
moduleController.UpdateModule(module);
}
}
//Add List module to Admin page of every portal
ModuleDefinitionInfo mDef = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Lists");
if (mDef != null)
{
AddAdminPages("Lists",
"Manage common lists",
"~/Icons/Sigma/Lists_16X16_Standard.png",
"~/Icons/Sigma/Lists_32X32_Standard.png",
true,
mDef.ModuleDefID,
"Lists",
"~/Icons/Sigma/Lists_16X16_Standard.png",
true);
}
//update DotNetNuke.Portals' friend name to 'Sites'.
var portalPackage = PackageController.GetPackageByName("DotNetNuke.Portals");
if(portalPackage != null)
{
portalPackage.FriendlyName = "Sites";
PackageController.SavePackage(portalPackage);
}
//add mobile preview control
AddModuleControl(Null.NullInteger, "MobilePreview", "Mobile Preview", "DesktopModules/Admin/MobilePreview/Preview.ascx", string.Empty, SecurityAccessLevel.Admin, Null.NullInteger);
}
示例9: UpgradeToVersion500
private static void UpgradeToVersion500()
{
var portalController = new PortalController();
ArrayList portals = portalController.GetPortals();
var tabController = new TabController();
//Add Edit Permissions for Admin Tabs to legacy portals
var permissionController = new PermissionController();
ArrayList permissions = permissionController.GetPermissionByCodeAndKey("SYSTEM_TAB", "EDIT");
int permissionId = -1;
if (permissions.Count == 1)
{
var permission = permissions[0] as PermissionInfo;
if (permission != null)
{
permissionId = permission.PermissionID;
}
foreach (PortalInfo portal in portals)
{
var adminTab = tabController.GetTab(portal.AdminTabId, portal.PortalID, true);
if (adminTab != null)
{
var tabPermission = new TabPermissionInfo {TabID = adminTab.TabID, PermissionID = permissionId, AllowAccess = true, RoleID = portal.AdministratorRoleId};
if (!TabPermissionExists(tabPermission, portal.PortalID))
{
adminTab.TabPermissions.Add(tabPermission);
}
//Save Tab Permissions to Data Base
TabPermissionController.SaveTabPermissions(adminTab);
foreach (var childTab in TabController.GetTabsByParent(portal.AdminTabId, portal.PortalID))
{
tabPermission = new TabPermissionInfo {TabID = childTab.TabID, PermissionID = permissionId, AllowAccess = true, RoleID = portal.AdministratorRoleId};
if (!TabPermissionExists(tabPermission, portal.PortalID))
{
childTab.TabPermissions.Add(tabPermission);
}
//Save Tab Permissions to Data Base
TabPermissionController.SaveTabPermissions(childTab);
}
}
}
}
//Update Host/Admin modules Visibility setting
bool superTabProcessed = Null.NullBoolean;
var moduleController = new ModuleController();
foreach (PortalInfo portal in portals)
{
if (!superTabProcessed)
{
//Process Host Tabs
foreach (TabInfo childTab in TabController.GetTabsByParent(portal.SuperTabId, Null.NullInteger))
{
foreach (ModuleInfo tabModule in moduleController.GetTabModules(childTab.TabID).Values)
{
tabModule.Visibility = VisibilityState.None;
moduleController.UpdateModule(tabModule);
}
}
}
//Process Portal Tabs
foreach (TabInfo childTab in TabController.GetTabsByParent(portal.AdminTabId, portal.PortalID))
{
foreach (ModuleInfo tabModule in moduleController.GetTabModules(childTab.TabID).Values)
{
tabModule.Visibility = VisibilityState.None;
moduleController.UpdateModule(tabModule);
}
}
}
//Upgrade PortalDesktopModules to support new "model"
permissions = permissionController.GetPermissionByCodeAndKey("SYSTEM_DESKTOPMODULE", "DEPLOY");
if (permissions.Count == 1)
{
var permission = permissions[0] as PermissionInfo;
if (permission != null)
{
permissionId = permission.PermissionID;
}
foreach (PortalInfo portal in portals)
{
foreach (DesktopModuleInfo desktopModule in DesktopModuleController.GetDesktopModules(Null.NullInteger).Values)
{
if (!desktopModule.IsPremium)
{
//Parse the permissions
var deployPermissions = new DesktopModulePermissionCollection();
DesktopModulePermissionInfo deployPermission;
// if Not IsAdmin add Registered Users
if (!desktopModule.IsAdmin)
{
deployPermission = new DesktopModulePermissionInfo {PermissionID = permissionId, AllowAccess = true, RoleID = portal.RegisteredRoleId};
deployPermissions.Add(deployPermission);
}
//.........这里部分代码省略.........
示例10: UpdateModuleTitleIfNecessary
protected void UpdateModuleTitleIfNecessary(Entity entity)
{
// Creating new Context, because EntityTitle gets not refreshed otherwise
var sexyContext = new SexyContent(ZoneId, AppId, true);
// Get ContentGroup
var listContentGroupItem = ContentGroup.ListContent;
var entityModel = new DbLoadIntoEavDataStructure(sexyContext.ContentContext).GetEavEntity(entity.EntityID); // sexyContext.ContentContext.GetEntityModel(entity.EntityID);
// If this is the list title, or no list-title exists, set module title
if (ItemType == "ListContent" || (listContentGroupItem == null && ItemType == "Content" && SortOrder == 0) && entityModel.IsPublished)
{
var languages = Sexy.ContentContext.Dimensions.GetLanguages();
// Find Module for default language
var moduleController = new ModuleController();
var originalModule = moduleController.GetModule(ModuleID);
// Update Original Module if no languages active
if (languages.Count == 0)
{
// Get Title value of Entitiy in current language
var titleValue = entityModel.Title[0].ToString();
originalModule.ModuleTitle = titleValue;
moduleController.UpdateModule(originalModule);
}
foreach (var dimension in languages)
{
// Get Title value of Entitiy in current language
var titleValue = entityModel.Title[dimension.DimensionID].ToString();
if(!originalModule.IsDefaultLanguage)
originalModule = originalModule.DefaultLanguageModule;
// Break if default language module is null
if (originalModule == null)
return;
// Find module for given Culture
var moduleByCulture = moduleController.GetModuleByCulture(originalModule.ModuleID, originalModule.TabID, PortalId, LocaleController.Instance.GetLocale(dimension.ExternalKey));
// Break if no module found
if (moduleByCulture == null)
return;
moduleByCulture.ModuleTitle = titleValue;
moduleController.UpdateModule(moduleByCulture);
}
}
}
示例11: readyForTranslationButton_Click
protected void readyForTranslationButton_Click(object sender, EventArgs e)
{
var modCtrl = new ModuleController();
var tabCtrl = new TabController();
foreach (TabInfo localizedTab in Tab.LocalizedTabs.Values)
{
//Make Deep copies of all modules
var moduleCtrl = new ModuleController();
foreach (KeyValuePair<int, ModuleInfo> kvp in moduleCtrl.GetTabModules(Tab.TabID))
{
ModuleInfo sourceModule = kvp.Value;
ModuleInfo localizedModule = null;
//Make sure module has the correct culture code
if (string.IsNullOrEmpty(sourceModule.CultureCode))
{
sourceModule.CultureCode = Tab.CultureCode;
moduleCtrl.UpdateModule(sourceModule);
}
if (!sourceModule.LocalizedModules.TryGetValue(localizedTab.CultureCode, out localizedModule))
{
if (!sourceModule.IsDeleted)
{
//Shallow (Reference Copy)
{
if (sourceModule.AllTabs)
{
foreach (ModuleInfo m in moduleCtrl.GetModuleTabs(sourceModule.ModuleID))
{
//Get the tab
TabInfo allTabsTab = tabCtrl.GetTab(m.TabID, m.PortalID, false);
TabInfo localizedAllTabsTab = null;
if (allTabsTab.LocalizedTabs.TryGetValue(localizedTab.CultureCode, out localizedAllTabsTab))
{
moduleCtrl.CopyModule(m, localizedAllTabsTab, Null.NullString, true);
}
}
}
else
{
moduleCtrl.CopyModule(sourceModule, localizedTab, Null.NullString, true);
}
}
//Fetch new module
localizedModule = moduleCtrl.GetModule(sourceModule.ModuleID, localizedTab.TabID);
//Convert to deep copy
moduleCtrl.LocalizeModule(localizedModule, LocaleController.Instance.GetLocale(localizedTab.CultureCode));
}
}
}
var users = new Dictionary<int, UserInfo>();
//Give default translators for this language and administrators permissions
tabCtrl.GiveTranslatorRoleEditRights(localizedTab, users);
//Send Messages to all the translators of new content
foreach (UserInfo translator in users.Values)
{
if (translator.UserID != PortalSettings.AdministratorId)
{
var message = new Message();
message.FromUserID = PortalSettings.AdministratorId;
message.ToUserID = translator.UserID;
message.Subject = Localization.GetString("NewContentMessage.Subject", LocalResourceFile);
message.Status = MessageStatusType.Unread;
message.Body = string.Format(Localization.GetString("NewContentMessage.Body", LocalResourceFile),
localizedTab.TabName,
Globals.NavigateURL(localizedTab.TabID, false, PortalSettings, Null.NullString, localizedTab.CultureCode, new string[] { }));
var messageCtrl = new MessagingController();
messageCtrl.SaveMessage(message);
}
}
}
//Redirect to refresh page (and skinobjects)
Response.Redirect(Request.RawUrl, true);
}
示例12: UpdateSettings
/// <summary>
/// UpdateSettings saves the modified settings to the Database
/// </summary>
public override void UpdateSettings()
{
try
{
var htmlTextController = new HtmlTextController();
var objWorkflow = new WorkflowStateController();
// update replace token setting
var objModules = new ModuleController();
objModules.UpdateModuleSetting(ModuleId, "HtmlText_ReplaceTokens", chkReplaceTokens.Checked.ToString());
objModules.UpdateModuleSetting(ModuleId, "HtmlText_UseDecorate", cbDecorate.Checked ? "1" : "0");
objModules.UpdateModuleSetting(ModuleId, "HtmlText_SearchDescLength", txtSearchDescLength.Text);
// disable module caching if token replace is enabled
if (chkReplaceTokens.Checked)
{
ModuleInfo objModule = objModules.GetModule(ModuleId, TabId, false);
if (objModule.CacheTime > 0)
{
objModule.CacheTime = 0;
objModules.UpdateModule(objModule);
}
}
// update workflow/version settings
switch (rblApplyTo.SelectedValue)
{
case "Module":
htmlTextController.UpdateWorkflow(ModuleId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked);
break;
case "Page":
htmlTextController.UpdateWorkflow(TabId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked);
break;
case "Site":
htmlTextController.UpdateWorkflow(PortalId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked);
break;
}
//Module failed to load
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
示例13: cmdUpdate_Click
/// <summary>
/// cmdUpdate_Click runs when the Update LinkButton is clicked.
/// It saves the current Site Settings
/// </summary>
/// <history>
/// [cnurse] 10/18/2004 documented
/// [cnurse] 10/19/2004 modified to support custm module specific settings
/// </history>
protected void cmdUpdate_Click( object Sender, EventArgs e )
{
try
{
if( Page.IsValid )
{
ModuleController objModules = new ModuleController();
bool AllTabsChanged = false;
// tab administrators can only manage their own tab
if( PortalSecurity.IsInRoles( PortalSettings.AdministratorRoleName ) == false )
{
chkAllTabs.Enabled = false;
chkDefault.Enabled = false;
chkAllModules.Enabled = false;
cboTab.Enabled = false;
}
// update module
ModuleInfo objModule = objModules.GetModule( moduleId, TabId, false );
objModule.ModuleID = moduleId;
objModule.ModuleTitle = txtTitle.Text;
objModule.Alignment = cboAlign.SelectedItem.Value;
objModule.Color = txtColor.Text;
objModule.Border = txtBorder.Text;
objModule.IconFile = ctlIcon.Url;
if( !String.IsNullOrEmpty( txtCacheTime.Text ) )
{
objModule.CacheTime = int.Parse( txtCacheTime.Text );
}
else
{
objModule.CacheTime = 0;
}
objModule.TabID = TabId;
if( objModule.AllTabs != chkAllTabs.Checked )
{
AllTabsChanged = true;
}
objModule.AllTabs = chkAllTabs.Checked;
switch( int.Parse( cboVisibility.SelectedItem.Value ) )
{
case 0:
objModule.Visibility = VisibilityState.Maximized;
break;
case 1:
objModule.Visibility = VisibilityState.Minimized;
break;
case 2:
objModule.Visibility = VisibilityState.None;
break;
}
objModule.IsDeleted = false;
objModule.Header = txtHeader.Text;
objModule.Footer = txtFooter.Text;
if( !String.IsNullOrEmpty( txtStartDate.Text ) )
{
objModule.StartDate = Convert.ToDateTime( txtStartDate.Text );
}
else
{
objModule.StartDate = Null.NullDate;
}
if( !String.IsNullOrEmpty( txtEndDate.Text ) )
{
objModule.EndDate = Convert.ToDateTime( txtEndDate.Text );
}
else
{
objModule.EndDate = Null.NullDate;
}
objModule.ContainerSrc = ctlModuleContainer.SkinSrc;
objModule.ModulePermissions = dgPermissions.Permissions;
objModule.InheritViewPermissions = chkInheritPermissions.Checked;
objModule.DisplayTitle = chkDisplayTitle.Checked;
objModule.DisplayPrint = chkDisplayPrint.Checked;
objModule.DisplaySyndicate = chkDisplaySyndicate.Checked;
objModule.IsDefaultModule = chkDefault.Checked;
objModule.AllModules = chkAllModules.Checked;
objModules.UpdateModule( objModule );
//Update Custom Settings
if( ctlSpecific != null )
{
ctlSpecific.UpdateSettings();
}
//These Module Copy/Move statements must be
//.........这里部分代码省略.........
示例14: UpdateModuleTitle
public static void UpdateModuleTitle(ModuleInfo Module, string ModuleTitle)
{
if (Module.ModuleTitle != ModuleTitle)
{
ModuleController mc = new ModuleController();
var mod = mc.GetModule(Module.ModuleID, Module.TabID, true);
mod.ModuleTitle = ModuleTitle;
mc.UpdateModule(mod);
}
}
示例15: cmdRestoreModule_Click
/// <summary>
/// Restores selected modules in the listbox
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks>
/// Adds a log entry for each restored module to the EventLog
/// </remarks>
/// <history>
/// [VMasanas] 18/08/2004 Added support for multiselect listbox
/// </history>
protected void cmdRestoreModule_Click( Object sender, ImageClickEventArgs e )
{
EventLogController objEventLog = new EventLogController();
ModuleController objModules = new ModuleController();
ListItem item;
if( cboTab.SelectedItem != null )
{
foreach( ListItem tempLoopVar_item in lstModules.Items )
{
item = tempLoopVar_item;
if( item.Selected )
{
ModuleInfo objModule = objModules.GetModule( int.Parse( item.Value ), Null.NullInteger );
if( objModule != null )
{
objModule.IsDeleted = false;
objModule.TabID = Null.NullInteger;
objModules.UpdateModule( objModule );
// set defaults
objModule.CacheTime = 0;
objModule.Alignment = "";
objModule.Color = "";
objModule.Border = "";
objModule.IconFile = "";
objModule.Visibility = VisibilityState.Maximized;
objModule.ContainerSrc = "";
objModule.DisplayTitle = true;
objModule.DisplayPrint = true;
objModule.DisplaySyndicate = false;
objModule.AllTabs = false;
// get default module settings
Hashtable settings = PortalSettings.GetSiteSettings( PortalId );
if( Convert.ToString( settings["defaultmoduleid"] ) != "" && Convert.ToString( settings["defaulttabid"] ) != "" )
{
ModuleInfo objDefaultModule = objModules.GetModule( int.Parse( Convert.ToString( settings["defaultmoduleid"] ) ), int.Parse( Convert.ToString( settings["defaulttabid"] ) ) );
if( objDefaultModule != null )
{
objModule.CacheTime = objDefaultModule.CacheTime;
objModule.Alignment = objDefaultModule.Alignment;
objModule.Color = objDefaultModule.Color;
objModule.Border = objDefaultModule.Border;
objModule.IconFile = objDefaultModule.IconFile;
objModule.Visibility = objDefaultModule.Visibility;
objModule.ContainerSrc = objDefaultModule.ContainerSrc;
objModule.DisplayTitle = objDefaultModule.DisplayTitle;
objModule.DisplayPrint = objDefaultModule.DisplayPrint;
objModule.DisplaySyndicate = objDefaultModule.DisplaySyndicate;
}
}
// add tab module
objModule.TabID = int.Parse( cboTab.SelectedItem.Value );
objModule.PaneName = Globals.glbDefaultPane;
objModule.ModuleOrder = - 1;
objModules.AddModule( objModule );
objEventLog.AddLog( objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_RESTORED );
}
}
}
BindData();
}
}