| 1 |
<?php
|
| 2 |
|
| 3 |
// $Id: scripturefilter.module,v 1.10 2009/02/13 21:52:57 smsimms Exp $
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* An input filter that turns scripture references into links to
|
| 8 |
* various online Bibles.
|
| 9 |
*/
|
| 10 |
|
| 11 |
function scripturefilter_filter_tips($delta, $format, $long = FALSE) {
|
| 12 |
return t('Scripture references will be linked automatically to an online Bible. E.g. John 3:16, Eph 2:8-9 (ESV).');
|
| 13 |
}
|
| 14 |
|
| 15 |
function scripturefilter_filter($op, $delta = 0, $format = -1, $text = '') {
|
| 16 |
include_once 'scripturefilter.inc';
|
| 17 |
switch ($op) {
|
| 18 |
case 'list':
|
| 19 |
return array(0 => t('Scripture Filter'));
|
| 20 |
|
| 21 |
case 'description':
|
| 22 |
return t('Turns any Scripture reference into a link to one of several online Bibles.');
|
| 23 |
|
| 24 |
case 'process':
|
| 25 |
return scripturize($text, variable_get("scripturefilter_default_translation_$format", DEFAULT_BIBLE_TRANSLATION));
|
| 26 |
|
| 27 |
case 'settings':
|
| 28 |
$form['filter_scripturefilter'] = array(
|
| 29 |
'#type' => 'fieldset',
|
| 30 |
'#title' => 'Scripture filter',
|
| 31 |
'#collapsible' => TRUE,
|
| 32 |
'#description' => t('This filter enables content that has a reference to Scripture to be linked to one of several online Bibles, such as BibleGateway, the ESV online Bible and the NET Bible.')
|
| 33 |
);
|
| 34 |
|
| 35 |
$form['filter_scripturefilter']["scripturefilter_default_translation_$format"] = array(
|
| 36 |
'#type' => 'select',
|
| 37 |
'#title' => t('Default Bible translation'),
|
| 38 |
'#default_value' => variable_get("scripturefilter_default_translation_$format", DEFAULT_BIBLE_TRANSLATION),
|
| 39 |
'#options' => array(
|
| 40 |
"KJ21" => t("21st Century King James Version"),
|
| 41 |
"ASV" => t("American Standard Version"),
|
| 42 |
"AMP" => t("Amplified Bible"),
|
| 43 |
"CEV" => t("Contemporary English Version"),
|
| 44 |
"DARBY" => t("Darby Translation"),
|
| 45 |
"ESV" => t("English Standard Version"),
|
| 46 |
"KJV" => t("King James Version"),
|
| 47 |
"MSG" => t("The Message"),
|
| 48 |
"NASB" => t("New American Standard Bible"),
|
| 49 |
"NET" => t("New English Translation"),
|
| 50 |
"NIRV" => t("New International Reader's Version"),
|
| 51 |
"NIV" => t("New International Version"),
|
| 52 |
"NIV-UK" => t("New International Version - UK"),
|
| 53 |
"NKJV" => t("New King James Version"),
|
| 54 |
"NLT" => t("New Living Translation"),
|
| 55 |
"TNIV" => t("Today's New International Version"),
|
| 56 |
"WE" => t("Worldwide English New Testament"),
|
| 57 |
"WYC" => t("Wycliffe New Testament"),
|
| 58 |
"YLT" => t("Young's Literal Translation"),
|
| 59 |
),
|
| 60 |
);
|
| 61 |
return $form;
|
| 62 |
|
| 63 |
default:
|
| 64 |
return $text;
|
| 65 |
}
|
| 66 |
}
|