/** * Constructs a book dialog * $action - GET or POST action to take. * $inclusions - NULL (in which case it does nothing), or an array of book IDs to include. * $exclusions - NULL (in which case it does nothing), or an array of book IDs to exclude. */ public function __construct($header, $info_top, $info_bottom, $action, $inclusions, $exclusions) { $this->view = new Assets_View(__FILE__); $caller = $_SERVER["PHP_SELF"] . "?" . http_build_query(array()); $this->view->view->caller = $caller; $this->view->view->header = $header; $this->view->view->info_top = $info_top; $this->view->view->info_bottom = $info_bottom; $this->view->view->action = $action; $database_books = Database_Books::getInstance(); $book_ids = $database_books->getIDs(); if (is_array($inclusions)) { $book_ids = $inclusions; } if (is_array($exclusions)) { $book_ids = array_diff($book_ids, $exclusions); $book_ids = array_values($book_ids); } foreach ($book_ids as $id) { $book_names[] = $database_books->getEnglishFromId($id); } $this->view->view->book_ids = $book_ids; $this->view->view->book_names = $book_names; $this->view->render("books2.php"); Assets_Page::footer(); die; }
public function run() { $this->view->view->text_lines = $this->text_lines; $this->view->view->get_parameters = $this->get_parameters; $this->view->render("list.php"); Assets_Page::footer(); }
/** * Dialog that asks the user for confirmation to perform an action. * $query: Array with the basic query parameters for the page where to go on clicking Cancel or Yes. * $question: The question to ask. * $action: String with the query parameter to add to the basic query in order to perform the desired action. */ public function __construct($query, $question, $action) { $this->view = new Assets_View(__FILE__); $caller_url = $_SERVER["PHP_SELF"]; if (is_array($query)) { $full_query = array(); foreach ($query as $value) { $full_query = array_merge($full_query, array($value => $_GET[$value])); } $caller_url .= "?" . http_build_query($full_query); } $this->view->view->caller_url = $caller_url; if ($action != "") { $full_query = array($action => $_GET[$action]); if (is_array($query)) { $action = "&"; } else { $action = "?"; } $action .= http_build_query($full_query); } $this->view->view->action = $action; $this->view->view->question = $question; $this->view->render("yes.php"); Assets_Page::footer(); }
/** * Dialog that asks the user for confirmation to perform an action. * $question: The question to ask. * $action: String with the query parameter to add to the basic query. * In case the user gives confirmation, then the following parameters are added: &confirm=yes */ public function __construct($question, $action) { $this->view = new Assets_View(__FILE__); $caller_url = $_SERVER["PHP_SELF"] . "?" . http_build_query(array()); $this->view->view->caller_url = $caller_url; $this->view->view->action = $action; $this->view->view->question = $question; $this->view->render("yes2.php"); Assets_Page::footer(); die; }
function page_access_level($level) { $session_logic = Session_Logic::getInstance(); if ($level > $session_logic->currentLevel()) { $header = new Assets_Header("Privileges"); $header->setLogin(); $header->run(); $view = new Assets_View(__FILE__); $view->render("privileges.php"); Assets_Page::footer(); die; } }
/** * Entry dialog constructor * $query : Nothing, or array with query variables, e.g. array ("search" => "bibledit"). * If any $query is passed, if Cancel is clicked in this dialog, it should go go back * to the original caller page with the $query added. Same for Ok, it would post * the value entered, but also add the $query to the url. * $question: The question to be asked. * $value : The initial value to be put into the entry. * $submit : Name of POST request to submit the information. * $help : Help information explaining to the user what's going on. */ public function __construct($query, $question, $value, $submit, $help) { $this->view = new Assets_View(__FILE__); $base_url = $_SERVER['PHP_SELF']; if (is_array($query)) { $base_url .= "?" . http_build_query($query); } $this->view->view->base_url = $base_url; $this->view->view->question = $question; $this->view->view->value = $value; $this->view->view->submit = $submit; $this->view->view->help = $help; $this->view->render("entry.php"); Assets_Page::footer(); }
<?php /* Copyright (©) 2003-2014 Teus Benschop. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 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::ADMIN_LEVEL); Assets_Page::header(Locale_Translate::_("Collaboration")); $view = new Assets_View(__FILE__); $object = $_GET['object']; $view->view->object = $object; $database_config_bible = Database_Config_Bible::getInstance(); $url = $database_config_bible->getRemoteRepositoryUrl($object); $directory = Filter_Git::git_directory($object); $view->render("collaboration_repo_data.php"); Assets_Page::footer();
} else { $field_terminate = $_POST['import_csv_fieldsterminated']; $field_enclosed = $_POST['import_csv_fieldsenclosed']; $field_escaped = $_POST['import_csv_fieldsescaped']; $null = $_POST['import_csv_replacenull']; $fields_in_first_row = isset($_POST['import_csv_fieldnames']); $importSuccess = $db->import_csv($_FILES["file"]["tmp_name"], $_POST['single_table'], $field_terminate, $field_enclosed, $field_escaped, $null, $fields_in_first_row); } } } header('Content-Type: text/html; charset=utf-8'); // Displaying the Bibledit-Web heder and menu is postponed till here. // This fixes the following: // Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at assets/view.php:57) in phpliteadmin/index.php on line 464 // With headers, it forgets which table it has selected. Assets_Page::header("phpLiteAdmin"); // here begins the HTML. ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <!-- Copyright <?php echo date("Y") . ' ' . PROJECT . ' (' . PROJECT_URL . ')'; ?> --> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> <link rel="shortcut icon" href="?resource=favicon" /> <title><?php echo PROJECT; ?> </title>
/** * Uncompresses a .tar.gz archive identified by $file. * Returns the path to the folder it created. * If $show_errors is true, it outputs errors in html. */ public static function untargz($file, $show_errors) { $file = escapeshellarg($file); $folder = uniqid(sys_get_temp_dir() . "/"); mkdir($folder); exec("cd {$folder} && tar zxf {$file} 2>&1", $output, $return_var); if ($return_var != 0) { Filter_Rmdir::rmdir($folder); $folder = NULL; if ($show_errors) { Assets_Page::error(Locale_Translate::_("Failed to uncompress archive")); foreach ($output as $line) { Assets_Page::error($line); } Assets_Page::error("Return status: {$return_var}"); } } return $folder; }
public function run() { $this->view->render("text.php"); Assets_Page::footer(); die; }
$verse_texts = array(); $contents = array(); foreach ($identifiers as $identifier) { $summary = $database_notes->getSummary($identifier); $passages = $database_notes->getPassages($identifier); $verses = Filter_Books::passagesDisplayInline($passages); $summaries[] = $summary . " | " . $verses; $verse_text = ""; if ($passage_inclusion_selector) { $passages = $database_notes->getPassages($identifier); foreach ($passages as $passage) { $usfm = $database_bibles->getChapter($bible, $passage[0], $passage[1]); $text = Filter_Usfm::getVerseText($usfm, $passage[2]); $verse_text .= $text; $verse_text .= "\n"; } } $verse_texts[] = nl2br($verse_text); $content = ""; if ($text_inclusion_selector) { $content = $database_notes->getContents($identifier); } $contents[] = $content; } $view->view->summaries = $summaries; $view->view->versetexts = $verse_texts; $view->view->contents = $contents; $view->render("notes.php"); if ($count == 0) { Assets_Page::message(Locale_Translate::_("This view does not display any notes.")); }