Pressbooks\Modules\Export\Mpdf\Pdf::addFrontMatterByType PHP Method

addFrontMatterByType() public method

Add front matter of a specific/special type
public addFrontMatterByType ( string $type, array $contents )
$type string - special content placed ahead of everything else
$contents array - book contents
    function addFrontMatterByType($type, $contents)
    {
        $page_options = array('suppress' => 'on');
        foreach ($contents as $index => $page) {
            // If we hit non front-matter post types we won't see anymore front-matter
            if ('front-matter' != $page['post_type']) {
                return;
            }
            if (\Pressbooks\Taxonomy::getFrontMatterType($page['ID']) == $type) {
                $page['mpdf_omit_toc'] = true;
                $this->addPage($page, $page_options, false, false);
            }
        }
    }