public function customize($bible) { $database_config_bible = Database_Config_Bible::getInstance(); $class = Filter_CustomCSS::getClass($bible); $font = $database_config_bible->getTextFont($bible); $uploaded_font = Fonts_Logic::fontExists($font); $font = Fonts_Logic::getFontPath($font); $direction = $database_config_bible->getTextDirection($bible); $css = Filter_CustomCSS::getCss($class, $font, $direction); if ($uploaded_font) { $css = str_replace("../fonts/", "", $css); } $this->css[] = $css; }
// Filename for the html file. $basename = Export_Logic::baseBookFileName($book); $filename = "{$directory}/{$basename}.html"; $filecss = "{$directory}/stylesheet.css"; $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); // Create stylesheet. $styles_sheets = new Styles_Sheets(); $styles_sheets->create($stylesheet, $filecss, false, $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}"); } } $filter_text = new Filter_Text($bible); $filter_text->html_text_standard = new Html_Text(Locale_Translate::_("Bible")); $filter_text->html_text_standard->customClass = Filter_CustomCSS::getClass($bible); // Load one book. $chapters = $database_bibles->getChapters($bible, $book); foreach ($chapters as $chapter) { $usfm = $database_bibles->getChapter($bible, $book, $chapter); $usfm = trim($usfm); // Use small chunks of USFM at a time for much better performance. $filter_text->addUsfmCode($usfm); }