Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Merge the living_word_quote functionality into the workflow branch. T…
Browse files Browse the repository at this point in the history
…his helps Issue #11

# Manually resolved conflicts:
#	living_word/living_word.field.inc
  • Loading branch information
rudolfbyker committed Jan 9, 2016
2 parents 63cfe6c + acd03dd commit 2038bef
Show file tree
Hide file tree
Showing 8 changed files with 732 additions and 13 deletions.
50 changes: 39 additions & 11 deletions living_word/living_word.field.inc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ function living_word_field_config() {
));
}


$fieldname = "{$prefix}_subverse";
if (!in_array($fieldname, $fieldnames)) {
field_create_field(array(
'field_name' => $fieldname,
'type' => 'living_word_quote',
'cardinality' => 1,
));
}

}


Expand Down Expand Up @@ -145,7 +155,7 @@ function living_word_field_instance_config() {
'label' => 'hidden',
),
),
'widget' => array('weight' => 0),
'widget' => array('weight' => 10),
));
$instances[] = $fieldname;
}
Expand All @@ -165,7 +175,7 @@ function living_word_field_instance_config() {
'label' => 'hidden',
),
),
'widget' => array('weight' => 1),
'widget' => array('weight' => 20),
));
$instances[] = $fieldname;
}
Expand All @@ -184,7 +194,7 @@ function living_word_field_instance_config() {
'type' => 'hidden',
),
),
'widget' => array('weight' => 2),
'widget' => array('weight' => 30),
'default_value' => array(array('value' => 0)),
));
$instances[] = $fieldname;
Expand All @@ -200,10 +210,7 @@ function living_word_field_instance_config() {
'description' => $t('Reference one or more verses from the Bible'),
'required' => true,
'widget' => array(
'weight' => 3,
// 'type' => 'scripture_picker',
// 'settings' => array(
// ),
'weight' => 40,
),
'display' => array(
'default' => array(
Expand All @@ -221,6 +228,27 @@ function living_word_field_instance_config() {
$instances[] = $fieldname;
}

$fieldname = "{$prefix}_subverse";
if (!in_array($fieldname, $instances) && in_array($fieldname, $fields)) {
field_create_instance(array(
'field_name' => $fieldname,
'label' => $t('Subverse'),
'entity_type' => 'node',
'bundle' => $bundle,
'description' => $t('Quote a selection of the scripture verse'),
'required' => true,
'widget' => array(
'weight' => 50,
),
'display' => array(
'default' => array(
'type' => 'hidden',
),
),
));
$instances[] = $fieldname;
}

$settings = variable_get("living_word_vocabs",NULL);

// load vocabulary for position
Expand All @@ -247,7 +275,7 @@ function living_word_field_instance_config() {
),
'widget' => array(
'type' => 'options_select',
'weight' => 4,
'weight' => 60,
),
));
$instances[] = $fieldname;
Expand Down Expand Up @@ -283,7 +311,7 @@ function living_word_field_instance_config() {
),
'widget' => array(
'type' => 'options_select',
'weight' => 5,
'weight' => 70,
),
));
$instances[] = $fieldname;
Expand All @@ -310,7 +338,7 @@ function living_word_field_instance_config() {
),
),
'widget' => array(
'weight' => 6,
'weight' => 80,
'type' => 'options_buttons',
),
));
Expand All @@ -332,7 +360,7 @@ function living_word_field_instance_config() {
),
),
'widget' => array(
'weight' => 6,
'weight' => 90,
'type' => 'options_buttons',
),
));
Expand Down
3 changes: 2 additions & 1 deletion living_word/living_word.info
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependencies[] = taxonomy
dependencies[] = scripture
dependencies[] = options
dependencies[] = list
dependencies[] = number
dependencies[] = number
dependencies[] = living_word_quote
15 changes: 14 additions & 1 deletion living_word/living_word.module
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,17 @@ define('LIVING_WORD_LISTING_ORDER_APPLICATION_TAGS', 0x0003);
*/
function living_word_get_comments($picker_values = array(), $detail_values = array(), $position_values = array()) {

}
}


/**
* Implements hook_field_widget_WIDGET_TYPE_form_alter(&$element, &$form_state, $context).
* https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_widget_WIDGET_TYPE_form_alter/7
* Specify the source text for the JS field widget, from which the quoted text
* must be selected.
*/
function living_word_field_widget_living_word_quote_widget_js_form_alter(&$element, &$form_state, $context) {
$element['#source_text'] = t("The Word is alive");
// TODO: get the verse range associated with the node, etc.
}

Loading

0 comments on commit 2038bef

Please sign in to comment.