/**
     * Rendering the copy file form for a multiple items
     *
     * @return	string		HTML content
     */
    function renderFormMulti($items, $targetFolder)
    {
        global $BACK_PATH, $LANG, $TCA;
        $content = '';
        $references = 0;
        // FOLDER_INFO is missing due to missing param in current function - so we set it to nothing
        $this->pObj->markers['FOLDER_INFO'] = '';
        $titleNotExists = 'title="' . $GLOBALS['LANG']->getLL('fileNotExists', true) . '"';
        $iconNotExists = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' ' . $titleNotExists . ' valign="top" alt="" />';
        $referencedIcon = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/is_referenced.gif', 'width="15" height="12"') . ' title="' . $LANG->getLL($this->langPrefix . 'messageReferencesUsed', 1) . '" alt="" />';
        // init table layout
        $tableLayout = array('table' => array('<table cellpadding="2" cellspacing="1" border="0" width="100%">', '</table>'), '0' => array('defCol' => array('<th nowrap="nowrap" class="bgColor5">', '</th>'), '0' => array('<th width="1%" class="bgColor5">', '</th>'), '1' => array('<th width="1%" class="bgColor5">', '</th>'), '3' => array('<th width="1%" class="bgColor5">', '</th>'), '4' => array('<th width="1%" class="bgColor5">', '</th>'), '5' => array('<th width="1%" class="bgColor5">', '</th>')), 'defRow' => array('defCol' => array('<td nowrap="nowrap" class="bgColor4">', '</td>'), '2' => array('<td class="bgColor4">', '</td>'), '3' => array('<td style="text-align:center" class="bgColor4">', '</td>'), '4' => array('<td style="padding:0 5px 0 5px" class="bgColor4">', '</td>'), '5' => array('<td style="text-align:center" class="bgColor4">', '</td>')));
        $cTable = array();
        $tr = 0;
        $td = 0;
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['title']['label'], 1);
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = '&nbsp;';
        $cTable[$tr][$td++] = $LANG->sL($TCA['tx_dam']['columns']['file_path']['label'], 1);
        $tr++;
        foreach ($items as $id => $meta) {
            $filepath = tx_dam::file_absolutePath($meta);
            if ($meta['file_accessable']) {
                $checkbox = '<input type="checkbox" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '"  checked="checked" />';
            } else {
                $checkbox = '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], PATH_txdam_rel . 'i/error_h.gif', 'width="10" height="10"') . ' title="' . $LANG->getLL('accessDenied', true) . '" alt="" />';
            }
            $title = $meta['title'] ? $meta['title'] : $meta['file_name'];
            $title = t3lib_div::fixed_lgd_cs($title, 50);
            $icon = tx_dam_guiFunc::icon_getFileTypeImgTag($meta, 'class="c-recicon"', false);
            if (!@file_exists($filepath)) {
                $icon .= $iconNotExists;
                $info = '';
            } else {
                $info = $GLOBALS['SOBE']->btn_infoFile($meta);
            }
            // Add row to table
            $td = 0;
            $cTable[$tr][$td++] = $checkbox;
            $cTable[$tr][$td++] = $icon;
            $cTable[$tr][$td++] = htmlspecialchars($title);
            $cTable[$tr][$td++] = htmlspecialchars(strtoupper($meta['file_type']));
            $cTable[$tr][$td++] = $info;
            $cTable[$tr][$td++] = htmlspecialchars(t3lib_div::fixed_lgd_cs($meta['file_path'], -15));
            $tr++;
        }
        $itemTable = $this->pObj->doc->table($cTable, $tableLayout);
        $targetFolderRel = tx_dam::path_makeRelative($targetFolder);
        $msg = array();
        $msg[] = '&nbsp;';
        $msg[] = $LANG->getLL('labelTargetFolder', 1) . ' <strong>' . htmlspecialchars($targetFolderRel) . '</strong>';
        $msg[] = '&nbsp;';
        $msg[] = htmlspecialchars(sprintf($LANG->getLL($this->langPrefix . 'message'), $targetFolderRel));
        $msg[] = '&nbsp;';
        $msg[] = $itemTable;
        $buttons = '
			<input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" />
			<input type="hidden" name="data[' . $this->copyOrMove . '][' . $id . '][target]" value="' . htmlspecialchars($targetFolder) . '" />';
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            if ($this->copyOrMove == 'copy') {
                $buttons .= '
					<input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filecopy.submit', 1) . '" />
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
            } else {
                $buttons .= '
					<input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filemove.submit', 1) . '" />
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
            }
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/clip_copy.gif') . ' title="' . $LANG->getLL($this->langPrefix . 'submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        return $content;
    }
    /**
     * Making the form for create file
     *
     * @return	string		HTML content
     */
    function renderForm($fileContent = '')
    {
        global $BE_USER, $LANG, $TYPO3_CONF_VARS;
        $content = '';
        $msg = array();
        $this->pObj->markers['FOLDER_INFO'] = tx_dam_guiFunc::getFolderInfoBar(tx_dam::path_compileInfo($this->pObj->media->pathAbsolute));
        $msg[] = '&nbsp;';
        $this->pObj->markers['FILE_INFO'] = $GLOBALS['LANG']->sL('LLL:EXT:dam/locallang_db.xml:tx_dam_item.file_name', 1) . ' <strong>' . htmlspecialchars($this->pObj->media->filename) . '</strong>';
        $msg[] = '&nbsp;';
        $msg[] = $GLOBALS['LANG']->getLL('tx_dam_cmd_filenew.text_content', 1);
        $msg[] = '<textarea rows="30" name="data[file_content]" wrap="off"' . $this->pObj->doc->formWidthText(48, 'width:99%;height:65%', 'off') . ' class="fixed-font enable-tab">' . t3lib_div::formatForTextarea($fileContent) . '</textarea>';
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->getLL('labelCmdSave', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['SAVE_CLOSE'] = '<input class="c-inputButton" name="_saveandclosedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/saveandclosedok.gif') . ' title="' . $GLOBALS['LANG']->getLL('labelCmdSaveClose', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            $buttons = '
				<input type="submit" name="save" value="' . $GLOBALS['LANG']->getLL('labelCmdSave', 1) . '" />
				<input type="submit" name="_saveandclosedok_x" value="' . $GLOBALS['LANG']->getLL('labelCmdSaveClose', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
        }
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        return $content;
    }
 /**
  * Replace a file with an uploaded file and process indexing and DB update
  * Important: $meta['uid'] have to be used in the upload data like this $upload_data['upload'][$meta['uid']]
  *
  * @param 	array 	$meta Meta data array
  * @param 	array 	$upload_data Form upload data for $TCEfile->setCmdmap($upload_data)
  * @return	mixed		error message or error array
  * @see tx_dam_tce_file::getLastError()
  */
 function process_replaceFile($meta, $upload_data, $getFullErrorLogEntry = FALSE)
 {
     global $TYPO3_CONF_VARS;
     $error = false;
     require_once PATH_txdam . 'lib/class.tx_dam_tce_file.php';
     $TCEfile = t3lib_div::makeInstance('tx_dam_tce_file');
     $TCEfile->init();
     // allow overwrite
     $TCEfile->fileProcessor->dontCheckForUnique = true;
     // FIXME overwrite only original file not others
     // dontCheckForUnique=true allow overwriting any file
     // dontCheckForUnique have to be false and the file have to be replaced afterwards?
     if ($id = $meta['uid'] and is_array($upload_data['upload'][$id])) {
         // Processing uploads
         $TCEfile->setCmdmap($upload_data);
         $log = $TCEfile->process();
         if ($TCEfile->errors()) {
             $error = $TCEfile->getLastError();
         } else {
             $newFile = $log['cmd']['upload'][$id]['target_file'];
             $newFile = tx_dam::file_absolutePath($newFile);
             $new_filename = tx_dam::file_basename($newFile);
             // new file name - so we need to update some stuff
             if ($new_filename !== $meta['file_name']) {
                 // rename meta data fields
                 $fields_values = array();
                 $fields_values['file_name'] = $new_filename;
                 $fields_values['file_dl_name'] = $new_filename;
                 $fields_values['uid'] = $meta['uid'];
                 tx_dam_db::insertUpdateData($fields_values);
                 // delete the old file
                 $oldFile = tx_dam::file_absolutePath($meta);
                 @unlink($oldFile);
                 if (@is_file($oldFile)) {
                     $error = 'File ' . $meta['file_name'] . ' could not be deleted.';
                     if ($getFullErrorLogEntry) {
                         $error = array('msg' => $error);
                     }
                 }
             }
             // reindex the file
             $setup = array('recursive' => false, 'doReindexing' => tx_dam::config_checkValueEnabled('setup.indexing.replaceFile.reindexingMode', 2));
             tx_dam::index_process($newFile, $setup);
         }
     } else {
         $error = true;
     }
     if (!$error) {
         $info = array('uid' => $meta['uid'], 'new_file' => $newFile, 'old_file' => $oldFile);
         tx_dam::_callProcessPostTrigger('replaceFile', $info);
     }
     return $error;
 }
 /**
  * Creates a tab menu from an array definition
  *
  * Returns a tab menu for a module
  * Requires the JS function jumpToUrl() to be available
  *
  * @param	mixed		$id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
  * @param	string		$elementName it the form elements name, probably something like "SET[...]"
  * @param	string		$currentValue is the value to be selected currently.
  * @param	array		$menuItems is an array with the menu items for the selector box
  * @param	string		$script is the script to send the &id to, if empty it's automatically found
  * @param	string		$addParams is additional parameters to pass to the script.
  * @return	string		HTML code for tab menu
  */
 function getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addparams = '')
 {
     // read page TSconfig
     $useTabs = tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.useTabs');
     if ($useTabs && is_array($menuItems)) {
         if (!is_array($mainParams)) {
             $mainParams = array('id' => $mainParams);
         }
         $mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
         if (!$script) {
             $script = basename(PATH_thisScript);
         }
         $menuDef = array();
         foreach ($menuItems as $value => $label) {
             $menuDef[$value]['isActive'] = !strcmp($currentValue, $value);
             $menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
             // original: $menuDef[$value]['url'] = htmlspecialchars($script.'?'.$mainParams.$addparams.'&'.$elementName.'='.$value);
             $menuDef[$value]['url'] = $script . '?' . $mainParams . $addparams . '&' . $elementName . '=' . $value;
         }
         $this->content .= $this->doc->getTabMenuRaw($menuDef);
         return '';
     } else {
         return t3lib_BEfunc::getFuncMenu($this->id, $elementName, $currentValue, $menuItems);
     }
 }
    /**
     * Making the formfields for renaming
     *
     * @return	string		HTML content
     */
    function renderForm()
    {
        global $BACK_PATH, $LANG;
        $content = '';
        $msg = array();
        $this->pObj->markers['FOLDER_INFO'] = tx_dam_guiFunc::getFolderInfoBar($this->folder);
        $msg[] = '&nbsp;';
        $msg[] = $LANG->getLL('foldername', 1);
        $msg[] = '<input' . $GLOBALS['SOBE']->doc->formWidth(20) . ' type="text" name="data[new_name]" value="' . htmlspecialchars($this->pObj->data['new_name'] ? $this->pObj->data['new_name'] : $this->folder['dir_name']) . '">';
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            $buttons = '
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_rename.php.submit', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_rename.php.submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        $content .= '<input type="hidden" name="folder" value="' . htmlspecialchars($this->folder['dir_path_absolute']) . '" />';
        return $content;
    }
    /**
     * Rendering the upload file form fields
     *
     * @return	string		HTML content
     */
    function renderForm()
    {
        global $BACK_PATH, $LANG;
        $id = $this->meta['uid'];
        $path = tx_dam::path_makeAbsolute($this->meta['file_path']);
        $content = '';
        $msg = array();
        $this->pObj->markers['FOLDER_INFO'] = '[' . $this->file['file_path'] . ']:' . $this->file['file_name'];
        $msg[] = tx_dam_guiFunc::getRecordInfoHeaderExtra($this->meta);
        $msg[] = '&nbsp;';
        $msg[] = '
				<input type="file" name="upload_' . $id . '"' . $this->pObj->doc->formWidth(35) . ' size="45" />
				<input type="hidden" name="data[upload][' . $id . '][target]" value="' . htmlspecialchars($path) . '" />
				<input type="hidden" name="data[upload][' . $id . '][data]" value="' . $id . '" />';
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            $buttons = '
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_upload.php.submit', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_upload.php.submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        return $content;
    }
    /**
     * Rendering the delete file form for a single item
     *
     * @return	string		HTML content
     */
    function renderFormSingle($id, $meta)
    {
        global $BACK_PATH, $LANG;
        $filepath = tx_dam::file_absolutePath($meta);
        $content = '';
        $this->pObj->markers['FOLDER_INFO'] = 'File: ' . $filepath;
        if ($meta['uid']) {
            $references = tx_dam_db::getMediaUsageReferences($meta['uid']);
            if ($references) {
                $msg = $LANG->getLL('tx_dam_cmd_filedelete.messageReferences', 1);
                $msg .= $GLOBALS['SOBE']->doc->spacer(5);
                // Render the references
                $references = tx_dam_guiFunc::renderReferencesTable($references);
                $references = $GLOBALS['SOBE']->doc->section($LANG->getLL('tx_dam_cmd_filedelete.references', 1), $msg . $references, 0, 0, 0);
            }
        }
        $msg = array();
        $msg[] = tx_dam_guiFunc::getRecordInfoHeaderExtra($meta);
        if ($references) {
            $msg[] = '&nbsp;';
            $msg[] = '<strong><span class="typo3-red">' . $LANG->getLL('labelWarning', 1) . '</span> ' . $LANG->getLL('tx_dam_cmd_filedelete.messageReferencesUsed', 1) . '</strong>';
            $msg[] = $LANG->getLL('tx_dam_cmd_filedelete.messageReferencesDelete', 1);
            $msg[] = $references;
        }
        $msg[] = '&nbsp;';
        $msg[] = $LANG->getLL('tx_dam_cmd_filedelete.message', 1);
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            $buttons = '
				<input type="submit" value="' . $LANG->getLL('tx_dam_cmd_filedelete.submit', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/deletedok.gif') . ' title="' . $LANG->getLL('tx_dam_cmd_filedelete.submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= '<input type="hidden" name="data[delete][' . $id . '][data]" value="' . htmlspecialchars($filepath) . '" />';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        //$content .= $GLOBALS['SOBE']->doc->spacer(5);
        //$content .= $references;
        return $content;
    }
 /**
  * convert/cleans a file name to be more usable as title
  *
  * @param	string		Filename or similar
  * @return	string		Title string
  */
 function makeTitleFromFilename($title)
 {
     if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.useOriginalFilenameAsTitle') && $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dam']['temporaryFilenamesStorage'][$title]) {
         // The title will be an original filename. This info is stored in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dam'] while file uploading process.
         $title = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dam']['temporaryFilenamesStorage'][$title];
     } else {
         $orgTitle = $title;
         $extpos = strrpos($title, '.');
         $title = $extpos ? substr($title, 0, $extpos) : $title;
         // remove extension
         $title = str_replace('_', ' ', $title);
         // Substituting "_" for " " because many filenames may have this instead of a space char.
         $title = str_replace('%20', ' ', $title);
         // studly caps: add spaces
         $title = preg_replace('#([a-z])([A-Z])#', '\\1 \\2', $title);
     }
     if ($this->writeDevLog) {
         t3lib_div::devLog('makeTitleFromFilename(): ' . $orgTitle . ' > ' . $title, 'tx_dam_indexing');
     }
     return $title;
 }
    /**
     * Making the formfields for renaming
     *
     * @return	string		HTML content
     */
    function renderForm()
    {
        global $TCA, $BACK_PATH, $LANG, $TYPO3_CONF_VARS;
        $content = '';
        $msg = array();
        $this->pObj->markers['FOLDER_INFO'] = '[' . $this->file['file_path'] . ']:' . $this->file['file_name'];
        $msg[] = tx_dam_guiFunc::getRecordInfoHeaderExtra($this->meta);
        if ($this->meta['uid']) {
            $msg[] = $this->pObj->getFormInputField('title', $this->meta['title'], 30);
            $msg[] = $this->pObj->getFormInputField('file_name', $this->meta['file_name'], 30);
            $msg[] = $this->pObj->getFormInputField('file_dl_name', $this->meta['file_dl_name'], 30);
        } else {
            $msg[] = $this->pObj->getFormInputField('file_name', $this->meta['file_name'], 30);
        }
        if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
            $buttons = '
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_rename.php.submit', 1) . '" />
				<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
        }
        $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/savedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:file_rename.php.submit', 1) . '" height="16" type="image" width="16">';
        $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
        $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
        return $content;
    }
    /**
     * Making the form for delete
     *
     * @return	string		HTML content
     */
    function renderForm()
    {
        global $BACK_PATH, $LANG, $TYPO3_CONF_VARS;
        $content = '';
        if (!$this->path_isEmpty($this->folder['dir_path_absolute']) and !tx_dam::access_checkFileOperation('deleteFolderRecursively')) {
            $content .= $GLOBALS['SOBE']->getMessageBox($LANG->getLL('actionDenied'), $LANG->getLL('tx_dam_cmd_folderdelete.messageRecursiveDenied', 1), $this->pObj->buttonBack(0), 2);
        } else {
            $msg = array();
            $this->pObj->markers['FOLDER_INFO'] = tx_dam_guiFunc::getFolderInfoBar($this->folder);
            $msg[] = '&nbsp;';
            if (!$this->path_isEmpty($this->folder['dir_path_absolute'])) {
                $msg[] = '<strong><span class="typo3-red">' . $LANG->getLL('labelWarning', 1) . '</span> ' . $LANG->getLL('tx_dam_cmd_folderdelete.messageRecursive', 1) . '</strong>';
            }
            $msg[] = sprintf($LANG->sL('LLL:EXT:lang/locallang_core.xml:mess.delete', 1), $this->folder['dir_path_relative']);
            if (tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.displayExtraButtons', 1)) {
                $buttons = '
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" />
					<input type="submit" value="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" onclick="jumpBack(); return false;" />';
            }
            $this->pObj->docHeaderButtons['SAVE'] = '<input class="c-inputButton" name="_savedok"' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/deletedok.gif') . ' title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:cm.delete', 1) . '" height="16" type="image" width="16">';
            $this->pObj->docHeaderButtons['CLOSE'] = '<a href="#" onclick="jumpBack(); return false;"><img' . t3lib_iconWorks::skinImg($this->pObj->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.cancel', 1) . '" alt="" height="16" width="16"></a>';
            $content .= $GLOBALS['SOBE']->getMessageBox($GLOBALS['SOBE']->pageTitle, $msg, $buttons, 1);
            $content .= '<input type="hidden" name="folder" value="' . $this->folder['dir_path_absolute'] . '" />
					<input type="hidden" name="data[delete_confirmed]" value="1" />';
        }
        if (!$this->path_isEmpty($this->folder['dir_path_absolute'])) {
            $content .= $GLOBALS['SOBE']->doc->spacer(5);
            require_once PATH_txdam . 'lib/class.tx_dam_filebrowser.php';
            $filelist = t3lib_div::makeInstance('tx_dam_filebrowser');
            $filelisting = $filelist->getStaticFolderList($this->folder['dir_path_absolute'], false);
            $content .= $GLOBALS['SOBE']->doc->section($LANG->getLL('folder', 1), $filelisting, 0, 0, 0);
        }
        return $content;
    }
 /**
  * rendering the browsable trees
  *
  * @return	string		tree HTML content
  */
 function getTrees()
 {
     global $LANG, $BACK_PATH;
     $tree = '';
     if (is_array($this->treeObjArr)) {
         foreach ($this->treeObjArr as $classKey => $treeObj) {
             if (tx_dam::config_checkValueEnabled('setup.selections.' . $classKey . '.hidden', false)) {
                 continue;
             }
             if (is_object($treeObj) && method_exists($treeObj, 'getBrowsableTree')) {
                 $tree .= $treeObj->getBrowsableTree();
             }
         }
     }
     return $tree;
 }