From b823ef6b68e50bb5ccbdffd04e6e7c2aff89be76 Mon Sep 17 00:00:00 2001 From: Cynthia Mijares Date: Mon, 20 Apr 2015 13:17:58 -0700 Subject: [PATCH] CAW-141: Added Image Insert field --- stanford_news.ds.inc | 12 +-- stanford_news.features.field_base.inc | 42 ++++---- stanford_news.features.field_instance.inc | 113 +++++++++++++++++++++- stanford_news.features.inc | 1 + stanford_news.field_group.inc | 8 +- stanford_news.info | 4 +- stanford_news.strongarm.inc | 6 +- 7 files changed, 151 insertions(+), 35 deletions(-) diff --git a/stanford_news.ds.inc b/stanford_news.ds.inc index 8163277..8070b58 100644 --- a/stanford_news.ds.inc +++ b/stanford_news.ds.inc @@ -25,12 +25,12 @@ function stanford_news_ds_layout_settings_info() { 2 => 'group_s_postcard_content', 3 => 'group_descriptor_info', 4 => 'body', - 5 => 'field_s_news_link', - 6 => 'field_s_news_date', + 5 => 'field_s_news_date', + 6 => 'field_s_news_link', 7 => 'field_s_news_attachment', 8 => 'field_s_news_source', - 9 => 'group_s_news_postedin', - 10 => 'field_s_image_info', + 9 => 'field_s_image_info', + 10 => 'group_s_news_postedin', 11 => 'field_s_news_categories', ), ), @@ -40,12 +40,12 @@ function stanford_news_ds_layout_settings_info() { 'group_s_postcard_content' => 'ds_content', 'group_descriptor_info' => 'ds_content', 'body' => 'ds_content', - 'field_s_news_link' => 'ds_content', 'field_s_news_date' => 'ds_content', + 'field_s_news_link' => 'ds_content', 'field_s_news_attachment' => 'ds_content', 'field_s_news_source' => 'ds_content', - 'group_s_news_postedin' => 'ds_content', 'field_s_image_info' => 'ds_content', + 'group_s_news_postedin' => 'ds_content', 'field_s_news_categories' => 'ds_content', ), 'classes' => array(), diff --git a/stanford_news.features.field_base.inc b/stanford_news.features.field_base.inc index 07818ed..a326169 100644 --- a/stanford_news.features.field_base.inc +++ b/stanford_news.features.field_base.inc @@ -17,14 +17,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_attachment', - 'foreign keys' => array( - 'fid' => array( - 'columns' => array( - 'fid' => 'fid', - ), - 'table' => 'file_managed', - ), - ), 'indexes' => array( 'fid' => array( 0 => 'fid', @@ -48,14 +40,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_categories', - 'foreign keys' => array( - 'tid' => array( - 'columns' => array( - 'tid' => 'tid', - ), - 'table' => 'taxonomy_term_data', - ), - ), 'indexes' => array( 'tid' => array( 0 => 'tid', @@ -82,7 +66,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_date', - 'foreign keys' => array(), 'indexes' => array(), 'locked' => 0, 'module' => 'date', @@ -112,7 +95,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_featured', - 'foreign keys' => array(), 'indexes' => array( 'value' => array( 0 => 'value', @@ -131,6 +113,28 @@ function stanford_news_field_default_field_bases() { 'type' => 'list_boolean', ); + // Exported field_base: 'field_s_news_image_insert' + $field_bases['field_s_news_image_insert'] = array( + 'active' => 1, + 'cardinality' => -1, + 'deleted' => 0, + 'entity_types' => array(), + 'field_name' => 'field_s_news_image_insert', + 'indexes' => array( + 'fid' => array( + 0 => 'fid', + ), + ), + 'locked' => 0, + 'module' => 'image', + 'settings' => array( + 'default_image' => 0, + 'uri_scheme' => 'public', + ), + 'translatable' => 0, + 'type' => 'image', + ); + // Exported field_base: 'field_s_news_link' $field_bases['field_s_news_link'] = array( 'active' => 1, @@ -138,7 +142,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_link', - 'foreign keys' => array(), 'indexes' => array(), 'locked' => 0, 'module' => 'link', @@ -168,7 +171,6 @@ function stanford_news_field_default_field_bases() { 'deleted' => 0, 'entity_types' => array(), 'field_name' => 'field_s_news_source', - 'foreign keys' => array(), 'indexes' => array(), 'locked' => 0, 'module' => 'link', diff --git a/stanford_news.features.field_instance.inc b/stanford_news.features.field_instance.inc index 9f05345..f089b14 100644 --- a/stanford_news.features.field_instance.inc +++ b/stanford_news.features.field_instance.inc @@ -234,7 +234,7 @@ function stanford_news_field_default_field_instances() { 'progress_indicator' => 'throbber', ), 'type' => 'file_generic', - 'weight' => 6, + 'weight' => 7, ), ); @@ -430,6 +430,115 @@ them, and integrate them with the site architecture.', ), ); + // Exported field_instance: 'node-stanford_news_item-field_s_news_image_insert' + $field_instances['node-stanford_news_item-field_s_news_image_insert'] = array( + 'bundle' => 'stanford_news_item', + 'deleted' => 0, + 'description' => 'Use this to Insert images into the text.', + 'display' => array( + 'default' => array( + 'label' => 'above', + 'module' => 'image', + 'settings' => array( + 'image_link' => '', + 'image_style' => '', + ), + 'type' => 'image', + 'weight' => 17, + ), + 'full' => array( + 'label' => 'hidden', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'taxonomy' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + 'teaser' => array( + 'label' => 'above', + 'settings' => array(), + 'type' => 'hidden', + 'weight' => 0, + ), + ), + 'entity_type' => 'node', + 'field_name' => 'field_s_news_image_insert', + 'label' => 'Image Insert', + 'required' => 0, + 'settings' => array( + 'alt_field' => 1, + 'default_image' => 0, + 'file_directory' => '', + 'file_extensions' => 'png gif jpg jpeg', + 'max_filesize' => '', + 'max_resolution' => '1200x1200', + 'min_resolution' => '', + 'title_field' => 1, + 'user_register_form' => FALSE, + ), + 'widget' => array( + 'active' => 1, + 'module' => 'image', + 'settings' => array( + 'insert' => 1, + 'insert_absolute' => 0, + 'insert_class' => '', + 'insert_default' => 'image_large-scaled', + 'insert_styles' => array( + 'auto' => 'auto', + 'icon_link' => 0, + 'image' => 'image', + 'image_3-col-header' => 0, + 'image_4-col-header' => 0, + 'image_6-col-banner' => 0, + 'image_6-col-banner-short' => 0, + 'image_6-col-banner-tall' => 0, + 'image_6-col-photo-landscape' => 0, + 'image_8-col-banner' => 0, + 'image_8-col-banner-short' => 0, + 'image_8-col-banner-tall' => 0, + 'image_9-col-banner' => 0, + 'image_9-col-banner-short' => 0, + 'image_12-col-banner' => 0, + 'image_12-col-banner-tall' => 0, + 'image_icon-profile' => 0, + 'image_icon-square' => 0, + 'image_large' => 0, + 'image_large-landscape' => 0, + 'image_large-landscape-scaled' => 0, + 'image_large-profile' => 0, + 'image_large-profile-scaled' => 0, + 'image_large-scaled' => 'image_large-scaled', + 'image_large-square' => 'image_large-square', + 'image_med-landscape' => 0, + 'image_med-landscape-scaled' => 0, + 'image_med-profile' => 0, + 'image_med-profile-scaled' => 0, + 'image_med-square' => 'image_med-square', + 'image_medium' => 0, + 'image_page-width' => 'image_page-width', + 'image_sm-landscape' => 0, + 'image_sm-profile' => 0, + 'image_sm-square' => 'image_sm-square', + 'image_thmb-landscape' => 0, + 'image_thmb-profile' => 0, + 'image_thmb-square' => 0, + 'image_thumbnail' => 0, + 'link' => 0, + ), + 'insert_width' => '', + 'preview_image_style' => 'thumbnail', + 'progress_indicator' => 'throbber', + ), + 'type' => 'image_image', + 'weight' => 6, + ), + ); + // Exported field_instance: 'node-stanford_news_item-field_s_news_link' $field_instances['node-stanford_news_item-field_s_news_link'] = array( 'bundle' => 'stanford_news_item', @@ -573,6 +682,7 @@ them, and integrate them with the site architecture.'); t('External Link'); t('Featured'); t('File'); + t('Image Insert'); t('Insert the article\'s source and URL link. (e.g. Stanford Report, http://news.stanford.edu/sr/)'); t('News Image'); t('Optional external link associated with this news item.'); @@ -580,6 +690,7 @@ them, and integrate them with the site architecture.'); t('This is a setting used to feature a news item in various places on the site (e.g., check "Featured" if you want to display this item, leave unchecked if you do not want to display this item).'); t('Upload file attachments associated with this news item.'); t('Use this Date field to indicate the date when a story appeared in an external publication.'); + t('Use this to Insert images into the text.'); return $field_instances; } diff --git a/stanford_news.features.inc b/stanford_news.features.inc index 795e45e..caee050 100644 --- a/stanford_news.features.inc +++ b/stanford_news.features.inc @@ -40,5 +40,6 @@ function stanford_news_node_info() { 'help' => '', ), ); + drupal_alter('node_info', $items); return $items; } diff --git a/stanford_news.field_group.inc b/stanford_news.field_group.inc index f54d558..f22acf8 100644 --- a/stanford_news.field_group.inc +++ b/stanford_news.field_group.inc @@ -87,7 +87,7 @@ function stanford_news_field_group_info() { $field_group->parent_name = ''; $field_group->data = array( 'label' => 'Advanced', - 'weight' => '10', + 'weight' => '11', 'children' => array( 0 => 'field_s_news_featured', ), @@ -367,9 +367,9 @@ function stanford_news_field_group_info() { 'label' => 'Postcard Content', 'weight' => '2', 'children' => array( - 0 => 'body', - 1 => 'field_s_news_attachment', - 2 => 'field_s_news_link', + 0 => 'field_s_news_attachment', + 1 => 'field_s_news_link', + 2 => 'body', 3 => 'group_descriptor_info', ), 'format_type' => 'div', diff --git a/stanford_news.info b/stanford_news.info index 76b524d..33f195d 100644 --- a/stanford_news.info +++ b/stanford_news.info @@ -2,7 +2,7 @@ name = Stanford News description = News Item content type, and list Views with an image and taxonomy terms core = 7.x package = Stanford -version = 7.x-3.0 +version = 7.x-3.0-alpha3 project = stanford_news dependencies[] = ctools dependencies[] = date @@ -32,6 +32,7 @@ features[field_base][] = field_s_news_attachment features[field_base][] = field_s_news_categories features[field_base][] = field_s_news_date features[field_base][] = field_s_news_featured +features[field_base][] = field_s_news_image_insert features[field_base][] = field_s_news_link features[field_base][] = field_s_news_source features[field_group][] = group_descriptor_info|node|stanford_news_item|default @@ -58,6 +59,7 @@ features[field_instance][] = node-stanford_news_item-field_s_news_attachment features[field_instance][] = node-stanford_news_item-field_s_news_categories features[field_instance][] = node-stanford_news_item-field_s_news_date features[field_instance][] = node-stanford_news_item-field_s_news_featured +features[field_instance][] = node-stanford_news_item-field_s_news_image_insert features[field_instance][] = node-stanford_news_item-field_s_news_link features[field_instance][] = node-stanford_news_item-field_s_news_source features[node][] = stanford_news_item diff --git a/stanford_news.strongarm.inc b/stanford_news.strongarm.inc index 92dd7a1..3d281e9 100644 --- a/stanford_news.strongarm.inc +++ b/stanford_news.strongarm.inc @@ -66,13 +66,13 @@ function stanford_news_strongarm() { 'weight' => '0', ), 'path' => array( - 'weight' => '7', + 'weight' => '8', ), 'metatags' => array( - 'weight' => '9', + 'weight' => '10', ), 'redirect' => array( - 'weight' => '8', + 'weight' => '9', ), ), 'display' => array(),