t('Scripture Filter')); case 'description': return t('Turns any Scripture reference into a link to one of several online Bibles.'); case 'process': return scripturize($text, variable_get("scripturefilter_default_translation_$format", DEFAULT_BIBLE_TRANSLATION)); //removed Code from case 'settings' down to return $form default: return $text; } } //Added Code Below... function scripturefilter_menu($may_cache) { //This function creates the menu link for the settings page global $user; $items = array(); if ($may_cache) { $items[] = array( 'path' => 'admin/settings/scripturefilter', 'title' => t('Scripture Filter'), 'description' => t('Configure the settings for Scripture Filter'), 'access' => user_access('administer scripture filter'), 'callback' => 'drupal_get_form', 'callback arguments' => array('scripturefilter_settings'), ); } return $items; } // endfunction scripturefilter_menu function scripturefilter_footer($main = 0) { //Add Javascript and CSS and settings for Tooltip to page If(variable_get("scripturefilter_default_translation_format", DEFAULT_BIBLE_TRANSLATION)=="ESV"){ //If translation is ESV then add the appropirate CSS File $scripture_dir = drupal_get_path('module', 'scripturefilter'); drupal_add_css($scripture_dir . '/esv.css'); If(variable_get("scripturefilter_default_displaystyle", 'tooltip')=="tooltip"){ //If display style is tooltip then add js and options drupal_add_js($scripture_dir . '/esv_tooltip.js'); $ttoptions = array( 'scripture' => array( 'tipWidth' => variable_get("scripturefilter_esv_tooltip_width",600).'px', 'tipBorderSize' => variable_get("scripturefilter_esv_border-width",'1') . 'px', 'tipWidthHeaderSub' => (variable_get("scripturefilter_esv_tooltip_width",600)-10).'px', 'tipWidthBodySub' => (variable_get("scripturefilter_esv_tooltip_width",600)-4).'px', 'tipBorderColor' => variable_get("scripturefilter_esv_border-colour",'black'), 'tipHeaderOpacity' => "93", 'tipBodyOpacity' => "97", 'tipHeaderBgColor' => variable_get("scripturefilter_esv_heading-colour",'#444'), 'tipHeaderFontFamily' => "", 'tipHeaderFontSize' => variable_get("scripturefilter_esv_heading-font",16) . 'px', 'tipHeaderFontColor' => variable_get("scripturefilter_esv_heading-font-colour",'white'), 'tipHeaderAlign' => "left", 'tipHeaderPadding' => "5px", 'tipBodyBgColor' => variable_get("scripturefilter_esv_body-colour",'#E8E8FF') , 'tipBodyFontFamily' => "", 'tipBodyFontSize' => variable_get("scripturefilter_esv_body-font",13) . 'px', 'tipBodyFontColor' => variable_get("scripturefilter_esv_body-font-colour",'black'), 'tipBodyAlign' => "left", 'tipBodyPadding' => "2px", )); drupal_add_js($ttoptions, 'setting'); } elseif(variable_get("scripturefilter_default_displaystyle", 'tooltip')=="inline"){ //if Display style is Inline then add js to enable collapsing block drupal_add_js($scripture_dir . '/esv_showhide.js'); } } } function scripturefilter_settings() { //This array creates the Settings Menu $form['filter_scripturefilter'] = array('#type' => 'fieldset', '#title' => 'Scripture filter', '#collapsible' => TRUE, '#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.')); $form['filter_scripturefilter']["scripturefilter_default_translation_format"] = array('#type' => 'select', '#title' => t('Default Bible translation'), '#default_value' => variable_get("scripturefilter_default_translation_format", DEFAULT_BIBLE_TRANSLATION), '#options' => array("KJ21" => t("21st Century King James Version"), "ASV" => t("American Standard Version"), "AMP" => t("Amplified Bible"), "CEV" => t("Contemporary English Version"), "DARBY" => t("Darby Translation"), "ESV" => t("English Standard Version"), "KJV" => t("King James Version"), "MSG" => t("The Message"), "NASB" => t("New American Standard Bible"), "NET" => t("New English Translation"), "NIRV" => t("New International Reader's Version"), "NIV" => t("New International Version"), "NIV-UK" => t("New International Version - UK"), "NKJV" => t("New King James Version"), "NLT" => t("New Living Translation"), "TNIV" => t("Today's New International Version"), "WE" => t("Worldwide English New Testament"), "WYC" => t("Wycliffe New Testament"), "YLT" => t("Young's Literal Translation"), ), ); $form['filter_scripturefilter_esv'] = array('#type' => 'fieldset', '#title' => 'ESV settings', '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('These are the settings for the ESV bible.')); $form['filter_scripturefilter_esv']["scripturefilter_esv_API_key"] = array('#type' => 'textfield', '#title' => t('ESV API Key'), '#default_value' => variable_get("scripturefilter_esv_API_key",IP), '#description' => t("The default value for this is 'IP'. Read more about this here"), '#size' => '30', ); $form['filter_scripturefilter_esv']["scripturefilter_default_displaystyle"] = array('#type' => 'select', '#title' => t('Default Bible translation'), '#default_value' => variable_get("scripturefilter_default_displaystyle", 'tooltip'), '#options' => array( "tooltip" => t("Display Verse as a Tooltip "), "inline" => t("Display Verse in collapsed Block "), ), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_show-header"] = array('#type' => 'checkbox', '#title' => t('Display Header'), '#default_value' => variable_get("scripturefilter_esv_show-header",TRUE), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_audio"] = array('#type' => 'checkbox', '#title' => t('Display Audio Link'), '#default_value' => variable_get("scripturefilter_esv_audio",TRUE), '#description' => t("Audio is only available if you chose to display the text in the collapsible block"), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_include-footnotes"] = array('#type' => 'checkbox', '#title' => t('Include Footnotes'), '#default_value' => variable_get("scripturefilter_esv_include-footnotes",TRUE), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_include-verse-numbers"] = array('#type' => 'checkbox', '#title' => t('Include Verse Numbers'), '#default_value' => variable_get("scripturefilter_esv_include-verse-numbers",TRUE), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_include-headings"] = array('#type' => 'checkbox', '#title' => t('Include Section Headings'), '#default_value' => variable_get("scripturefilter_esv_include-headings",TRUE), ); $form['filter_scripturefilter_esv']["scripturefilter_esv_include-subheadings"] = array('#type' => 'checkbox', '#title' => t('Include Subheadings'), '#default_value' => variable_get("scripturefilter_esv_include-subheadings",TRUE), ); $form['filter_scripturefilter_esv_tooltip'] = array('#type' => 'fieldset', '#title' => 'ESV Tooltip settings', '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('These are the settings for the ESV bible when displayed in Tooltip form.')); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_tooltip_width"] = array('#type' => 'textfield', '#title' => t('ESV Tooltip Width'), '#field_suffix' => t('px'), '#default_value' => variable_get("scripturefilter_esv_tooltip_width",'600'), '#size' => '6', ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_border-colour"] = array('#type' => 'textfield', '#title' => t('Border Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_border-colour",'black'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_border-width"] = array('#type' => 'textfield', '#title' => t('Border Width'), '#size' => '3', '#field_suffix' => t('px'), '#default_value' => variable_get("scripturefilter_esv_border-width",'1'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_heading-colour"] = array('#type' => 'textfield', '#title' => t('Heading Background Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_heading-colour",'#444'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_heading-font"] = array('#type' => 'textfield', '#title' => t('Heading Font Size'), '#size' => '3', '#field_suffix' => t('pt'), '#default_value' => variable_get("scripturefilter_esv_heading-font",'16'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_heading-font-colour"] = array('#type' => 'textfield', '#title' => t('Heading Font Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_heading-font-colour",'white'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_body-colour"] = array('#type' => 'textfield', '#title' => t('Body Background Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_body-colour",'#E8E8FF'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_body-font"] = array('#type' => 'textfield', '#title' => t('Body Font Size'), '#size' => '3', '#field_suffix' => t('pt'), '#default_value' => variable_get("scripturefilter_esv_body-font",'13'), ); $form['filter_scripturefilter_esv_tooltip']["scripturefilter_esv_body-font-colour"] = array('#type' => 'textfield', '#title' => t('Body Font Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_body-font-colour",'black'), ); $form['filter_scripturefilter_esv_inline'] = array('#type' => 'fieldset', '#title' => 'ESV settings for Collasible Block Display', '#collapsible' => TRUE, '#collapsed' => TRUE, '#description' => t('These are the settings for the ESV bible when displayed in collapsible block form.')); $audioformat = array( 'flash' => t('Flash Player'), 'mp3' => t('MP3'), 'real' => t('Real Audio'), 'wma' => t('Windows Media Audio'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_audio-format"] = array( '#type' => 'select', '#title' => t('Audio Format'), '#default_value' => variable_get('scripturefilter_esv_audio-format', 'flash'), '#options' => $audioformat, '#description' => t('RealAudio and WMA, only have New Testament recordings'), ); $audiospeaker = array( 'mm' => t('Max McLean, complete Bible'), 'ml' => t('Marquis Laughlin, New Testament only'), 'ml-mm' => t('Max McLean for Old Testament, Marquis Laughlin for New Testament'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_audio-version"] = array( '#type' => 'select', '#title' => t('Audio Speaker'), '#default_value' => variable_get('scripturefilter_esv_audio-version', 'mm'), '#options' => $audiospeaker, '#description' => t('Only affects the output if the audio format is flash or mp3'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_inline-border-colour"] = array('#type' => 'textfield', '#title' => t('Border Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_inline-border-colour",'blue'), '#description' => t("This sets the colour of the border to the collasible block and left margin"), ); $borderstyles = array( 'none' => t('No Border'), 'dotted' => t('Dotted Border'), 'dashed' => t('Dashed Border'), 'solid' => t('Solid Border'), 'double' => t('Dotted Border'), 'groove' => t('3D Groove Border'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_inline-border-style"] = array( '#type' => 'select', '#title' => t('Border Style'), '#default_value' => variable_get('scripturefilter_esv_inline-border-style', 'dotted'), '#options' => $borderstyles, ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_inline-border-width"] = array('#type' => 'textfield', '#title' => t('Border Width'), '#size' => '3', '#field_suffix' => t('px'), '#default_value' => variable_get("scripturefilter_esv_inline-border-width",'1'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_inline-left-border"] = array('#type' => 'textfield', '#title' => t('Left Margin Size'), '#size' => '3', '#field_suffix' => t('px'), '#default_value' => variable_get("scripturefilter_esv_inline-left-border",'5'), ); $form['filter_scripturefilter_esv_inline']["scripturefilter_esv_inline-text-colour"] = array('#type' => 'textfield', '#title' => t('Text Colour'), '#size' => '8', '#default_value' => variable_get("scripturefilter_esv_inline-text-colour",'black'), '#description' => t("This sets the colour of the text"), ); return system_settings_form($form); } function scripturefilter_settings_validate($form_id, $form_values) { //Clears out cached verses when settings are changed cache_clear_all('scripture', 'cache', TRUE); //Clears out the Input Filter Cache db_query("DELETE FROM cache_filter"); } ?>