Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
The file manager showed a toggle button even if there were no valid f…
Browse files Browse the repository at this point in the history
…iles (#1993)
  • Loading branch information
leofeyer committed May 22, 2010
1 parent 0845798 commit f594ba4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions contao-2.9/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Version 2.9.RC1 (2010--)
- Fixed: check the table names during import to prevent data injections (#1978)
- Fixed: the theme importer did not strip special characters from the file name (#1974)
- Fixed: the Encryption class did not handle empty strings (#2004)
- Fixed: the file manager showed a toggle button even if there were no valid files (#1993)
- Fixed a few minor issues

Version 2.9.beta1 (2010-05-17)
Expand Down
26 changes: 24 additions & 2 deletions contao-2.9/system/drivers/DC_Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1625,11 +1625,33 @@ protected function generateTree($path, $intMargin, $mount=false, $blnProtected=f

$md5 = md5($folders[$f]);
$content = scan($folders[$f]);
$countFiles = count($content);
$folderAttribute = 'style="margin-left:20px;"';
$currentFolder = str_replace(TL_ROOT.'/', '', $folders[$f]);
$session['filetree'][$md5] = is_numeric($session['filetree'][$md5]) ? $session['filetree'][$md5] : 0;
$currentEncoded = $this->urlEncode($currentFolder);
$countFiles = count($content);

// Subtract files that will not be shown
if (!empty($this->arrValidFileTypes))
{
foreach ($content as $file)
{
// Folders
if (is_dir($folders[$f] .'/'. $file))
{
if ($file == '.svn')
{
--$countFiles;
}
}

// Files
elseif (!in_array(strtolower(substr($file, (strrpos($file, '.') + 1))), $this->arrValidFileTypes))
{
--$countFiles;
}
}
}

// Add a toggle button if there are childs
if ($countFiles > 0)
Expand Down Expand Up @@ -1662,7 +1684,7 @@ protected function generateTree($path, $intMargin, $mount=false, $blnProtected=f
$return .= '</div><div style="clear:both;"></div></li>';

// Call next node
if ($countFiles > 0 && $session['filetree'][$md5] == 1)
if (count($content) > 0 && $session['filetree'][$md5] == 1)
{
$return .= '<li class="parent" id="filetree_'.$md5.'"><ul class="level_'.$level.'">';
$return .= $this->generateTree($folders[$f], ($intMargin + $intSpacing), false, $protected, $arrClipboard);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$GLOBALS['TL_LANG']['tl_theme']['checking_theme'] = 'Die Theme-Daten werden überprüft';
$GLOBALS['TL_LANG']['tl_theme']['tables_fields'] = 'Tabellen und Felder';
$GLOBALS['TL_LANG']['tl_theme']['missing_field'] = 'Das Feld <strong>%s</strong> fehlt in der Datenbank und wird daher nicht importiert.';
$GLOBALS['TL_LANG']['tl_theme']['tables_checked'] = 'Die Prüfung der Tabellen war erfolgreich.';
$GLOBALS['TL_LANG']['tl_theme']['tables_ok'] = 'Die Prüfung der Tabellen war erfolgreich.';
$GLOBALS['TL_LANG']['tl_theme']['custom_sections'] = 'Eigene Layoutbereiche';
$GLOBALS['TL_LANG']['tl_theme']['missing_section'] = 'Der Layoutbereich <strong>%s</strong> ist in den Backend-Einstellungen nicht definiert.';
$GLOBALS['TL_LANG']['tl_theme']['sections_ok'] = 'Das Theme enthält keine eigenen Layoutbereiche.';
Expand Down

0 comments on commit f594ba4

Please sign in to comment.