diff --git a/mnn_show.features.field.inc b/mnn_show.features.field.inc new file mode 100644 index 0000000..d4dd211 --- /dev/null +++ b/mnn_show.features.field.inc @@ -0,0 +1,1618 @@ + array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_delivered_via', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'delivered_via', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 7, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_delivered_via', + 'label' => 'Delivered Via', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '5', + ), + ), + ); + + // Exported field: 'node-cm_show-field_device' + $fields['node-cm_show-field_device'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_device', + 'field_permissions' => array( + 'type' => '2', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'device', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 6, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_device', + 'label' => 'Device', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '7', + ), + ), + ); + + // Exported field: 'node-cm_show-field_episode_number' + $fields['node-cm_show-field_episode_number'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_episode_number', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array(), + 'indexes' => array(), + 'module' => 'number', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'number_integer', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'number', + 'settings' => array( + 'decimal_separator' => '.', + 'prefix_suffix' => TRUE, + 'scale' => 0, + 'thousand_separator' => ' ', + ), + 'type' => 'number_integer', + 'weight' => 20, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_episode_number', + 'label' => 'Episode Number', + 'required' => 1, + 'settings' => array( + 'max' => '', + 'min' => '', + 'prefix' => '', + 'suffix' => '', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'number', + 'settings' => array(), + 'type' => 'number', + 'weight' => '3', + ), + ), + ); + + // Exported field: 'node-cm_show-field_format' + $fields['node-cm_show-field_format'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_format', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'format', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 1, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_format', + 'label' => 'Format', + 'required' => 1, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '5', + ), + ), + ); + + // Exported field: 'node-cm_show-field_narrative' + $fields['node-cm_show-field_narrative'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_narrative', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text_long', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 13, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_narrative', + 'label' => 'Show Narrative', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => '5', + ), + 'type' => 'text_textarea', + 'weight' => '9', + ), + ), + ); + + // Exported field: 'node-cm_show-field_producer_address' + $fields['node-cm_show-field_producer_address'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_producer_address', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text_long', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 22, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_producer_address', + 'label' => 'Producer Address', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => '5', + ), + 'type' => 'text_textarea', + 'weight' => '21', + ), + ), + ); + + // Exported field: 'node-cm_show-field_producer_email' + $fields['node-cm_show-field_producer_email'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_producer_email', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '255', + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 24, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_producer_email', + 'label' => 'Producer Email', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => '60', + ), + 'type' => 'text_textfield', + 'weight' => '23', + ), + ), + ); + + // Exported field: 'node-cm_show-field_producer_name' + $fields['node-cm_show-field_producer_name'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_producer_name', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '255', + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 21, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_producer_name', + 'label' => 'Producer Name', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => '60', + ), + 'type' => 'text_textfield', + 'weight' => '20', + ), + ), + ); + + // Exported field: 'node-cm_show-field_producer_phone' + $fields['node-cm_show-field_producer_phone'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_producer_phone', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '25', + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 23, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_producer_phone', + 'label' => 'Producer Phone Number', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => '25', + ), + 'type' => 'text_textfield', + 'weight' => '22', + ), + ), + ); + + // Exported field: 'node-cm_show-field_producer_website' + $fields['node-cm_show-field_producer_website'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_producer_website', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '255', + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 25, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_producer_website', + 'label' => 'Producer Website', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => '60', + ), + 'type' => 'text_textfield', + 'weight' => '24', + ), + ), + ); + + // Exported field: 'node-cm_show-field_project_audience' + $fields['node-cm_show-field_project_audience'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_project_audience', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'audience', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 11, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_project_audience', + 'label' => 'Audience', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '42', + ), + ), + ); + + // Exported field: 'node-cm_show-field_reject_reason' + $fields['node-cm_show-field_reject_reason'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_reject_reason', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'reject_reason', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 8, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_reject_reason', + 'label' => 'Reject Reason', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '6', + ), + ), + ); + + // Exported field: 'node-cm_show-field_runtime' + $fields['node-cm_show-field_runtime'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_runtime', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'runtime', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 9, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_runtime', + 'label' => 'Runtime', + 'required' => 1, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '6', + ), + ), + ); + + // Exported field: 'node-cm_show-field_short_description' + $fields['node-cm_show-field_short_description'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_short_description', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'max_length' => '200', + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 19, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_short_description', + 'label' => 'Short Description', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'size' => '100', + ), + 'type' => 'text_textfield', + 'weight' => '8', + ), + ), + ); + + // Exported field: 'node-cm_show-field_show_notes' + $fields['node-cm_show-field_show_notes'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_show_notes', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'format' => array( + 'columns' => array( + 'format' => 'format', + ), + 'table' => 'filter_format', + ), + ), + 'indexes' => array( + 'format' => array( + 0 => 'format', + ), + ), + 'module' => 'text', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'text_long', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'text', + 'settings' => array(), + 'type' => 'text_default', + 'weight' => 14, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_show_notes', + 'label' => 'Show Notes', + 'required' => 0, + 'settings' => array( + 'text_processing' => '0', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'text', + 'settings' => array( + 'rows' => '5', + ), + 'type' => 'text_textarea', + 'weight' => '10', + ), + ), + ); + + // Exported field: 'node-cm_show-field_timecode_in' + $fields['node-cm_show-field_timecode_in'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_timecode_in', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array(), + 'indexes' => array(), + 'module' => 'number', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'number_integer', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'number', + 'settings' => array( + 'decimal_separator' => '.', + 'prefix_suffix' => TRUE, + 'scale' => 0, + 'thousand_separator' => ' ', + ), + 'type' => 'number_integer', + 'weight' => 15, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_timecode_in', + 'label' => 'Timecode In', + 'required' => 0, + 'settings' => array( + 'max' => '', + 'min' => '0', + 'prefix' => '', + 'suffix' => '', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'number', + 'settings' => array(), + 'type' => 'number', + 'weight' => '33', + ), + ), + ); + + // Exported field: 'node-cm_show-field_timecode_out' + $fields['node-cm_show-field_timecode_out'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_timecode_out', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array(), + 'indexes' => array(), + 'module' => 'number', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'number_integer', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'number', + 'settings' => array( + 'decimal_separator' => '.', + 'prefix_suffix' => TRUE, + 'scale' => 0, + 'thousand_separator' => ' ', + ), + 'type' => 'number_integer', + 'weight' => 16, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_timecode_out', + 'label' => 'Timecode Out', + 'required' => 0, + 'settings' => array( + 'max' => '', + 'min' => '0', + 'prefix' => '', + 'suffix' => '', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'number', + 'settings' => array(), + 'type' => 'number', + 'weight' => '34', + ), + ), + ); + + // Exported field: 'node-cm_show-field_topic' + $fields['node-cm_show-field_topic'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_topic', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'topic', + 'parent' => '0', + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 12, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_topic', + 'label' => 'Topic', + 'required' => 0, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '43', + ), + ), + ); + + // Exported field: 'node-cm_show-field_trans_timecode_in' + $fields['node-cm_show-field_trans_timecode_in'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_trans_timecode_in', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array(), + 'indexes' => array(), + 'module' => 'number', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'number_integer', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'number', + 'settings' => array( + 'decimal_separator' => '.', + 'prefix_suffix' => TRUE, + 'scale' => 0, + 'thousand_separator' => ' ', + ), + 'type' => 'number_integer', + 'weight' => 17, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_trans_timecode_in', + 'label' => 'Transcoded Timecode In', + 'required' => 0, + 'settings' => array( + 'max' => '', + 'min' => '0', + 'prefix' => '', + 'suffix' => '', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'number', + 'settings' => array(), + 'type' => 'number', + 'weight' => '35', + ), + ), + ); + + // Exported field: 'node-cm_show-field_trans_timecode_out' + $fields['node-cm_show-field_trans_timecode_out'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'field_trans_timecode_out', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array(), + 'indexes' => array(), + 'module' => 'number', + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'number_integer', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'number', + 'settings' => array( + 'decimal_separator' => '.', + 'prefix_suffix' => TRUE, + 'scale' => 0, + 'thousand_separator' => ' ', + ), + 'type' => 'number_integer', + 'weight' => 18, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_trans_timecode_out', + 'label' => 'Transcoded Timecode Out', + 'required' => 0, + 'settings' => array( + 'max' => '', + 'min' => '0', + 'prefix' => '', + 'suffix' => '', + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 0, + 'module' => 'number', + 'settings' => array(), + 'type' => 'number', + 'weight' => '36', + ), + ), + ); + + // Exported field: 'node-cm_show-group_audience' + $fields['node-cm_show-group_audience'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '-1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'group_audience', + 'field_permissions' => array( + 'type' => '0', + ), + 'foreign keys' => array( + 'og' => array( + 'columns' => array( + 'gid' => 'gid', + ), + 'table' => 'og', + ), + ), + 'indexes' => array( + 'gid' => array( + 0 => 'gid', + ), + ), + 'module' => 'og', + 'no_ui' => TRUE, + 'settings' => array( + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'group', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'og', + 'settings' => array(), + 'type' => 'og_list_default', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'group_audience', + 'label' => 'Project', + 'required' => 1, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'view modes' => array( + 'full' => array( + 'custom settings' => FALSE, + 'label' => 'Full', + 'type' => 'og_list_default', + ), + 'teaser' => array( + 'custom settings' => FALSE, + 'label' => 'Teaser', + 'type' => 'og_list_default', + ), + ), + 'widget' => array( + 'active' => 1, + 'module' => 'og', + 'settings' => array( + 'opt_group' => 'auto', + ), + 'type' => 'group_audience', + 'weight' => '1', + ), + 'widget_type' => 'group_audience', + ), + ); + + // Exported field: 'node-cm_show-taxonomy_cm_project_types' + $fields['node-cm_show-taxonomy_cm_project_types'] = array( + 'field_config' => array( + 'active' => '1', + 'cardinality' => '1', + 'deleted' => '0', + 'entity_types' => array(), + 'field_name' => 'taxonomy_cm_project_types', + 'field_permissions' => array( + 'type' => '1', + ), + 'foreign keys' => array( + 'tid' => array( + 'columns' => array( + 'tid' => 'tid', + ), + 'table' => 'taxonomy_term_data', + ), + ), + 'indexes' => array( + 'tid' => array( + 0 => 'tid', + ), + ), + 'module' => 'taxonomy', + 'settings' => array( + 'allowed_values' => array( + 0 => array( + 'vocabulary' => 'cm_project_types', + 'parent' => 0, + ), + ), + 'profile2_private' => FALSE, + ), + 'translatable' => '0', + 'type' => 'taxonomy_term_reference', + ), + 'field_instance' => array( + 'bundle' => 'cm_show', + 'default_value' => NULL, + 'deleted' => '0', + 'description' => '', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'taxonomy', + 'settings' => array(), + 'type' => 'taxonomy_term_reference_link', + 'weight' => 5, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'taxonomy_cm_project_types', + 'label' => 'Schedule Type', + 'required' => 1, + 'settings' => array( + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'options', + 'settings' => array(), + 'type' => 'options_select', + 'weight' => '4', + ), + ), + ); + + // Translatables + // Included for use with string extractors like potx. + t('Audience'); + t('Delivered Via'); + t('Device'); + t('Episode Number'); + t('Format'); + t('Producer Address'); + t('Producer Email'); + t('Producer Name'); + t('Producer Phone Number'); + t('Producer Website'); + t('Project'); + t('Reject Reason'); + t('Runtime'); + t('Schedule Type'); + t('Short Description'); + t('Show Narrative'); + t('Show Notes'); + t('Timecode In'); + t('Timecode Out'); + t('Topic'); + t('Transcoded Timecode In'); + t('Transcoded Timecode Out'); + + return $fields; +} diff --git a/mnn_show.features.inc b/mnn_show.features.inc new file mode 100644 index 0000000..1b37f76 --- /dev/null +++ b/mnn_show.features.inc @@ -0,0 +1,15 @@ + "1"); + } +} diff --git a/mnn_show.features.taxonomy.inc b/mnn_show.features.taxonomy.inc new file mode 100644 index 0000000..0990e49 --- /dev/null +++ b/mnn_show.features.taxonomy.inc @@ -0,0 +1,151 @@ + array( + 'name' => 'Audience', + 'machine_name' => 'audience', + 'description' => '', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + 'delivered_via' => array( + 'name' => 'Delivered Via', + 'machine_name' => 'delivered_via', + 'description' => 'Set of terms used to say how a piece of media (usually for a show) was delivered.', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + 'device' => array( + 'name' => 'Device', + 'machine_name' => 'device', + 'description' => '', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + 'reject_reason' => array( + 'name' => 'Reject Reason', + 'machine_name' => 'reject_reason', + 'description' => 'A set of terms to indicate why a piece of media (usually associated with a show) was rejected by staff.', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + 'runtime' => array( + 'name' => 'Runtime', + 'machine_name' => 'runtime', + 'description' => '', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + 'topic' => array( + 'name' => 'Topic', + 'machine_name' => 'topic', + 'description' => 'A set of terms to describe a Project. These terms actually describe the format of the show, like PSA, Sitcom, Talk Show,etc...', + 'hierarchy' => '0', + 'module' => 'taxonomy', + 'weight' => '0', + 'rdf_mapping' => array( + 'rdftype' => array( + 0 => 'skos:ConceptScheme', + ), + 'name' => array( + 'predicates' => array( + 0 => 'dc:title', + ), + ), + 'description' => array( + 'predicates' => array( + 0 => 'rdfs:comment', + ), + ), + ), + ), + ); +} diff --git a/mnn_show.field_group.inc b/mnn_show.field_group.inc new file mode 100644 index 0000000..bef3106 --- /dev/null +++ b/mnn_show.field_group.inc @@ -0,0 +1,170 @@ +disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ + $field_group->api_version = 1; + $field_group->identifier = 'group_physical_media_info|node|cm_show|form'; + $field_group->group_name = 'group_physical_media_info'; + $field_group->entity_type = 'node'; + $field_group->bundle = 'cm_show'; + $field_group->mode = 'form'; + $field_group->parent_name = ''; + $field_group->data = array( + 'label' => 'Tape Library Information', + 'weight' => '9', + 'children' => array( + 0 => 'field_delivered_via', + 1 => 'field_reject_reason', + ), + 'format_type' => 'fieldset', + 'format_settings' => array( + 'label' => 'Tape Library Information', + 'instance_settings' => array( + 'required_fields' => 1, + 'classes' => '', + 'description' => '', + ), + 'formatter' => 'collapsible', + ), + ); + $export['group_physical_media_info|node|cm_show|form'] = $field_group; + + $field_group = new stdClass; + $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ + $field_group->api_version = 1; + $field_group->identifier = 'group_show_basic_information|node|cm_show|form'; + $field_group->group_name = 'group_show_basic_information'; + $field_group->entity_type = 'node'; + $field_group->bundle = 'cm_show'; + $field_group->mode = 'form'; + $field_group->parent_name = ''; + $field_group->data = array( + 'label' => 'Basic Information', + 'weight' => '2', + 'children' => array( + 0 => 'field_format', + 1 => 'taxonomy_cm_project_types', + 2 => 'field_device', + 3 => 'field_runtime', + 4 => 'field_narrative', + 5 => 'field_show_notes', + 6 => 'field_short_description', + 7 => 'field_episode_number', + ), + 'format_type' => 'fieldset', + 'format_settings' => array( + 'formatter' => 'collapsible', + 'instance_settings' => array( + 'description' => '', + 'classes' => '', + 'required_fields' => 1, + ), + ), + ); + $export['group_show_basic_information|node|cm_show|form'] = $field_group; + + $field_group = new stdClass; + $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ + $field_group->api_version = 1; + $field_group->identifier = 'group_show_categories|node|cm_show|form'; + $field_group->group_name = 'group_show_categories'; + $field_group->entity_type = 'node'; + $field_group->bundle = 'cm_show'; + $field_group->mode = 'form'; + $field_group->parent_name = ''; + $field_group->data = array( + 'label' => 'Categories', + 'weight' => '10', + 'children' => array( + 0 => 'field_project_audience', + 1 => 'field_topic', + 2 => 'field_pbcore_fcc_ratings', + 3 => 'field_pbcore_genres', + 4 => 'field_pbcore_languages', + ), + 'format_type' => 'fieldset', + 'format_settings' => array( + 'formatter' => 'collapsible', + 'instance_settings' => array( + 'description' => '', + 'classes' => '', + 'required_fields' => 1, + ), + ), + ); + $export['group_show_categories|node|cm_show|form'] = $field_group; + + $field_group = new stdClass; + $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ + $field_group->api_version = 1; + $field_group->identifier = 'group_show_producer_info|node|cm_show|form'; + $field_group->group_name = 'group_show_producer_info'; + $field_group->entity_type = 'node'; + $field_group->bundle = 'cm_show'; + $field_group->mode = 'form'; + $field_group->parent_name = ''; + $field_group->data = array( + 'label' => 'Special Producer Information', + 'weight' => '12', + 'children' => array( + 0 => 'field_producer_name', + 1 => 'field_producer_address', + 2 => 'field_producer_phone', + 3 => 'field_producer_email', + 4 => 'field_producer_website', + ), + 'format_type' => 'fieldset', + 'format_settings' => array( + 'label' => 'Special Producer Information', + 'instance_settings' => array( + 'required_fields' => 0, + 'classes' => '', + 'description' => '', + ), + 'formatter' => 'collapsible', + ), + ); + $export['group_show_producer_info|node|cm_show|form'] = $field_group; + + $field_group = new stdClass; + $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */ + $field_group->api_version = 1; + $field_group->identifier = 'group_timing_information|node|cm_show|form'; + $field_group->group_name = 'group_timing_information'; + $field_group->entity_type = 'node'; + $field_group->bundle = 'cm_show'; + $field_group->mode = 'form'; + $field_group->parent_name = ''; + $field_group->data = array( + 'label' => 'Timing Information', + 'weight' => '11', + 'children' => array( + 0 => 'field_timecode_in', + 1 => 'field_timecode_out', + 2 => 'field_trans_timecode_in', + 3 => 'field_trans_timecode_out', + ), + 'format_type' => 'fieldset', + 'format_settings' => array( + 'formatter' => 'collapsible', + 'instance_settings' => array( + 'description' => '', + 'classes' => '', + 'required_fields' => 1, + ), + ), + ); + $export['group_timing_information|node|cm_show|form'] = $field_group; + + return $export; +} diff --git a/mnn_show.info b/mnn_show.info new file mode 100644 index 0000000..47e7060 --- /dev/null +++ b/mnn_show.info @@ -0,0 +1,51 @@ +#features[field][] = "taxonomy_term-pbcore_genres-field_pbcore_custom_name" +core = "7.x" +dependencies[] = "cm_project" +dependencies[] = "cm_show" +dependencies[] = "features" +dependencies[] = "field_group" +dependencies[] = "mnn_project" +dependencies[] = "number" +dependencies[] = "og" +dependencies[] = "pbcore_custom_names" +dependencies[] = "taxonomy" +description = "Fields Extending Show Content Type" +features[ctools][] = "field_group:field_group:1" +features[field][] = "node-cm_show-field_delivered_via" +features[field][] = "node-cm_show-field_device" +features[field][] = "node-cm_show-field_episode_number" +features[field][] = "node-cm_show-field_format" +features[field][] = "node-cm_show-field_narrative" +features[field][] = "node-cm_show-field_producer_address" +features[field][] = "node-cm_show-field_producer_email" +features[field][] = "node-cm_show-field_producer_name" +features[field][] = "node-cm_show-field_producer_phone" +features[field][] = "node-cm_show-field_producer_website" +features[field][] = "node-cm_show-field_project_audience" +features[field][] = "node-cm_show-field_reject_reason" +features[field][] = "node-cm_show-field_runtime" +features[field][] = "node-cm_show-field_short_description" +features[field][] = "node-cm_show-field_show_notes" +features[field][] = "node-cm_show-field_timecode_in" +features[field][] = "node-cm_show-field_timecode_out" +features[field][] = "node-cm_show-field_topic" +features[field][] = "node-cm_show-field_trans_timecode_in" +features[field][] = "node-cm_show-field_trans_timecode_out" +features[field][] = "node-cm_show-group_audience" +features[field][] = "node-cm_show-taxonomy_cm_project_types" +features[field_group][] = "group_physical_media_info|node|cm_show|form" +features[field_group][] = "group_show_basic_information|node|cm_show|form" +features[field_group][] = "group_show_categories|node|cm_show|form" +features[field_group][] = "group_show_producer_info|node|cm_show|form" +features[field_group][] = "group_timing_information|node|cm_show|form" +features[taxonomy][] = "audience" +features[taxonomy][] = "delivered_via" +features[taxonomy][] = "device" +features[taxonomy][] = "reject_reason" +features[taxonomy][] = "runtime" +features[taxonomy][] = "topic" +name = "MNN Show" +package = "MNN Features" +php = "5.2.4" +project = "mnn_show" +version = "7.x-1.0-beta1" diff --git a/mnn_show.module b/mnn_show.module new file mode 100644 index 0000000..0d4f8b6 --- /dev/null +++ b/mnn_show.module @@ -0,0 +1,321 @@ +nid) ? + $form['#node'] : NULL; + $project_id_from_query_string = + filter_input(INPUT_GET, CM_PROJECT_ID_QUERY_ARGUMENT_NAME); + + if ($show_node) { + $project_field_on_show = &$show_node->{MNN_PROJECT_OG_FIELD_FOR_SHOW}; + $project_id = ($project_field_on_show) ? + $project_field_on_show[LANGUAGE_NONE][0]['target_id'] : NULL; + } + else if ($project_id_from_query_string) { + $project_id = $project_id_from_query_string; + } + if ($project_id) { + $project_node = node_load($project_id); + if ($project_node) { + $default_project_for_show = $project_node->title." (".$project_id.")"; + if (!$show_node) { + cm_project_synch_fields_for_child($form, $project_node); + } + } + } + + $project_widget = &$form[MNN_PROJECT_OG_FIELD_FOR_SHOW][LANGUAGE_NONE][0]; + $default_sub_field = &$project_widget['default'][0]['target_id']; + $admin_sub_field = &$project_widget['admin'][0]['target_id']; + + if ($default_project_for_show) { + $form['title']['#type'] = "hidden"; + $form['title']['#value'] = NULL; + + $default_sub_field['#value'] = NULL; + $admin_sub_field['#value'] = $default_project_for_show; + $default_sub_field['#type'] = "hidden"; + $admin_sub_field['#type'] = "hidden"; + $form[MNN_PROJECT_OG_FIELD_FOR_SHOW]['cm_project_picker_title'] = + array('#markup' => + "

