• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

modules/comment.views_default.inc

Go to the documentation of this file.
00001 <?php
00002 
00011 function comment_views_default_views() {
00012   $views = array();
00013 
00014   $view = new view;
00015   $view->name = 'comments_recent';
00016   $view->description = 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.';
00017   $view->tag = 'default';
00018   $view->base_table = 'comment';
00019   $view->human_name = 'Recent comments';
00020   $view->core = 0;
00021   $view->api_version = '3.0';
00022   $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
00023 
00024   /* Display: Master */
00025   $handler = $view->new_display('default', 'Master', 'default');
00026   $handler->display->display_options['title'] = 'Recent comments';
00027   $handler->display->display_options['use_more'] = TRUE;
00028   $handler->display->display_options['access']['type'] = 'none';
00029   $handler->display->display_options['cache']['type'] = 'none';
00030   $handler->display->display_options['query']['type'] = 'views_query';
00031   $handler->display->display_options['query']['options']['query_comment'] = FALSE;
00032   $handler->display->display_options['exposed_form']['type'] = 'basic';
00033   $handler->display->display_options['pager']['type'] = 'some';
00034   $handler->display->display_options['pager']['options']['items_per_page'] = 5;
00035   $handler->display->display_options['style_plugin'] = 'list';
00036   $handler->display->display_options['row_plugin'] = 'fields';
00037   /* Relationship: Comment: Content */
00038   $handler->display->display_options['relationships']['nid']['id'] = 'nid';
00039   $handler->display->display_options['relationships']['nid']['table'] = 'comment';
00040   $handler->display->display_options['relationships']['nid']['field'] = 'nid';
00041   /* Field: Comment: Title */
00042   $handler->display->display_options['fields']['subject']['id'] = 'subject';
00043   $handler->display->display_options['fields']['subject']['table'] = 'comment';
00044   $handler->display->display_options['fields']['subject']['field'] = 'subject';
00045   $handler->display->display_options['fields']['subject']['label'] = '';
00046   $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
00047   /* Field: Comment: Updated date */
00048   $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
00049   $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
00050   $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
00051   $handler->display->display_options['fields']['timestamp']['label'] = '';
00052   $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
00053   /* Sort criterion: Comment: Updated date */
00054   $handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
00055   $handler->display->display_options['sorts']['timestamp']['table'] = 'comment';
00056   $handler->display->display_options['sorts']['timestamp']['field'] = 'changed';
00057   $handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
00058   /* Filter criterion: Content: Published or admin */
00059   $handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
00060   $handler->display->display_options['filters']['status_extra']['table'] = 'node';
00061   $handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
00062   $handler->display->display_options['filters']['status_extra']['relationship'] = 'nid';
00063   $handler->display->display_options['filters']['status_extra']['group'] = 0;
00064 
00065   /* Display: Page */
00066   $handler = $view->new_display('page', 'Page', 'page');
00067   $handler->display->display_options['defaults']['style_plugin'] = FALSE;
00068   $handler->display->display_options['style_plugin'] = 'list';
00069   $handler->display->display_options['defaults']['style_options'] = FALSE;
00070   $handler->display->display_options['defaults']['row_plugin'] = FALSE;
00071   $handler->display->display_options['row_plugin'] = 'fields';
00072   $handler->display->display_options['row_options']['inline'] = array(
00073     'title' => 'title',
00074     'timestamp' => 'timestamp',
00075   );
00076   $handler->display->display_options['row_options']['separator'] = '&nbsp;';
00077   $handler->display->display_options['defaults']['row_options'] = FALSE;
00078   $handler->display->display_options['defaults']['fields'] = FALSE;
00079   /* Field: Content: Title */
00080   $handler->display->display_options['fields']['title']['id'] = 'title';
00081   $handler->display->display_options['fields']['title']['table'] = 'node';
00082   $handler->display->display_options['fields']['title']['field'] = 'title';
00083   $handler->display->display_options['fields']['title']['relationship'] = 'nid';
00084   $handler->display->display_options['fields']['title']['label'] = 'Reply to';
00085   $handler->display->display_options['fields']['title']['link_to_node'] = 1;
00086   /* Field: Comment: Updated date */
00087   $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
00088   $handler->display->display_options['fields']['timestamp']['table'] = 'comment';
00089   $handler->display->display_options['fields']['timestamp']['field'] = 'changed';
00090   $handler->display->display_options['fields']['timestamp']['label'] = '';
00091   $handler->display->display_options['fields']['timestamp']['date_format'] = 'time ago';
00092   /* Field: Comment: Title */
00093   $handler->display->display_options['fields']['subject']['id'] = 'subject';
00094   $handler->display->display_options['fields']['subject']['table'] = 'comment';
00095   $handler->display->display_options['fields']['subject']['field'] = 'subject';
00096   $handler->display->display_options['fields']['subject']['label'] = '';
00097   $handler->display->display_options['fields']['subject']['link_to_comment'] = 1;
00098   /* Field: Comment: Comment */
00099   $handler->display->display_options['fields']['comment']['id'] = 'comment';
00100   $handler->display->display_options['fields']['comment']['table'] = 'field_data_comment_body';
00101   $handler->display->display_options['fields']['comment']['field'] = 'comment_body';
00102   $handler->display->display_options['fields']['comment']['label'] = '';
00103   $handler->display->display_options['path'] = 'comments/recent';
00104 
00105   /* Display: Block */
00106   $handler = $view->new_display('block', 'Block', 'block');
00107   $translatables['comments_recent'] = array(
00108     t('Master'),
00109     t('Recent comments'),
00110     t('more'),
00111     t('Apply'),
00112     t('Reset'),
00113     t('Sort by'),
00114     t('Asc'),
00115     t('Desc'),
00116     t('Content'),
00117     t('Page'),
00118     t('Reply to'),
00119     t('Block'),
00120   );
00121 
00122   $views['comments_recent'] = $view;
00123 
00124   $view = new view;
00125   $view->name = 'tracker';
00126   $view->description = 'Shows all new activity on system.';
00127   $view->tag = 'default';
00128   $view->base_table = 'node';
00129   $view->human_name = 'Tracker';
00130   $view->core = 0;
00131   $view->api_version = '3.0';
00132   $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
00133 
00134   /* Display: Master */
00135   $handler = $view->new_display('default', 'Master', 'default');
00136   $handler->display->display_options['title'] = 'Recent posts';
00137   $handler->display->display_options['access']['type'] = 'none';
00138   $handler->display->display_options['cache']['type'] = 'none';
00139   $handler->display->display_options['query']['type'] = 'views_query';
00140   $handler->display->display_options['query']['options']['query_comment'] = FALSE;
00141   $handler->display->display_options['exposed_form']['type'] = 'basic';
00142   $handler->display->display_options['pager']['type'] = 'full';
00143   $handler->display->display_options['pager']['options']['items_per_page'] = '25';
00144   $handler->display->display_options['style_plugin'] = 'table';
00145   $handler->display->display_options['style_options']['columns'] = array(
00146     'type' => 'type',
00147     'title' => 'title',
00148     'name' => 'name',
00149     'comment_count' => 'comment_count',
00150     'last_comment_timestamp' => 'last_comment_timestamp',
00151     'timestamp' => 'title',
00152     'new_comments' => 'comment_count',
00153   );
00154   $handler->display->display_options['style_options']['default'] = 'last_comment_timestamp';
00155   $handler->display->display_options['style_options']['info'] = array(
00156     'type' => array(
00157       'sortable' => 1,
00158       'separator' => '',
00159     ),
00160     'title' => array(
00161       'sortable' => 1,
00162       'separator' => '&nbsp;',
00163     ),
00164     'name' => array(
00165       'sortable' => 1,
00166       'separator' => '',
00167     ),
00168     'comment_count' => array(
00169       'sortable' => 1,
00170       'separator' => '<br />',
00171     ),
00172     'last_comment_timestamp' => array(
00173       'sortable' => 1,
00174       'separator' => '&nbsp;',
00175     ),
00176     'timestamp' => array(
00177       'separator' => '',
00178     ),
00179     'new_comments' => array(
00180       'separator' => '',
00181     ),
00182   );
00183   $handler->display->display_options['style_options']['override'] = 1;
00184   $handler->display->display_options['style_options']['order'] = 'desc';
00185   /* Relationship: Content: Author */
00186   $handler->display->display_options['relationships']['uid']['id'] = 'uid';
00187   $handler->display->display_options['relationships']['uid']['table'] = 'node';
00188   $handler->display->display_options['relationships']['uid']['field'] = 'uid';
00189   /* Field: Content: Type */
00190   $handler->display->display_options['fields']['type']['id'] = 'type';
00191   $handler->display->display_options['fields']['type']['table'] = 'node';
00192   $handler->display->display_options['fields']['type']['field'] = 'type';
00193   /* Field: Content: Title */
00194   $handler->display->display_options['fields']['title']['id'] = 'title';
00195   $handler->display->display_options['fields']['title']['table'] = 'node';
00196   $handler->display->display_options['fields']['title']['field'] = 'title';
00197   /* Field: User: Name */
00198   $handler->display->display_options['fields']['name']['id'] = 'name';
00199   $handler->display->display_options['fields']['name']['table'] = 'users';
00200   $handler->display->display_options['fields']['name']['field'] = 'name';
00201   $handler->display->display_options['fields']['name']['relationship'] = 'uid';
00202   $handler->display->display_options['fields']['name']['label'] = 'Author';
00203   /* Field: Content: Comment count */
00204   $handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
00205   $handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
00206   $handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
00207   $handler->display->display_options['fields']['comment_count']['label'] = 'Replies';
00208   /* Field: Content: Last comment time */
00209   $handler->display->display_options['fields']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
00210   $handler->display->display_options['fields']['last_comment_timestamp']['table'] = 'node_comment_statistics';
00211   $handler->display->display_options['fields']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
00212   $handler->display->display_options['fields']['last_comment_timestamp']['label'] = 'Last Post';
00213   /* Field: Content: Has new content */
00214   $handler->display->display_options['fields']['timestamp']['id'] = 'timestamp';
00215   $handler->display->display_options['fields']['timestamp']['table'] = 'history';
00216   $handler->display->display_options['fields']['timestamp']['field'] = 'timestamp';
00217   $handler->display->display_options['fields']['timestamp']['label'] = '';
00218   $handler->display->display_options['fields']['timestamp']['link_to_node'] = 0;
00219   $handler->display->display_options['fields']['timestamp']['comments'] = 1;
00220   /* Field: Content: New comments */
00221   $handler->display->display_options['fields']['new_comments']['id'] = 'new_comments';
00222   $handler->display->display_options['fields']['new_comments']['table'] = 'node';
00223   $handler->display->display_options['fields']['new_comments']['field'] = 'new_comments';
00224   $handler->display->display_options['fields']['new_comments']['label'] = '';
00225   $handler->display->display_options['fields']['new_comments']['hide_empty'] = TRUE;
00226   $handler->display->display_options['fields']['new_comments']['suffix'] = ' new';
00227   $handler->display->display_options['fields']['new_comments']['link_to_comment'] = 1;
00228   /* Sort criterion: Content: Last comment time */
00229   $handler->display->display_options['sorts']['last_comment_timestamp']['id'] = 'last_comment_timestamp';
00230   $handler->display->display_options['sorts']['last_comment_timestamp']['table'] = 'node_comment_statistics';
00231   $handler->display->display_options['sorts']['last_comment_timestamp']['field'] = 'last_comment_timestamp';
00232   /* Contextual filter: Content: User posted or commented */
00233   $handler->display->display_options['arguments']['uid_touch']['id'] = 'uid_touch';
00234   $handler->display->display_options['arguments']['uid_touch']['table'] = 'node';
00235   $handler->display->display_options['arguments']['uid_touch']['field'] = 'uid_touch';
00236   $handler->display->display_options['arguments']['uid_touch']['exception']['title_enable'] = 1;
00237   $handler->display->display_options['arguments']['uid_touch']['title_enable'] = 1;
00238   $handler->display->display_options['arguments']['uid_touch']['title'] = 'Recent posts for %1';
00239   $handler->display->display_options['arguments']['uid_touch']['default_argument_type'] = 'fixed';
00240   $handler->display->display_options['arguments']['uid_touch']['summary']['format'] = 'default_summary';
00241   $handler->display->display_options['arguments']['uid_touch']['specify_validation'] = 1;
00242   /* Filter criterion: Content: Published */
00243   $handler->display->display_options['filters']['status']['id'] = 'status';
00244   $handler->display->display_options['filters']['status']['table'] = 'node';
00245   $handler->display->display_options['filters']['status']['field'] = 'status';
00246   $handler->display->display_options['filters']['status']['value'] = '1';
00247   $handler->display->display_options['filters']['status']['group'] = 0;
00248   $handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
00249 
00250   /* Display: Page */
00251   $handler = $view->new_display('page', 'Page', 'page');
00252   $handler->display->display_options['path'] = 'tracker';
00253   $handler->display->display_options['menu']['type'] = 'normal';
00254   $handler->display->display_options['menu']['title'] = 'Recent posts';
00255   $translatables['tracker'] = array(
00256     t('Master'),
00257     t('Recent posts'),
00258     t('more'),
00259     t('Apply'),
00260     t('Reset'),
00261     t('Sort by'),
00262     t('Asc'),
00263     t('Desc'),
00264     t('Items per page'),
00265     t('- All -'),
00266     t('Offset'),
00267     t('Type'),
00268     t('Title'),
00269     t('Author'),
00270     t('Replies'),
00271     t('.'),
00272     t(','),
00273     t('Last Post'),
00274     t(' new'),
00275     t('All'),
00276     t('Recent posts for %1'),
00277     t('Page'),
00278   );
00279 
00280   $views['tracker'] = $view;
00281 
00282   return $views;
00283 }

Generated on Sun Feb 26 2012 12:52:51 for Views by  doxygen 1.7.1