mkdir($directory, 0777, true); } $database_logs = Database_Logs::getInstance(); $database_config_bible = Database_Config_Bible::getInstance(); $database_bibles = Database_Bibles::getInstance(); $database_books = Database_Books::getInstance(); $stylesheet = $database_config_bible->getExportStylesheet($bible); // Copy font to the output directory. $font = $database_config_bible->getTextFont($bible); if ($font) { if (Fonts_Logic::fontExists($font)) { $fontpath = Fonts_Logic::getFontPath($font); copy($fontpath, "{$directory}/{$font}"); } } $backLinkPath = Export_Logic::webBackLinkDirectory($bible); $bibleBookText = $bible . " " . $database_books->getEnglishFromId($book); // Web index file for the book. $html_text_rich_book_index = new Html_Text($bibleBookText); $htmlHeader = new Html_Header($html_text_rich_book_index); $htmlHeader->searchBackLink($backLinkPath . Filter_Paths::htmlFileNameBible("", $book), Locale_Translate::_("Go back to") . " " . $bibleBookText); $htmlHeader->create(array(array($bible, Filter_Paths::htmlFileNameBible()), array($database_books->getEnglishFromId($book), Filter_Paths::htmlFileNameBible()))); $html_text_rich_book_index->newParagraph("navigationbar"); $html_text_rich_book_index->addText("|"); // Go through the chapters of this book. $chapters = $database_bibles->getChapters($bible, $book); foreach ($chapters as $chapter) { // The text filter for this chapter. $filter_text_chapter = new Filter_Text($bible); $usfm = $database_bibles->getChapter($bible, $book, $chapter); $usfm = trim($usfm);