You are here

function template_preprocess_cmis_content_properties in CMIS API 3.0.x

Same name and namespace in other branches
  1. 8.2 cmis.module \template_preprocess_cmis_content_properties()
  2. 8 cmis.module \template_preprocess_cmis_content_properties()

Implements hook_preprocess_cmis_content_properties().

File

./cmis.module, line 127

Code

function template_preprocess_cmis_content_properties(&$variables) {
  $object = $variables['object'];
  $rows = [];
  foreach ($object
    ->getProperties() as $key => $property) {
    if ($property) {
      $rows[] = [
        $key,
        _cmis_get_property($property),
      ];
    }
  }
  $variables['properties'] = '';
  if (!empty($rows)) {
    $table = [
      '#theme' => 'table',
      '#header' => [
        t('Property'),
        t('Value'),
      ],
      '#rows' => $rows,
    ];
    $variables['properties'] = render($table);
  }
}