tripal_pub.views_default.inc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. /**
  3. * @file
  4. * Describe publication default views
  5. */
  6. /**
  7. * Implements hook_views_default_views().
  8. *
  9. * @ingroup tripal_legacy_pub
  10. */
  11. function tripal_pub_views_default_views() {
  12. $views = array();
  13. // Main default view
  14. $view = tripal_pub_defaultview_admin_publications();
  15. $view = tripal_make_view_compatible_with_external($view);
  16. $views[$view->name] = $view;
  17. return $views;
  18. }
  19. /**
  20. * Default publication administration view
  21. *
  22. * @ingroup tripal_legacy_pub
  23. */
  24. function tripal_pub_defaultview_admin_publications() {
  25. $view = new view();
  26. $view->name = 'tripal_pub_admin_publications';
  27. $view->description = 'DO NOT DISABLE';
  28. $view->tag = 'tripal admin';
  29. $view->base_table = 'pub';
  30. $view->human_name = 'Publication Admin';
  31. $view->core = 0;
  32. $view->api_version = '3.0';
  33. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  34. /* Display: Defaults */
  35. $handler = $view->new_display('default', 'Defaults', 'default');
  36. $handler->display->display_options['title'] = 'Publications';
  37. $handler->display->display_options['use_more_always'] = FALSE;
  38. $handler->display->display_options['access']['type'] = 'perm';
  39. $handler->display->display_options['access']['perm'] = 'access chado_pub content';
  40. $handler->display->display_options['cache']['type'] = 'none';
  41. $handler->display->display_options['query']['type'] = 'views_query';
  42. $handler->display->display_options['exposed_form']['type'] = 'input_required';
  43. $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Search';
  44. $handler->display->display_options['exposed_form']['options']['text_input_required'] = 'Click search to see a listing of publications that meet the filter requirements. Use the filters to restrict this set to a more reasonable number of publications or to find a specific publication.';
  45. $handler->display->display_options['exposed_form']['options']['text_input_required_format'] = 'full_html';
  46. $handler->display->display_options['pager']['type'] = 'full';
  47. $handler->display->display_options['pager']['options']['items_per_page'] = '25';
  48. $handler->display->display_options['pager']['options']['offset'] = '0';
  49. $handler->display->display_options['pager']['options']['id'] = '0';
  50. $handler->display->display_options['pager']['options']['quantity'] = '9';
  51. $handler->display->display_options['style_plugin'] = 'table';
  52. $handler->display->display_options['style_options']['grouping'] = '';
  53. $handler->display->display_options['style_options']['columns'] = array(
  54. 'title' => 'title',
  55. 'pyear' => 'pyear',
  56. 'type' => 'type',
  57. 'all_dbxref' => 'all_dbxref',
  58. 'all_properties' => 'all_properties',
  59. 'all_relationships' => 'all_relationships',
  60. );
  61. $handler->display->display_options['style_options']['default'] = '-1';
  62. $handler->display->display_options['style_options']['info'] = array(
  63. 'title' => array(
  64. 'sortable' => 1,
  65. 'separator' => '',
  66. ),
  67. 'type' => array(
  68. 'sortable' => 1,
  69. 'separator' => '',
  70. ),
  71. 'pyear' => array(
  72. 'sortable' => 1,
  73. 'separator' => '',
  74. ),
  75. 'all_dbxref' => array(
  76. 'separator' => '',
  77. ),
  78. 'all_properties' => array(
  79. 'separator' => '',
  80. ),
  81. 'all_relationships' => array(
  82. 'separator' => '',
  83. ),
  84. );
  85. /* Header: Global: Action Links */
  86. $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
  87. $handler->display->display_options['header']['action_links_area']['table'] = 'views';
  88. $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
  89. $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
  90. $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
  91. $handler->display->display_options['header']['action_links_area']['link-1'] = array(
  92. 'label-1' => 'Add Publication',
  93. 'path-1' => 'node/add/tripal-pub',
  94. );
  95. $handler->display->display_options['header']['action_links_area']['link-2'] = array(
  96. 'label-2' => '',
  97. 'path-2' => '',
  98. );
  99. $handler->display->display_options['header']['action_links_area']['link-3'] = array(
  100. 'label-3' => '',
  101. 'path-3' => '',
  102. );
  103. $handler->display->display_options['header']['action_links_area']['link-4'] = array(
  104. 'label-4' => '',
  105. 'path-4' => '',
  106. );
  107. /* No results behavior: Global: Text area */
  108. $handler->display->display_options['empty']['text']['id'] = 'area';
  109. $handler->display->display_options['empty']['text']['table'] = 'views';
  110. $handler->display->display_options['empty']['text']['field'] = 'area';
  111. $handler->display->display_options['empty']['text']['content'] = 'No publications match the supplied criteria.';
  112. $handler->display->display_options['empty']['text']['format'] = '1';
  113. /* Relationship: Pub: Pub => Node */
  114. $handler->display->display_options['relationships']['pub_id']['id'] = 'pub_id';
  115. $handler->display->display_options['relationships']['pub_id']['table'] = 'chado_pub';
  116. $handler->display->display_options['relationships']['pub_id']['field'] = 'pub_id';
  117. /* Field: Content: Nid */
  118. $handler->display->display_options['fields']['nid']['id'] = 'nid';
  119. $handler->display->display_options['fields']['nid']['table'] = 'node';
  120. $handler->display->display_options['fields']['nid']['field'] = 'nid';
  121. $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
  122. /* Field: Node URL */
  123. $handler->display->display_options['fields']['nid_1']['id'] = 'nid_1';
  124. $handler->display->display_options['fields']['nid_1']['table'] = 'node';
  125. $handler->display->display_options['fields']['nid_1']['field'] = 'nid';
  126. $handler->display->display_options['fields']['nid_1']['relationship'] = 'feature_id';
  127. $handler->display->display_options['fields']['nid_1']['ui_name'] = 'Node URL';
  128. $handler->display->display_options['fields']['nid_1']['label'] = '';
  129. $handler->display->display_options['fields']['nid_1']['exclude'] = TRUE;
  130. $handler->display->display_options['fields']['nid_1']['alter']['alter_text'] = TRUE;
  131. $handler->display->display_options['fields']['nid_1']['alter']['text'] = 'node/[nid]';
  132. $handler->display->display_options['fields']['nid_1']['element_label_colon'] = FALSE;
  133. /* Field: Chado Pub: Title */
  134. $handler->display->display_options['fields']['title']['id'] = 'title';
  135. $handler->display->display_options['fields']['title']['table'] = 'pub';
  136. $handler->display->display_options['fields']['title']['field'] = 'title';
  137. $handler->display->display_options['fields']['title']['alter']['make_link'] = TRUE;
  138. $handler->display->display_options['fields']['title']['alter']['path'] = '[nid_1]';
  139. /* Field: Chado Pub: Pyear */
  140. $handler->display->display_options['fields']['pyear']['id'] = 'name';
  141. $handler->display->display_options['fields']['pyear']['table'] = 'pub';
  142. $handler->display->display_options['fields']['pyear']['field'] = 'pyear';
  143. $handler->display->display_options['fields']['pyear']['label'] = 'Year';
  144. /* Field: Chado Cvterm: Name */
  145. $handler->display->display_options['fields']['type']['id'] = 'type';
  146. $handler->display->display_options['fields']['type']['table'] = 'cvterm';
  147. $handler->display->display_options['fields']['type']['field'] = 'name';
  148. $handler->display->display_options['fields']['type']['label'] = 'Type';
  149. /* Sort criterion: Chado Pub: Id */
  150. $handler->display->display_options['sorts']['pub_id']['id'] = 'pub_id';
  151. $handler->display->display_options['sorts']['pub_id']['table'] = 'pub';
  152. $handler->display->display_options['sorts']['pub_id']['field'] = 'pub_id';
  153. $handler->display->display_options['sorts']['pub_id']['order'] = 'DESC';
  154. /* Filter criterion: Chado Pub: Title */
  155. $handler->display->display_options['filters']['title']['id'] = 'title';
  156. $handler->display->display_options['filters']['title']['table'] = 'pub';
  157. $handler->display->display_options['filters']['title']['field'] = 'title';
  158. $handler->display->display_options['filters']['title']['operator'] = 'contains';
  159. $handler->display->display_options['filters']['title']['group'] = '0';
  160. $handler->display->display_options['filters']['title']['exposed'] = TRUE;
  161. $handler->display->display_options['filters']['title']['expose']['operator_id'] = 'title_op';
  162. $handler->display->display_options['filters']['title']['expose']['label'] = 'Title Contains';
  163. $handler->display->display_options['filters']['title']['expose']['operator'] = 'title_op';
  164. $handler->display->display_options['filters']['title']['expose']['identifier'] = 'pub_title';
  165. $handler->display->display_options['filters']['title']['expose']['remember_roles'] = array(
  166. 2 => '2',
  167. 1 => 0,
  168. 3 => 0,
  169. );
  170. /* Filter criterion: Chado Pub: Type Id */
  171. $handler->display->display_options['filters']['type_id']['id'] = 'type_id';
  172. $handler->display->display_options['filters']['type_id']['table'] = 'pub';
  173. $handler->display->display_options['filters']['type_id']['field'] = 'type_id';
  174. $handler->display->display_options['filters']['type_id']['value'] = 'All';
  175. $handler->display->display_options['filters']['type_id']['group'] = '0';
  176. $handler->display->display_options['filters']['type_id']['exposed'] = TRUE;
  177. $handler->display->display_options['filters']['type_id']['expose']['operator_id'] = 'type_id_op';
  178. $handler->display->display_options['filters']['type_id']['expose']['label'] = 'Type';
  179. $handler->display->display_options['filters']['type_id']['expose']['operator'] = 'type_id_op';
  180. $handler->display->display_options['filters']['type_id']['expose']['identifier'] = 'type_id';
  181. $handler->display->display_options['filters']['type_id']['expose']['remember_roles'] = array(
  182. 2 => '2',
  183. 1 => 0,
  184. 3 => 0,
  185. );
  186. /** MANUALLY ADD since filter handler no exporting correctly */
  187. $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
  188. $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
  189. $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
  190. $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
  191. /* Display: Page */
  192. $handler = $view->new_display('page', 'Page', 'page_1');
  193. $handler->display->display_options['path'] = 'admin/tripal/legacy/tripal_pub/publications';
  194. $handler->display->display_options['menu']['type'] = 'default tab';
  195. $handler->display->display_options['menu']['title'] = 'Publications';
  196. $handler->display->display_options['menu']['description'] = 'A published article, book, conference proceeding, etc.';
  197. $handler->display->display_options['menu']['weight'] = '-10';
  198. $handler->display->display_options['menu']['context'] = 0;
  199. $handler->display->display_options['menu']['context_only_inline'] = 0;
  200. $handler->display->display_options['tab_options']['weight'] = '0';
  201. /** MANUALLY ADD since filter handler no exporting correctly
  202. $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
  203. $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
  204. $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
  205. $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
  206. */
  207. return $view;
  208. }