Ejemplo n.º 1
0
 public function consultationNote($id)
 {
     $database_notes = Database_Notes::getInstance();
     $database_logs = Database_Logs::getInstance();
     $passage = $database_notes->getPassages($id);
     $passageText = Filter_Books::passagesDisplayInline($passage);
     $summary = $database_notes->getSummary($id);
     $contents = $database_notes->getContents($id);
     $contents = Filter_Html::html2text($contents);
     $session_logic = Session_Logic::getInstance();
     $username = $session_logic->currentUser();
     $database_logs->log("{$username} deleted / marked for deletion consultation note {$passageText} | {$summary} | {$contents}");
 }
Ejemplo n.º 2
0
 public function create($breadcrumbs)
 {
     $tableElement = $this->htmlText->newTable();
     $tableRowElement = $this->htmlText->newTableRow($tableElement);
     $tableDataElement = $this->htmlText->newTableData($tableRowElement);
     if (is_array($breadcrumbs)) {
         $crumbAdded = false;
         foreach ($breadcrumbs as $breadcrumb) {
             if ($crumbAdded) {
                 $spanElement = $this->htmlText->newElement("span");
                 $spanElement->nodeValue = Filter_Html::sanitize("»");
                 $tableDataElement->appendChild($spanElement);
             }
             $this->htmlText->addLink($tableDataElement, $breadcrumb[1], "", $breadcrumb[0], "", ' ' . $breadcrumb[0] . ' ');
             $crumbAdded = true;
         }
     }
     $tableDataElement = $this->htmlText->newTableData($tableRowElement, true);
     $formElement = $this->htmlText->newElement("form");
     $tableDataElement->appendChild($formElement);
     $formElement->setAttribute("action", "../../../webbible/search.php");
     $formElement->setAttribute("method", "GET");
     $formElement->setAttribute("name", "search");
     $formElement->setAttribute("id", "search");
     $inputElement = $this->htmlText->newElement("input");
     $formElement->appendChild($inputElement);
     $inputElement->setAttribute("name", "q");
     $inputElement->setAttribute("type", "text");
     $inputElement->setAttribute("placeholder", Locale_Translate::_("Search the Bible"));
     $inputElement = $this->htmlText->newElement("input");
     $formElement->appendChild($inputElement);
     $inputElement->setAttribute("type", "image");
     $inputElement->setAttribute("name", "search");
     $inputElement->setAttribute("src", "lens.png");
     $inputElement = $this->htmlText->newElement("input");
     $formElement->appendChild($inputElement);
     $inputElement->setAttribute("type", "hidden");
     $inputElement->setAttribute("name", "url");
     $inputElement->setAttribute("value", $this->searchBackLinkUrl);
     $inputElement = $this->htmlText->newElement("input");
     $formElement->appendChild($inputElement);
     $inputElement->setAttribute("type", "hidden");
     $inputElement->setAttribute("name", "text");
     $inputElement->setAttribute("value", $this->searchBackLinkText);
 }
