/**
  * Main function, rendering the content of the rename form
  *
  * @return	void
  */
 function main()
 {
     global $LANG;
     $content = '';
     // Cleaning and checking target
     if ($this->pObj->file[0]) {
         $this->file = tx_dam::file_compileInfo($this->pObj->file[0]);
         $this->meta = tx_dam::meta_getDataForFile($this->file);
     } elseif ($id = intval($this->pObj->record['tx_dam'][0])) {
         $this->meta = tx_dam::meta_getDataByUid($id);
         $this->file = tx_dam::file_compileInfo($this->meta);
     }
     if (!is_array($this->meta)) {
         $fileType = tx_dam::file_getType($this->file);
         $this->meta = array_merge($this->file, $fileType);
         $this->meta['uid'] = 0;
     }
     if ($this->file['file_accessable']) {
         if (is_array($this->pObj->data) and $this->pObj->data['upload']) {
             $error = tx_dam::process_replaceFile($this->meta, $this->pObj->data);
             if ($error) {
                 $content .= $GLOBALS['SOBE']->getMessageBox($LANG->getLL('error'), htmlspecialchars($error), $this->pObj->buttonBack(0), 2);
             } else {
                 $this->pObj->redirect();
             }
         } else {
             $content .= $this->renderForm();
         }
     } else {
         // this should have happen in index.php already
         $content .= $this->pObj->accessDeniedMessageBox($this->file['file_name']);
     }
     return $content;
 }