/**
  * Main function, rendering the content of the rename form
  *
  * @return	void
  */
 function main()
 {
     global $LANG;
     $content = '';
     $items = $this->pObj->compileFilesAndRecordsData();
     //
     // perform delete files(s)
     //
     if (count($items) and is_array($this->pObj->data) and $this->pObj->data['delete']) {
         $errors = array();
         foreach ($this->pObj->data['delete'] as $id => $filepath) {
             if ($items[$id] and $items[$id]['file_accessable']) {
                 if ($error = tx_dam::process_deleteFile($items[$id])) {
                     $errors[] = htmlspecialchars($error);
                 }
             } else {
                 $errors[] = $LANG->getLL('accessDenied', true) . htmlspecialchars(' (' . $filepath . ')');
             }
         }
         if ($errors) {
             $content .= $GLOBALS['SOBE']->getMessageBox($LANG->getLL('error'), implode('<br />', $errors), $this->pObj->buttonBack(0), 2);
         } else {
             $this->pObj->redirect();
         }
     }
     //
     // display forms
     //
     if (count($items) == 1) {
         reset($items);
         $item = current($items);
         if ($item['file_accessable']) {
             $content .= $this->renderFormSingle(key($items), $item);
         } else {
             // this should have happen in index.php already
             $content .= $this->pObj->accessDeniedMessageBox($item['file_name']);
         }
     } elseif (count($items) > 1) {
         // multi action
         $content .= $this->renderFormMulti($items);
     }
     return $content;
 }