00001 <?php
00074 function hook_views_data() {
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 $data['example_table']['table']['group'] = t('Example table');
00091
00092
00093
00094
00095 $data['example_table']['table']['base'] = array(
00096 'field' => 'nid',
00097 'title' => t('Example table'),
00098 'help' => t("Example table contains example content and can be related to nodes."),
00099 'weight' => -10,
00100 );
00101
00102
00103
00104
00105 $data['example_table']['table']['join'] = array(
00106
00107
00108
00109 'node' => array(
00110 'left_field' => 'nid',
00111 'field' => 'nid',
00112 ),
00113 );
00114
00115
00116
00117
00118
00119
00120
00121 $data['example_table']['nid'] = array(
00122 'title' => t('Example content'),
00123 'help' => t('Some example content that references a node.'),
00124
00125
00126
00127 'relationship' => array(
00128 'base' => 'node',
00129 'field' => 'nid',
00130 'handler' => 'views_handler_relationship',
00131 'label' => t('Example node'),
00132 ),
00133 );
00134
00135
00136 $data['example_table']['plain_text_field'] = array(
00137 'title' => t('Plain text field'),
00138 'help' => t('Just a plain text field.'),
00139 'field' => array(
00140 'handler' => 'views_handler_field',
00141 'click sortable' => TRUE,
00142 ),
00143 'sort' => array(
00144 'handler' => 'views_handler_sort',
00145 ),
00146 'filter' => array(
00147 'handler' => 'views_handler_filter_string',
00148 ),
00149 'argument' => array(
00150 'handler' => 'views_handler_argument_string',
00151 ),
00152 );
00153
00154
00155 $data['example_table']['numeric_field'] = array(
00156 'title' => t('Numeric field'),
00157 'help' => t('Just a numeric field.'),
00158 'field' => array(
00159 'handler' => 'views_handler_field_numeric',
00160 'click sortable' => TRUE,
00161 ),
00162 'filter' => array(
00163 'handler' => 'views_handler_filter_numeric',
00164 ),
00165 'sort' => array(
00166 'handler' => 'views_handler_sort',
00167 ),
00168 );
00169
00170
00171 $data['example_table']['boolean_field'] = array(
00172 'title' => t('Boolean field'),
00173 'help' => t('Just an on/off field.'),
00174 'field' => array(
00175 'handler' => 'views_handler_field_boolean',
00176 'click sortable' => TRUE,
00177 ),
00178 'filter' => array(
00179 'handler' => 'views_handler_filter_boolean_operator',
00180 'label' => t('Published'),
00181 'type' => 'yes-no',
00182
00183 'use equal' => TRUE,
00184 ),
00185 'sort' => array(
00186 'handler' => 'views_handler_sort',
00187 ),
00188 );
00189
00190
00191 $data['example_table']['timestamp_field'] = array(
00192 'title' => t('Timestamp field'),
00193 'help' => t('Just a timestamp field.'),
00194 'field' => array(
00195 'handler' => 'views_handler_field_date',
00196 'click sortable' => TRUE,
00197 ),
00198 'sort' => array(
00199 'handler' => 'views_handler_sort_date',
00200 ),
00201 'filter' => array(
00202 'handler' => 'views_handler_filter_date',
00203 ),
00204 );
00205
00206 return $data;
00207 }
00208
00222 function hook_views_data_alter(&$data) {
00223
00224 $data['node']['nid']['title'] = t('Node-Nid');
00225
00226
00227 $data['users']['example_field'] = array(
00228 'title' => t('Example field'),
00229 'help' => t('Some examüple content that references a user'),
00230 'handler' => 'hook_handlers_field_example_field',
00231 );
00232
00233
00234
00235
00236 $data['node']['title']['handler'] = 'modulename_handlers_field_node_title';
00237 }
00238
00239
00252 function hook_views_plugins() {
00253
00254 }
00255
00259 function hook_views_plugins_alter(&$plugins) {
00260
00261 $plugins['row']['node']['base'][] = 'apachesolr';
00262 }
00263
00278 function hook_views_api() {
00279 return array(
00280 'api' => 3,
00281 'path' => drupal_get_path('module', 'example') . '/includes/views',
00282 'template path' => drupal_get_path('module', 'example') . 'themes',
00283 );
00284 }
00285
00304 function hook_views_default_views() {
00305
00306 $view = new view;
00307 $view->name = 'frontpage';
00308 $view->description = t('Emulates the default Drupal front page; you may set the default home page path to this view to make it your front page.');
00309 $view->tag = t('default');
00310 $view->base_table = 'node';
00311 $view->api_version = 2;
00312 $view->disabled = FALSE;
00313 $view->display = array();
00314 $display = new views_display;
00315 $display->id = 'default';
00316 $display->display_title = t('Master');
00317 $display->display_plugin = 'default';
00318 $display->position = '1';
00319 $display->display_options = array (
00320 'style_plugin' => 'default',
00321 'style_options' =>
00322 array (
00323 ),
00324 'row_plugin' => 'node',
00325 'row_options' =>
00326 array (
00327 'teaser' => 1,
00328 'links' => 1,
00329 ),
00330 'relationships' =>
00331 array (
00332 ),
00333 'fields' =>
00334 array (
00335 ),
00336 'sorts' =>
00337 array (
00338 'sticky' =>
00339 array (
00340 'id' => 'sticky',
00341 'table' => 'node',
00342 'field' => 'sticky',
00343 'order' => 'ASC',
00344 ),
00345 'created' =>
00346 array (
00347 'id' => 'created',
00348 'table' => 'node',
00349 'field' => 'created',
00350 'order' => 'ASC',
00351 'relationship' => 'none',
00352 'granularity' => 'second',
00353 ),
00354 ),
00355 'arguments' =>
00356 array (
00357 ),
00358 'filters' =>
00359 array (
00360 'promote' =>
00361 array (
00362 'id' => 'promote',
00363 'table' => 'node',
00364 'field' => 'promote',
00365 'operator' => '=',
00366 'value' => '1',
00367 'group' => 0,
00368 'exposed' => false,
00369 'expose' =>
00370 array (
00371 'operator' => false,
00372 'label' => '',
00373 ),
00374 ),
00375 'status' =>
00376 array (
00377 'id' => 'status',
00378 'table' => 'node',
00379 'field' => 'status',
00380 'operator' => '=',
00381 'value' => '1',
00382 'group' => 0,
00383 'exposed' => false,
00384 'expose' =>
00385 array (
00386 'operator' => false,
00387 'label' => '',
00388 ),
00389 ),
00390 ),
00391 'items_per_page' => 10,
00392 'use_pager' => '1',
00393 'pager_element' => 0,
00394 'title' => '',
00395 'header' => '',
00396 'header_format' => '1',
00397 'footer' => '',
00398 'footer_format' => '1',
00399 'empty' => '',
00400 'empty_format' => '1',
00401 );
00402 $view->display['default'] = $display;
00403 $display = new views_display;
00404 $display->id = 'page';
00405 $display->display_title = t('Page');
00406 $display->display_plugin = 'page';
00407 $display->position = '2';
00408 $display->display_options = array (
00409 'defaults' =>
00410 array (
00411 'access' => true,
00412 'title' => true,
00413 'header' => true,
00414 'header_format' => true,
00415 'header_empty' => true,
00416 'footer' => true,
00417 'footer_format' => true,
00418 'footer_empty' => true,
00419 'empty' => true,
00420 'empty_format' => true,
00421 'items_per_page' => true,
00422 'offset' => true,
00423 'use_pager' => true,
00424 'pager_element' => true,
00425 'link_display' => true,
00426 'php_arg_code' => true,
00427 'exposed_options' => true,
00428 'style_plugin' => true,
00429 'style_options' => true,
00430 'row_plugin' => true,
00431 'row_options' => true,
00432 'relationships' => true,
00433 'fields' => true,
00434 'sorts' => true,
00435 'arguments' => true,
00436 'filters' => true,
00437 'use_ajax' => true,
00438 'distinct' => true,
00439 ),
00440 'relationships' =>
00441 array (
00442 ),
00443 'fields' =>
00444 array (
00445 ),
00446 'sorts' =>
00447 array (
00448 ),
00449 'arguments' =>
00450 array (
00451 ),
00452 'filters' =>
00453 array (
00454 ),
00455 'path' => 'frontpage',
00456 );
00457 $view->display['page'] = $display;
00458 $display = new views_display;
00459 $display->id = 'feed';
00460 $display->display_title = t('Feed');
00461 $display->display_plugin = 'feed';
00462 $display->position = '3';
00463 $display->display_options = array (
00464 'defaults' =>
00465 array (
00466 'access' => true,
00467 'title' => false,
00468 'header' => true,
00469 'header_format' => true,
00470 'header_empty' => true,
00471 'footer' => true,
00472 'footer_format' => true,
00473 'footer_empty' => true,
00474 'empty' => true,
00475 'empty_format' => true,
00476 'use_ajax' => true,
00477 'items_per_page' => true,
00478 'offset' => true,
00479 'use_pager' => true,
00480 'pager_element' => true,
00481 'use_more' => true,
00482 'distinct' => true,
00483 'link_display' => true,
00484 'php_arg_code' => true,
00485 'exposed_options' => true,
00486 'style_plugin' => false,
00487 'style_options' => false,
00488 'row_plugin' => false,
00489 'row_options' => false,
00490 'relationships' => true,
00491 'fields' => true,
00492 'sorts' => true,
00493 'arguments' => true,
00494 'filters' => true,
00495 ),
00496 'relationships' =>
00497 array (
00498 ),
00499 'fields' =>
00500 array (
00501 ),
00502 'sorts' =>
00503 array (
00504 ),
00505 'arguments' =>
00506 array (
00507 ),
00508 'filters' =>
00509 array (
00510 ),
00511 'displays' =>
00512 array (
00513 'default' => 'default',
00514 'page' => 'page',
00515 ),
00516 'style_plugin' => 'rss',
00517 'style_options' =>
00518 array (
00519 'description' => '',
00520 ),
00521 'row_plugin' => 'node_rss',
00522 'row_options' =>
00523 array (
00524 'item_length' => 'default',
00525 ),
00526 'path' => 'rss.xml',
00527 'title' => t('Front page feed'),
00528 );
00529 $view->display['feed'] = $display;
00530
00531
00532
00533 $views[$view->name] = $view;
00534
00535
00536
00537
00538 return $views;
00539 }
00540
00558 function hook_views_default_views_alter(&$views) {
00559 if (isset($views['taxonomy_term'])) {
00560 $views['taxonomy_term']->display['default']->display_options['title'] = 'Categories';
00561 }
00562 }
00563
00567 function hook_views_query_substitutions() {
00568
00569 }
00570
00575 function hook_views_form_substitutions() {
00576 return array(
00577 '<!--views-form-example-substitutions-->' => 'Example Substitution',
00578 );
00579 }
00580
00585 function hook_views_form_validate($form, &$form_state) {
00586
00587 }
00588
00593 function hook_views_form_submit($form, &$form_state) {
00594
00595 }
00596
00604 function hook_views_pre_view(&$view, &$display_id, &$args) {
00605
00606 }
00607
00615 function hook_views_pre_build(&$view) {
00616
00617 }
00618
00626 function hook_views_post_build(&$view) {
00627
00628 }
00629
00637 function hook_views_pre_execute(&$view) {
00638
00639 }
00640
00650 function hook_views_post_execute(&$view) {
00651
00652 }
00653
00665 function hook_views_pre_render(&$view) {
00666
00667 }
00668
00691 function hook_views_post_render(&$view, &$output, &$cache) {
00692
00693 }
00694
00704 function hook_views_query_alter(&$view, &$query) {
00705
00706 }
00707
00726 function hook_views_preview_info_alter(&$rows, $view) {
00727
00728 }
00729
00741 function hook_views_ui_display_top_links_alter(&$links, $view, $display_id) {
00742
00743 }
00744
00754 function hook_views_ajax_data_alter(&$commands, $view) {
00755 }
00756
00757
00758