Question: I've created a View of all the views that Drupal knows about, whether they reside in code or in the DB. It works great, tells the user about each view, its tags, its displays, its base table, its fields if they exist, and its path.

I'm doing this by overriding `execute(&$view)` in a custom query handler. A very truncated version of what I'm doing:

```
foreach(views_get_all_views() as $zview) {
    // Examine each display of each view.
    foreach($zview->display as $display) {
      $row = new stdClass();
      ... // Set the things on $row.
      $view->result[] = $row;
    }
}

```

Now I also want it to tell the user about each View's query.

If I do this it works (for the last of the many Views):

```
      $zxview = views_get_view($zview->name);
      $zxview->set_display($display->id);
      $zxview->pre_execute();
      $zxview->execute();
      dpm($zxview->query->query()->__toString());

```

but I have to do it outside of the `foreach()` that goes through each view. If I try to do `$zxview->execute()` inside `foreach(views_get_all_views() as $zview) { ... }` I get

```
PHP Fatal error:  Maximum function nesting level of '100' reached, aborting!

```

This makes sense, sort of. But, so how can I list the query being executed for each view next to the name of each view, within a view? (I'm already excluding views defined by the module defining this view of views.)

Answer: 
```
function MYTHEME_preprocess_block(&$vars) {
  if ($vars['block_html_id'] == 'block-menu-block-7') {
    $vars['classes_array'][] = 'CSS_CLASS_NAME';
  }
}

```

If you want to add a class to each individual item (li or/and a)use something like this:

```
function MYTHEME_menu_link(array $variables) {
  // replace MENU-MACHINE-NAME appropriately
  if ($variables['element']['#original_link']['menu_name'] == 'MENU-MACHINE-NAME') {
    // Add menu-li class to each li 
    $variables['element']['#attributes']['class'][] = 'menu-li';
    // Add menu-li-a class to each anchor link
    $variables['element']['#localized_options']['attributes']['class'][] = 'menu-li-a';
  }
  return theme_menu_link($variables);
}

```
You can use the [Menu attributes](https://www.drupal.org/project/menu_attributes) module. Here is a quote about it (from the module's project page):

> 
> This simple module allows you to specify some additional attributes for menu items such as id, name, class, style, and rel.
> 
> 
> You should use this module when:
> 
> 
> * You want to "nofollow" certain menu items to sculpt the flow of PageRank through your site
> * You want to give a menu item an ID so you can easily select it using jQuery
> * You want to add additional classes or styles to a menu item
> 
> 
>