Commit 24247060 authored by jcnventura's avatar jcnventura

Coder fixes and update of library URLs

parent 5cc5aeb7
......@@ -2,21 +2,21 @@
/**
* @file
* common drush functions for the print submodules.
* Common drush functions for the print submodules.
*/
/**
* Download and extract the lib
* Download and extract the lib.
*
* @param string $library
* library to download.
* Library to download.
* @param string $url
* URL of the file to download
* URL of the file to download.
*/
function _print_drush_download_lib($library, $url) {
$path = drush_get_option('path');
if (empty($path)) {
$path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries';
$path = drush_get_context('DRUSH_DRUPAL_ROOT') . '/sites/all/libraries/' . $library;
}
// Create the path if it does not exist.
......@@ -29,18 +29,21 @@ function _print_drush_download_lib($library, $url) {
$olddir = getcwd();
drush_op('chdir', $path);
// Warn about an existing dir
// Warn about an existing dir.
if (is_dir($library)) {
// drush_op('rmdir', $library); // Directory must be empty for the php rmdir to work..
drush_log(dt('An existing @library was overwritten at @path', array('@library' => $library, '@path' => $path . '/' . $library)), 'notice');
}
// Download the archive
if (preg_match('!api.github.com/repos/.*/releases/latest!', $url)) {
$url = _print_drush_github_latest_url($url);
}
// Download the archive.
$filename = _print_drush_download_file($url);
if ($filename) {
$extract_ret = _print_drush_download_extract($filename);
if ($extract_ret) {
// Remove the archive
// Remove the archive.
drush_op('unlink', $filename);
drush_log(dt('@file has been downloaded and extracted in @path', array('@file' => $filename, '@path' => $path)), 'success');
}
......@@ -58,23 +61,41 @@ function _print_drush_download_lib($library, $url) {
}
/**
* Download a file using wget or curl
* Get filename of latest from github.
*
* @param string $github_url
* The github URL to the latest project release.
*
* @return string
* The URL to the latest file release.
*/
function _print_drush_github_latest_url($github_url) {
$filename = _print_drush_download_file($github_url);
$contents = file_get_contents($filename);
$json = json_decode($contents);
$download_url = $json->assets[0]->browser_download_url;
drush_op('unlink', $filename);
return $download_url;
}
/**
* Download a file using wget or curl.
*
* Adapted from a function in drush/includes/drush.inc to support 302 redirects.
*
* @param string $download_url
* The path to the file to download
* The path to the file to download.
*
* @return string
* The filename that was downloaded, or NULL if the file could not be
* downloaded.
*/
function _print_drush_download_file($download_url) {
$wget_ret = drush_shell_exec("wget -nv --trust-server-names %s", $download_url);
if (!drush_get_context('DRUSH_SIMULATE')) {
$wget_ret = drush_shell_exec("wget -nv --content-disposition %s", $download_url);
if ($wget_ret) {
// Get the filename of the saved file from the output
// Get the filename of the saved file from the output.
$wget_out = explode('"', array_shift(drush_shell_exec_output()));
$filename = $wget_out[1];
}
......@@ -83,13 +104,12 @@ function _print_drush_download_file($download_url) {
$curl_ret = drush_shell_exec("curl -s -L -o %s %s -w '%%{url_effective}'", $tempnam, $download_url);
if ($curl_ret) {
// File was donwloaded with the tempname
// Find the effective name
// File was downloaded with the temporary name.
// Find the effective name.
$filename = explode('/', array_shift(drush_shell_exec_output()));
$filename = array_pop($filename);
// Rename file from tempname to effective name
// Rename file from tempname to effective name.
if (!drush_op('rename', $tempnam, './' . $filename)) {
$filename = $tempnam;
}
......@@ -110,7 +130,7 @@ function _print_drush_download_file($download_url) {
* Helper to extract the downloaded zip/tar archive.
*
* @param string $filename
* filename of the file to extract
* Filename of the file to extract.
*
* @return bool
* TRUE on success, FALSE on failure
......@@ -119,28 +139,36 @@ function _print_drush_download_extract($filename) {
$arch_ret = FALSE;
if (drush_op('is_file', $filename)) {
switch (drush_op('mime_content_type', $filename)) {
$mime_type = drush_op('mime_content_type', $filename);
switch ($mime_type) {
case 1:
$arch_ret = TRUE;
break;
case 'application/zip':
// Decompress the zip archive
// Decompress the zip archive.
$arch_ret = drush_shell_exec('unzip -qq -o %s', $filename);
// ZIP archives usually get the access rights wrong
// ZIP archives usually get the access rights wrong.
drush_log(dt('@filename is a Zip file. Check the access permissions of the extracted files.', array('@filename' => $filename)), 'warning');
break;
case 'application/x-gzip':
// Decompress the tar gz archive
// Decompress the tar gz archive.
$arch_ret = drush_shell_exec('tar xzf %s', $filename);
break;
case 'application/x-bzip2':
// Decompress the tar bz2 archive
// Decompress the tar bz2 archive.
$arch_ret = drush_shell_exec('tar xjf %s', $filename);
break;
case 'application/x-xz':
// Decompress the tar xz archive
// Decompress the tar xz archive.
$arch_ret = drush_shell_exec('tar xJf %s', $filename);
break;
default:
drush_log(dt('Unknown MIME type: @type', array('@type' => $mime_type)), 'error');
}
}
else {
......
......@@ -2,7 +2,7 @@
/**
* @file
* Common functions used by several of the print modules
* Common functions used by several of the print modules.
*
* @ingroup print
*/
......@@ -29,18 +29,18 @@ function _print_scan_libs($lib, $mask) {
}
/**
* Callback function for the preg_replace_callback replacing spaces with %20
* Callback function for the preg_replace_callback replacing spaces with %20.
*
* Replace spaces in URLs with %20
*
* @param array $matches
* array with the matched tag patterns, usually <a...>+text+</a>
* Array with the matched tag patterns, usually <a...>+text+</a>.
*
* @return string
* tag with re-written URL
*/
function _print_replace_spaces($matches) {
// first, split the html into the different tag attributes
// Split the html into the different tag attributes.
$pattern = '!\s*(\w+\s*=\s*"(?:\\\"|[^"])*")\s*|\s*(\w+\s*=\s*\'(?:\\\\\'|[^\'])*\')\s*|\s*(\w+\s*=\s*\w+)\s*|\s+!';
$attribs = preg_split($pattern, $matches[1], -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
foreach ($attribs as $key => $value) {
......@@ -48,8 +48,8 @@ function _print_replace_spaces($matches) {
}
$size = count($attribs);
for ($i=1; $i < $size; $i++) {
// If the attribute is href or src, we may need to rewrite the URL in the value
for ($i = 1; $i < $size; $i++) {
// If the attribute is href or src, we need to rewrite the URL in the value.
if (preg_match('!^(?:href|src)\s*?=(.*)!i', $attribs[$i], $urls) > 0) {
$url = trim($urls[1], " \t\n\r\0\x0B\"'");
$new_url = str_replace(' ', '%20', $url);
......@@ -66,7 +66,7 @@ function _print_replace_spaces($matches) {
}
/**
* Convert image paths to the file:// protocol
* Convert image paths to the file:// protocol.
*
* In some Drupal setups, the use of the 'private' filesystem or Apache's
* configuration prevent access to the images of the page. This function
......@@ -74,9 +74,9 @@ function _print_replace_spaces($matches) {
* filesystem.
*
* @param string $html
* contents of the post-processed template already with the node data
* Contents of the post-processed template already with the node data.
* @param bool $images_via_file
* if TRUE, convert also files in the 'public' filesystem to local paths
* If TRUE, convert also files in the 'public' filesystem to local paths.
*
* @return string
* converted file names
......@@ -86,7 +86,7 @@ function _print_access_images_via_file($html, $images_via_file) {
$lang = (function_exists('language_negotiation_get_any') && language_negotiation_get_any('locale-url')) ? $language->language : '';
// Always convert private to local paths
// Always convert private to local paths.
$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?)${base_url}/(?:(?:index.php)?\?q=)?(?:${lang}/)?system/files/([^>]*?>)!is";
$replacement = '$1file://' . realpath(variable_get('file_private_path', '')) . '/$2';
$html = preg_replace($pattern, $replacement, $html);
......
......@@ -19,7 +19,9 @@ function print_main_settings() {
$print_css = variable_get('print_css', PRINT_CSS_DEFAULT);
// Check that the stylesheet path is indeed valid and relative to base_path()
if (!empty($print_css) && empty($_POST)) {
$css_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . strtr($print_css, array('%t' => drupal_get_path('theme', variable_get('theme_default', 'garland'))));
$css_path = dirname($_SERVER['SCRIPT_FILENAME']) . '/' . strtr($print_css, array(
'%t' => drupal_get_path('theme', variable_get('theme_default', 'garland')),
));
if (!is_file($css_path) || !is_readable($css_path)) {
drupal_set_message(t("File %file is not readable by the web server.", array('%file' => $css_path)), 'warning', FALSE);
}
......@@ -37,8 +39,10 @@ function print_main_settings() {
'#size' => 60,
'#maxlength' => 250,
'#description' => t('The path to your custom print cascading stylesheet, if any. The path provided must be relative to the base path. When none is specified, the default module CSS file is used.') . '<br />' .
t('Macros: %t (path to theme: "%theme")', array('%theme' => drupal_get_path('theme', variable_get('theme_default', 'bartik')))) . '<br />' .
t('Requires the <em>Administer site configuration</em> permission.'),
t('Macros: %t (path to theme: "%theme")', array(
'%theme' => drupal_get_path('theme', variable_get('theme_default', 'bartik')),
)) . '<br />' .
t('Requires the <em>Administer site configuration</em> permission.'),
'#disabled' => !user_access('administer site configuration'),
);
......@@ -54,7 +58,9 @@ function print_main_settings() {
'#title' => t('Printer-friendly URLs list'),
'#default_value' => variable_get('print_urls', PRINT_URLS_DEFAULT),
'#description' => t('If set, a list of the destination URLs for the page links will be displayed at the bottom of the page.') . '<br />' .
t('Note that you can enable/disable the URL list for each content type individually from the !url.', array('!url' => l(t('Content Types page'), 'admin/structure/types'))),
t('Note that you can enable/disable the URL list for each content type individually from the !url.', array(
'!url' => l(t('Content Types page'), 'admin/structure/types'),
)),
);
$form['settings']['print_urls_anchors'] = array(
......@@ -89,7 +95,11 @@ function print_main_settings() {
$form['settings']['logo']['print_logo_options'] = array(
'#type' => 'radios',
'#title' => t('Logo type'),
'#options' => array(t('None (Disabled)'), t("Current theme's logo"), t('User-specified')),
'#options' => array(
t('None (Disabled)'),
t("Current theme's logo"),
t('User-specified'),
),
'#default_value' => variable_get('print_logo_options', PRINT_LOGO_OPTIONS_DEFAULT),
'#description' => t("Select the type of logo to display on the printer-friendly version. In case of a user-specified location, insert the path or URL below."),
);
......@@ -120,7 +130,11 @@ function print_main_settings() {
$form['settings']['footer']['print_footer_options'] = array(
'#type' => 'radios',
'#title' => t('Footer type'),
'#options' => array(t('None (Disabled)'), t("Site's footer"), t('User-specified')),
'#options' => array(
t('None (Disabled)'),
t("Site's footer"),
t('User-specified'),
),
'#default_value' => variable_get('print_footer_options', PRINT_FOOTER_OPTIONS_DEFAULT),
'#description' => t("Select the type of footer to display on the printer-friendly version. In case of a user-specified footer, insert it below."),
);
......@@ -179,6 +193,7 @@ function _print_main_settings_validate($form, &$form_state) {
// files table as a temporary file. We'll make a copy and let the garbage
// collector delete the original upload.
if ($filename = file_unmanaged_copy($file->uri)) {
/** @var DrupalStreamWrapperInterface $wrapper */
$wrapper = file_stream_wrapper_get_instance_by_uri($filename);
$form_state['values']['print_logo_options'] = 2;
......
......@@ -2,7 +2,7 @@
/**
* @file
* Main API entry point for the Printer, email and PDF versions
* Main API entry point for the Printer, email and PDF versions.
*
* @ingroup print
*/
......@@ -109,7 +109,7 @@
* etc.).
*
* @param string $url
* the url to be modified.
* The url to be modified.
*
* @ingroup print_hooks
*/
......
......@@ -21,7 +21,7 @@ function print_install() {
* Implements hook_enable().
*/
function print_enable() {
// Module weight
// Module weight.
db_update('system')
->fields(array(
'weight' => 0,
......@@ -146,7 +146,7 @@ function print_schema() {
}
/**
* Remove hardcoded numeric deltas from all blocks
* Remove hardcoded numeric deltas from all blocks.
*/
function print_update_7000(&$sandbox) {
$renamed_deltas = array(
......@@ -160,14 +160,14 @@ function print_update_7000(&$sandbox) {
}
/**
* Enable the print UI module
* Enable the print UI module.
*/
function print_update_7199(&$sandbox) {
module_enable(array('print_ui'), FALSE);
}
/**
* Delete old variables
* Delete old variables.
*/
function print_update_7200(&$sandbox) {
variable_del('print_settings');
......@@ -193,7 +193,7 @@ function print_update_7200(&$sandbox) {
}
/**
* Enable block and help area links
* Enable block and help area links.
*/
function print_update_7202(&$sandbox) {
$link_pos = variable_get('print_html_link_pos', drupal_json_decode('{ "link": "link", "block": "block", "help": "help" }'));
......@@ -203,11 +203,16 @@ function print_update_7202(&$sandbox) {
}
/**
* Increase size of the path field in the print_page_counter table
* Increase size of the path field in the print_page_counter table.
*/
function print_update_7203(&$sandbox) {
db_drop_primary_key('print_page_counter');
db_change_field('print_page_counter', 'path', 'path',
array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'description' => 'Page path'),
array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'description' => 'Page path',
),
array('primary key' => array('path')));
}
......@@ -85,7 +85,13 @@ function print_permission() {
function print_theme() {
return array(
'print' => array(
'variables' => array('node' => NULL, 'query' => NULL, 'format' => '', 'expand_css' => FALSE, 'message' => ''),
'variables' => array(
'node' => NULL,
'query' => NULL,
'format' => '',
'expand_css' => FALSE,
'message' => '',
),
'template' => 'print',
'file' => 'print.pages.inc',
),
......@@ -207,7 +213,7 @@ function print_block_view($delta = '') {
case 'print-top':
$block['subject'] = t('Most printed');
$result = db_query_range("SELECT path FROM {print_page_counter} LEFT JOIN {node} n ON path = CONCAT('node/', n.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
->fetchAll();
->fetchAll();
if (count($result)) {
$items = array();
foreach ($result as $obj) {
......@@ -224,11 +230,13 @@ function print_block_view($delta = '') {
* Implements hook_help().
*/
function print_help($path, $arg) {
$ret = '';
switch ($path) {
case 'admin/help#print':
// Return a line-break version of the module README
return _filter_autop(file_get_contents(drupal_get_path('module', 'print') . '/README.txt'));
// Return a line-break version of the module README.
$ret = _filter_autop(file_get_contents(drupal_get_path('module', 'print') . '/README.txt'));
}
return $ret;
}
/**
......@@ -251,7 +259,7 @@ function print_entity_info_alter(&$info) {
'custom settings' => FALSE,
),
);
// Add the 'Print' view mode for field_collections
// Add the 'Print' view mode for field_collections.
if (module_exists('field_collection')) {
$info['field_collection_item']['view modes'] += array(
PRINT_VIEW_MODE => array(
......@@ -263,10 +271,10 @@ function print_entity_info_alter(&$info) {
}
/**
* Auxiliary function to discover a given page's title
* Auxiliary function to discover a given page's title.
*
* @param string $path
* path of the page being identified
* Path of the page being identified.
*
* @return string
* string with the page's title
......@@ -276,16 +284,16 @@ function _print_get_title($path) {
$nid = preg_replace('!^node/!', '', $path);
if (ctype_digit($nid)) {
return db_query("SELECT title FROM {node} WHERE nid = :nid", array(':nid' => $nid))
->fetchField();
->fetchField();
}
else {
// Not a node, try to get title from the menu system
// Not a node, try to get title from the menu system.
$menu_item = menu_get_item($path);
if (!empty($menu_item['title'])) {
return $menu_item['title'];
}
elseif (drupal_substr($menu_item['page_callback'], 0, 6) == 'views_') {
// It's a view, load the view to have access to the title
// It's a view, load the view to have access to the title.
$view = views_get_view($menu_item['page_arguments']['0']);
return $view->get_title();
}
......@@ -296,7 +304,7 @@ function _print_get_title($path) {
}
/**
* Auxiliary function to display a formatted Printer-friendly link
* Auxiliary function to display a formatted Printer-friendly link.
*
* Function made available so that developers may call this function from
* their defined pages/blocks.
......@@ -307,7 +315,7 @@ function _print_get_title($path) {
* node object, to be used in checking node access. If the path argument is
* not provided, the path used will be node/nid.
* @param string $location
* where in the page where the link is being inserted ('link', 'corner',
* Where in the page where the link is being inserted ('link', 'corner',
* 'block', 'help').
*
* @return string
......@@ -317,7 +325,11 @@ function _print_get_title($path) {
*/
function print_insert_link($path = NULL, $node = NULL, $location = '') {
if (function_exists('print_ui_insert_link')) {
return print_ui_insert_link(print_print_link(), array('path' => $path, 'node' => $node, 'location' => $location));
return print_ui_insert_link(print_print_link(), array(
'path' => $path,
'node' => $node,
'location' => $location,
));
}
else {
return FALSE;
......@@ -325,11 +337,11 @@ function print_insert_link($path = NULL, $node = NULL, $location = '') {
}
/**
* Check if the link to the PF version is allowed depending on the settings
* Check if the link to the PF version is allowed depending on the settings.
*
* @param array $args
* array containing the possible parameters:
* view_mode, node, type, path
* Array containing the possible parameters:
* view_mode, node, type, path.
*
* @return bool
* FALSE if not allowed, TRUE otherwise
......@@ -342,7 +354,7 @@ function print_link_allowed($args) {
* Implements hook_contextual_links_view_alter().
*/
function print_contextual_links_view_alter(&$element, $items) {
// Hide all contextual links
// Hide all contextual links.
if (preg_match('!^print!', $_GET['q'])) {
unset($element['#links']);
}
......
This diff is collapsed.
......@@ -2,12 +2,11 @@
/**
* @file
* Printer-friendly version Views integration
* Printer-friendly version Views integration.
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
......@@ -26,18 +25,16 @@ function print_views_data() {
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'nid',
// 'type' => 'INNER',
);
$data['print_page_counter']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'path',
// 'type' => 'INNER',
'handler' => 'print_join_page_counter',
);
// print_node_conf fields
// print_node_conf fields.
$data['print_node_conf']['link'] = array(
'title' => t('Web: Show link'),
'help' => t('Whether to show the printer-friendly version link.'),
......@@ -87,8 +84,7 @@ function print_views_data() {
),
);
// print_page_counter fields
// print_page_counter fields.
$data['print_page_counter']['totalcount'] = array(
'title' => t('Web: Number of page accesses'),
'help' => t('Counter of accesses to the printer-friendly version for this node.'),
......
......@@ -2,15 +2,15 @@
/**
* @file
* drush integration for print_epub_phpepub module EPUB libraries download.
* Provides drush integration for print_epub_phpepub module.
*/
/**
* The EPUB project download URL
* The EPUB project download URL.
*/
// URI to the the latest PHPePub version.. Hardcoded version unfortunately
define('PHPEPUB_DOWNLOAD_URI', 'https://github.com/Grandt/PHPePub/tarball/2.04');
// URI to the the latest PHPePub version.
define('PHPEPUB_DOWNLOAD_URI', 'https://api.github.com/repos/Grandt/PHPePub/releases/latest');
/**
* Implements hook_drush_command().
......
<?php
/**
* @file
* Install, update and uninstall functions for the print_epub_phpepub module.
*
* @ingroup print
*/
/**
* Implements hook_requirements().
*/
function print_epub_phpepub_requirements($phase) {
$requirements = array();
$t = get_t();
switch ($phase) {
// At runtime, make sure that a EPUB generation tool is selected.
case 'runtime':
$print_epub_epub_tool = variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT);
if (!empty($print_epub_epub_tool)) {
$tool = explode('|', $print_epub_epub_tool);
if (is_file($tool[1]) && is_readable($tool[1])) {
if (basename($tool[1]) == 'EPub.php') {
$version = _print_epub_phpepub_version($tool[1]);
$requirements['print_epub_tool_version'] = array(
'title' => $t('Printer, email and EPUB versions - EPUB generation library'),
'value' => $t('PHPePub') . ' ' . $version,
);
}
}
}
break;
}
return $requirements;
}
......@@ -8,37 +8,7 @@
*/
/**
* Implements hook_requirements().
*/
function print_epub_phpepub_requirements($phase) {
$requirements = array();
$t = get_t();
switch ($phase) {
// At runtime, make sure that a EPUB generation tool is selected
case 'runtime':
$print_epub_epub_tool = variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT);
if (!empty($print_epub_epub_tool)) {
$tool = explode('|', $print_epub_epub_tool);
if (is_file($tool[1]) && is_readable($tool[1])) {
if (basename($tool[1]) == 'EPub.php') {
$version = _print_epub_phpepub_version($tool[1]);
$requirements['print_epub_tool_version'] = array(
'title' => $t('Printer, email and EPUB versions - EPUB generation library'),
'value' => $t('PHPePub') . ' ' . $version,
);
}
}
}
break;
}
return $requirements;
}
/**
* Find out the version of the PHPePub library
* Find out the version of the PHPePub library.
*
* @param string $epub_tool
* Filename of the tool to be analysed.
......@@ -47,7 +17,7 @@ function print_epub_phpepub_requirements($phase) {
* version number of the library
*/
function _print_epub_phpepub_version($epub_tool) {
require_once(DRUPAL_ROOT . '/' . $epub_tool);
require_once DRUPAL_ROOT . '/' . $epub_tool;
return EPub::VERSION;
}
......
......@@ -2,10 +2,10 @@
/**
* @file
* Generates the EPUB version using PHPePub
* Generates the EPUB version using PHPePub.
*
* This file is included by the print_epub_phpepub module and includes the
* functions that interface with the PHPePub library
* functions that interface with the PHPePub library.
*
* @ingroup print
*/
......@@ -21,12 +21,12 @@ function print_epub_phpepub_print_epub_generate($html, $meta, $filename = NULL)
$epub_tool = explode('|', variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT));
$images_via_file = variable_get('print_epub_images_via_file', PRINT_EPUB_IMAGES_VIA_FILE_DEFAULT);
require_once(DRUPAL_ROOT . '/' . $epub_tool[1]);
require_once DRUPAL_ROOT . '/' . $epub_tool[1];
// Try to use local file access for image files
// Try to use local file access for image files.
$html = _print_access_images_via_file($html, $images_via_file);
// set document information
// Set document information.
$epub = new EPub();
$epub->setTitle(html_entity_decode($meta['title'], ENT_QUOTES, 'UTF-8'));
......@@ -40,9 +40,10 @@ function print_epub_phpepub_print_epub_generate($html, $meta, $filename = NULL)
@$epub->addChapter("Chapter", "epub.html", $html, FALSE);
$epub->finalize(); // Finalize the book, and build the archive.
// Finalize the book, and build the archive.
$epub->finalize();
// Close and output EPUB document
// Close and output EPUB document.
$epub->sendBook(empty($filename) ? 'page' : $filename);
return TRUE;
}
......@@ -23,7 +23,7 @@ function print_epub_settings() {
$link = print_epub_print_link();
$current_epub_tool = variable_get('print_epub_epub_tool', PRINT_EPUB_EPUB_TOOL_DEFAULT);
$epub_tool_default = array_key_exists($current_epub_tool, $epub_tools) ? $current_epub_tool : PRINT_EPUB_EPUB_TOOL_DEFAULT;
$epub_tool_default = array_key_exists($current_epub_tool, $epub_tools) ? $current_epub_tool : PRINT_EPUB_EPUB_TOOL_DEFAULT;
$form['settings'] = array(
'#type' => 'fieldset',
......
......@@ -14,17 +14,17 @@
* Generate a EPUB version of the provided HTML.
*
* @param string $html
* HTML content of the EPUB
* HTML content of the EPUB.
* @param array $meta
* Meta information to be used in the EPUB
* - url: original URL
* - name: author's name
* - title: Page title
* - node: node object
* - node: node object.