Exemplo n.º 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\Utility\show_experimental_features()) {
            ?>
		<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 
    }
Exemplo n.º 2
0
	    	<input type="checkbox" id="wxr" name="export_formats[wxr]" value="1" <?php 
checked(1, $options['wxr'], false);
?>
/><label for="wxr"> <?php 
_e('PressBooks XML', 'pressbooks');
?>
</label><br />
	    	<input type="checkbox" id="vanillawxr" name="export_formats[vanillawxr]" value="1" <?php 
checked(1, $options['vanillawxr'], false);
?>
/><label for="vanillawxr"> <?php 
_e('WordPress XML', 'pressbooks');
?>
</label>
	    	<?php 
if (true == \PressBooks\Utility\show_experimental_features()) {
    ?>
<br/>
	    	<input type="checkbox" id="odt" name="export_formats[odt]" value="1" <?php 
    checked(1, $options['odt'], false);
    ?>
/><label for="odt"> <?php 
    _e('ODT', 'pressbooks');
    ?>
</label>
	    	<?php 
}
?>
	    </fieldset>
    </form>
    <div class="clear"></div>
Exemplo n.º 3
0
 /**
  * @covers \PressBooks\Utility\show_experimental_features
  */
 public function test_show_experimental_features()
 {
     $this->assertInternalType('bool', \PressBooks\Utility\show_experimental_features());
     $this->assertInternalType('bool', \PressBooks\Utility\show_experimental_features('http://pressbooks.com'));
 }