You are here

function workbench_preprocess_views_view_field in Workbench 7

Implementation of hook_preprocess_views_view_table().

This is done to convert the "type" field to a thumbnail for image files.

File

./workbench.module, line 193
Workbench module file for editorial workspaces.

Code

function workbench_preprocess_views_view_field(&$variables) {
  $view = $variables['view'];
  if ($view->name == 'workbench_current_user' && $variables['field']->definition['handler'] == 'views_handler_field_user_picture') {
    if (empty($variables['output'])) {

      // We could put the default picture here
      $variables['output'] = theme('image', array(
        'path' => drupal_get_path('module', 'workbench') . '/images/profile_default.png',
        'attributes' => array(
          'width' => '100px',
        ),
      ));
    }
  }
}