".FR_LAN_2." |
";
$text .= "
";
}
$text .= "";
if ($_POST['type'] == 'tree')
{
$text .= "".FR_LAN_3." |
root_dir))."')\">
| ";
}
else
{
$text .= "".FR_LAN_3." | ";
}
if ($_POST['core'] != 'none')
{
$text .= " ".FR_LAN_4.": ".($this -> count['core']['num'] ? $this -> count['core']['num'] : FR_LAN_21)." |
".$this -> parsesize($this -> count['core']['size'], 2)." | ";
}
if ($_POST['missing']) {
$text .= " ".FR_LAN_22.": ".($this -> count['missing']['num'] ? $this -> count['missing']['num'] : FR_LAN_21)." | ";
}
if ($_POST['noncore']) {
$text .= " ".FR_LAN_5.": ".($this -> count['unknown']['num'] ? $this -> count['unknown']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['unknown']['size'], 2)." | ";
}
if ($_POST['oldcore']) {
$text .= " ".FR_LAN_24.": ".($this -> count['deprecated']['num'] ? $this -> count['deprecated']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['deprecated']['size'], 2)." | ";
}
if ($_POST['core'] == 'all') {
$text .= " ".FR_LAN_6.": ".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])." | ".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)." | ";
}
if ($this -> count['warning']['num'])
{
$text .= " | ";
$text .= "
".FR_LAN_26." | ";
$text .= " ".FR_LAN_28.": ".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['warning']['size'], 2)." | ";
$text .= " ".FR_LAN_27." | ";
}
if ($_POST['integrity'] && $_POST['core'] != 'none')
{
$integrity_icon = $this -> count['fail']['num'] ? 'integrity_fail.png' : 'integrity_pass.png';
$integrity_text = $this -> count['fail']['num'] ? '( '.$this -> count['fail']['num'].' '.FR_LAN_19.' )' : '( '.FR_LAN_20.' )';
$text .= " | ";
$text .= "".FR_LAN_7." ".$integrity_text." | ";
$text .= " ".FR_LAN_8.": ".($this -> count['pass']['num'] ? $this -> count['pass']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['pass']['size'], 2)." | ";
$text .= " ".FR_LAN_9.": ".($this -> count['fail']['num'] ? $this -> count['fail']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['fail']['size'], 2)." | ";
$text .= " ".FR_LAN_25.": ".($this -> count['uncalculable']['num'] ? $this -> count['uncalculable']['num'] : FR_LAN_21)." | ".$this -> parsesize($this -> count['uncalculable']['size'], 2)." | ";
$text .= " | ";
$text .= " ".FR_LAN_10.": | ";
$text .= "
| ";
}
if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex'])
{
$text .= "
".FR_LAN_23." | ";
}
$text .= " ";
if ($_POST['type'] != 'tree')
{
$text .= "
|
";
if (!$this -> results && $_POST['regex']) {
$text .= "".FR_LAN_23." | ";
}
}
foreach ($this -> files as $dir_id => $fid)
{
// $this->sendProgress($cnt,$this->totalFiles,$path);
ksort($fid);
$text .= ($_POST['type'] == 'tree') ? "" : "";
$initial = FALSE;
foreach ($fid as $key => $stext) {
if (!$initial) {
if ($_POST['type'] == 'tree') {
$text .= "
".($stext['level'] ? " .." : "")." |
 | ";
}
} else {
if ($_POST['type'] != 'tree') {
$stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']);
}
$text .= "
".$stext['file']." ";
if ($_POST['regex']) {
if ($_POST['num'] || $_POST['line']) {
$text .= " ";
}
foreach ($stext['lines'] as $rkey => $rvalue) {
if ($_POST['num']) {
$text .= "[".($rkey + 1)."] ";
}
if ($_POST['line']) {
$text .= htmlspecialchars($rvalue)." ";
}
}
$text .= " ";
} else {
$text .= " |
".$this -> parsesize($stext['size']);
}
$text .= " | ";
}
$initial = TRUE;
}
$text .= ($_POST['type'] == 'tree') ? " " : "";
}
if ($_POST['type'] != 'tree') {
$text .= "
";
}
$text .= " |
";
$text .= "
";
echo $text;
//$ns -> tablerender(FR_LAN_1.'...', $text);
}
function create_image($dir) {
global $core_image, $deprecated_image,$coredir;
foreach ($coredir as $trim_key => $trim_dirs) {
$search[$trim_key] = "'".$trim_dirs."'";
$replace[$trim_key] = "\$coredir['".$trim_key."']";
}
$data = " scan($dir) : $core_image;
$image_array = var_export($scan_current, true);
$image_array = str_replace($search, $replace, $image_array);
$data .= "\$core_image = ".$image_array.";\n\n";
$scan_deprecated = ($_POST['snaptype'] == 'deprecated') ? $this -> scan($dir, $core_image) : $deprecated_image;
$image_array = var_export($scan_deprecated, true);
$image_array = str_replace($search, $replace, $image_array);
$data .= "\$deprecated_image = ".$image_array.";\n\n";
$data .= "?>";
$fp = fopen(e_ADMIN.'core_image.php', 'w');
fwrite($fp, $data);
}
function snapshot_interface()
{
$ns = e107::getRender();
$frm = e107::getRender();
$text = "";
if (isset($_POST['create_snapshot']))
{
$this -> create_image($_POST['snapshot_path']);
$text = "
";
}
$text .= "
";
$ns -> tablerender('Snapshot', $text);
}
function checksum($filename)
{
$checksum = md5(str_replace(array(chr(13),chr(10)), "", file_get_contents($filename)));
return $checksum;
}
function parsesize($size, $dec = 0) {
$size = $size ? $size : 0;
$kb = 1024;
$mb = 1024 * $kb;
$gb = 1024 * $mb;
$tb = 1024 * $gb;
if ($size < $kb) {
return $size." b";
} else if($size < $mb) {
return round($size/$kb)." kb";
} else if($size < $gb) {
return round($size/$mb, $dec)." mb";
} else if($size < $tb) {
return round($size/$gb, $dec)." gb";
} else {
return round($size/$tb, $dec)." tb";
}
}
function regex_match($file) {
$file_content = file_get_contents($file);
$match = preg_match($_POST['regex'], $file_content);
return $match;
}
function sendProgress($rand,$total,$diz)
{
if($this->progress_units <40 && ($rand != $total))
{
$this->progress_units++;
return;
}
else
{
$this->progress_units = 0;
}
$inc = round(($rand / $total) * 100);
if($inc == 0)
{
return;
}
echo "
";
$active = "active";
if($inc >= 100)
{
$inc = 100;
$active = "";
}
echo '
';
// exit;
/*
echo "
";
*/
echo "
".$diz."
";
if($total > 0)
{
echo "
".$inc ."%
";
}
echo "
";
}
function exploit_interface()
{
// global $ns;
$ns = e107::getRender();
$query = http_build_query($_POST);
$text = "
";
$ns -> tablerender(FR_LAN_1, $text);
}
function headerCss()
{
$pref = e107::getPref();
echo "\n";
$e_js = e107::getJs();
// Core CSS - XXX awaiting for path changes
if (!isset($no_core_css) || !$no_core_css)
{
//echo "
\n";
$e_js->otherCSS('{e_WEB_CSS}e107.css');
}
if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss'])
{
$css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss'];
//echo "
\n";
$e_js->themeCSS($css_file);
}
elseif (isset($pref['themecss']) && $pref['themecss'])
{
$css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? 'admin_'.$pref['themecss'] : $pref['themecss'];
//echo "
\n";
$e_js->themeCSS($css_file);
}
else
{
$css_file = file_exists(THEME.'admin_style.css') ? 'admin_style.css' : 'style.css';
//echo "
\n";
$e_js->themeCSS($css_file);
}
$e_js->renderJs('other_css', false, 'css', false);
echo "\n\n";
// Core CSS
$e_js->renderJs('core_css', false, 'css', false);
echo "\n\n";
// Plugin CSS
$e_js->renderJs('plugin_css', false, 'css', false);
echo "\n\n";
// Theme CSS
//echo "\n";
$e_js->renderJs('theme_css', false, 'css', false);
echo "\n\n";
// Inline CSS - not sure if this should stay at all!
$e_js->renderJs('inline_css', false, 'css', false);
echo "\n\n";
/*
echo "\n";
if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) {
$css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss'];
echo "
\n";
} else if (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss']))
{
$css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss'];
echo "
\n";
}
else
{
$css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css';
echo "
\n";
}
if (!isset($no_core_css) || !$no_core_css) {
echo "
\n";
}
* */
}
}
function fileinspector_adminmenu() //FIXME - has problems when navigation is on the LEFT instead of the right.
{
$var['setup']['text'] = "Setup";
$var['setup']['link'] = e_SELF."?mode=setup";
$var['run']['text'] = "Results";
$var['run']['link'] = e_SELF."?mode=run";
e107::getNav()->admin(FC_LAN_1, $_GET['mode'], $var);
}
require_once(e_ADMIN.'footer.php');
function headerjs() {
global $e107;
$text = "
\n";
return $text;
}
?>