<?php
/**
 *
 * @package Legacy
 * @version $Id: install_mainfile.inc.php,v 1.1.2.1.2.1 2006/12/16 14:10:30 nobunobu Exp $
 * @copyright Copyright 2005, 2006 XOOPSCube.org <http://xoopscube.org/> 
 * @license http://www.gnu.org/licenses/gpl.txt GNU GENERAL PUBLIC LICENSE Version 2
 *
 */
    // checking XOOPS_ROOT_PATH and XOOPS_URL
    include_once '../mainfile.php';

    $detected = str_replace('\\', '/', getcwd()); // "
    $detected = str_replace('/install', "", $detected);
    if ( substr($detected, -1) == '/' ) {
        $detected = substr($detected, 0, -1);
    }

    if (empty($detected)){
        $wizard->addArray('checks', _NGIMG._INSTALL_L95);
    } elseif ( XOOPS_ROOT_PATH != $detected ) {
        $wizard->addArray('checks', _NGIMG.sprintf(_INSTALL_L96,$detected));
    } else {
        $wizard->addArray('checks', _OKIMG._INSTALL_L97);
    }

    if(!is_dir(XOOPS_ROOT_PATH)){
        $wizard->addArray('checks', _NGIMG._INSTALL_L99);
    }

    if(preg_match('/^http[s]?:\/\/(.*)[^\/]+$/i',XOOPS_URL)){
        $wizard->addArray('checks', _OKIMG._INSTALL_L100);
    }else{
        $wizard->addArray('checks', _NGIMG._INSTALL_L101);
    }

    $wizard->render('install_mainfile.tpl.php');
?>
