本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.UpdateTranslationStatus方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.UpdateTranslationStatus方法的具体用法?C# ModuleController.UpdateTranslationStatus怎么用?C# ModuleController.UpdateTranslationStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Modules.ModuleController
的用法示例。
在下文中一共展示了ModuleController.UpdateTranslationStatus方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkTranslatedSelectedItems
public void MarkTranslatedSelectedItems(bool translated)
{
var moduleCtrl = new ModuleController();
foreach (GridDataItem row in localizedModulesGrid.SelectedItems)
{
var localizedModuleId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["ModuleId"];
var localizedTabId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["TabId"];
ModuleInfo sourceModule = moduleCtrl.GetModule(localizedModuleId, localizedTabId, false);
if (sourceModule.IsLocalized)
{
moduleCtrl.UpdateTranslationStatus(sourceModule, translated);
}
}
moduleCtrl.ClearCache(TabId);
//Rebind localized Modules
DataBind();
//Raise Changed event
OnModuleLocalizationChanged(EventArgs.Empty);
}
示例2: LocalizeSelectedItems
public void LocalizeSelectedItems(bool localize)
{
var moduleCtrl = new ModuleController();
foreach (GridDataItem row in localizedModulesGrid.SelectedItems)
{
var localizedModuleId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["ModuleId"];
var localizedTabId = (int)row.OwnerTableView.DataKeyValues[row.ItemIndex]["TabId"];
ModuleInfo sourceModule = moduleCtrl.GetModule(localizedModuleId, localizedTabId, false);
if (sourceModule != null)
{
if (sourceModule.DefaultLanguageModule != null)
{
if (localize)
{
//Localize
moduleCtrl.LocalizeModule(sourceModule, LocaleController.Instance.GetLocale(sourceModule.CultureCode));
}
else
{
//Delocalize
moduleCtrl.DeLocalizeModule(sourceModule);
//Mark module as Not Translated
moduleCtrl.UpdateTranslationStatus(sourceModule, false);
}
}
}
}
moduleCtrl.ClearCache(TabId);
//Rebind localized Modules
DataBind();
//Raise Changed event
OnModuleLocalizationChanged(EventArgs.Empty);
}
示例3: SynchronizeModule
/// <summary>
/// Synchronizes the module content between cache and database.
/// </summary>
/// <param name="moduleID">The module ID.</param>
public static void SynchronizeModule(int moduleID)
{
var moduleController = new ModuleController();
ArrayList modules = moduleController.GetModuleTabs(moduleID);
var tabController = new TabController();
foreach (ModuleInfo module in modules)
{
Hashtable tabSettings = tabController.GetTabSettings(module.TabID);
if (tabSettings["CacheProvider"] != null && tabSettings["CacheProvider"].ToString().Length > 0)
{
var outputProvider = OutputCachingProvider.Instance(tabSettings["CacheProvider"].ToString());
if (outputProvider != null)
{
outputProvider.Remove(module.TabID);
}
}
if (module.CacheTime > 0)
{
var moduleProvider = ModuleCachingProvider.Instance(module.GetEffectiveCacheMethod());
if (moduleProvider != null)
{
moduleProvider.Remove(module.TabModuleID);
}
}
//Synchronize module is called when a module needs to indicate that the content
//has changed and the cache's should be refreshed. So we can update the Version
//and also the LastContentModificationDate
UpdateTabModuleVersion(module.TabModuleID);
dataProvider.UpdateModuleLastContentModifiedOnDate(module.ModuleID);
//We should also indicate that the Transalation Status has changed
if (PortalController.GetPortalSettingAsBoolean("ContentLocalizationEnabled", module.PortalID, false))
{
moduleController.UpdateTranslationStatus(module, false);
}
// and clear the cache
moduleController.ClearCache(module.TabID);
}
}
示例4: publishPageButton_Click
protected void publishPageButton_Click(object sender, EventArgs e)
{
var tabCtrl = new TabController();
var modCtrl = new ModuleController();
//First mark all modules as translated
foreach (ModuleInfo m in modCtrl.GetTabModules(Tab.TabID).Values)
{
modCtrl.UpdateTranslationStatus(m, true);
}
//First mark tab as translated
tabCtrl.UpdateTranslationStatus(Tab, true);
//Next publish Tab (update Permissions)
tabCtrl.PublishTab(Tab);
//Redirect to refresh page (and skinobjects)
Response.Redirect(Request.RawUrl, true);
}
示例5: Translate
private void Translate(ModuleAction Command)
{
var moduleCtrl = new ModuleController();
ModuleInfo sourceModule = moduleCtrl.GetModule(ModuleContext.ModuleId, ModuleContext.TabId, false);
switch (Command.CommandName)
{
case ModuleActionType.TranslateModule:
moduleCtrl.UpdateTranslationStatus(sourceModule, true);
break;
case ModuleActionType.UnTranslateModule:
moduleCtrl.UpdateTranslationStatus(sourceModule, false);
break;
}
// Redirect to the same page to pick up changes
Response.Redirect(Request.RawUrl, true);
}