private function __wrapFieldWithDiv(Field $field, Entry $entry = NULL)
 {
     $div = $this->createElement('div', NULL, array('class' => sprintf('field field-%s %s %s', $field->handle(), $field->required == 'yes' ? 'required' : '', $this->__calculateWidth($field->width))));
     $field->displayPublishPanel($div, !is_null($entry) ? $entry->getData($field->id) : NULL, isset($this->_errors[$field->id]) ? $this->_errors[$field->id] : NULL, null, null, !is_null($entry) && is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
     return $div;
 }
 /**
  * Given a Field and Entry object, this function will wrap
  * the Field's displayPublishPanel result with a div that
  * contains some contextual information such as the Field ID,
  * the Field handle and whether it is required or not.
  *
  * @param Field $field
  * @param Entry $entry
  * @return XMLElement
  */
 private function __wrapFieldWithDiv(Field $field, Entry $entry)
 {
     $div = new XMLElement('div', NULL, array('id' => 'field-' . $field->get('id'), 'class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '')));
     $field->displayPublishPanel($div, $entry->getData($field->get('id')), isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : NULL, null, null, is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
     return $div;
 }
 private function __wrapFieldWithDiv(Field $field, Entry $entry, $prefix = null, $postfix = null, $css = null)
 {
     $div = new XMLElement('div', NULL, array('class' => 'field field-' . $field->handle() . ($field->get('required') == 'yes' ? ' required' : '')));
     if ($css != null) {
         $div->setAttribute('style', $css);
     }
     $field->displayPublishPanel($div, $_POST['fields'][$field->get('element_name')], isset($this->_errors[$field->get('id')]) ? $this->_errors[$field->get('id')] : NULL, $prefix ? '[' . $prefix . ']' : null, null, is_numeric($entry->get('id')) ? $entry->get('id') : NULL);
     return $div;
 }