Наследование: extends Pressbooks\Modules\Export\Export
Пример #1
0
    /**
     * Function called by the Pressbooks plugin when user is on [ Appearance → Theme Options ] page
     */
    function pressbooks_theme_options_display()
    {
        ?>
	<div class="wrap">
		<div id="icon-themes" class="icon32"></div>
		<h2><?php 
        echo wp_get_theme();
        ?>
 Theme Options</h2>
		<?php 
        settings_errors();
        ?>
		<?php 
        $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'global_options';
        ?>
		<h2 class="nav-tab-wrapper">
		<a href="?page=pressbooks_theme_options&tab=global_options" class="nav-tab <?php 
        echo $active_tab == 'global_options' ? 'nav-tab-active' : '';
        ?>
">Global Options</a>
		<a href="?page=pressbooks_theme_options&tab=web_options" class="nav-tab <?php 
        echo $active_tab == 'web_options' ? 'nav-tab-active' : '';
        ?>
">Web Options</a>
		<?php 
        if (true == \PressBooks\Utility\check_prince_install()) {
            ?>
		<a href="?page=pressbooks_theme_options&tab=pdf_options" class="nav-tab <?php 
            echo $active_tab == 'pdf_options' ? 'nav-tab-active' : '';
            ?>
">PDF Options</a>
		<?php 
        }
        ?>
		<?php 
        if (true == \PressBooks\Modules\Export\Mpdf\Pdf::isInstalled()) {
            ?>
		<a href="?page=pressbooks_theme_options&tab=mpdf_options" class="nav-tab <?php 
            echo $active_tab == 'mpdf_options' ? 'nav-tab-active' : '';
            ?>
">mPDF Options</a>
		<?php 
        }
        ?>
		<a href="?page=pressbooks_theme_options&tab=ebook_options" class="nav-tab <?php 
        echo $active_tab == 'ebook_options' ? 'nav-tab-active' : '';
        ?>
">Ebook Options</a>
		</h2>
		<!-- Create the form that will be used to render our options -->
		<form method="post" action="options.php">
			<?php 
        if ($active_tab == 'global_options') {
            settings_fields('pressbooks_theme_options_global');
            do_settings_sections('pressbooks_theme_options_global');
        } elseif ($active_tab == 'web_options') {
            settings_fields('pressbooks_theme_options_web');
            do_settings_sections('pressbooks_theme_options_web');
        } elseif ($active_tab == 'pdf_options') {
            settings_fields('pressbooks_theme_options_pdf');
            do_settings_sections('pressbooks_theme_options_pdf');
        } elseif ($active_tab == 'mpdf_options') {
            settings_fields('pressbooks_theme_options_mpdf');
            do_settings_sections('pressbooks_theme_options_mpdf');
        } elseif ($active_tab == 'ebook_options') {
            settings_fields('pressbooks_theme_options_ebook');
            do_settings_sections('pressbooks_theme_options_ebook');
        }
        ?>
			<?php 
        submit_button();
        ?>
		</form>
	</div>
<?php 
    }
 /**
  * Returns a filtered array of tabs that we should be loading.
  * @returns array
  */
 static function getTabs()
 {
     $tabs = array('global' => '\\Pressbooks\\Modules\\ThemeOptions\\GlobalOptions', 'web' => '\\Pressbooks\\Modules\\ThemeOptions\\WebOptions', 'pdf' => '\\Pressbooks\\Modules\\ThemeOptions\\PDFOptions', 'mpdf' => '\\Pressbooks\\Modules\\ThemeOptions\\MPDFOptions', 'ebook' => '\\Pressbooks\\Modules\\ThemeOptions\\EbookOptions');
     if (!\Pressbooks\Modules\Export\Prince\Pdf::hasDependencies()) {
         unset($tabs['pdf']);
     }
     if (!\Pressbooks\Modules\Export\Mpdf\Pdf::hasDependencies()) {
         unset($tabs['mpdf']);
     }
     return apply_filters('pressbooks_theme_options_tabs', $tabs);
 }
Пример #3
0
	       <legend><?php 
_e('Standard book formats', 'pressbooks');
?>
:</legend>
	       <?php 
if (true == \PressBooks\Utility\check_prince_install()) {
    ?>
	    	<input type="checkbox" id="pdf" name="export_formats[pdf]" value="1" /><label for="pdf"> <?php 
    _e('PDF (for printing)', 'pressbooks');
    ?>
</label><br />
	       <?php 
}
?>
		<?php 
if (\PressBooks\Modules\Export\Mpdf\Pdf::isInstalled()) {
    ?>
		<input type="checkbox" id="mpdf" name="export_formats[mpdf]" value="1" /><label for="mpdf"> <?php 
    _e('PDF (mPDF)', 'pressbooks');
    ?>
</label><br />
		<?php 
}
?>
		<input type="checkbox" id="epub" name="export_formats[epub]" value="1" /><label for="epub"> <?php 
_e('EPUB (for Nook, iBooks, Kobo etc.)', 'pressbooks');
?>
</label><br />
	    	<input type="checkbox" id="mobi" name="export_formats[mobi]" value="1" /><label for="mobi"> <?php 
_e('MOBI (for Kindle)', 'pressbooks');
?>
Пример #4
0
/><label for="print_pdf"> <?php 
_e('PDF (for print)', 'pressbooks');
?>
</label><br />
				<input type="checkbox" id="pdf" name="export_formats[pdf]" value="1" <?php 
if (false == $prince) {
    ?>
disabled <?php 
}
?>
/><label for="pdf"> <?php 
_e('PDF (for digital distribution)', 'pressbooks');
?>
</label><br />
				<?php 
if (true == \Pressbooks\Modules\Export\Mpdf\Pdf::hasDependencies()) {
    ?>
					<input type="checkbox" id="mpdf" name="export_formats[mpdf]" value="1" /><label for="mpdf"> <?php 
    _e('PDF (mPDF)', 'pressbooks');
    ?>
</label><br />
				<?php 
}
?>
				<input type="checkbox" id="epub" name="export_formats[epub]" value="1" <?php 
if (false == $epub) {
    ?>
disabled <?php 
}
?>
/><label for="epub"> <?php