// Create folders for the html export. $directory = Export_Logic::bibleDirectory($bible) . "/html"; if (!file_exists($directory)) { mkdir($directory, 0777, true); } // Filename for the html file. $basename = Export_Logic::baseBookFileName($book); $filename = "{$directory}/{$basename}.html"; $filecss = "{$directory}/stylesheet.css"; $database_logs = Database_Logs::getInstance(); $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); // Copy font to the output directory. $font = $database_config_bible->getTextFont($bible); if ($font) { if (Fonts_Logic::fontExists($font)) { $fontpath = Fonts_Logic::getFontPath($font); copy($fontpath, "{$directory}/{$font}"); } } $filter_text = new Filter_Text($bible); $filter_text->html_text_standard = new Html_Text(Locale_Translate::_("Bible")); $filter_text->html_text_standard->customClass = Filter_CustomCSS::getClass($bible); // Load one book. $chapters = $database_bibles->getChapters($bible, $book); foreach ($chapters as $chapter) {
} } else { $dialog_yes = new Dialog_Yes(NULL, Locale_Translate::_("Would you like to delete this stylesheet?"), "delete"); die; } } // Delete empty sheet that may have been there. $database_styles->deleteSheet(""); if (isset($_POST['new'])) { $name = $_POST['entry']; if (in_array($name, $database_styles->getSheets())) { Assets_Page::error(Locale_Translate::_("This stylesheet already exists")); } else { $database_styles->createSheet($name); $database_styles->grantWriteAccess($username, $name); Styles_Sheets::create_all(); Assets_Page::success(Locale_Translate::_("The stylesheet has been created")); } } if (isset($_GET['new'])) { $dialog_entry = new Dialog_Entry("", Locale_Translate::_("Please enter the name for the new stylesheet"), "", "new", ""); die; } $sheets = $database_styles->getSheets(); $editable = array(); foreach ($sheets as $sheet) { $write = $database_styles->hasWriteAccess($username, $sheet); if ($userlevel >= Filter_Roles::ADMIN_LEVEL) { $write = true; } $editable[] = $write;
<?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"; // Security: The script runs from the cli SAPI only. Filter_Cli::assert(); $database_logs = Database_Logs::getInstance(); $database_logs->log("Creating stylesheet.css files", Filter_Roles::ADMIN_LEVEL); $styles_sheets = new Styles_Sheets(); $styles_sheets->recreate();