1 views_handler_field_system_info.inc public views_handler_field_system_info::render($values)

Render the field.

Parameters

$values: The values retrieved from the database.

Overrides views_handler_field::render

File

core/modules/system/views/views_handler_field_system_info.inc, line 133
Definition of views_handler_field_system_info.

Class

views_handler_field_system_info
A handler to display module and theme properties stored in the database.

Code

public function render($values) {
  $value = $this->get_value($values);
  $info_array = unserialize($value);
  $info_property = $this->options['info_property'];
  if ($info_property == 'other') {
    $info_property = $this->options['other'];
  }
  if (empty($info_array[$info_property])) {
    return '';
  }

  switch ($info_property) {
    case 'tags':
    case 'dependencies':
    case 'scripts':
      $items = $info_array[$info_property];

      if ($info_property == 'dependencies' && $this->options['dependencies_display'] == 'project_names' && ($info_array['type'] == 'module' || $info_array['type'] == 'profile')) {
        // Display human names for projects.
        $modules = system_rebuild_module_data();
        $module_labels = array();
        foreach ($items as $item) {
          $module_labels[] = check_plain($modules[$item]->info['name']);
        }
        $items = $module_labels;
      }

      $multi_type = $this->options['multi_type'];
      $output = '';
      switch ($multi_type) {
        case 'separator':
          $separator = $this->options['separator'];
          $output = implode($separator, $items);
          break;

        default:
          $output = theme('item_list', array('items' => $items,
            'type' => $multi_type));
          break;
      }
      return $output;

    default:
      $output = $info_array[$info_property];
      if (is_array($output)) {
        $output = theme('item_list', array('items' => $this->_array2list($output)));
      }
      return $output;
  }
}