function testThis2($dir, $id = 0, $hide = false) { global $mod_strings; $path = $dir; $dh = opendir($dir); rewinddir($dh); $doHide = $hide ? 'none' : ''; $out = "<div id='{$id}' style='display:{$doHide};'>"; $out .= "<table cellpadding='1' cellspacing='0' style='border:0px solid #ccc'>\n"; while ($file = readdir($dh)) { if ($file == '.' || $file == '..' || $file == 'CVS' || $file == '.cvsignore') { continue; } if (is_dir($path . '/' . $file)) { $file = $path . '/' . $file; $newI = create_guid(); $out .= "<tr><td valign='top'><a href='javascript:toggleNwFiles(\"{$newI}\");'>" . SugarThemeRegistry::current()->getImage("Workflow", "", null, null, ".gif", $mod_strings['LBL_WORKFLOW']) . "</a></td>\n"; $out .= "<td valign='top'><b><a href='javascript:toggleNwFiles(\"{$newI}\");'>" . basename($file) . "</a></b></td></tr>"; $out .= "<tr><td></td><td valign='top'>" . testThis2($file, $newI, true) . "</td></tr>"; } else { $out .= "<tr><td valign='top'> </td>\n"; $out .= "<td valign='top'>" . basename($file) . "</td></tr>"; } } $out .= "</tr></table>"; $out .= "</div>"; closedir($dh); return $out; }
function testThis2($dir, $id = 0, $hide = false) { $path = $dir; $dh = opendir($dir); rewinddir($dh); $doHide = $hide ? 'none' : ''; $out = "<div id='{$id}' style='display:{$doHide};'>"; $out .= "<table cellpadding='1' cellspacing='0' border='0' style='border:0px solid #ccc'>\n"; while ($file = readdir($dh)) { if ($file == '.' || $file == '..' || $file == 'CVS' || $file == '.cvsignore') { continue; } if (is_dir($path . '/' . $file)) { $file = $path . '/' . $file; $newI = create_guid(); $out .= "<tr><td valign='top'><a href='javascript:toggleNwFiles(\"{$newI}\");'><img border='0' src='themes/Sugar/images/Workflow.gif'></a></td>\n"; $out .= "<td valign='top'><b><a href='javascript:toggleNwFiles(\"{$newI}\");'>" . basename($file) . "</a></b></td></tr>"; $out .= "<tr><td></td><td valign='top'>" . testThis2($file, $newI, true) . "</td></tr>"; } else { $out .= "<tr><td valign='top'> </td>\n"; $out .= "<td valign='top'>" . basename($file) . "</td></tr>"; } } $out .= "</tr></table>"; $out .= "</div>"; closedir($dh); return $out; }