You are here

function template_preprocess_cmis_content_properties in CMIS API 8

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

Template preprocess for content properties.

Parameters

type $variables:

File

./cmis.module, line 130
Contains cmis.module.

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($key, $property),
      ];
    }
  }
  $variables['properties'] = '';
  if (!empty($rows)) {
    $table = [
      '#theme' => 'table',
      '#header' => [
        t('Property'),
        t('Value'),
      ],
      '#rows' => $rows,
    ];
    $variables['properties'] = render($table);
  }
}