tripal_stock.views.inc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <?php
  2. /**
  3. * @file
  4. * This file contains the basic functions for views integration of
  5. * chado/tripal stock tables. Supplementary functions can be found in
  6. * ./views/
  7. *
  8. * Documentation on views integration can be found at
  9. * http://views2.logrus.com/doc/html/index.html.
  10. */
  11. /**
  12. * @defgroup tripal_stock_views Stock Views Integration
  13. * @ingroup views
  14. * @ingroup tripal_stock
  15. */
  16. /**
  17. * Implements hook_views_data(): Describe chado/tripal tables & fields to views
  18. *
  19. * @return array
  20. * A data array which follows the structure outlined in the
  21. * views2 documentation for this hook. Essentially, it's an array of table
  22. * definitions keyed by chado/tripal table name. Each table definition
  23. * includes basic details about the table, fields in that table and
  24. * relationships between that table and others (joins)
  25. *
  26. * @ingroup tripal_stock_views
  27. */
  28. function tripal_stock_views_data() {
  29. $data = array();
  30. if (module_exists('tripal_views')) {
  31. $tablename = 'stock';
  32. if (!tripal_views_is_integrated($tablename, 9)) {
  33. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
  34. // Add in node relationships if chado is in the same db as drupal
  35. if (tripal_core_chado_schema_exists()) {
  36. $integrations = tripal_views_add_node_relationship_to_chado_table_integration($table_integration_array);
  37. foreach ($integrations as $integration) {
  38. tripal_views_integration_add_entry($integration);
  39. }
  40. }
  41. else {
  42. tripal_views_integration_add_entry($table_integration_array);
  43. }
  44. }
  45. $tablename = 'stockcollection';
  46. if (!tripal_views_is_integrated($tablename, 9)) {
  47. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, TRUE);
  48. tripal_views_integration_add_entry($table_integration_array);
  49. }
  50. $tables = array(
  51. 'stock_cvterm',
  52. 'stock_dbxref',
  53. 'stock_genotype',
  54. 'stock_pub',
  55. 'stock_relationship',
  56. 'stock_relationship_pub',
  57. 'stockcollection_stock',
  58. 'stockcollectionprop',
  59. 'stockprop',
  60. 'stockprop_pub'
  61. );
  62. foreach ($tables as $tablename) {
  63. if (!tripal_views_is_integrated($tablename, 9)) {
  64. $table_integration_array = tripal_views_get_integration_array_for_chado_table($tablename, FALSE);
  65. tripal_views_integration_add_entry($table_integration_array);
  66. }
  67. }
  68. }
  69. return $data;
  70. }
  71. /**
  72. * Implements hook_views_handlers()
  73. *
  74. * Purpose: Register all custom handlers with views
  75. * where a handler describes either "the type of field",
  76. * "how a field should be filtered", "how a field should be sorted"
  77. *
  78. * @return array
  79. * An array of handler definitions
  80. *
  81. * @ingroup tripal_stock_views
  82. */
  83. function tripal_stock_views_handlers() {
  84. return array(
  85. 'info' => array(
  86. 'path' => drupal_get_path('module', 'tripal_stock') . '/views/handlers',
  87. ),
  88. 'handlers' => array(
  89. 'views_handler_field_computed_stock_nid' => array(
  90. 'parent' => 'views_handler_field_numeric',
  91. ),
  92. 'views_handler_field_stockprop_by_type' => array(
  93. 'parent' => 'views_handler_field_prerender_list',
  94. ),
  95. 'views_handler_field_stockprop_all' => array(
  96. 'parent' => 'views_handler_field_prerender_list',
  97. ),
  98. 'views_handler_field_stockrel_by_type' => array(
  99. 'parent' => 'views_handler_field_prerender_list',
  100. ),
  101. 'views_handler_field_stockrel_all' => array(
  102. 'parent' => 'views_handler_field_prerender_list',
  103. ),
  104. 'views_handler_field_stock_dbxref_by_type' => array(
  105. 'parent' => 'views_handler_field_prerender_list',
  106. ),
  107. 'views_handler_field_stock_dbxref_all' => array(
  108. 'parent' => 'views_handler_field_prerender_list',
  109. ),
  110. 'views_handler_filter_stockprop_id' => array(
  111. 'parent' => 'views_handler_filter',
  112. ),
  113. 'views_handler_filter_stock_dbxref_id' => array(
  114. 'parent' => 'views_handler_filter',
  115. ),
  116. 'views_handler_filter_stock_relationship_id' => array(
  117. 'parent' => 'views_handler_filter',
  118. ),
  119. 'views_handler_argument_stockprop_id' => array(
  120. 'parent' => 'views_handler_argument_string',
  121. ),
  122. ),
  123. );
  124. }
  125. /**
  126. * Implementation of hook_views_data_alter().
  127. */
  128. function tripal_stock_views_data_alter(&$data) {
  129. if ( !(is_array($db_url) and array_key_exists('chado', $db_url)) ) {
  130. // Add featuer relationship to node
  131. $data['node']['stock_chado_nid'] = array(
  132. 'group' => 'Stock',
  133. 'title' => 'Stock Node',
  134. 'help' => 'Links Chado Stock Fields/Data to the Nodes in the current View.',
  135. 'real field' => 'nid',
  136. 'relationship' => array(
  137. 'handler' => 'views_handler_relationship',
  138. 'title' => t('Node => Chado'),
  139. 'label' => t('Node => Chado'),
  140. 'real field' => 'nid',
  141. 'base' => 'chado_stock',
  142. 'base field' => 'nid'
  143. ),
  144. );
  145. }
  146. }
  147. /**
  148. * Implements hook_views_pre_render
  149. *
  150. * Purpose: Intercepts the view after the query has been executed
  151. * All the results are stored in $view->result
  152. * Looking up the NID here ensures the query is only executed once
  153. * for all stocks in the table.
  154. *
  155. * @todo add if !<chado/drupal same db> around NID portion
  156. *
  157. * @ingroup tripal_stock_views
  158. */
  159. function tripal_stock_views_pre_render (&$view) {
  160. if (preg_match('/stock/', $view->base_table)) {
  161. //-----Node IDs---------------------------------------------
  162. // @see tripal_core.views.inc, tripal_core_add_node_ids_to_view()
  163. // retrieve the stock_id for each record in the views current page
  164. $stock_ids = array();
  165. foreach ($view->result as $row_num => $row) {
  166. $stock_ids[$row_num] = $row->stock_id;
  167. }
  168. if (sizeof($stock_ids)) {
  169. //-----Properties------------------------------------------
  170. $field_names = array_keys($view->field);
  171. //if any property fields are in the current view
  172. $property_field_names = preg_grep('/properties/', $field_names);
  173. if (!empty($property_field_names)) {
  174. $sql = "SELECT stockprop.*, cvterm.name as type_name FROM {stockprop} "
  175. ."INNER JOIN cvterm cvterm ON stockprop.type_id=cvterm.cvterm_id "
  176. ."WHERE stockprop.stock_id IN (" . implode(',', $stock_ids) . ")";
  177. $previous_db = tripal_db_set_active('chado');
  178. $resource = db_query($sql);
  179. tripal_db_set_active($previous_db);
  180. $view->result[$key]->properties = array();
  181. while ($r = db_fetch_object($resource)) {
  182. $key = array_search($r->stock_id, $stock_ids);
  183. $view->result[$key]->properties[] = $r;
  184. }
  185. }
  186. //-----Relationships----------------------------------------
  187. //if any relationship fields are in the current view
  188. $relationship_field_names = preg_grep('/relationships/', $field_names);
  189. if (!empty($relationship_field_names)) {
  190. $sql = "SELECT stock_relationship.*, cvterm.name as type_name, "
  191. ."subject_stock.name as subject_name, object_stock.name as object_name "
  192. ."FROM stock_relationship "
  193. ."LEFT JOIN stock subject_stock ON stock_relationship.subject_id=subject_stock.stock_id "
  194. ."LEFT JOIN stock object_stock ON stock_relationship.object_id=object_stock.stock_id "
  195. ."LEFT JOIN cvterm cvterm ON stock_relationship.type_id = cvterm.cvterm_id "
  196. ."WHERE stock_relationship.subject_id IN (" . implode(',', $stock_ids) . ") "
  197. ."OR stock_relationship.object_id IN (" . implode(',', $stock_ids) . ") ";
  198. $previous_db = tripal_db_set_active('chado');
  199. $resource = db_query($sql);
  200. tripal_db_set_active($previous_db);
  201. while ($r = db_fetch_object($resource)) {
  202. if (in_array($r->subject_id, $stock_ids)) {
  203. $key = array_search($r->subject_id, $stock_ids);
  204. $r->stock_id = $r->subject_id;
  205. $view->result[$key]->relationships[] = clone $r;
  206. }
  207. if (in_array($r->object_id, $stock_ids)) {
  208. $key = array_search($r->object_id, $stock_ids);
  209. $r->stock_id = $r->object_id;
  210. $view->result[$key]->relationships[] = clone $r;
  211. }
  212. }
  213. }
  214. //-----DB References--------------------------------------------
  215. //if any dbxref fields are in the current view
  216. $dbxref_field_names = preg_grep('/dbxref/', $field_names);
  217. if (!empty($dbxref_field_names)) {
  218. $sql = "SELECT stock_dbxref.*, dbxref.db_id, db.name as db_name, db.urlprefix, "
  219. ."dbxref.accession, dbxref.version, dbxref.description "
  220. ."FROM stock_dbxref "
  221. ."LEFT JOIN dbxref dbxref ON stock_dbxref.dbxref_id=dbxref.dbxref_id "
  222. ."LEFT JOIN db db ON dbxref.db_id=db.db_id "
  223. ."WHERE stock_dbxref.stock_id IN (" . implode(',', $stock_ids) . ")";
  224. $previous_db = tripal_db_set_active('chado');
  225. $resource = db_query($sql);
  226. tripal_db_set_active($previous_db);
  227. $view->result[$key]->dbxref = array();
  228. while ($r = db_fetch_object($resource)) {
  229. $key = array_search($r->stock_id, $stock_ids);
  230. $view->result[$key]->dbxref[] = $r;
  231. }
  232. }
  233. } //if there are stocks
  234. } //if we're dealing with a stock view
  235. }
  236. /**
  237. *
  238. * @ingroup tripal_stock_views
  239. */
  240. function tripal_stock_views_default_views() {
  241. $views = array();
  242. if (!module_exists('tripal_views')) {
  243. return $views;
  244. }
  245. // Main default view
  246. $view = new view;
  247. $view->name = 'stock_listing';
  248. $view->description = 'This view lists all stocks by default.';
  249. $view->tag = 'chado default';
  250. $view->base_table = 'stock';
  251. $view->core = 0;
  252. $view->api_version = '2';
  253. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  254. $handler = $view->new_display('default', 'Defaults', 'default');
  255. $handler->override_option('fields', array(
  256. 'uniquename' => array(
  257. 'label' => 'Unique Name',
  258. 'alter' => array(
  259. 'alter_text' => 0,
  260. 'text' => '',
  261. 'make_link' => 0,
  262. 'path' => '',
  263. 'link_class' => '',
  264. 'alt' => '',
  265. 'prefix' => '',
  266. 'suffix' => '',
  267. 'target' => '',
  268. 'help' => '',
  269. 'trim' => 0,
  270. 'max_length' => '',
  271. 'word_boundary' => 1,
  272. 'ellipsis' => 1,
  273. 'html' => 0,
  274. 'strip_tags' => 0,
  275. ),
  276. 'empty' => '',
  277. 'hide_empty' => 0,
  278. 'empty_zero' => 0,
  279. 'link_to_node' => 1,
  280. 'exclude' => 0,
  281. 'id' => 'uniquename',
  282. 'table' => 'stock',
  283. 'field' => 'uniquename',
  284. 'relationship' => 'none',
  285. ),
  286. 'name_2' => array(
  287. 'label' => 'Name',
  288. 'alter' => array(
  289. 'alter_text' => 0,
  290. 'text' => '',
  291. 'make_link' => 0,
  292. 'path' => '',
  293. 'link_class' => '',
  294. 'alt' => '',
  295. 'prefix' => '',
  296. 'suffix' => '',
  297. 'target' => '',
  298. 'help' => '',
  299. 'trim' => 0,
  300. 'max_length' => '',
  301. 'word_boundary' => 1,
  302. 'ellipsis' => 1,
  303. 'html' => 0,
  304. 'strip_tags' => 0,
  305. ),
  306. 'empty' => '',
  307. 'hide_empty' => 0,
  308. 'empty_zero' => 0,
  309. 'link_to_node' => 1,
  310. 'exclude' => 0,
  311. 'id' => 'name_2',
  312. 'table' => 'stock',
  313. 'field' => 'name',
  314. 'relationship' => 'none',
  315. ),
  316. 'name' => array(
  317. 'label' => 'Type',
  318. 'alter' => array(
  319. 'alter_text' => 0,
  320. 'text' => '',
  321. 'make_link' => 0,
  322. 'path' => '',
  323. 'link_class' => '',
  324. 'alt' => '',
  325. 'prefix' => '',
  326. 'suffix' => '',
  327. 'target' => '',
  328. 'help' => '',
  329. 'trim' => 0,
  330. 'max_length' => '',
  331. 'word_boundary' => 1,
  332. 'ellipsis' => 1,
  333. 'html' => 0,
  334. 'strip_tags' => 0,
  335. ),
  336. 'empty' => '',
  337. 'hide_empty' => 0,
  338. 'empty_zero' => 0,
  339. 'exclude' => 0,
  340. 'id' => 'name',
  341. 'table' => 'cvterm',
  342. 'field' => 'name',
  343. 'relationship' => 'none',
  344. ),
  345. 'common_name' => array(
  346. 'label' => 'Organism',
  347. 'alter' => array(
  348. 'alter_text' => 0,
  349. 'text' => '',
  350. 'make_link' => 0,
  351. 'path' => '',
  352. 'link_class' => '',
  353. 'alt' => '',
  354. 'prefix' => '',
  355. 'suffix' => '',
  356. 'target' => '',
  357. 'help' => '',
  358. 'trim' => 0,
  359. 'max_length' => '',
  360. 'word_boundary' => 1,
  361. 'ellipsis' => 1,
  362. 'html' => 0,
  363. 'strip_tags' => 0,
  364. ),
  365. 'empty' => '',
  366. 'hide_empty' => 0,
  367. 'empty_zero' => 0,
  368. 'link_to_node' => 1,
  369. 'exclude' => 0,
  370. 'id' => 'common_name',
  371. 'table' => 'organism',
  372. 'field' => 'common_name',
  373. 'relationship' => 'none',
  374. ),
  375. ));
  376. $handler->override_option('sorts', array(
  377. 'common_name' => array(
  378. 'order' => 'ASC',
  379. 'id' => 'common_name',
  380. 'table' => 'organism',
  381. 'field' => 'common_name',
  382. 'relationship' => 'none',
  383. ),
  384. 'uniquename' => array(
  385. 'order' => 'ASC',
  386. 'id' => 'uniquename',
  387. 'table' => 'stock',
  388. 'field' => 'uniquename',
  389. 'relationship' => 'none',
  390. ),
  391. ));
  392. $handler->override_option('filters', array(
  393. 'common_name' => array(
  394. 'operator' => '=',
  395. 'value' => array(),
  396. 'group' => '0',
  397. 'exposed' => TRUE,
  398. 'expose' => array(
  399. 'use_operator' => 0,
  400. 'operator' => 'common_name_op',
  401. 'identifier' => 'organism_common_name',
  402. 'label' => 'Organism',
  403. 'remember' => 0,
  404. ),
  405. 'case' => 1,
  406. 'id' => 'common_name',
  407. 'table' => 'organism',
  408. 'field' => 'common_name',
  409. 'relationship' => 'none',
  410. 'values_form_type' => 'select',
  411. 'multiple' => 1,
  412. 'optional' => 0,
  413. 'agg' => array(
  414. 'records_with' => 1,
  415. 'aggregates_with' => 1,
  416. ),
  417. ),
  418. 'search_results' => array(
  419. 'operator' => '=',
  420. 'value' => '',
  421. 'group' => '0',
  422. 'exposed' => FALSE,
  423. 'expose' => array(
  424. 'operator' => FALSE,
  425. 'label' => '',
  426. ),
  427. 'id' => 'search_results',
  428. 'table' => 'views',
  429. 'field' => 'search_results',
  430. 'relationship' => 'none',
  431. 'apply_button' => 'Show',
  432. 'no_results_text' => 'Click "Show" to see a list of all stocks matching the entered criteria. If you leave a any of the criteria blank then the stocks will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all stocks will be listed.',
  433. ),
  434. 'type_id' => array(
  435. 'operator' => '=',
  436. 'value' => '',
  437. 'group' => '0',
  438. 'exposed' => TRUE,
  439. 'expose' => array(
  440. 'use_operator' => 0,
  441. 'operator' => 'type_id_op',
  442. 'identifier' => 'type_id',
  443. 'label' => 'Type',
  444. 'remember' => 0,
  445. ),
  446. 'case' => 1,
  447. 'id' => 'type_id',
  448. 'table' => 'stock',
  449. 'field' => 'type_id',
  450. 'relationship' => 'none',
  451. 'values_form_type' => 'select',
  452. 'multiple' => 1,
  453. 'optional' => 0,
  454. 'show_all' => 0,
  455. 'agg' => array(
  456. 'records_with' => 1,
  457. 'aggregates_with' => 1,
  458. ),
  459. ),
  460. 'name' => array(
  461. 'operator' => 'contains',
  462. 'value' => '',
  463. 'group' => '0',
  464. 'exposed' => TRUE,
  465. 'expose' => array(
  466. 'use_operator' => 0,
  467. 'operator' => 'name_op',
  468. 'identifier' => 'name',
  469. 'label' => 'Name Contains',
  470. 'remember' => 0,
  471. ),
  472. 'case' => 0,
  473. 'id' => 'name',
  474. 'table' => 'stock',
  475. 'field' => 'name',
  476. 'relationship' => 'none',
  477. 'agg' => array(
  478. 'records_with' => 1,
  479. 'aggregates_with' => 1,
  480. ),
  481. ),
  482. ));
  483. $handler->override_option('access', array(
  484. 'type' => 'perm',
  485. 'perm' => 'access chado_stock content',
  486. ));
  487. $handler->override_option('cache', array(
  488. 'type' => 'none',
  489. ));
  490. $handler->override_option('title', 'Stocks');
  491. $handler->override_option('header', 'Click "Show" to see a list of all stocks matching the entered criteria. If you leave a any of the criteria blank then the stocks will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all stocks will be listed.');
  492. $handler->override_option('header_format', '2');
  493. $handler->override_option('header_empty', 0);
  494. $handler->override_option('empty', 'No stocks match the supplied criteria.');
  495. $handler->override_option('empty_format', '1');
  496. $handler->override_option('items_per_page', 50);
  497. $handler->override_option('use_pager', '1');
  498. $handler->override_option('style_plugin', 'table');
  499. $handler->override_option('style_options', array(
  500. 'grouping' => '',
  501. 'override' => 1,
  502. 'sticky' => 0,
  503. 'order' => 'asc',
  504. 'columns' => array(
  505. 'uniquename' => 'uniquename',
  506. 'name_2' => 'name_2',
  507. 'name' => 'name',
  508. 'common_name' => 'common_name',
  509. 'all_dbxref' => 'all_dbxref',
  510. 'all_properties' => 'all_properties',
  511. 'all_relationships' => 'all_relationships',
  512. ),
  513. 'info' => array(
  514. 'uniquename' => array(
  515. 'sortable' => 1,
  516. 'separator' => '',
  517. ),
  518. 'name_2' => array(
  519. 'sortable' => 1,
  520. 'separator' => '',
  521. ),
  522. 'name' => array(
  523. 'sortable' => 1,
  524. 'separator' => '',
  525. ),
  526. 'common_name' => array(
  527. 'sortable' => 1,
  528. 'separator' => '',
  529. ),
  530. 'all_dbxref' => array(
  531. 'separator' => '',
  532. ),
  533. 'all_properties' => array(
  534. 'separator' => '',
  535. ),
  536. 'all_relationships' => array(
  537. 'separator' => '',
  538. ),
  539. ),
  540. 'default' => '-1',
  541. ));
  542. $default_handler = $handler;
  543. $handler = $view->new_display('page', 'Page', 'page_1');
  544. $handler->override_option('path', 'chado/stocks');
  545. $handler->override_option('menu', array(
  546. 'type' => 'normal',
  547. 'title' => 'Stocks',
  548. 'description' => 'A stock is the physical entities, either living or preserved, held by collections and can be globally identified by the combination of organism, uniquename and stock type.',
  549. 'weight' => '10',
  550. 'name' => 'navigation',
  551. ));
  552. $handler->override_option('tab_options', array(
  553. 'type' => 'none',
  554. 'title' => '',
  555. 'description' => '',
  556. 'weight' => 0,
  557. 'name' => 'navigation',
  558. ));
  559. // Add code specific to a local chado installation
  560. // NOTE: Edit $handler above to $default_handler for the default display
  561. if (tripal_core_chado_schema_exists()) {
  562. // Add nid field
  563. $fields = $view->get_items('field', 'default');
  564. $new_fields = array(
  565. 'nid' => array(
  566. 'label' => 'Nid',
  567. 'alter' => array(
  568. 'alter_text' => 0,
  569. 'text' => '',
  570. 'make_link' => 0,
  571. 'path' => '',
  572. 'absolute' => 0,
  573. 'link_class' => '',
  574. 'alt' => '',
  575. 'rel' => '',
  576. 'prefix' => '',
  577. 'suffix' => '',
  578. 'target' => '',
  579. 'help' => '',
  580. 'trim' => 0,
  581. 'max_length' => '',
  582. 'word_boundary' => 1,
  583. 'ellipsis' => 1,
  584. 'html' => 0,
  585. 'strip_tags' => 0,
  586. ),
  587. 'empty' => '',
  588. 'hide_empty' => 0,
  589. 'empty_zero' => 0,
  590. 'hide_alter_empty' => 1,
  591. 'link_to_node' => 0,
  592. 'exclude' => 1,
  593. 'id' => 'nid',
  594. 'table' => 'node',
  595. 'field' => 'nid',
  596. 'relationship' => 'none',
  597. )
  598. );
  599. $fields = $new_fields + $fields;
  600. // Change analysis.name to have a link to the node
  601. $fields['name_2']['alter']['make_link'] = 1;
  602. $fields['name_2']['alter']['path'] = 'node/[nid]';
  603. $default_handler->override_option('fields', $fields);
  604. // Adds stock => Node relationship
  605. $default_handler->override_option('relationships', array(
  606. 'nid' => array(
  607. 'label' => 'Stock to Node',
  608. 'required' => 0,
  609. 'id' => 'nid',
  610. 'table' => 'chado_stock',
  611. 'field' => 'nid',
  612. 'relationship' => 'none',
  613. ),
  614. ));
  615. // Only show records with published nodes
  616. $filters = $view->get_items('filter', 'default');
  617. $filters['status'] = array(
  618. 'operator' => '=',
  619. 'value' => '1',
  620. 'group' => '0',
  621. 'exposed' => FALSE,
  622. 'expose' => array(
  623. 'operator' => FALSE,
  624. 'label' => '',
  625. ),
  626. 'id' => 'status',
  627. 'table' => 'node',
  628. 'field' => 'status',
  629. 'relationship' => 'none',
  630. );
  631. $default_handler->override_option('filters', $filters);
  632. }
  633. $views[$view->name] = $view;
  634. return $views;
  635. }