Permalink
Browse files

Added bfox_ref_links() function for separating complex bible referenc…

…es into separate links
  • Loading branch information...
1 parent ff3f4dc commit aa21a821749af760cf88d5f921a1528c090012bd @rvenable committed Dec 1, 2011
@@ -23,6 +23,20 @@ function pop_bfox_ref_link_defaults() {
$refController->popLinkDefaults();
}
+function bfox_ref_links(BfoxRef $ref, $options = array()) {
+ $serializer = new BfoxRefSerializer();
+ $serializer->setCombineNone();
+ $elements = $serializer->elementsForRef($ref);
+
+ $str = '';
+ foreach ($elements as $index => $element) {
+ if ($index % 2 == 0) $str .= bfox_ref_link($element, $options);
+ else $str .= $element;
+ }
+
+ return $str;
+}
+
function bfox_ref_link($ref_str, $options = array()) {
if (empty($ref_str)) return false;
@@ -17,7 +17,7 @@
* See style-bfox_plan.css for the different options available (or create your own in your theme's style.css)
*/ ?>
<?php if (bfox_plan_reading_list(array('column_class' => 'reading-list-2c-h'))): ?>
- <p><?php _e('In total, this reading plan covers all of the following passages:', 'bfox') ?> <?php echo bfox_ref_link(bfox_plan_total_ref_str(0, BibleMeta::name_short)) ?></p>
+ <p><?php _e('In total, this reading plan covers all of the following passages:', 'bfox') ?> <?php echo bfox_ref_links(bfox_plan_total_ref()) ?></p>
<?php else: ?>
<p><?php _e('This reading plan doesn\'t currently have any readings.', 'bfox') ?></p>
<?php endif ?>
@@ -12,7 +12,7 @@
<?php if (empty($ref_str)): ?>
<p>This post currently has no bible references.</p>
<?php else: ?>
- <p>This post is currently referencing: <?php echo bfox_ref_link(bfox_ref_str()) ?></p>
+ <p>This post is currently referencing: <?php echo bfox_ref_links(bfox_ref()) ?></p>
<?php endif ?>
<p>Add more bible references by typing them into the post, or adding them to the post tags.</p>

0 comments on commit aa21a82

Please sign in to comment.