color: #000; text-align: center; } kbd { background: #ddd; padding: 0 0.5em; border-right: 1px solid black; border-bottom: 1px solid black; font: 9px verdana, arial, helvetica; margin: 0.2em; } //--> </style> <?php if (getLanguageDirection() == "rtl") { ?> <style type="text/css" media="screen,print,projection"> <!-- body { direction: rtl; margin: 0; padding: 0; background: white; font: 12px verdana, arial, helvetica; } p, li { direction: rtl; text-align: right; } div#mod { direction: rtl; text-align: right; } h1, ul li { direction: ltr; } td { font: 12px verdana, arial, helvetica;
protected function getXhtmlTitle(Book $book) { $footerElements = []; if ($book->publisher != '') { $footerElements[] = $book->publisher; } if ($book->periodical != '') { $footerElements[] = $book->periodical; } if ($book->place != '') { $footerElements[] = $book->place; } if ($book->year != '') { $footerElements[] = $book->year; } $content = '<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="' . $book->lang . '" dir="' . getLanguageDirection($book->lang) . '"> <head> <title>' . htmlspecialchars($book->name, ENT_QUOTES) . '</title> <meta http-equiv="default-style" content="application/xhtml+xml; charset=utf-8" /> <link type="text/css" rel="stylesheet" href="main.css" /> </head> <body style="background-color:ghostwhite;"><div style="text-align:center; margin-right: auto; margin-left:auto; text-indent : 0px;"> <h1 id="heading_id_2">' . htmlspecialchars($book->name, ENT_QUOTES) . '</h1> <h2>' . htmlspecialchars($book->author, ENT_QUOTES) . '</h2> <br /> <br /> <img alt="" src="images/Accueil_scribe.png" /> <br /> <h4>' . implode($footerElements, ', ') . '</h4> <br style="margin-top: 3em; margin-bottom: 3em; border: none; background: black; width: 8em; height: 1px; display: block;" /> <h5>' . str_replace('%d', strftime('%x'), htmlspecialchars($this->i18n['exported_from_wikisource_the'], ENT_QUOTES)) . '</h5> </div></body> </html>'; // TODO: Use somthing better than strftime return $content; }
/** * get an xhtml page from a text content * @param string $lang content language code * @param string $content * @param string $title * @return string */ function getXhtmlFromContent($lang, $content, $title = ' ') { if ($content != '') { $content = preg_replace('#<\\!--(.+)-->#isU', '', $content); } $html = '<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"'; if ($lang != null) { $html .= ' xml:lang="' . $lang . '" dir="' . getLanguageDirection($lang) . '"'; } return $html . '><head><meta content="application/xhtml+xml;charset=UTF-8" http-equiv="default-style" /><link type="text/css" rel="stylesheet" href="main.css" /><title>' . $title . '</title></head><body>' . $content . '</body></html>'; }