Project

". + l($project_node->title, "node/".$project_id). + "

", + '#weight' => -100); + } + else { + $default_sub_field['#value'] = NULL; + $admin_sub_field['#value'] = NULL; + $admin_sub_field['#default_value'] = NULL; + $admin_sub_field['#default_value'] = NULL; + $default_sub_field['#type'] = "hidden"; + $default_sub_field['#type'] = "hidden"; + $form['title']['#type'] = "hidden"; + $form['title']['#value'] = NULL; + drupal_set_message(t("You must use the project picker to add a show."), + 'error'); + } + + if (!$show_node) { + $airings = mnn_show_airings_for_project($project_id); + } + + if (isset($airings)) { + $form['mnn_cm_airing'] = + array( + '#type' => 'select', + '#options'=> $airings, + '#prefix' => '
'. + "

".t('Air Date')."

", + '#suffix' => '
', + ); + } + if (!$show_node) { + $episode_number = mnn_show_get_next_episode_number($project_id); + $form['field_episode_number'][LANGUAGE_NONE][0] + ['value']['#default_value'] = $episode_number; + } + } +} +function mnn_show_node_validate($node, $form, &$form_state) { + if ($node->type=='cm_show') { + $project_id = $node->{MNN_PROJECT_OG_FIELD_FOR_SHOW}; + $project_id = $project_id[LANGUAGE_NONE][0]['target_id']; + + $show_id = ($node->nid) ? $node->nid : NULL; + + $episode_number = $node->field_episode_number[LANGUAGE_NONE][0]['value']; + + $existing_show_id = + mnn_show_get_existing_show_for_episode_number($project_id, + $show_id, + $episode_number); + $existing_show = node_load($existing_show_id); + if($existing_show) { + form_set_error('field_episode_number', + t("That episode number is already in use. "). + l($existing_show->title, "node/".$existing_show->nid)); + } + + //don't allow new shows to be added to inactive projects + if (!$show_id) { + $project = node_load($project_id); + + if (!$project->group_group[LANGUAGE_NONE][0]['value']) { + form_set_error(MNN_PROJECT_OG_FIELD_FOR_SHOW, + t("This project is not active. The project must be + active to add new shows")); + } + } + } +} + +function mnn_show_get_existing_show_for_episode_number($project_id, + $show_id, + $episode_number){ + $sql = + "SELECT s.nid as existing_show_id + FROM {node} s + LEFT JOIN {og_membership} og_membership + ON (s.nid = og_membership.etid AND + og_membership.entity_type = 'node') + LEFT JOIN {node} p + ON og_membership.gid = p.nid + INNER JOIN {field_data_field_episode_number} epnum + ON epnum.revision_id=s.vid + WHERE (p.nid = $project_id ) + AND (s.status = '1') + AND (s.type IN ('cm_show')) + AND (epnum.field_episode_number_value = :episode_number)"; + $params = array(':episode_number'=>$episode_number); + if ($show_id) { + $sql .= " AND (s.nid != :show_id)"; + $params[':show_id'] = $show_id; + } + + + $result = db_query($sql, $params)->fetchObject(); + return $result->existing_show_id;; +} + +function mnn_show_get_next_episode_number($project_id) { + $sql = + "SELECT (max(convert(epnum.field_episode_number_value,unsigned)) + 1) + AS episode_number + FROM {node} s + LEFT JOIN {og_membership} og_membership + ON (s.nid = og_membership.etid AND + og_membership.entity_type = 'node') + LEFT JOIN {node} p + ON og_membership.gid = p.nid + INNER JOIN field_data_field_episode_number epnum + ON epnum.revision_id=s.vid + WHERE (p.nid = :project_id ) + AND (s.status = '1') + AND (s.type IN ('cm_show')) + ORDER BY epnum.field_episode_number_value desc"; + $result = db_query($sql, array(':project_id'=>$project_id))->fetchObject(); + $episode_number = $result->episode_number ? $result->episode_number : 1; + return $episode_number; + + +} + +function mnn_show_og_node2_callback($form, $form_state) { + return $form['mnn_cm_airing']; +} + + + +function mnn_show_node_presave($node) { + if ($node->type=='cm_show') { + //SET THE TITLE + $short_description = $node->field_short_description ? + $node->field_short_description[LANGUAGE_NONE][0]['value'] : ""; + $episode_number = $node->field_episode_number ? + $node->field_episode_number[LANGUAGE_NONE][0]['value'] : ""; + $project_id = $node->{MNN_PROJECT_OG_FIELD_FOR_SHOW} ? + $node->{MNN_PROJECT_OG_FIELD_FOR_SHOW}[LANGUAGE_NONE][0]['target_id']:""; + $project = node_load($project_id); + $project_title = $project->title; + + $node->title = ($short_description) ? + $project->title." Episode ".$episode_number.": ".$short_description : + $project->title." Episode ".$episode_number; + + //RESAVE ALL RELATED AIRINGS + if ($node->nid) { + $airings = mnn_show_airings_for_show($node->nid); + foreach($airings as $airing_id) { + $airings = entity_load('airing', array($airing_id)); + $airing = array_pop($airings); + if ($airing) { + $airing->cm_use_auto_title = TRUE; + $airing->cm_use_auto_endtime = TRUE; + //FIXME SHOULD CHANGE THIS NAME TO FIT BOTH UPDATE AND CREATE + $airing->cm_newly_created_show = $node; + entity_save('airing', $airing); + } + } + } + } +} + + +function mnn_show_node_insert($node) { + if ($node->type=='cm_show') { + $airing_id = (isset($node->mnn_cm_airing) && $node->mnn_cm_airing) ? + $node->mnn_cm_airing : NULL; + + if ($airing_id) { + $airings = entity_load('airing', array($airing_id)); + $airing = array_pop($airings); + if ($airing) { + $airing->field_airing_show_ref[LANGUAGE_NONE][0]['target_id'] = + $node->nid; + $airing->cm_use_auto_title = TRUE; + $airing->cm_use_auto_endtime = TRUE; + $airing->cm_newly_created_show = $node; + entity_save('airing', $airing); + } + } + } +} +/** + * This function is called after a Project has been selected, it will + * return a dropdown of airings for a project. + */ +function mnn_show_airings_for_project($project_id = NULL) { + $airdates = array(0=>"- Select a value -");; + + $results = db_query( + "SELECT a.airing_id,td.name as channel, at.field_airing_date_value + FROM {cm_airing} a + INNER JOIN {field_data_field_airing_date} at + ON a.airing_id=at.entity_id + INNER JOIN {field_data_field_airing_project_ref} p + ON p.entity_id=at.entity_id + LEFT JOIN {field_data_field_airing_show_ref} s + ON s.entity_id = at.entity_id + INNER JOIN {field_data_field_airing_channel} c + ON a.airing_id = c.entity_id + INNER JOIN {taxonomy_term_data} td + ON td.tid = c.field_airing_channel_tid + WHERE p.field_airing_project_ref_target_id = :pid + AND s.field_airing_show_ref_target_id is NULL + AND at.field_airing_date_value > CURDATE() + ORDER BY at.field_airing_date_value asc + ", array(':pid'=>$project_id)); + + while ($airdate = $results->fetchObject()) { + $txt = date('m-d-y h:ia', + strtotime($airdate->field_airing_date_value))." ".$airdate->channel; + $airdates[$airdate->airing_id] = $txt; + } + + return $airdates; +} + + +/** + * THIS WILL RETURN ALL THE AIRING FOR A SHOW + */ +function mnn_show_airings_for_show($show_id = NULL) { + $ret = array(); + $results = db_query( + "SELECT a.airing_id + FROM {cm_airing} a + LEFT JOIN {field_data_field_airing_show_ref} s + ON s.entity_id = a.airing_id + WHERE s.field_airing_show_ref_target_id = :sid + ", array(':sid'=>$show_id)); + + while ($airdate = $results->fetchObject()) { + $ret[$airdate->airing_id] = $airdate->airing_id; + } + + return $ret; +} + + +function mnn_show_node_access($node, $op, $account) { + + $type = is_string($node) ? $node : $node->type; + + if ($type == 'cm_show' && $op == 'update') { + if (user_access('edit any ' . $type . ' content', $account) || + (user_access('edit own ' . $type . ' content', $account) && + ($account->uid == $node->uid))) { + return NODE_ACCESS_ALLOW; + } + else { + return NODE_ACCESS_DENY; + } + } + + if ($type == 'cm_show' && $op == 'delete') { + if (user_access('delete any ' . $type . ' content', $account) || + (user_access('delete own ' . $type . ' content', $account) && + ($account->uid == $node->uid))) { + return NODE_ACCESS_ALLOW; + } + else { + return NODE_ACCESS_DENY; + } + } + + return NODE_ACCESS_IGNORE; +} +