How can you print the field class you entered in a View 's style settings? So in Views you can add a CSS class (under style settings) to your field.
I need to print the same class in a parent div of the calendar module.

The fields are rendered to calendar content with the calendar-item.tpl.php
That file looks like this:

$index = 0;
?&gt;
&lt;div class="&lt;?php print !empty($item-&gt;class) ? $item-&gt;class : 'item'; ?&gt;"&gt;
  &lt;div class="view-item view-item-&lt;?php print $view-&gt;name ?&gt;"&gt;
  &lt;div class="calendar &lt;?php print $item-&gt;granularity; ?&gt;view"&gt;
    &lt;?php print theme('calendar_stripe_stripe', array('item' =&gt; $item)); ?&gt;
    &lt;div class="&lt;?php print $item-&gt;date_id ?&gt; contents"&gt;
      &lt;?php foreach ($rendered_fields as $field): ?&gt;
        &lt;?php if ($index++ == 0 &amp;&amp; (isset($item-&gt;continuation) &amp;&amp; $item-&gt;continuation)) : ?&gt;
        &lt;div class="continuation"&gt;&amp;laquo;&lt;/div&gt;
        &lt;?php endif;?&gt;
        &lt;?php print $field; ?&gt;
      &lt;?php endforeach; ?&gt;
    &lt;/div&gt;  
    &lt;?php if (isset($item-&gt;continues) &amp;&amp; $item-&gt;continues) : ?&gt;
    &lt;div class="continues"&gt;&amp;raquo;&lt;/div&gt;
    &lt;?php else : ?&gt;
    &lt;div class="cutoff"&gt;&amp;nbsp;&lt;/div&gt;
    &lt;?php endif;?&gt;
  &lt;/div&gt; 
  &lt;/div&gt;   
&lt;/div&gt;


So I need to get that class in the first DIV

&lt;div class="&lt;?php print !empty($item-&gt;class) ? $item-&gt;class : 'item' . ENTER-FIELDCLASS-HERE; ?&gt;"&gt;


I've been looking in the VIEWS module and the code taht checks if you entered a CSS class should be this part in the THEME.inc file:

if ($classes = $object-&gt;handler-&gt;element_classes($view-&gt;row_index)) {
          if ($class) {
            $class .= ' ';
          }
          $class .=  $classes;
        }


A more complete part:

$previous_inline = FALSE;
  $vars['fields'] = array(); // ensure it's at least an empty array.
  foreach ($view-&gt;field as $id =&gt; $field) {
    // render this even if set to exclude so it can be used elsewhere.
    $field_output = $view-&gt;style_plugin-&gt;get_field($view-&gt;row_index, $id);
    $empty = $field-&gt;is_value_empty($field_output, $field-&gt;options['empty_zero']);
    if (empty($field-&gt;options['exclude']) &amp;&amp; (!$empty || (empty($field-&gt;options['hide_empty']) &amp;&amp; empty($vars['options']['hide_empty'])))) {
      $object = new stdClass();
      $object-&gt;handler = &amp;$view-&gt;field[$id];
      $object-&gt;inline = !empty($vars['options']['inline'][$id]);

      $object-&gt;element_type = $object-&gt;handler-&gt;element_type(TRUE, !$vars['options']['default_field_elements'], $object-&gt;inline);
      if ($object-&gt;element_type) {
        $class = '';
        if ($object-&gt;handler-&gt;options['element_default_classes']) {
          $class = 'field-content';
        }

        if ($classes = $object-&gt;handler-&gt;element_classes($view-&gt;row_index)) {
          if ($class) {
            $class .= ' ';
          }
          $class .=  $classes;
        }

        $pre = '&lt;' . $object-&gt;element_type;
        if ($class) {
          $pre .= ' class="' . $class . '"';
        }
        $field_output = $pre . '&gt;' . $field_output . '&lt;/' . $object-&gt;element_type . '&gt;';
      }


Not the most clear code to me.
It can't be that hard. If only something like $field->class would work!

Thanks in advance!
You can add a class through the views interface:


Go to views ui
Under "Fields", click on the field you want to change
Click on "Style Setting"
Choose "Customize Field HTML"
Click "CSS Class" and enter your new css class


Alternatively, you can also achieve this through theme pre rendering. 


View machine name: "your_view_name" 
Field machine name: 'yourfield'
New class: "your_new_css_class"


Add to the file template.php in your theme directory: 

function yourtheme_views_pre_render(&amp;$view) {

  if ($view-&gt;name == "your_view_name") {
     $view-&gt;field['yourfield']-&gt;options['element_class'] = "your_new_css_class";
  }

}


To debug, download and enable the devel module (http://drupal.org/project/devel), and write out the variables:

function yourtheme_views_pre_render(&amp;$view) {
    if ($view-&gt;name == "your_view_name") {
        drupal_debug($view-&gt;field['yourfield']-&gt;options['element_class']);
    }
}


The output will appear in tmp/drupal_debug.txt (depending on how you configured your tmp directory).