Beispiel #1
0
 public function testHtmlFileNameBible()
 {
     $this->assertEquals("index.html", Filter_Paths::htmlFileNameBible());
     $this->assertEquals("path/index.html", Filter_Paths::htmlFileNameBible("path"));
     $this->assertEquals("path/01-Genesis.html", Filter_Paths::htmlFileNameBible("path", 1));
     $this->assertEquals("01-Genesis.html", Filter_Paths::htmlFileNameBible("", 1));
     $this->assertEquals("path/11-1Kings.html", Filter_Paths::htmlFileNameBible("path", 11));
     $this->assertEquals("path/22-SongofSolomon-000.html", Filter_Paths::htmlFileNameBible("path", 22, 0));
     $this->assertEquals("path/33-Micah-333.html", Filter_Paths::htmlFileNameBible("path", 33, 333));
     $this->assertEquals("33-Micah-333.html", Filter_Paths::htmlFileNameBible("", 33, 333));
 }
Beispiel #2
0
$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);
    // Use small chunks of USFM at a time for much better performance.
    $filter_text_chapter->addUsfmCode($usfm);
    // Interlinked web data for one chapter.
    $filter_text_chapter->html_text_linked = new Html_Text(Locale_Translate::_("Bible"));
    $filter_text_chapter->html_text_linked->customClass = Filter_CustomCSS::getClass($bible);
    // Create breadcrumbs for the chapter.
    $htmlHeader = new Html_Header($filter_text_chapter->html_text_linked);
    $htmlHeader->searchBackLink($backLinkPath . Filter_Paths::htmlFileNameBible("", $book, $chapter), Locale_Translate::_("Go back to") . " " . $bibleBookText . " " . $chapter);
    $htmlHeader->create(array(array($bible, Filter_Paths::htmlFileNameBible()), array($database_books->getEnglishFromId($book), Filter_Paths::htmlFileNameBible()), array($chapter, Filter_Paths::htmlFileNameBible("", $book))));
    // Create interlinked html for the chapter.
    $filter_text_chapter->run($stylesheet);
    $filter_text_chapter->html_text_linked->save(Filter_Paths::htmlFileNameBible($directory, $book, $chapter));
    $html_text_rich_book_index->addLink($html_text_rich_book_index->currentPDomElement, Filter_Paths::htmlFileNameBible("", $book, $chapter), "", $chapter, "", " " . $chapter . " ");
    $html_text_rich_book_index->addText("|");
}
// Save the book index.
$html_text_rich_book_index->save(Filter_Paths::htmlFileNameBible($directory, $book));
$database_logs->log(Locale_Translate::_("Exported to web") . " {$bible} " . Export_Logic::baseBookFileName($book), Filter_Roles::TRANSLATOR_LEVEL);
Beispiel #3
0
// Go through the search hits.
foreach ($ids as $id) {
    // Get the details of this search hit.
    $details = $database_search->getBiblePassage($id);
    if ($details == NULL) {
        continue;
    }
    $bible = $details["bible"];
    $book = $details["book"];
    $chapter = $details["chapter"];
    $verse = $details["verse"];
    // The title.
    $title = "{$bible}" . " | " . Filter_Books::passageDisplay($book, $chapter, $verse);
    $title = Filter_Html::sanitize($title);
    // The URL.
    $url = "../exports/{$bible}/web/" . Filter_Paths::htmlFileNameBible("", $book, $chapter);
    // Output title and URL.
    echo "<p style=\"margin-top: 0.75em; margin-bottom: 0em\"><a href=\"{$url}\">{$title}</a></p>\n";
    // The excerpt.
    $text = $database_search->getBibleVerseText($bible, $book, $chapter, $verse);
    $text = explode("\n", $text);
    $excerpt = "";
    // Go through each line of text separately.
    foreach ($text as $line) {
        $markedLine = Filter_Markup::words($queryWords, $line);
        if ($markedLine != $line) {
            // Store this bit of the excerpt.
            $excerpt .= "<p style=\"margin-top: 0em; margin-bottom: 0em\">{$markedLine}</p>\n";
        }
    }
    echo "{$excerpt}\n";
Beispiel #4
0
$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);
$backLinkPath = Export_Logic::webBackLinkDirectory($bible);
// Main index file.
$html_text_rich_bible_index = new Html_Text($bible);
// On top are the breadcrumbs, starting with a clickable Bible name.
$htmlHeader = new Html_Header($html_text_rich_bible_index);
$htmlHeader->searchBackLink($backLinkPath . Filter_Paths::htmlFileNameBible(), Locale_Translate::_("Go back to Bible"));
$htmlHeader->create(array(array($bible, Filter_Paths::htmlFileNameBible())));
// Prepare for the list of books in de html index file.
$html_text_rich_bible_index->newParagraph("navigationbar");
$html_text_rich_bible_index->addText(" |");
// Go through the Bible books.
$books = $database_bibles->getBooks($bible);
foreach ($books as $book) {
    // Add this book to the main web index.
    $html_text_rich_bible_index->addLink($html_text_rich_bible_index->currentPDomElement, Filter_Paths::htmlFileNameBible("", $book), "", $database_books->getEnglishFromId($book), "", " " . $database_books->getEnglishFromId($book) . " ");
    $html_text_rich_bible_index->addText("|");
}
// Save index file for the interlinked web export.
$database_logs->log("exports: Create index file for interlinked Web");
$html_text_rich_bible_index->save($indexFile);
$html_text_rich_bible_index->save($index00);
// Lens image supporting search.
copy("../webbible/lens.png", "{$directory}/lens.png");
$database_logs->log(Locale_Translate::_("Web export index") . " {$bible}", Filter_Roles::TRANSLATOR_LEVEL);