8ac59801be
Update commons modules to release 7.12, and move the codebase under modules/commons instead of constant fetching from remote repository. The commons.make file removed so it is not required to rebuild groups distribution. Change-Id: I3be393ba1af34427e2915b18ab1ad718fd4e54db
242 lines
13 KiB
PHP
242 lines
13 KiB
PHP
<?php
|
||
/**
|
||
* @file
|
||
* commons_q_a.views_default.inc
|
||
*/
|
||
|
||
/**
|
||
* Implements hook_views_default_views().
|
||
*/
|
||
function commons_q_a_views_default_views() {
|
||
$export = array();
|
||
|
||
$view = new view();
|
||
$view->name = 'commons_bw_q_a';
|
||
$view->description = 'Commons Q&A listing for the group browsing widget.';
|
||
$view->tag = 'Commons Q&A, Commons Browsing Widget';
|
||
$view->base_table = 'node';
|
||
$view->human_name = 'Commons Browsing Widget - Q&A';
|
||
$view->core = 7;
|
||
$view->api_version = '3.0';
|
||
$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['use_ajax'] = TRUE;
|
||
$handler->display->display_options['use_more_always'] = FALSE;
|
||
$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'] = 'lite';
|
||
$handler->display->display_options['pager']['options']['items_per_page'] = '10';
|
||
$handler->display->display_options['pager']['options']['offset'] = '0';
|
||
$handler->display->display_options['pager']['options']['id'] = '3';
|
||
$handler->display->display_options['pager']['options']['quantity'] = '9';
|
||
$handler->display->display_options['style_plugin'] = 'default';
|
||
$handler->display->display_options['row_plugin'] = 'entity';
|
||
$handler->display->display_options['row_options']['view_mode'] = 'teaser';
|
||
/* Header: Global: Node partial form */
|
||
$handler->display->display_options['header']['commons_bw_node_partial_form']['id'] = 'commons_bw_node_partial_form';
|
||
$handler->display->display_options['header']['commons_bw_node_partial_form']['table'] = 'views';
|
||
$handler->display->display_options['header']['commons_bw_node_partial_form']['field'] = 'commons_bw_node_partial_form';
|
||
$handler->display->display_options['header']['commons_bw_node_partial_form']['bundle'] = 'question';
|
||
/* No results behavior: Global: Text area */
|
||
$handler->display->display_options['empty']['area']['id'] = 'area';
|
||
$handler->display->display_options['empty']['area']['table'] = 'views';
|
||
$handler->display->display_options['empty']['area']['field'] = 'area';
|
||
$handler->display->display_options['empty']['area']['empty'] = TRUE;
|
||
$handler->display->display_options['empty']['area']['content'] = 'No questions have been added to this group.';
|
||
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
|
||
/* Relationship: OG membership: OG membership from Node */
|
||
$handler->display->display_options['relationships']['og_membership_rel']['id'] = 'og_membership_rel';
|
||
$handler->display->display_options['relationships']['og_membership_rel']['table'] = 'node';
|
||
$handler->display->display_options['relationships']['og_membership_rel']['field'] = 'og_membership_rel';
|
||
$handler->display->display_options['relationships']['og_membership_rel']['required'] = TRUE;
|
||
/* Field: Content: Title */
|
||
$handler->display->display_options['fields']['title']['id'] = 'title';
|
||
$handler->display->display_options['fields']['title']['table'] = 'node';
|
||
$handler->display->display_options['fields']['title']['field'] = 'title';
|
||
$handler->display->display_options['fields']['title']['label'] = '';
|
||
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
|
||
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
|
||
/* Sort criterion: Content: Sticky */
|
||
$handler->display->display_options['sorts']['sticky']['id'] = 'sticky';
|
||
$handler->display->display_options['sorts']['sticky']['table'] = 'node';
|
||
$handler->display->display_options['sorts']['sticky']['field'] = 'sticky';
|
||
$handler->display->display_options['sorts']['sticky']['order'] = 'DESC';
|
||
/* Sort criterion: Content: Post date */
|
||
$handler->display->display_options['sorts']['created']['id'] = 'created';
|
||
$handler->display->display_options['sorts']['created']['table'] = 'node';
|
||
$handler->display->display_options['sorts']['created']['field'] = 'created';
|
||
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
|
||
$handler->display->display_options['sorts']['created']['exposed'] = TRUE;
|
||
$handler->display->display_options['sorts']['created']['expose']['label'] = 'most recent';
|
||
/* Contextual filter: OG membership: Group ID */
|
||
$handler->display->display_options['arguments']['gid']['id'] = 'gid';
|
||
$handler->display->display_options['arguments']['gid']['table'] = 'og_membership';
|
||
$handler->display->display_options['arguments']['gid']['field'] = 'gid';
|
||
$handler->display->display_options['arguments']['gid']['relationship'] = 'og_membership_rel';
|
||
$handler->display->display_options['arguments']['gid']['default_argument_type'] = 'fixed';
|
||
$handler->display->display_options['arguments']['gid']['summary']['number_of_records'] = '0';
|
||
$handler->display->display_options['arguments']['gid']['summary']['format'] = 'default_summary';
|
||
$handler->display->display_options['arguments']['gid']['summary_options']['items_per_page'] = '25';
|
||
$handler->display->display_options['arguments']['gid']['break_phrase'] = TRUE;
|
||
/* 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'] = 1;
|
||
$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(
|
||
'question' => 'question',
|
||
);
|
||
/* Filter criterion: OG membership: Group_type */
|
||
$handler->display->display_options['filters']['group_type']['id'] = 'group_type';
|
||
$handler->display->display_options['filters']['group_type']['table'] = 'og_membership';
|
||
$handler->display->display_options['filters']['group_type']['field'] = 'group_type';
|
||
$handler->display->display_options['filters']['group_type']['relationship'] = 'og_membership_rel';
|
||
$handler->display->display_options['filters']['group_type']['value'] = array(
|
||
'node' => 'node',
|
||
);
|
||
$translatables['commons_bw_q_a'] = array(
|
||
t('Master'),
|
||
t('more'),
|
||
t('Apply'),
|
||
t('Reset'),
|
||
t('Sort by'),
|
||
t('Asc'),
|
||
t('Desc'),
|
||
t('Items per page'),
|
||
t('- All -'),
|
||
t('Offset'),
|
||
t('« first'),
|
||
t('‹ previous'),
|
||
t('next ›'),
|
||
t('last »'),
|
||
t('No questions have been asked in this group.'),
|
||
t('OG membership from node'),
|
||
t('following'),
|
||
t('most recent'),
|
||
t('most active'),
|
||
t('All'),
|
||
t('Following'),
|
||
);
|
||
$export['commons_bw_q_a'] = $view;
|
||
|
||
$view = new view();
|
||
$view->name = 'commons_question_answers';
|
||
$view->description = '';
|
||
$view->tag = 'Commons Q&A';
|
||
$view->base_table = 'node';
|
||
$view->human_name = 'Answers to a question';
|
||
$view->core = 7;
|
||
$view->api_version = '3.0';
|
||
$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['title'] = 'Answers';
|
||
$handler->display->display_options['use_more_always'] = FALSE;
|
||
$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'] = 'full';
|
||
$handler->display->display_options['style_plugin'] = 'default';
|
||
$handler->display->display_options['row_plugin'] = 'entity';
|
||
/* No results behavior: Global: Text area */
|
||
$handler->display->display_options['empty']['area']['id'] = 'area';
|
||
$handler->display->display_options['empty']['area']['table'] = 'views';
|
||
$handler->display->display_options['empty']['area']['field'] = 'area';
|
||
$handler->display->display_options['empty']['area']['empty'] = TRUE;
|
||
$handler->display->display_options['empty']['area']['content'] = 'This Empty text is overridden in commons_q_a.module';
|
||
$handler->display->display_options['empty']['area']['format'] = 'filtered_html';
|
||
/* Field: Content: Title */
|
||
$handler->display->display_options['fields']['title']['id'] = 'title';
|
||
$handler->display->display_options['fields']['title']['table'] = 'node';
|
||
$handler->display->display_options['fields']['title']['field'] = 'title';
|
||
$handler->display->display_options['fields']['title']['label'] = '';
|
||
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
|
||
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
|
||
/* Sort criterion: Content: Post date */
|
||
$handler->display->display_options['sorts']['created']['id'] = 'created';
|
||
$handler->display->display_options['sorts']['created']['table'] = 'node';
|
||
$handler->display->display_options['sorts']['created']['field'] = 'created';
|
||
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
|
||
/* Contextual filter: Content: Related question (field_related_question) */
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['id'] = 'field_related_question_target_id';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['table'] = 'field_data_field_related_question';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['field'] = 'field_related_question_target_id';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['default_action'] = 'empty';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['default_argument_type'] = 'fixed';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['summary']['number_of_records'] = '0';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['summary']['format'] = 'default_summary';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['summary_options']['items_per_page'] = '25';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['specify_validation'] = TRUE;
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['validate']['type'] = 'node';
|
||
$handler->display->display_options['arguments']['field_related_question_target_id']['validate_options']['types'] = array(
|
||
'question' => 'question',
|
||
);
|
||
/* 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'] = 1;
|
||
$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(
|
||
'answer' => 'answer',
|
||
);
|
||
|
||
/* Display: Content pane */
|
||
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
|
||
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
|
||
$handler->display->display_options['pane_category']['name'] = 'Commons';
|
||
$handler->display->display_options['pane_category']['weight'] = '0';
|
||
$handler->display->display_options['argument_input'] = array(
|
||
'field_related_question_target_id' => array(
|
||
'type' => 'context',
|
||
'context' => 'entity:node.nid',
|
||
'context_optional' => 0,
|
||
'panel' => '0',
|
||
'fixed' => '',
|
||
'label' => 'Content: Related Question (field_related_question)',
|
||
),
|
||
);
|
||
$handler->display->display_options['inherit_panels_path'] = '1';
|
||
$translatables['commons_question_answers'] = array(
|
||
t('Master'),
|
||
t('Answers'),
|
||
t('more'),
|
||
t('Apply'),
|
||
t('Reset'),
|
||
t('Sort by'),
|
||
t('Asc'),
|
||
t('Desc'),
|
||
t('Items per page'),
|
||
t('- All -'),
|
||
t('Offset'),
|
||
t('« first'),
|
||
t('‹ previous'),
|
||
t('next ›'),
|
||
t('last »'),
|
||
t('This Empty text is overridden in commons_q_a.module'),
|
||
t('All'),
|
||
t('Content pane'),
|
||
t('Commons'),
|
||
);
|
||
$export['commons_question_answers'] = $view;
|
||
|
||
return $export;
|
||
}
|