function commons_answers_views_default_views in Drupal Commons 6.2
Implementation of hook_views_default_views().
File
- modules/
features/ commons_answers/ commons_answers.views_default.inc, line 6
Code
function commons_answers_views_default_views() {
$views = array();
// Exported view: group_tab_questions
$view = new view();
$view->name = 'group_tab_questions';
$view->description = 'Show a tab for group questions';
$view->tag = '';
$view->base_table = 'node';
$view->core = 6;
$view->api_version = '2';
$view->disabled = FALSE;
/* Edit this to true to make a default view disabled initially */
$handler = $view
->new_display('default', 'Defaults', 'default');
$handler
->override_option('relationships', array(
'group_nid' => array(
'label' => 'Group node (post)',
'required' => 0,
'id' => 'group_nid',
'table' => 'og_ancestry',
'field' => 'group_nid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler
->override_option('fields', array(
'title' => array(
'label' => 'Question',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'created' => array(
'label' => 'Post date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 1,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 1,
'date_format' => 'small',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'field_answer_count_value' => array(
'label' => 'Answers',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'absolute' => 0,
'link_class' => '',
'alt' => '',
'rel' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '0',
'hide_empty' => 0,
'empty_zero' => 0,
'hide_alter_empty' => 0,
'link_to_node' => 0,
'label_type' => 'custom',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_answer_count_value',
'table' => 'node_data_field_answer_count',
'field' => 'field_answer_count_value',
'relationship' => 'none',
),
));
$handler
->override_option('sorts', array(
'created_1' => array(
'id' => 'created_1',
'table' => 'node',
'field' => 'created',
),
));
$handler
->override_option('arguments', array(
'group_nid' => array(
'default_action' => 'not found',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '%1 - Q & A',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'og_group_types',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'group_nid',
'table' => 'og_ancestry',
'field' => 'group_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
2 => 0,
3 => 0,
4 => 0,
5 => 0,
),
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'poll' => 0,
'discussion' => 0,
'document' => 0,
'event' => 0,
'wiki' => 0,
'group' => 0,
'notice' => 0,
'page' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
2 => 0,
3 => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_node_flag_name' => '*relationship*',
'validate_argument_node_flag_test' => 'flaggable',
'validate_argument_node_flag_id_type' => 'id',
'validate_argument_user_flag_name' => '*relationship*',
'validate_argument_user_flag_test' => 'flaggable',
'validate_argument_user_flag_id_type' => 'id',
'validate_argument_is_member' => 'OG_VIEWS_DO_NOT_VALIDATE_MEMBERSHIP',
'validate_argument_group_node_type' => array(
'group' => 0,
),
'validate_argument_php' => '',
),
));
$handler
->override_option('filters', array(
'picg' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'picg',
'table' => 'og_ancestry',
'field' => 'picg',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'question' => 'question',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler
->override_option('access', array(
'type' => 'perm',
'perm' => 'access content',
));
$handler
->override_option('cache', array(
'type' => 'none',
));
$handler
->override_option('title', 'Group Q & A');
$handler
->override_option('header_format', '1');
$handler
->override_option('header_empty', 0);
$handler
->override_option('empty', 'No questions have been added to this group yet.');
$handler
->override_option('empty_format', '1');
$handler
->override_option('use_pager', '1');
$handler
->override_option('distinct', 1);
$handler
->override_option('style_plugin', 'table');
$handler
->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'summary' => '',
'columns' => array(
'title' => 'title',
'created' => 'created',
'field_answer_count_value' => 'field_answer_count_value',
),
'info' => array(
'title' => array(
'sortable' => 0,
'separator' => '',
),
'created' => array(
'sortable' => 0,
'separator' => '',
),
'field_answer_count_value' => array(
'sortable' => 0,
'separator' => '',
),
),
'default' => '-1',
));
$handler
->override_option('row_options', array(
'inline' => array(
'picture' => 'picture',
'created' => 'created',
'name' => 'name',
'timestamp' => 'timestamp',
),
'separator' => '',
'hide_empty' => 0,
));
$handler = $view
->new_display('page', 'Page', 'page_1');
$handler
->override_option('path', 'node/%/questions');
$handler
->override_option('menu', array(
'type' => 'tab',
'title' => 'Q & A',
'description' => 'View the group questions',
'weight' => '4',
'name' => 'navigation',
));
$handler
->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
'name' => 'navigation',
));
$views[$view->name] = $view;
return $views;
}