public static void SynchronizeModuleHack (this IModuleControl module)
        {
            ModuleController.SynchronizeModule (module.ModuleContext.ModuleId);

            // NOTE: update module cache (temporary fix before 7.2.0)?
            // more info: https://github.com/dnnsoftware/Dnn.Platform/pull/21
            var moduleController = new ModuleController ();
            moduleController.ClearCache (module.ModuleContext.TabId);

        }
        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);
        }
        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);
        }
        protected void CmdDeleteModuleClick(object sender, EventArgs e)
        {
            var moduleId = Convert.ToInt32(((ImageButton)sender).CommandArgument);
            var tabId = Convert.ToInt32(ctlPages.SelectedNode.Value);

            var moduleController = new ModuleController();
            moduleController.DeleteTabModule(tabId, moduleId, true);
            moduleController.ClearCache(tabId);

            grdModules.Rebind();
        }
        /// <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);
            }
        }