includes/plugins.inc File Reference


Detailed Description

Built in plugins for Views output handling.

Definition in file plugins.inc.

Go to the source code of this file.

Classes

class  views_plugin
 Abstract base class to provide interface common to all plugins. More...

Functions

 views_views_plugins ()
 Implementation of hook_views_plugins.
 views_discover_plugins ()
 Builds and return a list of all plugins available in the system.


Function Documentation

views_discover_plugins (  ) 

Builds and return a list of all plugins available in the system.

Returns:
Nested array of plugins, grouped by type.

Definition at line 266 of file plugins.inc.

Referenced by _views_fetch_plugin_data().

00266                                   {
00267   $cache = array('display' => array(), 'style' => array(), 'row' => array(), 'argument default' => array(), 'argument validator' => array(), 'access' => array(), 'cache' => array());
00268   // Get plugins from all mdoules.
00269   foreach (module_implements('views_plugins') as $module) {
00270     $function = $module . '_views_plugins';
00271     $result = $function();
00272     if (!is_array($result)) {
00273       continue;
00274     }
00275 
00276     $module_dir = isset($result['module']) ? $result['module'] : $module;
00277     // Setup automatic path/file finding for theme registration
00278     if ($module_dir == 'views') {
00279       $theme_path = drupal_get_path('module', $module_dir) . '/theme';
00280       $theme_file = 'theme.inc';
00281       $path = drupal_get_path('module', $module_dir) . '/plugins';
00282     }
00283     else {
00284       $theme_path = $path = drupal_get_path('module', $module_dir);
00285       $theme_file = "$module.views.inc";
00286     }
00287 
00288     foreach ($result as $type => $info) {
00289       if ($type == 'module') {
00290         continue;
00291       }
00292       foreach ($info as $plugin => $def) {
00293         $def['module'] = $module_dir;
00294         if (!isset($def['theme path'])) {
00295           $def['theme path'] = $theme_path;
00296         }
00297         if (!isset($def['theme file'])) {
00298           $def['theme file'] = $theme_file;
00299         }
00300         if (!isset($def['path'])) {
00301           $def['path'] = $path;
00302         }
00303         if (!isset($def['file'])) {
00304           $def['file'] = $def['handler'] . '.inc';
00305         }
00306         if (!isset($def['parent'])) {
00307           $def['parent'] = 'parent';
00308         }
00309         // merge the new data in
00310         $cache[$type][$plugin] = $def;
00311       }
00312     }
00313   }
00314   return $cache;
00315 }

views_views_plugins (  ) 

Implementation of hook_views_plugins.

Definition at line 12 of file plugins.inc.

