Inheritance: extends Pressbooks\Modules\Export\Export
示例#1
0
 /**
  * Override load template function
  * Switch path from /epub201 to /epub3 when possible.
  *
  * @param string $path
  * @param array $vars (optional)
  *
  * @return string
  * @throws \Exception
  */
 protected function loadTemplate($path, array $vars = array())
 {
     $search = '/templates/epub201/';
     $replace = '/templates/epub3/';
     $pos = strpos($path, $search);
     if ($pos !== false) {
         $newPath = substr_replace($path, $replace, $pos, strlen($search));
         if (file_exists($newPath)) {
             $path = $newPath;
         }
     }
     return parent::loadTemplate($path, $vars);
 }
示例#2
0
if ($timezone_string) {
    date_default_timezone_set($timezone_string);
} else {
    date_default_timezone_set('America/Montreal');
}
// -------------------------------------------------------------------------------------------------------------------
// Warnings and errors
// -------------------------------------------------------------------------------------------------------------------
$dependency_errors = array();
if (false == \Pressbooks\Modules\Export\Prince\Pdf::hasDependencies()) {
    $prince = false;
    $dependency_errors['pdf'] = 'PDF';
} else {
    $prince = true;
}
if (false == \Pressbooks\Modules\Export\Epub\Epub201::hasDependencies()) {
    $epub = false;
    $dependency_errors['epub'] = 'EPUB';
} else {
    $epub = true;
}
if (false == \Pressbooks\Modules\Export\Mobi\Kindlegen::hasDependencies()) {
    $mobi = false;
    $dependency_errors['mobi'] = 'MOBI';
} else {
    $mobi = true;
}
if (false == \Pressbooks\Modules\Export\Xhtml\Xhtml11::hasDependencies()) {
    $xhtml = false;
    $dependency_errors['xhtml'] = 'XHTML';
} else {