Bloom.Book.TranslationGroupManager.PrepareElementsInPageOrDocument C# (CSharp) Method

PrepareElementsInPageOrDocument() public static method

For each group of editable elements in the div which have lang attributes (normally, a .bloom-translationGroup div), make a new element with the lang code of the vernacular (normally, a .bloom-editable). Also enable/disable editing as warranted (e.g. in shell mode or not)
public static PrepareElementsInPageOrDocument ( XmlNode pageOrDocumentNode, CollectionSettings collectionSettings ) : void
pageOrDocumentNode System.Xml.XmlNode
collectionSettings Bloom.Collection.CollectionSettings
return void
        public static void PrepareElementsInPageOrDocument(XmlNode pageOrDocumentNode, CollectionSettings collectionSettings)
        {
            PrepareElementsOnPageOneLanguage(pageOrDocumentNode, collectionSettings.Language1Iso639Code);
            PrepareElementsOnPageOneLanguage(pageOrDocumentNode, collectionSettings.Language2Iso639Code);

            if (!string.IsNullOrEmpty(collectionSettings.Language3Iso639Code))
            {
                PrepareElementsOnPageOneLanguage(pageOrDocumentNode, collectionSettings.Language3Iso639Code);
            }
        }

Usage Example

Example #1
0
        public static void SetupPage(XmlElement pageDiv, CollectionSettings collectionSettings, string contentLanguageIso1, string contentLanguageIso2)        //, bool inShellMode)
        {
            TranslationGroupManager.PrepareElementsInPageOrDocument(pageDiv, collectionSettings);

            // a page might be "extra" as far as the template is concerned, but
            // once a page is inserted into book (which may become a shell), it's
            // just a normal page
            pageDiv.SetAttribute("data-page", pageDiv.GetAttribute("data-page").Replace("extra", "").Trim());
            ClearAwayDraftText(pageDiv);
        }
All Usage Examples Of Bloom.Book.TranslationGroupManager::PrepareElementsInPageOrDocument