コード例 #1
0
ファイル: text.php プロジェクト: alerque/bibledit
 /**
  * This produces and saves the Fallout document.
  * $path: Path to the document.
  */
 public function produceFalloutDocument($path)
 {
     $fallout = new Html_Text(Locale_Translate::_("Fallout"));
     $fallout->newHeading1(Locale_Translate::_("Fallout"));
     foreach ($this->fallout as $line) {
         $fallout->newParagraph();
         $fallout->addText($line);
     }
     $fallout->save($path);
 }
コード例 #2
0
ファイル: web.php プロジェクト: alerque/bibledit
$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);
    // 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);
コード例 #3
0
ファイル: textTest.php プロジェクト: alerque/bibledit
    public function testEmbeddedFormattedNote()
    {
        $html_text = new Html_Text("");
        $html_text->newParagraph();
        $html_text->addText("text");
        $html_text->addNote("𐌰", "f");
        $html_text->openTextStyle(array('marker' => "add"), true, false);
        $html_text->addNoteText("add");
        $html_text->openTextStyle(array('marker' => "nd"), true, true);
        $html_text->addNoteText("nd");
        $html_text->closeTextStyle(true, false);
        $html_text->addNoteText("normal");
        $html_text->addText(".");
        $html = $html_text->getInnerHtml();
        $standard = <<<'EOD'
<p><span>text</span><a href="#note1" id="citation1" class="superscript">𐌰</a><span>.</span></p>
<div><p class="f"><a href="#citation1" id="note1">𐌰</a><span> </span><span class="add">add</span><span class="add nd">nd</span><span>normal</span></p></div>
EOD;
        $this->assertEquals(trim($standard), trim($html));
    }
コード例 #4
0
ファイル: web0.php プロジェクト: alerque/bibledit
$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);