Esempio n. 1
0
        public int GetLatestVersion(int moduleId)
        {
            var moduleVersionSettings = new PagePublishing.ModuleVersions(moduleId, Log);
            var ver = moduleVersionSettings.GetLatestVersion();

            Log.Add($"GetLatestVersion(m:{moduleId}) = ver:{ver}");
            return(ver);
        }
Esempio n. 2
0
        public int GetPublishedVersion(int moduleId)
        {
            var moduleVersionSettings = new PagePublishing.ModuleVersions(moduleId, Log);
            var publ = moduleVersionSettings.GetPublishedVersion();

            Log.Add($"GetPublishedVersion(m:{moduleId}) = pub:{publ}");
            return(publ);
        }
Esempio n. 3
0
        public void DoInsidePublishing(int moduleId, int userId, Action <VersioningActionInfo> action)
        {
            var enabled = IsEnabled(moduleId);

            Log.Add($"DoInsidePublishing(module:{moduleId}, user:{userId}, enabled:{enabled})");
            if (enabled)
            {
                var moduleVersionSettings = new PagePublishing.ModuleVersions(moduleId, Log);

                // Get an new version number and submit it to DNN
                // The submission must be made every time something changes, because a "discard" could have happened
                // in the meantime.
                TabChangeTracker.Instance.TrackModuleModification(
                    moduleVersionSettings.ModuleInfo,
                    moduleVersionSettings.IncreaseLatestVersion(),
                    userId
                    );
            }

            var versioningActionInfo = new VersioningActionInfo();

            action.Invoke(versioningActionInfo);
            Log.Add("/DoInsidePublishing");
        }