예제 #1
0
 function parsePassagesIntoReadings($passages, $readingSize, $allowPassageGroups = true)
 {
     $readingSize = max(1, $readingSize);
     if ($allowPassageGroups) {
         $ref = BfoxRefParser::with_groups($passages);
     } else {
         $ref = new BfoxRef($passages);
     }
     if ($ref->is_valid()) {
         $readingRefs = $ref->get_sections($readingSize);
         foreach ($readingRefs as $readingRef) {
             if ($readingRef->is_valid()) {
                 $this->addReading($readingRef);
             }
         }
     }
     return $readings;
 }
예제 #2
0
function list_bfox_ref_chapters(BfoxRef $ref = null, $options = array())
{
    $defaults = array('format' => BibleMeta::name_none, 'first_format' => false, 'before' => '<li>', 'after' => '</li>', 'between' => '', 'link_cb' => 'bfox_ref_link', 'link_cb_options' => array());
    extract(wp_parse_args($options, $defaults));
    $chapters = $ref->get_sections(1);
    $strs = array();
    foreach ($chapters as $chapter) {
        if ($first_format !== false) {
            $ref_str = $chapter->get_string($first_format);
            $first_format = false;
        } else {
            $ref_str = $chapter->get_string($format);
        }
        $link_cb_options['text'] = $ref_str;
        if ($link_cb && is_callable($link_cb)) {
            $ref_str = call_user_func($link_cb, $chapter->get_string(), $link_cb_options);
        }
        $strs[] = $before . $ref_str . $after;
    }
    return implode($between, $strs);
}
예제 #3
0
 public static function readings_from_passages($passages, $chunk_size)
 {
     $chunk_size = max(1, $chunk_size);
     $ref = new BfoxRef($passages);
     $readings = array();
     if ($ref->is_valid()) {
         $chunks = $ref->get_sections($chunk_size);
         foreach ($chunks as $chunk) {
             if ($chunk->is_valid()) {
                 $readings[] = $chunk;
             }
         }
     }
     return $readings;
 }
예제 #4
0
<?php

// Limit the ref to 10 chapters
$input_ref = new BfoxRef($_REQUEST['bfoxp']);
list($ref) = $input_ref->get_sections(10, 1);
$trans_ids = BfoxTrans::get_ids_by_short_name();
$trans = new BfoxTrans($trans_ids[$_REQUEST['trans']]);
// Get the show options param (default is to show options)
$show_options = !(isset($_REQUEST['opts']) && !$_REQUEST['opts']);
$allow_tooltips = !!$_REQUEST['allow_tooltips'];
// TODO: We shouldn't really use tooltips on the print screen, but use inline scriptures
if (!$allow_tooltips) {
    wp_deregister_script('bfox-blog');
}
// All we need are the scripture styles and script
// TODO: Buddypress is adding a few other syles which we don't need to load here
wp_enqueue_script('bfox-theme-print', BFOX_TRANS_URL . '/theme/print.js', array('jquery'));
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" <?php 
language_attributes();
?>
>

	<head profile="http://gmpg.org/xfn/11">
		<meta http-equiv="Content-Type" content="<?php 
bloginfo('html_type');
?>
; charset=<?php