Ejemplo n.º 3
0
            Checks_Verses::missingPunctuationAtEnd($bible, $book, $chapter, $verses_text, $center_marks, $end_marks);
        }
        if ($check_patterns) {
            Checks_Verses::patterns($bible, $book, $chapter, $verses_text, $checking_patterns);
        }
    }
}
// Identifier for this $bible.
$bibleID = $database_bibles->getID($bible);
// Create an email with the checking results for this $bible.
$emailBody = array();
$hits = $database_check->getHits();
foreach ($hits as $hit) {
    if ($hit['bible'] == $bibleID) {
        $passage = Filter_Books::passagesDisplayInline(array(array($hit['book'], $hit['chapter'], $hit['verse'])));
        $data = Filter_Html::sanitize($hit['data']);
        $result = "<p>{$passage} {$data}</p>";
        $emailBody[] = $result;
    }
}
// Send email to users with write access to the Bible and a subscription to the notification.
if (count($emailBody) > 0) {
    $subject = Locale_Translate::_("Bible Checks") . " " . $bible;
    $emailBody = implode("\n", $emailBody);
    $users = $database_users->getUsers();
    foreach ($users as $user) {
        if ($database_config_user->getUserBibleChecksNotification($user)) {
            if (Access_Bible::write($bible, $user)) {
                if (!Filter_Client::enabled()) {
                    $database_mail->send($user, $subject, $emailBody);
                }
Ejemplo n.º 4
0
        $validator = new Zend_Validate_EmailAddress();
        if (!$validator->isValid($newemail)) {
            $form_is_valid = false;
            $view->view->new_email_invalid_message = Locale_Translate::_("Email address is not valid");
        }
        if (!$database_users->matchUsernamePassword($username, $currentpassword)) {
            $form_is_valid = false;
            $view->view->current_password_invalid_message = Locale_Translate::_("Current password is not valid");
        }
        if ($form_is_valid) {
            $confirm_worker = Confirm_Worker::getInstance();
            $initial_subject = Locale_Translate::_("Email address verification");
            $initial_body = Locale_Translate::_("Somebody requested to change the email address that belongs to your account.");
            $query = $database_users->updateEmailQuery($username, $newemail);
            $subsequent_subject = Locale_Translate::_("Email address change");
            $subsequent_body = Locale_Translate::_("The email address that belongs to your account has been changed successfully.");
            $confirm_worker->setup($newemail, $initial_subject, $initial_body, $query, $subsequent_subject, $subsequent_body);
            $actions_taken = true;
            $success_messages[] = Locale_Translate::_("A verification email was sent to {$newemail}");
        }
    }
    if (!$actions_taken) {
        $success_messages[] = Locale_Translate::_("No changes were made");
    }
}
$view->view->username = Filter_Html::sanitize($username);
$view->view->email = Filter_Html::sanitize($email);
$view->view->success_messages = $success_messages;
$view->view->actions_taken = $actions_taken;
$view->render("account.php");
Assets_Page::footer();
Ejemplo n.º 5
0
if ($assignment_selector != "") {
    if (!in_array($assignment_selector, $assignees)) {
        $view->view->nonexistingassignee = true;
    }
}
$assignment_selector = $database_config_user->getConsultationNotesAssignmentSelector();
$view->view->assignmentselector = $assignment_selector;
$subscription_selector = $database_config_user->getConsultationNotesSubscriptionSelector();
$view->view->subscriptionselector = $subscription_selector;
$view->view->severities = $database_notes->getPossibleSeverities();
$severity_selector = $database_config_user->getConsultationNotesSeveritySelector();
$view->view->severityselector = $severity_selector;
$text_selector = $database_config_user->getConsultationNotesTextSelector();
$view->view->textselector = $text_selector;
$search_text = $database_config_user->getConsultationNotesSearchText();
$view->view->searchtext = Filter_Html::sanitize($search_text);
$passage_inclusion_selector = $database_config_user->getConsultationNotesPassageInclusionSelector();
$view->view->passageinclusionselector = $passage_inclusion_selector;
$text_inclusion_selector = $database_config_user->getConsultationNotesTextInclusionSelector();
$view->view->textinclusionselector = $text_inclusion_selector;
// The admin disables notes selection on Bibles, so the admin sees all notes, even notes referring to non-existing Bibles.
if ($session_logic->currentLevel() == Filter_Roles::ADMIN_LEVEL) {
    $bibles = NULL;
}
$book = $ipc_focus->getBook();
$chapter = $ipc_focus->getChapter();
$verse = $ipc_focus->getVerse();
$identifiers = $database_notes->selectNotes($bibles, $book, $chapter, $verse, $passage_selector, $edit_selector, $non_edit_selector, $status_selector, $bible_selector, $assignment_selector, $subscription_selector, $severity_selector, $text_selector, $search_text, NULL);
$count = count($identifiers);
$view->view->count = $count;
$view->render("select.php");
Ejemplo n.º 6
0
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::MANAGER_LEVEL);
Assets_Page::header(Locale_Translate::_("Verse mappings"));
$view = new Assets_View(__FILE__);
$database_mappings = Database_Mappings::getInstance();
$session_logic = Session_Logic::getInstance();
$username = $session_logic->currentUser();
$userlevel = $session_logic->currentLevel();
$name = $_GET['name'];
$view->view->name = Filter_Html::sanitize($name);
//$write = $database_styles->hasWriteAccess ($username, $name);
$write = true;
if ($userlevel >= Filter_Roles::ADMIN_LEVEL) {
    $write = true;
}
if (isset($_POST['submit'])) {
    $data = $_POST['data'];
    if ($write) {
        $database_mappings->import($name, $data);
    }
}
$data = $database_mappings->export($name);
$view->view->data = $data;
$view->render("map.php");
Assets_Page::footer();
Ejemplo n.º 7
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::MANAGER_LEVEL);
Assets_Page::header(Locale_Translate::_("Chapter"));
$view = new Assets_View(__FILE__);
$database_bibles = Database_Bibles::getInstance();
$database_books = Database_Books::getInstance();
// The Bible.
$bible = Access_Bible::clamp($_GET['bible']);
$view->view->bible = Filter_Html::sanitize($bible);
// Whether the user has write access to this Bible.
$write_access = Access_Bible::write($bible);
$view->view->write_access = $write_access;
// The book.
$book = $_GET['book'];
$view->view->book = Filter_Html::sanitize($book);
$book_name = $database_books->getEnglishFromId($book);
$view->view->book_name = Filter_Html::sanitize($book_name);
// The chapter.
$chapter = $_GET['chapter'];
$view->view->chapter = Filter_Html::sanitize($chapter);
$view->render("chapter.php");
Assets_Page::footer();
Ejemplo n.º 8
0
// The various bits of the history from the database.
$passageTexts = array();
$authors = array();
$dates = array();
$bibles = array();
$oldTexts = array();
$modifications = array();
$newTexts = array();
$data = $database_history->get($author_filter, $myBibles, $book_filter, $chapter_filter, $verse_filter, $start);
foreach ($data as $entry) {
    $passageText = Filter_Books::passagesDisplayInline(array(array($entry['book'], $entry['chapter'], $entry['verse'])));
    $passageText = Filter_Html::sanitize($passageText);
    $passageTexts[] = $passageText;
    $authors[] = Filter_Html::sanitize($entry['author']);
    $dates[] = $timestamp = date('j F Y g:i:s a', $entry['timestamp']);
    $bibles[] = Filter_Html::sanitize($entry['bible']);
    $oldTexts[] = $entry['oldtext'];
    $modifications[] = $entry['modification'];
    $newTexts[] = $entry['newtext'];
}
$view->view->passageTexts = $passageTexts;
$view->view->authors = $authors;
$view->view->dates = $dates;
$view->view->bibles = $bibles;
$view->view->oldTexts = $oldTexts;
$view->view->modifications = $modifications;
$view->view->newTexts = $newTexts;
// Data for going back and forward in the pager.
$back = $start;
if ($back > 0) {
    $back -= 50;
Ejemplo n.º 9
0
        $ids = $database_modifications->getNotificationTeamIdentifiers($username, "♺", true);
        $view->view->filter = 2;
    } else {
        $ids = $database_modifications->getNotificationIdentifiers($username, true);
        $view->view->filter = 0;
    }
}
$view->view->ids = $ids;
$links = array();
$categories = array();
$modifications = array();
foreach ($ids as $id) {
    $passage = $database_modifications->getNotificationPassage($id);
    $link = Filter_Books::linkForOpeningEditorAt($passage['book'], $passage['chapter'], $passage['verse']);
    $links[] = $link;
    $category = $database_modifications->getNotificationCategory($id);
    $category = Filter_Html::sanitize($category);
    $categories[] = $category;
    $modification = $database_modifications->getNotificationModification($id);
    $modifications[] = $modification;
}
$view->view->links = $links;
$view->view->categories = $categories;
$view->view->modifications = $modifications;
$loading = '"' . Locale_Translate::_("Loading ...") . '"';
$script = <<<EOD
var loading = {$loading};
EOD;
$view->view->script = $script;
$view->render("changes.php");
Assets_Page::footer();
Ejemplo n.º 10
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::TRANSLATOR_LEVEL);
Assets_Page::header(Locale_Translate::_("Styles"));
$view = new Assets_View(__FILE__);
$database_config_user = Database_Config_User::getInstance();
if (isset($_GET['sheet'])) {
    $sheet = $_GET['sheet'];
    if ($sheet == "") {
        $dialog_list = new Dialog_List2(Locale_Translate::_("Would you like to switch to another stylesheet?"));
        $database_styles = Database_Styles::getInstance();
        $sheets = $database_styles->getSheets();
        foreach ($sheets as $sheet) {
            $parameter = "&sheet={$sheet}";
            $dialog_list->add_row($sheet, $parameter);
        }
        $dialog_list->run();
    } else {
        $database_config_user->setStylesheet($sheet);
    }
}
$stylesheet = $database_config_user->getStylesheet();
$view->view->stylesheet = Filter_Html::sanitize($stylesheet);
$view->render("indext.php");
Assets_Page::footer();
Ejemplo n.º 11
0
    $database_check->release($release);
    $view->view->success = Locale_Translate::_("The check result will no longer be suppressed.");
}
// Get the Bibles the user has write-access to.
$bibleIDs = array();
$bibles = $database_bibles->getBibles();
foreach ($bibles as $bible) {
    if (Access_Bible::write($bible)) {
        $id = $database_bibles->getID($bible);
        $bibleIDs[] = $id;
    }
}
$ids = array();
$data = array();
$suppressions = $database_check->getSuppressions();
foreach ($suppressions as $suppression) {
    $bibleID = $suppression['bible'];
    // Only display entries for Bibles the user has write access to.
    if (in_array($bibleID, $bibleIDs)) {
        $ids[] = $suppression['rowid'];
        $bible = Filter_Html::sanitize($database_bibles->getName($bibleID));
        $passage = Filter_Books::passagesDisplayInline(array(array($suppression['book'], $suppression['chapter'], $suppression['verse'])));
        $result = Filter_Html::sanitize($suppression['data']);
        $result = "{$bible} {$passage} {$result}";
        $data[] = $result;
    }
}
$view->view->ids = $ids;
$view->view->data = $data;
$view->render("suppress.php");
Assets_Page::footer();
Ejemplo n.º 12
0
        $id = $database_bibles->getID($bible);
        $bibleIDs[] = $id;
    }
}
$ids = array();
$bibles = array();
$links = array();
$passages = array();
$passageTexts = array();
$information = array();
$hits = $database_check->getHits();
foreach ($hits as $hit) {
    $bibleID = $hit['bible'];
    if (in_array($bibleID, $bibleIDs)) {
        $ids[] = $hit['rowid'];
        $bible = Filter_Html::sanitize($database_bibles->getName($bibleID));
        $bibles[] = $bible;
        $book = $hit['book'];
        $chapter = $hit['chapter'];
        $verse = $hit['verse'];
        $link = Filter_Books::linkForOpeningEditorAt($book, $chapter, $verse);
        $links[] = $link;
        $information[] = Filter_Html::sanitize($hit['data']);
    }
}
$view->view->ids = $ids;
$view->view->bibles = $bibles;
$view->view->links = $links;
$view->view->information = $information;
$view->render("index.php");
Assets_Page::footer();
Ejemplo n.º 13
0
    $database_config_bible->setGenerateInfoDuringNight($bible, !$database_config_bible->getGenerateInfoDuringNight($bible));
    $view->view->success = Locale_Translate::_("The setting for nightly generation of info was updated.");
}
$view->view->info = $database_config_bible->getGenerateInfoDuringNight($bible);
if (isset($_GET['infonow'])) {
    Export_Logic::scheduleInfo($bible);
    $view->view->success = Locale_Translate::_("The info documents are being generated.");
}
$view->view->stylesheet = Filter_Html::sanitize($database_config_bible->getExportStylesheet($bible));
$view->view->dropcaps = $database_config_bible->getExportChapterDropCapsFrames($bible);
$view->view->pagewidth = Filter_Html::sanitize($database_config_bible->getPageWidth($bible));
$view->view->pageheight = Filter_Html::sanitize($database_config_bible->getPageHeight($bible));
$view->view->innermargin = Filter_Html::sanitize($database_config_bible->getInnerMargin($bible));
$view->view->outermargin = Filter_Html::sanitize($database_config_bible->getOuterMargin($bible));
$view->view->topmargin = Filter_Html::sanitize($database_config_bible->getTopMargin($bible));
$view->view->bottommargin = Filter_Html::sanitize($database_config_bible->getBottomMargin($bible));
$view->view->dateinheader = $database_config_bible->getDateInHeader($bible);
if (isset($_GET['eswordtoggle'])) {
    $database_config_bible->setExportESwordDuringNight($bible, !$database_config_bible->getExportESwordDuringNight($bible));
    $view->view->success = Locale_Translate::_("The setting for nightly export to e-Sword format was updated.");
}
$view->view->esword = $database_config_bible->getExportESwordDuringNight($bible);
if (isset($_GET['eswordnow'])) {
    Export_Logic::scheduleESword($bible);
    $view->view->success = Locale_Translate::_("The Bible is being exported to e-Sword format.");
}
if (isset($_GET['onlinebibletoggle'])) {
    $database_config_bible->setExportOnlineBibleDuringNight($bible, !$database_config_bible->getExportOnlineBibleDuringNight($bible));
    $view->view->success = Locale_Translate::_("The setting for nightly export to Online Bible format was updated.");
}
$view->view->onlinebible = $database_config_bible->getExportOnlineBibleDuringNight($bible);
Ejemplo n.º 14
0
    public function testHtml2Text4()
    {
        $html = <<<EOD
Line one.<BR>

Line two.<BR>

Line three.<BR>
EOD;
        $plain = <<<EOD
Line one.
Line two.
Line three.
EOD;
        $this->assertEquals($plain, Filter_Html::html2text($html));
    }
