Permalink
Browse files

added basic page banner view and context

  • Loading branch information...
1 parent fba7c2b commit 4ffd3b917aedb2860cf2d18a68f95e295247419e @jessehs jessehs committed Jun 22, 2011
Showing with 190 additions and 18 deletions.
  1. +50 −0 os_base.context.inc
  2. +11 −18 os_base.features.field.inc
  3. +14 −0 os_base.features.inc
  4. +6 −0 os_base.info
  5. +109 −0 os_base.views_default.inc
View
@@ -0,0 +1,50 @@
+<?php
+/**
+ * @file
+ * os_base.context.inc
+ */
+
+/**
+ * Implementation of hook_context_default_contexts().
+ */
+function os_base_context_default_contexts() {
+ $export = array();
+
+ $context = new stdClass;
+ $context->disabled = FALSE; /* Edit this to true to make a default context disabled initially */
+ $context->api_version = 3;
+ $context->name = 'header image';
+ $context->description = 'Adds header image views block to the header context.';
+ $context->tag = 'Basic pages';
+ $context->conditions = array(
+ 'node' => array(
+ 'values' => array(
+ 'page' => 'page',
+ ),
+ 'options' => array(
+ 'node_form' => '0',
+ ),
+ ),
+ );
+ $context->reactions = array(
+ 'block' => array(
+ 'blocks' => array(
+ 'views-basic_page_banner_image-block' => array(
+ 'module' => 'views',
+ 'delta' => 'basic_page_banner_image-block',
+ 'region' => 'highlighted',
+ 'weight' => '-10',
+ ),
+ ),
+ ),
+ );
+ $context->condition_mode = 0;
+
+ // Translatables
+ // Included for use with string extractors like potx.
+ t('Adds header image views block to the header context.');
+ t('Basic pages');
+ $export['header image'] = $context;
+
+ return $export;
+}
@@ -64,16 +64,17 @@ function os_base_field_default_fields() {
'entity_type' => 'node',
'field_name' => 'body',
'label' => 'Body',
- 'required' => FALSE,
+ 'required' => 0,
'settings' => array(
- 'display_summary' => TRUE,
- 'text_processing' => 1,
+ 'display_summary' => 1,
+ 'text_processing' => '1',
'user_register_form' => FALSE,
),
'widget' => array(
+ 'active' => 1,
'module' => 'text',
'settings' => array(
- 'rows' => 20,
+ 'rows' => '20',
'summary_rows' => 5,
),
'type' => 'text_textarea_with_summary',
@@ -119,12 +120,8 @@ function os_base_field_default_fields() {
'display' => array(
'default' => array(
'label' => 'hidden',
- 'module' => 'image',
- 'settings' => array(
- 'image_link' => '',
- 'image_style' => 'page-banner',
- ),
- 'type' => 'image',
+ 'settings' => array(),
+ 'type' => 'hidden',
'weight' => '0',
),
'teaser' => array(
@@ -217,14 +214,10 @@ function os_base_field_default_fields() {
'description' => 'Upload images to be associated with this node. Use the "Insert" button to paste the image (resized according your selection) into the page\'s <em>Body</em> area.',
'display' => array(
'default' => array(
- 'label' => 'above',
- 'module' => 'image',
- 'settings' => array(
- 'image_link' => '',
- 'image_style' => '',
- ),
- 'type' => 'image',
- 'weight' => 2,
+ 'label' => 'hidden',
+ 'settings' => array(),
+ 'type' => 'hidden',
+ 'weight' => '2',
),
'teaser' => array(
'label' => 'above',
View
@@ -9,6 +9,10 @@
*/
function os_base_ctools_plugin_api() {
list($module, $api) = func_get_args();
+ if ($module == "context" && $api == "context") {
+ return array("version" => 3);
+ }
+ list($module, $api) = func_get_args();
if ($module == "page_manager" && $api == "pages_default") {
return array("version" => 1);
}
@@ -19,6 +23,16 @@ function os_base_ctools_plugin_api() {
}
/**
+ * Implementation of hook_views_api().
+ */
+function os_base_views_api() {
+ list($module, $api) = func_get_args();
+ if ($module == "views" && $api == "views_default") {
+ return array("version" => 3.0);
+ }
+}
+
+/**
* Implementation of hook_image_default_styles().
*/
function os_base_image_default_styles() {
View
@@ -1,12 +1,17 @@
core = "7.x"
+dependencies[] = "context"
dependencies[] = "ctools"
dependencies[] = "features"
dependencies[] = "image"
dependencies[] = "page_manager"
dependencies[] = "strongarm"
+dependencies[] = "views"
description = "Base content types, roles and usability enhancements"
+features[context][] = "header image"
+features[ctools][] = "context:context:3"
features[ctools][] = "page_manager:pages_default:1"
features[ctools][] = "strongarm:strongarm:1"
+features[ctools][] = "views:views_default:3.0"
features[field][] = "node-page-body"
features[field][] = "node-page-field_page_banner"
features[field][] = "node-page-field_page_images"
@@ -29,6 +34,7 @@ features[user_role][] = "site editor"
features[variable][] = "comment_page"
features[variable][] = "node_options_page"
features[variable][] = "pathauto_node_page_pattern"
+features[views_view][] = "basic_page_banner_image"
name = "OpenSourcery base"
package = "Features"
php = "5.2.4"
@@ -0,0 +1,109 @@
+<?php
+/**
+ * @file
+ * os_base.views_default.inc
+ */
+
+/**
+ * Implementation of hook_views_default_views().
+ */
+function os_base_views_default_views() {
+ $export = array();
+
+ $view = new view;
+ $view->name = 'basic_page_banner_image';
+ $view->description = '';
+ $view->tag = 'default';
+ $view->base_table = 'node';
+ $view->human_name = 'Basic Page Banner Image';
+ $view->core = 7;
+ $view->api_version = '3.0-alpha1';
+ $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+ /* Display: Master */
+ $handler = $view->new_display('default', 'Master', 'default');
+ $handler->display->display_options['access']['type'] = 'perm';
+ $handler->display->display_options['cache']['type'] = 'none';
+ $handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['exposed_form']['type'] = 'basic';
+ $handler->display->display_options['pager']['type'] = 'some';
+ $handler->display->display_options['pager']['options']['items_per_page'] = '1';
+ $handler->display->display_options['pager']['options']['offset'] = '0';
+ $handler->display->display_options['style_plugin'] = 'default';
+ $handler->display->display_options['row_plugin'] = 'fields';
+ /* Field: Content: Banner image */
+ $handler->display->display_options['fields']['field_page_banner']['id'] = 'field_page_banner';
+ $handler->display->display_options['fields']['field_page_banner']['table'] = 'field_data_field_page_banner';
+ $handler->display->display_options['fields']['field_page_banner']['field'] = 'field_page_banner';
+ $handler->display->display_options['fields']['field_page_banner']['label'] = '';
+ $handler->display->display_options['fields']['field_page_banner']['alter']['alter_text'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['make_link'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['absolute'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['external'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['replace_spaces'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['trim'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['nl2br'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['word_boundary'] = 1;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['ellipsis'] = 1;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['strip_tags'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['alter']['html'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['element_label_colon'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['element_default_classes'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['hide_empty'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['empty_zero'] = 0;
+ $handler->display->display_options['fields']['field_page_banner']['click_sort_column'] = 'fid';
+ $handler->display->display_options['fields']['field_page_banner']['settings'] = array(
+ 'image_style' => 'page-banner',
+ 'image_link' => '',
+ );
+ $handler->display->display_options['fields']['field_page_banner']['field_api_classes'] = 0;
+ /* Contextual filter: Content: Nid */
+ $handler->display->display_options['arguments']['nid']['id'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['table'] = 'node';
+ $handler->display->display_options['arguments']['nid']['field'] = 'nid';
+ $handler->display->display_options['arguments']['nid']['default_action'] = 'default';
+ $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
+ $handler->display->display_options['arguments']['nid']['default_argument_skip_url'] = 0;
+ $handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
+ $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
+ $handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
+ $handler->display->display_options['arguments']['nid']['specify_validation'] = 1;
+ $handler->display->display_options['arguments']['nid']['validate']['type'] = 'node';
+ $handler->display->display_options['arguments']['nid']['validate_options']['types'] = array(
+ 'page' => 'page',
+ );
+ $handler->display->display_options['arguments']['nid']['validate_options']['access'] = 0;
+ $handler->display->display_options['arguments']['nid']['break_phrase'] = 0;
+ $handler->display->display_options['arguments']['nid']['not'] = 0;
+ /* Filter criterion: Content: Published */
+ $handler->display->display_options['filters']['status']['id'] = 'status';
+ $handler->display->display_options['filters']['status']['table'] = 'node';
+ $handler->display->display_options['filters']['status']['field'] = 'status';
+ $handler->display->display_options['filters']['status']['value'] = 1;
+ $handler->display->display_options['filters']['status']['group'] = 0;
+ $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
+ /* Filter criterion: Content: Type */
+ $handler->display->display_options['filters']['type']['id'] = 'type';
+ $handler->display->display_options['filters']['type']['table'] = 'node';
+ $handler->display->display_options['filters']['type']['field'] = 'type';
+ $handler->display->display_options['filters']['type']['value'] = array(
+ 'page' => 'page',
+ );
+
+ /* Display: Block */
+ $handler = $view->new_display('block', 'Block', 'block');
+ $translatables['basic_page_banner_image'] = array(
+ t('Master'),
+ t('more'),
+ t('Apply'),
+ t('Reset'),
+ t('Sort by'),
+ t('Asc'),
+ t('Desc'),
+ t('All'),
+ t('Block'),
+ );
+ $export['basic_page_banner_image'] = $view;
+
+ return $export;
+}

0 comments on commit 4ffd3b9

Please sign in to comment.