00012                                {
00013   $path = drupal_get_path('module', 'views') . '/js';
00014   return array(
00015     'module' => 'views', // This just tells our themes are elsewhere.
00016     'display' => array(
00017       'parent' => array(
00018         // this isn't really a display but is necessary so the file can
00019         // be included.
00020         'no ui' => TRUE,
00021         'handler' => 'views_plugin_display',
00022         'parent' => '',
00023       ),
00024       'default' => array(
00025         'title' => t('Defaults'),
00026         'help' => t('Default settings for this view.'),
00027         'handler' => 'views_plugin_display_default',
00028         'theme' => 'views_view',
00029         'no ui' => TRUE,
00030         'no remove' => TRUE,
00031         'js' => array('misc/collapse.js', 'misc/textarea.js', 'misc/tabledrag.js', 'misc/autocomplete.js', "$path/dependent.js"),
00032         'use ajax' => TRUE,
00033         'use pager' => TRUE,
00034         'use more' => TRUE,
00035         'accept attachments' => TRUE,
00036         'help topic' => 'display-default',
00037       ),
00038       'page' => array(
00039         'title' => t('Page'),
00040         'help' => t('Display the view as a page, with a URL and menu links.'),
00041         'handler' => 'views_plugin_display_page',
00042         'theme' => 'views_view',
00043         'uses hook menu' => TRUE,
00044         'use ajax' => TRUE,
00045         'use pager' => TRUE,
00046         'accept attachments' => TRUE,
00047         'admin' => t('Page'),
00048         'help topic' => 'display-page',
00049       ),
00050       'block' => array(
00051         'title' => t('Block'),
00052         'help' => t('Display the view as a block.'),
00053         'handler' => 'views_plugin_display_block',
00054         'theme' => 'views_view',
00055         'uses hook block' => TRUE,
00056         'use ajax' => TRUE,
00057         'use pager' => TRUE,
00058         'use more' => TRUE,
00059         'accept attachments' => TRUE,
00060         'admin' => t('Block'),
00061         'help topic' => 'display-block',
00062       ),
00063       'attachment' => array(
00064         'title' => t('Attachment'),
00065         'help' => t('Attachments added to other displays to achieve multiple views in the same view.'),
00066         'handler' => 'views_plugin_display_attachment',
00067         'theme' => 'views_view',
00068         'use ajax' => TRUE,
00069         'help topic' => 'display-attachment',
00070       ),
00071       'feed' => array(
00072         'title' => t('Feed'),
00073         'help' => t('Display the view as a feed, such as an RSS feed.'),
00074         'handler' => 'views_plugin_display_feed',
00075         'parent' => 'page', // so it knows to load the page plugin .inc file
00076         'uses hook menu' => TRUE,
00077         'use ajax' => FALSE,
00078         'use pager' => FALSE,
00079         'accept attachments' => FALSE,
00080         'admin' => t('Feed'),
00081         'help topic' => 'display-feed',
00082       ),
00083     ),
00084     'style' => array(
00085       'parent' => array(
00086         // this isn't really a display but is necessary so the file can
00087         // be included.
00088         'no ui' => TRUE,
00089         'handler' => 'views_plugin_style',
00090         'parent' => '',
00091       ),
00092       'default' => array(
00093         'title' => t('Unformatted'),
00094         'help' => t('Displays rows one after another.'),
00095         'handler' => 'views_plugin_style_default',
00096         'theme' => 'views_view_unformatted',
00097         'uses row plugin' => TRUE,
00098         'uses options' => TRUE,
00099         'uses grouping' => TRUE,
00100         'type' => 'normal',
00101         'help topic' => 'style-unformatted',
00102       ),
00103       'list' => array(
00104         'title' => t('HTML List'),
00105         'help' => t('Displays rows as an HTML list.'),
00106         'handler' => 'views_plugin_style_list',
00107         'theme' => 'views_view_list',
00108         'uses row plugin' => TRUE,
00109         'uses options' => TRUE,
00110         'type' => 'normal',
00111         'help topic' => 'style-list',
00112       ),
00113       'grid' => array(
00114         'title' => t('Grid'),
00115         'help' => t('Displays rows in a grid.'),
00116         'handler' => 'views_plugin_style_grid',
00117         'theme' => 'views_view_grid',
00118         'uses row plugin' => TRUE,
00119         'uses options' => TRUE,
00120         'type' => 'normal',
00121         'help topic' => 'style-grid',
00122       ),
00123       'table' => array(
00124         'title' => t('Table'),
00125         'help' => t('Displays rows in a table.'),
00126         'handler' => 'views_plugin_style_table',
00127         'theme' => 'views_view_table',
00128         'uses row plugin' => FALSE,
00129         'uses fields' => TRUE,
00130         'uses options' => TRUE,
00131         'type' => 'normal',
00132         'help topic' => 'style-table',
00133       ),
00134       'default_summary' => array(
00135         'title' => t('List'),
00136         'help' => t('Displays the default summary as a list.'),
00137         'handler' => 'views_plugin_style_summary',
00138         'theme' => 'views_view_summary',
00139         'type' => 'summary', // only shows up as a summary style
00140         'uses options' => TRUE,
00141         'help topic' => 'style-summary',
00142       ),
00143       'unformatted_summary' => array(
00144         'title' => t('Unformatted'),
00145         'help' => t('Displays the summary unformatted, with option for one after another or inline.'),
00146         'handler' => 'views_plugin_style_summary_unformatted',
00147         'parent' => 'default_summary',
00148         'theme' => 'views_view_summary_unformatted',
00149         'type' => 'summary', // only shows up as a summary style
00150         'uses options' => TRUE,
00151         'help topic' => 'style-summary-unformatted',
00152       ),
00153       'rss' => array(
00154         'title' => t('RSS Feed'),
00155         'help' => t('Generates an RSS feed from a view.'),
00156         'handler' => 'views_plugin_style_rss',
00157         'theme' => 'views_view_rss',
00158         'uses row plugin' => TRUE,
00159         'uses options' => TRUE,
00160         'type' => 'feed',
00161         'help topic' => 'style-rss',
00162       ),
00163     ),
00164     'row' => array(
00165       'parent' => array(
00166         // this isn't really a display but is necessary so the file can
00167         // be included.
00168         'no ui' => TRUE,
00169         'handler' => 'views_plugin_row',
00170         'parent' => '',
00171       ),
00172       'fields' => array(
00173         'title' => t('Fields'),
00174         'help' => t('Displays the fields with an optional template.'),
00175         'handler' => 'views_plugin_row_fields',
00176         'theme' => 'views_view_fields',
00177         'uses fields' => TRUE,
00178         'uses options' => TRUE,
00179         'type' => 'normal',
00180         'help topic' => 'style-row-fields',
00181       ),
00182     ),
00183     'argument default' => array(
00184       // This type of plugin does not conform to the standard and
00185       // uses 'fixed' as the parent rather than having a separate parent.
00186       'fixed' => array(
00187         'title' => t('Fixed entry'),
00188         'handler' => 'views_plugin_argument_default',
00189       ),
00190       'php' => array(
00191         'title' => t('PHP Code'),
00192         'handler' => 'views_plugin_argument_default_php',
00193         'parent' => 'fixed',
00194       ),
00195     ),
00196     'argument validator' => array(
00197       'parent' => array(
00198         'no ui' => TRUE,
00199         'handler' => 'views_plugin_argument_validate',
00200         'parent' => '',
00201       ),
00202       'php' => array(
00203         'title' => t('PHP Code'),
00204         'handler' => 'views_plugin_argument_validate_php',
00205       ),
00206       'numeric' => array(
00207         'title' => t('Numeric'),
00208         'handler' => 'views_plugin_argument_validate_numeric',
00209       ),
00210     ),
00211     'access' => array(
00212       'parent' => array(
00213         'no ui' => TRUE,
00214         'handler' => 'views_plugin_access',
00215         'parent' => '',
00216       ),
00217       'none' => array(
00218         'title' => t('None'),
00219         'help' => t('Will be available to all users.'),
00220         'handler' => 'views_plugin_access_none',
00221         'help topic' => 'access-none',
00222       ),
00223       'role' => array(
00224         'title' => t('Role'),
00225         'help' => t('Access will be granted to users with any of the specified roles.'),
00226         'handler' => 'views_plugin_access_role',
00227         'uses options' => TRUE,
00228         'help topic' => 'access-role',
00229       ),
00230       'perm' => array(
00231         'title' => t('Permission'),
00232         'help' => t('Access will be granted to users with the specified permission string.'),
00233         'handler' => 'views_plugin_access_perm',
00234         'uses options' => TRUE,
00235         'help topic' => 'access-perm',
00236       ),
00237     ),
00238     'cache' => array(
00239       'parent' => array(
00240         'no ui' => TRUE,
00241         'handler' => 'views_plugin_cache',
00242         'parent' => '',
00243       ),
00244       'none' => array(
00245         'title' => t('None'),
00246         'help' => t('No caching of Views data.'),
00247         'handler' => 'views_plugin_cache_none',
00248         'help topic' => 'cache-none',
00249       ),
00250       'time' => array(
00251         'title' => t('Time-based'),
00252         'help' => t('Simple time-based caching of data.'),
00253         'handler' => 'views_plugin_cache_time',
00254         'uses options' => TRUE,
00255         'help topic' => 'cache-time',
00256       ),
00257     ),
00258   );
00259 }


Generated on Wed Jun 17 08:19:11 2009 for Views by  doxygen 1.4.7