<?php


   
require 'template/header.php';
require 'library/folders.php';

if (strlen($_POST['folder']) < 2)
{
	echo $translate->__('<p>You must enter Directory Location.</p>');
	exit();
}

?>


<h1><?php $translate->__('Checking default directories'); ?></h1>

<?php

$error = 0;

echo '<ul id="check-default-folders">';

while (list($k, $v) = each($writable_folders))
{
	$dir = $_POST['folder'] . '/' . $k;
	
	$class = '';
	
	if (! is_writable($dir))
	{
		$status = '<font color=\'red\'><B>'. $translate->__('Error').'</B></font><!--  $dir  -->';
		$class = " class=\"error\"";
		$error = 1;
	}
	else
	{
		$status = '<font color=\'green\'><B>'. $translate->__('Success').'</B></font>';
	}
	
	echo '<li' . $class . '>'; $translate->__('Set permission for '); echo '' . $v . ' <b>' . $k . '</b>'; $translate->__(' to 777'); echo '  ' . $status . '</li>';
}

echo '</ul>';

if ($error == 1)
{
	echo "<form method='POST' action=''>
		<input type='submit' class='install_it' name='submit' value='"; $translate->__('check Again'); echo " '>
		<input type='hidden' name='folder' value='{$_POST['folder']}'>
		</form>";
}
else
{
	echo "<form method='POST' action='./step2.php?lang";echo $output;echo"'>
		<input type='submit' class='install_it' name='submit' value='"; $translate->__('Next');echo "'>
		<input type='hidden' name='folder' value='{$_POST['folder']}'>
		</form>";
}

require './template/footer.php';
