<?php

$sRootPathModule = 'Application/module';
$sRootPathPlugin = 'Application/plugin';
//generation
$sRootPages = 'Public/Application/pages';
$tLang = array('fr', 'en');
$tNavBrut = array('index' => array('Accueil', 'Home'), 'normal_list_1' => array('Modules pour Applications "Normales"', 'Normal compatibles extensions'), 'plugin_list_1' => array('Plugins', 'Plugins'));
$tNav = array();
foreach ($tNavBrut as $key => $tLabel) {
    $tNav['fr'][$key] = $tLabel[0];
    $tNav['en'][$key] = $tLabel[1];
}
//page accueil
$tContent = array('fr' => 'Bienvenue sur le market mkframework, ici vous pourrez ajouter de nouveaux modules &agrave; votre application.', 'en' => 'welcome to the mkframework market. There you should install new module for your application.');
Page::$sRootPages = $sRootPages;
foreach ($tLang as $lang) {
    $oPageAccueil = new Page();
    $oPageAccueil->name = 'index';
    $oPageAccueil->type = 'content';
    $oPageAccueil->content = $tContent[$lang];
    $oPageAccueil->tNav = $tNav[$lang];
    $oPageAccueil->save($lang);
}
//---modules
$tType = array('all', 'normal', 'bootstrap');
foreach ($tType as $sType) {
    $sPathModule = $sRootPathModule . '/' . $sType;
    $tData = array();
    $tModulesAll = scandir($sPathModule);
    foreach ($tModulesAll as $sModule) {