You are here

function drupalchat_preprocess_drupalchat in DrupalChat 8

Same name and namespace in other branches
  1. 6.2 drupalchat.module \drupalchat_preprocess_drupalchat()
  2. 6 drupalchat.module \drupalchat_preprocess_drupalchat()
  3. 7.2 drupalchat.module \drupalchat_preprocess_drupalchat()
  4. 7 drupalchat.module \drupalchat_preprocess_drupalchat()

File

./drupalchat.module, line 341
Module code for DrupalChat.

Code

function drupalchat_preprocess_drupalchat(&$variables) {
  $modules = \Drupal::moduleHandler()
    ->invokeAll('drupalchat_subpanel');
  $items = array();
  $drupalchat_object_render = drupalchatController::_drupalchat_chat();
  $drupalchat_object_render['#wrapper_attributes'] = array(
    'id' => 'chatpanel',
  );
  $items[] = $drupalchat_object_render;
  foreach ($modules as $module) {
    $drupalchat_subpanel = array(
      '#theme' => 'drupalchat_subpanel',
      '#subpanel' => $module,
    );
    $items[] = array(
      '#markup' => $drupalchat_subpanel,
      '#wrapper_attributes' => $module['name'],
    );
  }
  $item_list = array(
    '#theme' => 'item_list',
    '#items' => $items,
    '#title' => NULL,
    '#list_type' => 'ul',
    '#attributes' => array(
      'id' => 'mainpanel',
    ),
  );
  $variables['subpanels'] = $item_list;
}