Index: typo3/file_list.php
===================================================================
--- typo3/file_list.php (revision 3304)
+++ typo3/file_list.php (working copy)
@@ -58,6 +58,7 @@
require_once (PATH_t3lib.'class.t3lib_extfilefunc.php');
require_once (PATH_t3lib.'class.t3lib_recordlist.php');
require_once (PATH_t3lib.'class.t3lib_clipboard.php');
+require_once (PATH_t3lib.'class.t3lib_parsehtml.php');
require_once ('class.file_list.inc');
$BE_USER->modAccess($MCONF,1);
@@ -166,6 +167,7 @@
// Initialize the template object
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
+ $this->doc->setModuleTemplate('templates/file_list.html');
$this->doc->docType = 'xhtml_trans';
// Validating the input "id" (the path, directory!) and checking it against the mounts of the user.
@@ -176,25 +178,25 @@
if ($access) {
// Create filelisting object
- $filelist = t3lib_div::makeInstance('fileList');
- $filelist->backPath = $BACK_PATH;
- $filelist->thumbs = $this->MOD_SETTINGS['displayThumbs']?1:$BE_USER->uc['thumbnailsByDefault'];
+ $this->filelist = t3lib_div::makeInstance('fileList');
+ $this->filelist->backPath = $BACK_PATH;
+ $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs']?1:$BE_USER->uc['thumbnailsByDefault'];
// Create clipboard object and initialize that
- $filelist->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
- $filelist->clipObj->fileMode=1;
- $filelist->clipObj->initializeClipboard();
+ $this->filelist->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
+ $this->filelist->clipObj->fileMode=1;
+ $this->filelist->clipObj->initializeClipboard();
$CB = t3lib_div::_GET('CB');
- if ($this->cmd=='setCB') $CB['el'] = $filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'),t3lib_div::_POST('CBC')),'_FILE');
+ if ($this->cmd=='setCB') $CB['el'] = $this->filelist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'),t3lib_div::_POST('CBC')),'_FILE');
if (!$this->MOD_SETTINGS['clipBoard']) $CB['setP']='normal';
- $filelist->clipObj->setCmd($CB);
- $filelist->clipObj->cleanCurrent();
- $filelist->clipObj->endClipboard(); // Saves
+ $this->filelist->clipObj->setCmd($CB);
+ $this->filelist->clipObj->cleanCurrent();
+ $this->filelist->clipObj->endClipboard(); // Saves
// If the "cmd" was to delete files from the list (clipboard thing), do that:
if ($this->cmd=='delete') {
- $items = $filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'),'_FILE',1);
+ $items = $this->filelist->clipObj->cleanUpCBC(t3lib_div::_POST('CBC'),'_FILE',1);
if (count($items)) {
// Make command array:
$FILE=array();
@@ -223,16 +225,13 @@
// Start up filelisting object, include settings.
$this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
- $filelist->start($this->id,$this->pointer,$this->MOD_SETTINGS['sort'],$this->MOD_SETTINGS['reverse'],$this->MOD_SETTINGS['clipBoard']);
+ $this->filelist->start($this->id,$this->pointer,$this->MOD_SETTINGS['sort'],$this->MOD_SETTINGS['reverse'],$this->MOD_SETTINGS['clipBoard']);
- // Write the header
- $filelist->writeTop($this->id);
-
// Generate the list
- $filelist->generateList();
+ $this->filelist->generateList();
// Write the footer
- $filelist->writeBottom();
+ $this->filelist->writeBottom();
// Set top JavaScript:
$this->doc->JScode=$this->doc->wrapScriptTags('
@@ -242,88 +241,78 @@
window.location.href = URL;
}
- '.$filelist->CBfunctions() // ... and add clipboard JavaScript functions
+ '.$this->filelist->CBfunctions() // ... and add clipboard JavaScript functions
);
// This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
$this->doc->getContextMenuCode();
+ // Setting up the buttons and markers for docheader
+ list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->id);
+
+ // add the folder info to the marker array
+ $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
+
+ $docHeaderButtons = array_merge($this->getButtons(), $buttons);
+
+ // Build the
for the module
+ $this->content = $this->doc->startPage('Template Tools');
// Create output
- $this->content='';
- $this->content.=$this->doc->startPage($LANG->getLL('files'));
- $this->content.= '';
-
- // FileList Module CSH:
- $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'],'
|');
-
- $this->content.='
-
-
- ';
-
- if ($filelist->HTMLcode) { // Making listing options:
-
- $this->content.='
-
+ $pageContent='';
+ $pageContent.=$this->doc->startPage($LANG->getLL('files'));
+ $pageContent.= '';
+
+
+ if ($this->filelist->HTMLcode) { // Making listing options:
+
+ $pageContent.='
+
';
-
+
// Add "display thumbnails" checkbox:
- $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[displayThumbs]',$this->MOD_SETTINGS['displayThumbs'],'file_list.php','','id="checkDisplayThumbs"').'
';
-
+ $pageContent.=t3lib_BEfunc::getFuncCheck($this->id,'SET[displayThumbs]',$this->MOD_SETTINGS['displayThumbs'],'file_list.php','','id="checkDisplayThumbs"').'
';
+
// Add clipboard button
- $this->content.=t3lib_BEfunc::getFuncCheck($this->id,'SET[clipBoard]',$this->MOD_SETTINGS['clipBoard'],'file_list.php','','id="checkClipBoard"').' ';
-
- $this->content.='
+ $pageContent.=t3lib_BEfunc::getFuncCheck($this->id,'SET[clipBoard]',$this->MOD_SETTINGS['clipBoard'],'file_list.php','','id="checkClipBoard"').' ';
+
+ $pageContent.='
';
- $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_options', $GLOBALS['BACK_PATH']);
-
-
+
+
// Set clipboard:
if ($this->MOD_SETTINGS['clipBoard']) {
- $this->content.=$filelist->clipObj->printClipboard();
- $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
+ $pageContent.=$this->filelist->clipObj->printClipboard();
+ $pageContent.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
}
}
+
+ $markerArray = array(
+ 'CSH' => $docHeaderButtons['csh'],
+ 'FUNC_MENU' => t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']),
+ 'CONTENT' => $pageContent
+ );
- // Add shortcut
- if ($BE_USER->mayMakeShortcut()) {
- $this->content.='
'.$this->doc->makeShortcutIcon('pointer,id,target,table',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']);
- }
+ $this->content.= $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers));
+ $this->content.= $this->doc->endPage();
+ $this->content = $this->doc->insertStylesAndJS($this->content);
+
} else {
// Create output - no access (no warning though)
- $this->content='';
- $this->content.=$this->doc->startPage($LANG->getLL('files'));
+ $this->content = '';
+ $this->content .= $this->doc->startPage($LANG->getLL('files'));
+ $this->content .= $this->doc->endPage();
+ $this->content = $this->doc->insertStylesAndJS($this->content);
}
+
}
/**
@@ -332,10 +321,42 @@
* @return void
*/
function printContent() {
- $this->content.= $this->doc->endPage();
- $this->content = $this->doc->insertStylesAndJS($this->content);
echo $this->content;
}
+
+ /**
+ * Create the panel of buttons for submitting the form or otherwise perform operations.
+ *
+ * @return array all available buttons as an assoc. array
+ */
+ function getButtons() {
+ global $TCA, $LANG, $BACK_PATH, $BE_USER;
+
+ $buttons = array(
+ 'csh' => '',
+ 'shortcut' => '',
+ 'upload' => '',
+ 'new' => '',
+ );
+
+ // Add shortcut
+ if ($BE_USER->mayMakeShortcut()) {
+ $buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']);
+ }
+
+ // FileList Module CSH:
+ $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH']);
+
+ // upload button
+ $theIcon = 'backPath,'gfx/upload.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.upload',1)).'" alt="" />';
+ $buttons['upload'] = ''.$theIcon.'';
+
+ $theIcon = 'backPath,'gfx/new_file.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:cm.new',1)).'" alt="" />';
+ $buttons['new'] = ''.$theIcon.'';
+
+ return $buttons;
+ }
+
}
// Include extension?
Index: typo3/class.file_list.inc
===================================================================
--- typo3/class.file_list.inc (revision 3304)
+++ typo3/class.file_list.inc (working copy)
@@ -140,58 +140,57 @@
}
/**
- * Make the top of the list
+ * Return the buttons used by the file list to include in the top header
*
- * @param string The path to list.
- * @return void
+ * @return array
*/
- function writeTop($path) {
+ function getButtonsAndOtherMarkers($path) {
+
// Makes the code for the foldericon in the top
$path = $GLOBALS['SOBE']->basicFF->is_directory($path); // Cleaning name...
if ($path) {
- $out='';
+ $otherMarkers = array(
+ 'PAGE_ICON' => '',
+ 'TITLE' => '',
+ );
+
+ $buttons = array(
+ 'level_up' => '',
+ 'refresh' => '',
+ 'title' => '',
+ 'page_icon' => '',
+ );
+
$theFile = $GLOBALS['SOBE']->basicFF->getTotalFileInfo($path);
- $root = $GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($theFile['path']);
- $titleCol='path';
- $this->fieldArray = Array($titleCol,'up');
list($title,$icon,$path) = $this->dirData($theFile);
// Start compiling the HTML
- $theData = Array();
- $theData[$titleCol] = $this->widthGif;
-
$title = $GLOBALS['SOBE']->basicFF->blindPath($path);
- $theData['up']=''.
- 'backPath,'gfx/refresh_n.gif','width="14" height="14"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload',1).'" alt="" />'.
- '';
- if ($root) {
+ // if this is some subpage under the mount root....
+ if ($GLOBALS['SOBE']->basicFF->checkPathAgainstMounts($theFile['path'])) {
// The icon with link
- $theIcon = 'backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
- if ($this->clickMenus) $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
+ $otherMarkers['PAGE_ICON'] = 'backPath,$icon,'width="18" height="16"').' title="'.htmlspecialchars($theFile['file']).'" alt="" />';
+ if ($this->clickMenus) $otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'],$path);
- $theData[$titleCol].='
'.t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)); // No HTML specialchars here - HTML like is allowed
- $theData['up'].=$this->linkWrapDir('backPath,'gfx/i/folder_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />',$theFile['path']);
+ $buttons['level_up'] .= $this->linkWrapDir('backPath,'gfx/i/folder_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />',$theFile['path']);
+ $otherMarkers['TITLE'] .= t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)); // No HTML specialchars here - HTML like is allowed
+
+ // this is the root page
} else {
- // root:0
- $theIcon='backPath,'gfx/i/_icon_ftp.gif','width="18" height="16"').' alt="" />';
- $theData[$titleCol].='
'.htmlspecialchars(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
+ $otherMarkers['PAGE_ICON'] = 'backPath,'gfx/i/_icon_ftp.gif','width="18" height="16"').' alt="" />';
+ if ($this->clickMenus) $otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'],$path);
+ $otherMarkers['TITLE'] .= htmlspecialchars(t3lib_div::fixed_lgd_cs($title,-($this->fixedL+20)));
}
-
- // Adding top element
- $out.=$this->addelement(1,'',$theData,'','',$theIcon);
-
- $this->HTMLcode.='
-
-
- ';
}
+
+ $buttons['refresh'] = ''.
+ 'backPath,'gfx/refresh_n.gif','width="14" height="14"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.reload',1).'" alt="" />'.
+ '';
+
+ return array($buttons, $otherMarkers);
}
/**
@@ -276,9 +275,6 @@
$out.=$iOut;
// half line is drawn
- $theData = Array();
- $theData[$titleCol] = $this->counter.' File(s), '.t3lib_div::formatSize($this->totalbytes).'bytes';
- $out.=$this->addelement(1,'',$theData);
// finish
return '
@@ -293,6 +289,20 @@
}
/**
+ * Gets the number of files and total size of a folder
+ *
+ * @return string
+ **/
+ function getFolderInfo() {
+ if($this->counter == 1) {
+ $fileLabel = 'File';
+ } else {
+ $fileLabel = 'Files';
+ }
+ return $this->counter.' '.$fileLabel.', '.t3lib_div::formatSize($this->totalbytes).'bytes';
+ }
+
+ /**
* This returns tablerows for the directories in the array $items['sorting'].
*
* @param array Directory items
Index: typo3/file_rename.php
===================================================================
--- typo3/file_rename.php (revision 3304)
+++ typo3/file_rename.php (working copy)
@@ -53,6 +53,7 @@
require('init.php');
require('template.php');
require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
+require_once(PATH_t3lib.'class.t3lib_parsehtml.php');
@@ -63,7 +64,6 @@
-
/**
* Script Class for the rename-file form.
*
@@ -134,17 +134,19 @@
default: $this->icon = 'gfx/i/_icon_ftp.gif'; break;
}
+ $this->icon = 'backPath,$this->icon,'width="18" height="16"').' title="" alt="" />';
+
// Relative path to filemount, $key:
$this->shortPath = substr($this->target,strlen($GLOBALS['FILEMOUNTS'][$key]['path']));
// Setting title:
- $this->title = $GLOBALS['FILEMOUNTS'][$key]['name'].': '.$this->shortPath;
+ $this->title = $this->icon.$GLOBALS['FILEMOUNTS'][$key]['name'].': '.$this->shortPath;
// Setting template object
- $this->doc = t3lib_div::makeInstance('smallDoc');
+ $this->doc = t3lib_div::makeInstance('template');
$this->doc->docType = 'xhtml_trans';
+ $this->doc->setModuleTemplate('templates/file_rename.html');
$this->doc->backPath = $BACK_PATH;
- $this->doc->form='