$view = new view; $view->name = 'list_documents_in_directory'; $view->description = 'List all documents for a given directory.'; $view->tag = 'sddms'; $view->view_php = ''; $view->base_table = 'node'; $view->is_cacheable = FALSE; $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( 'field_document_directory_nid' => array( 'label' => 'Directory', 'required' => 1, 'delta' => -1, 'id' => 'field_document_directory_nid', 'table' => 'node_data_field_document_directory', 'field' => 'field_document_directory_nid', 'relationship' => 'none', ), 'field_document_file_fid' => array( 'label' => 'File', 'required' => 1, 'delta' => -1, 'id' => 'field_document_file_fid', 'table' => 'node_data_field_document_file', 'field' => 'field_document_file_fid', 'relationship' => 'none', ), 'uid' => array( 'id' => 'uid', 'table' => 'node_revisions', 'field' => 'uid', ), )); $handler->override_option('fields', array( 'title_1' => array( 'label' => 'Name', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title_1', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', ), 'filename' => array( 'label' => 'File', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_file' => 0, 'exclude' => 0, 'id' => 'filename', 'table' => 'files', 'field' => 'filename', 'relationship' => 'field_document_file_fid', ), 'filemime' => array( 'label' => 'Mime type', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_file' => 0, 'exclude' => 0, 'id' => 'filemime', 'table' => 'files', 'field' => 'filemime', 'relationship' => 'field_document_file_fid', ), 'filesize' => array( 'label' => 'Size', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'file_size_display' => 'formatted', 'exclude' => 0, 'id' => 'filesize', 'table' => 'files', 'field' => 'filesize', 'relationship' => 'field_document_file_fid', ), 'name' => array( 'label' => 'Author', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_user' => 1, 'overwrite_anonymous' => 0, 'anonymous_text' => '', 'exclude' => 0, 'id' => 'name', 'table' => 'users', 'field' => 'name', 'relationship' => 'uid', ), 'totalcount' => array( 'label' => 'Total views', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'set_precision' => FALSE, 'precision' => 0, 'decimal' => '.', 'separator' => ',', 'prefix' => '', 'suffix' => '', 'exclude' => 0, 'id' => 'totalcount', 'table' => 'node_counter', 'field' => 'totalcount', 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'title' => array( 'order' => 'ASC', 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', ), )); $handler->override_option('arguments', array( 'field_document_directory_nid' => array( 'default_action' => 'empty', 'style_plugin' => 'default_summary', 'style_options' => array(), 'wildcard' => 'all', 'wildcard_substitution' => 'All', 'title' => '', 'breadcrumb' => '', 'default_argument_type' => 'fixed', 'default_argument' => '', 'validate_type' => 'node', 'validate_fail' => 'empty', 'break_phrase' => 0, 'not' => 0, 'id' => 'field_document_directory_nid', 'table' => 'node_data_field_document_directory', 'field' => 'field_document_directory_nid', 'validate_user_argument_type' => 'uid', 'validate_user_roles' => array( '2' => 0, ), 'relationship' => 'none', 'default_options_div_prefix' => '', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'validate_argument_node_type' => array( 'book' => 'book', 'document' => 0, 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 1, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array(), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'validate_argument_php' => '', ), )); $handler->override_option('filters', array( 'type' => array( 'operator' => 'in', 'value' => array( 'document' => 'document', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('footer', 'Add a document or add a directory.'); $handler->override_option('footer_format', '1'); $handler->override_option('footer_empty', 1); $handler->override_option('empty', 'This directory contains no documents.'); $handler->override_option('empty_format', '1'); $handler->override_option('items_per_page', 0); $handler->override_option('distinct', 1); $handler->override_option('style_plugin', 'table'); $handler->override_option('style_options', NULL);