Ejemplo n.º 15
0
page_access_level(Filter_Roles::MANAGER_LEVEL);
Assets_Page::header(Locale_Translate::_("Book"));
$view = new Assets_View(__FILE__);
$database_bibles = Database_Bibles::getInstance();
$database_books = Database_Books::getInstance();
// The name of the Bible.
$bible = Access_Bible::clamp($_GET['bible']);
$view->view->bible = Filter_Html::sanitize($bible);
// Whether the user has write access to this Bible.
$write_access = Access_Bible::write($bible);
$view->view->write_access = $write_access;
// The book.
$book = $_GET['book'];
$view->view->book = Filter_Html::sanitize($book);
$book_name = $database_books->getEnglishFromId($book);
$view->view->book_name = Filter_Html::sanitize($book_name);
// Delete chapter.
@($deletechapter = $_GET['deletechapter']);
if ($deletechapter != "") {
    @($confirm = $_GET['confirm']);
    if ($confirm != "yes") {
        $dialog_yes = new Dialog_Yes(array("bible", "book"), Locale_Translate::_("Would you like to delete this chapter?"), "deletechapter");
        die;
    } else {
        if ($write_access) {
            Bible_Logic::deleteChapter($bible, $book, $deletechapter);
        }
    }
}
// Add chapter.
if (isset($_GET['createchapter'])) {
Ejemplo n.º 16
0
    }
}
// Sort them, most recent notes first.
$timestamps = array();
foreach ($notes as $note) {
    $timestap = $database_notes->getModified($note);
    $timestamps[] = $timestap;
}
array_multisort($timestamps, SORT_DESC, $notes);
// Details for the notes.
$summaries = array();
$subscriptions = array();
$assignments = array();
foreach ($notes as $note) {
    $summary = $database_notes->getSummary($note);
    $summary = Filter_Html::sanitize($summary);
    $summaries[] = $summary;
    $subscriptions[] = $database_notes->isSubscribed($note, $username);
    $assignments[] = $database_notes->isAssigned($note, $username);
}
$view->view->notes = $notes;
$view->view->summaries = $summaries;
$view->view->subscriptions = $subscriptions;
$view->view->assignments = $assignments;
// Time stamp.
$timestamp = $database_modifications->getNotificationTimeStamp($id);
$timestamp = date('j F Y', $timestamp);
$view->view->timestamp = $timestamp;
// Whether there's a live notes editor available.
$live_notes_editor = $ipc_notes->alive();
$view->view->live_notes_editor = $live_notes_editor;
Ejemplo n.º 17
0
    $categories = trim($categories);
    $categories = explode("\n", $categories);
    foreach ($categories as $category) {
        $category = trim($category);
        if ($category != "") {
            $categories2[] = $category;
        }
    }
    $categories = implode("\n", $categories2);
    $database_config_bible->setSprintTaskCompletionCategories($bible, $categories);
}
$tasks = $database_sprint->getTasks($bible, $year, $month);
$titles = array();
$percentages = array();
foreach ($tasks as &$id) {
    $titles[] = Filter_Html::sanitize($database_sprint->getTitle($id));
    $percentages[] = $database_sprint->getComplete($id);
}
$view->view->bible = $bible;
$view->view->sprint = date("F Y", mktime(0, 0, 0, $month, 1, $year));
$view->view->tasks = $tasks;
$view->view->titles = $titles;
$view->view->percentages = $percentages;
//if (extension_loaded ("gd")) {
//  $view->view->chart = base64_encode (Sprint_Logic::createGraphicalBurndownChart ($bible, $year, $month));
//}
$view->view->chart2 = Sprint_Logic::createTextBasedBurndownChart($bible, $year, $month);
$categorytext = $database_config_bible->getSprintTaskCompletionCategories($bible);
$view->view->categorytext = $categorytext;
$categories = explode("\n", $categorytext);
$view->view->categories = $categories;
Ejemplo n.º 18
0
    $view->view->success = Locale_Translate::_("The capitals were stored");
}
if (isset($_POST['smallletters'])) {
    $database_config_bible->setSentenceStructureSmallLetters($bible, $_POST['smallletters']);
    $view->view->success = Locale_Translate::_("The small letters were stored");
}
if (isset($_POST['endpunctuationmarks'])) {
    $database_config_bible->setSentenceStructureEndPunctuation($bible, $_POST['endpunctuationmarks']);
    $view->view->success = Locale_Translate::_("The punctuation marks at the ends of sentences were stored");
}
if (isset($_POST['middlepunctuationmarks'])) {
    $database_config_bible->setSentenceStructureMiddlePunctuation($bible, $_POST['middlepunctuationmarks']);
    $view->view->success = Locale_Translate::_("The punctuation marks within the sentences were stored");
}
if (isset($_POST['disregards'])) {
    $database_config_bible->setSentenceStructureDisregards($bible, $_POST['disregards']);
    $view->view->success = Locale_Translate::_("The characters that should be disregarded within the sentences were stored");
}
if (isset($_POST['names'])) {
    $database_config_bible->setSentenceStructureNames($bible, $_POST['names']);
    $view->view->success = Locale_Translate::_("The names that may occur after mid-sentence punctuation were stored");
}
$view->view->bible = $bible;
$view->view->capitals = Filter_Html::sanitize($database_config_bible->getSentenceStructureCapitals($bible));
$view->view->smallletters = Filter_Html::sanitize($database_config_bible->getSentenceStructureSmallLetters($bible));
$view->view->endpunctuationmarks = Filter_Html::sanitize($database_config_bible->getSentenceStructureEndPunctuation($bible));
$view->view->middlepunctuationmarks = Filter_Html::sanitize($database_config_bible->getSentenceStructureMiddlePunctuation($bible));
$view->view->disregards = Filter_Html::sanitize($database_config_bible->getSentenceStructureDisregards($bible));
$view->view->names = Filter_Html::sanitize($database_config_bible->getSentenceStructureNames($bible));
$view->render("settingssentences.php");
Assets_Page::footer();
Ejemplo n.º 19
0
    case UserString2None:
        break;
    case UserString2DumpEndnotesHere:
        if ($userint2 == EndNotePositionAtMarker) {
            $view->view->userstring2_dumpendnotes = true;
            $userstring2_question = Locale_Translate::_("Please enter a marker at which the endnotes should be dumped");
            $userstring2_info = Locale_Translate::_("The marker is to be given without the backslash, e.g. \"zendnotes\".");
        }
        break;
}
if (isset($_GET['userstring2'])) {
    $dialog_entry = new Dialog_Entry($standard_page_query, $userstring2_question, $userstring2, "userstring2", $userstring2_info);
    die;
}
if (isset($_POST['userstring2'])) {
    $userstring2 = $_POST['entry'];
    if ($write) {
        $database_styles->updateUserstring2($sheet, $style, $userstring2);
    }
}
if ($userstring2 == "") {
    $userstring2 = "--";
}
$view->view->userstring2 = Filter_Html::sanitize($userstring2);
// Recreate stylesheets after editing a style.
if (count($_GET) != 2 || count($_POST) != 0) {
    Styles_Sheets::create_all();
}
// Userstring3 not yet used.
$view->render("view.php");
Assets_Page::footer();
Ejemplo n.º 20
0
function render_journal_entry($entry)
{
    $entry = substr($entry, 2);
    $seconds = (int) $entry;
    $entry = substr($entry, 10);
    $timestamp = date('g:i:s a', $seconds);
    $event = Filter_Html::sanitize($entry);
    return "{$timestamp} | {$event}";
}
Ejemplo n.º 21
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
// This script logs a message in the Journal through the web.
// Skip empty message.
@($msg = $_GET["msg"]);
if ($msg == "") {
    die;
}
// It can be called from localhost only for security reasons.
if ($_SERVER['SERVER_ADDR'] != $_SERVER['REMOTE_ADDR']) {
    die;
}
require_once "../bootstrap/bootstrap.php";
if (Filter_Cli::not_yet_ready()) {
    die;
}
// Keep pure text only.
$msg = Filter_Html::html2text($msg);
$msg = trim($msg);
if ($msg == "") {
    die;
}
// Log the message.
$database_logs = Database_Logs::getInstance();
$database_logs->log($msg);
Ejemplo n.º 22
0
 public function updateSearchFields($identifier)
 {
     // The search field is a combination of the summary and content converted to clean text.
     // It enables us to search with wildcards before and after the search query.
     $noteSummary = $this->getSummary($identifier);
     $noteContents = $this->getContents($identifier);
     $cleanText = $noteSummary . "\n" . Filter_Html::html2text($noteContents);
     // Bail out if the search field is already up to date.
     if ($cleanText == $this->getSearchField($identifier)) {
         return;
     }
     // Update the field.
     $db = self::connect();
     $identifier = Database_SQLiteInjection::no($identifier);
     $cleanText = Database_SQLiteInjection::no($cleanText);
     $query = "UPDATE notes SET cleantext = '{$cleanText}' WHERE identifier = {$identifier};";
     Database_SQLite::exec($db, $query);
     unset($db);
 }
