public function testExtractNotesThree() { $usfm = '\\v 1 Melusi kaIsrayeli, beka indlebe, okhokhela uJosefa njengomhlambi\\f + Hlab. 81.5.\\f*\\fe + Gen. 48.15. 49.24. Hlab. 77.20. Hlab. 95.7.\\fe*, ohlezi \\add phakathi\\add* \\w kwamakherubhi\\w**\\x + Hlab. 99.1. Eks. 25.22.\\x*, khanyisa\\x + Hlab. 50.2.\\x*.'; $notes = Filter_Usfm::extractNotes($usfm, array("x", "f", "fe")); $standard = array(array(69, '\\f + Hlab. 81.5.\\f*'), array(69, '\\fe + Gen. 48.15. 49.24. Hlab. 77.20. Hlab. 95.7.\\fe*'), array(117, '\\x + Hlab. 99.1. Eks. 25.22.\\x*'), array(127, '\\x + Hlab. 50.2.\\x*')); $this->assertEquals($standard, $notes); }
require_once "../bootstrap/bootstrap.php"; page_access_level(Filter_Roles::TRANSLATOR_LEVEL); $database_config_user = Database_Config_User::getInstance(); $database_bibles = Database_Bibles::getInstance(); $ipc_focus = Ipc_Focus::getInstance(); $bible = $database_config_user->getTargetXrefBible(); $currentBook = $ipc_focus->getBook(); $currentChapter = $ipc_focus->getChapter(); $currentPassage = array($currentBook, $currentChapter, 1); $currentLocation = Filter_Books::passage2integer($currentPassage); $books = $database_bibles->getBooks($bible); foreach ($books as $book) { $chapters = $database_bibles->getChapters($bible, $book); foreach ($chapters as $chapter) { if ($chapter == 0) { continue; } $passage = array($book, $chapter, 1); $location = Filter_Books::passage2integer($passage); if ($location > $currentLocation) { $usfm = $database_bibles->getChapter($bible, $book, $chapter); $xrefs = Filter_Usfm::extractNotes($usfm, array("x")); if (empty($xrefs)) { $ipc_focus->set($book, $chapter, 1); Filter_Url::redirect("index.php"); die; } } } } Filter_Url::redirect("index.php");