You are here

function cheeseburger_menu_preprocess_table in Cheeseburger Menu 5.0.x

Implements hook_preprocess_HOOK(). Remove modal dialog from cheeseburger place block link.

File

./cheeseburger_menu.module, line 193
Contains cheeseburger_menu.module.

Code

function cheeseburger_menu_preprocess_table(&$variables) {
  if (isset($variables['attributes']['class'][0]) && $variables['attributes']['class'][0] === 'block-add-table') {
    foreach ($variables['rows'] as &$row) {
      if (isset($row['cells']['operations']['content']['#links']['add']['url'])) {
        $url = $row['cells']['operations']['content']['#links']['add']['url'];
        if ($url instanceof Url) {
          $plugin_id = $url
            ->getRouteParameters()['plugin_id'];
          if ($plugin_id === 'cheeseburger_menu') {
            unset($row['cells']['operations']['content']['#links']['add']['attributes']);
          }
        }
      }
    }
  }
}