Ejemplo n.º 23
0
echo "<font size=\"-1\" color=\"grey\"><hr /></font>\n";
echo "<p><font size=\"-1\" color=\"grey\">{$hitCount} " . Locale_Translate::_("chapters") . "</font></p>\n";
// 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";
        }
Ejemplo n.º 24
0
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::TRANSLATOR_LEVEL);
$header = new Assets_Header(Locale_Translate::_("Order"));
$header->jQueryUIOn("sortable");
$header->run();
$view = new Assets_View(__FILE__);
$database_config_bible = Database_Config_Bible::getInstance();
$database_books = Database_Books::getInstance();
$database_bibles = Database_Bibles::getInstance();
$bible = Access_Bible::clamp($_GET['bible']);
$view->view->bible = Filter_Html::sanitize($bible);
@($reset = $_GET["reset"]);
if (isset($reset)) {
    $database_config_bible->setBookOrder($bible, "");
}
@($order = $_POST['order']);
if (isset($order)) {
    $order = explode(",", $order);
    $ids = array();
    foreach ($order as $english) {
        $id = $database_books->getIdFromEnglish($english);
        $ids[] = $id;
    }
    $order = implode(" ", $ids);
    $database_config_bible->setBookOrder($bible, $order);
    die;
Ejemplo n.º 25
0
 public static function getText($resource, $book, $chapter, $verse)
 {
     $database_bibles = Database_Bibles::getInstance();
     $database_resources = Database_Resources::getInstance();
     $database_usfmresources = Database_UsfmResources::getInstance();
     $database_offlineresources = Database_OfflineResources::getInstance();
     $bibles = $database_bibles->getBibles();
     $usfms = $database_usfmresources->getResources();
     $externals = $database_resources->getNames();
     $isBible = in_array($resource, $bibles);
     $isUsfm = in_array($resource, $usfms);
     if ($isBible || $isUsfm) {
         if ($isBible) {
             $chapter_usfm = $database_bibles->getChapter($resource, $book, $chapter);
         }
         if ($isUsfm) {
             $chapter_usfm = $database_usfmresources->getUsfm($resource, $book, $chapter);
         }
         $verse_usfm = Filter_Usfm::getVerseText($chapter_usfm, $verse);
         $database_config_user = Database_Config_User::getInstance();
         $stylesheet = $database_config_user->getStylesheet();
         $filter_text = new Filter_Text($resource);
         $filter_text->text_text = new Text_Text();
         $filter_text->addUsfmCode($verse_usfm);
         $filter_text->run($stylesheet);
         $text = $filter_text->text_text->get();
     } else {
         if (in_array($resource, $externals)) {
             // Use offline copy if it exists, else fetch it online.
             if ($database_offlineresources->exists($resource, $book, $chapter, $verse)) {
                 $text = $database_offlineresources->get($resource, $book, $chapter, $verse);
             } else {
                 $text = Resource_Logic::getExternal($resource, $book, $chapter, $verse, true);
             }
             $text = Filter_Html::html2text($text);
         } else {
             $text = "";
         }
     }
     return $text;
 }