/** * Registers Anthologize's packaged export formats * * @since 0.7 */ function anthologize_register_default_formats() { // Defining the default options for export formats $d_page_size = array('letter' => __('Letter', 'anthologize'), 'a4' => __('A4', 'anthologize')); $d_font_size = array('9' => __('9 pt', 'anthologize'), '10' => __('10 pt', 'anthologize'), '11' => __('11 pt', 'anthologize'), '12' => __('12 pt', 'anthologize'), '13' => __('13 pt', 'anthologize'), '14' => __('14 pt', 'anthologize')); $d_font_face = array('times' => __('Times New Roman', 'anthologize'), 'helvetica' => __('Helvetica', 'anthologize'), 'courier' => __('Courier', 'anthologize')); $d_font_face_pdf = array('times' => __('Times New Roman', 'anthologize'), 'helvetica' => __('Helvetica', 'anthologize'), 'courier' => __('Courier', 'anthologize'), 'dejavusans' => __('Deja Vu Sans', 'anthologize'), 'arialunicid0-cj' => __('Chinese and Japanese', 'anthologize'), 'arialunicid0-ko' => __('Korean', 'anthologize')); $d_font_face_epub = array('Times New Roman' => __('Times New Roman', 'anthologize'), 'Helvetica' => __('Helvetica', 'anthologize'), 'Courier' => __('Courier', 'anthologize')); // Register PDF + options anthologize_register_format('pdf', __('PDF', 'anthologize'), WP_PLUGIN_DIR . '/anthologize/templates/pdf/base.php'); anthologize_register_format_option('pdf', 'page-size', __('Page Size', 'anthologize'), 'dropdown', $d_page_size, 'letter'); anthologize_register_format_option('pdf', 'font-size', __('Base Font Fize', 'anthologize'), 'dropdown', $d_font_size, '12'); anthologize_register_format_option('pdf', 'font-face', __('Font Face', 'anthologize'), 'dropdown', $d_font_face_pdf, 'Times New Roman'); anthologize_register_format_option('pdf', 'break-parts', __('Page break before parts?', 'anthologize'), 'checkbox'); anthologize_register_format_option('pdf', 'break-items', __('Page break before items?', 'anthologize'), 'checkbox'); anthologize_register_format_option('pdf', 'colophon', __('Include Anthologize colophon page?', 'anthologize'), 'checkbox'); // Register RTF + options anthologize_register_format('rtf', __('RTF', 'anthologize'), WP_PLUGIN_DIR . '/anthologize/templates/rtf/base.php'); anthologize_register_format_option('rtf', 'page-size', __('Page Size', 'anthologize'), 'dropdown', $d_page_size, 'letter'); anthologize_register_format_option('rtf', 'font-size', __('Base Font Fize', 'anthologize'), 'dropdown', $d_font_size, '12'); anthologize_register_format_option('rtf', 'font-face', __('Font Face', 'anthologize'), 'dropdown', $d_font_face_pdf, 'Times New Roman'); anthologize_register_format_option('rtf', 'break-parts', __('Page break before parts?', 'anthologize'), 'checkbox'); anthologize_register_format_option('rtf', 'break-items', __('Page break before items?', 'anthologize'), 'checkbox'); anthologize_register_format_option('rtf', 'colophon', __('Include Anthologize colophon page?', 'anthologize'), 'checkbox'); // Register ePub. anthologize_register_format('epub', __('ePub', 'anthologize'), WP_PLUGIN_DIR . '/anthologize/templates/epub/index.php'); anthologize_register_format_option('epub', 'font-size', __('Base Font Fize', 'anthologize'), 'dropdown', $d_font_size, '12'); anthologize_register_format_option('epub', 'font-family', __('Font Family', 'anthologize'), 'dropdown', $d_font_face_epub, 'Times New Roman'); anthologize_register_format_option('epub', 'colophon', __('Include Anthologize colophon page?', 'anthologize'), 'checkbox'); //build the covers list for selection $coversArray = array(); $coversArray['none'] = 'None'; //scan the covers directory and return the array $filesArray = scandir(WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'anthologize' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'epub' . DIRECTORY_SEPARATOR . 'covers'); foreach ($filesArray as $file) { if (!is_dir($file)) { $coversArray[$file] = $file; } } anthologize_register_format_option('epub', 'cover', __('Cover Image', 'anthologize'), 'dropdown', $coversArray); //epub colophon commented out until we get the XSLTs working for it //anthologize_register_format_option( 'epub', 'colophon', __( 'Include Anthologize colophon page?', 'anthologize' ), 'checkbox' ); // Register HTML anthologize_register_format('html', __('HTML', 'anthologize'), WP_PLUGIN_DIR . '/anthologize/templates/html/output.php'); $htmlFontSizes = array('48pt' => '48 pt', '36pt' => '36 pt', '18pt' => '18 pt', '14' => '14 pt', '12' => '12 pt'); anthologize_register_format_option('html', 'font-size', __('Font Size', 'anthologize'), 'dropdown', $htmlFontSizes, '14pt'); anthologize_register_format_option('html', 'download', __('Download HTML?', 'anthologize'), 'checkbox', array('Download' => 'download'), 'download'); // Register TEI. No options for this one anthologize_register_format('tei', __('Anthologize TEI', 'anthologize'), WP_PLUGIN_DIR . '/anthologize/templates/tei/base.php'); }
<?php /* Plugin Name: Anthologize HTML Description: Demo HTML exporter for Anthologize */ require_once WP_PLUGIN_DIR . '/anthologize/anthologize.php'; require_once WP_PLUGIN_DIR . '/anthologize/includes/class-format-api.php'; anthologize_register_format('html', __('HTML', 'anthologize'), WP_PLUGIN_DIR . '/anthologizehtml/output.php'); $fontSizes = array('48pt' => '48 pt', '36pt' => '36 pt', '18pt' => '18 pt', '14' => '14 pt', '12' => '12 pt'); anthologize_register_format_option('html', 'font-size', __('Font Size', 'anthologize'), 'dropdown', $fontSizes, '14pt'); anthologize_register_format_option('html', 'download', __('Download HTML?', 'anthologize'), 'checkbox', array('Download' => 'download'), 'download');