phpDocumentor lodel-install
[ class tree: lodel-install ] [ index: lodel-install ] [ all elements ]

Source for file generatelang.php

Documentation is available at generatelang.php

  1. <?php
  2. /**
  3.  * Fichier utilitaire pour la génération des fichiers de traductions
  4.  *
  5.  * Ce script est ŕ lancer en ligne de commande
  6.  *
  7.  * PHP versions 4 et 5
  8.  *
  9.  * LODEL - Logiciel d'Edition ELectronique.
  10.  *
  11.  * Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
  12.  * Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  13.  * Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  14.  * Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  15.  * Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  16.  * Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  17.  *
  18.  * Home page: http://www.lodel.org
  19.  *
  20.  * E-Mail: lodel@lodel.org
  21.  *
  22.  * All Rights Reserved
  23.  *
  24.  * This program is free software; you can redistribute it and/or modify
  25.  * it under the terms of the GNU General Public License as published by
  26.  * the Free Software Foundation; either version 2 of the License, or
  27.  * (at your option) any later version.
  28.  *
  29.  * This program is distributed in the hope that it will be useful,
  30.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  31.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  32.  * GNU General Public License for more details.
  33.  *
  34.  * You should have received a copy of the GNU General Public License
  35.  * along with this program; if not, write to the Free Software
  36.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  37.  *
  38.  * @author Ghislain Picard
  39.  * @author Jean Lamy
  40.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  41.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  42.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  43.  * @licence http://www.gnu.org/copyleft/gpl.html
  44.  * @version CVS:$Id:
  45.  * @package lodel/install
  46.  */
  47.  
  48.  
  49. require 'lodelconfig.php';
  50. require 'connect.php';
  51. require 'func.php';
  52.  
  53. $files array("install.php",
  54.          "tpl/install-admin.html",
  55.          "tpl/install-bienvenue.html",
  56.          "tpl/install-closehtml.html",
  57.          "tpl/install-database.html",
  58.          "tpl/install-fin.html",
  59.          "tpl/install-home.html",
  60.          "tpl/install-htaccess.html",
  61.          "tpl/install-lodelconfig.html",
  62.          "tpl/install-mysql.html",
  63.          "tpl/install-openhtml.html",
  64.          "tpl/install-options.html",
  65.          "tpl/install-php.html",
  66.          "tpl/install-plateform.html",
  67.          "tpl/install-servoo.html",
  68.          "tpl/install-showlodelconfig.html");
  69.  
  70.  
  71. // look for the files and create the tags
  72. $GLOBALS['lodeluser']['admin']   true;
  73. $GLOBALS['lodeluser']['visitor'true;
  74. $GLOBALS['lodeluser']['rights']  128;
  75.  
  76. foreach($files as $file{
  77.     $text file_get_contents($file);
  78.     preg_match_all("/\[@(\w+\.\w+)(|sprintf\(([^\]]+)\))?\]/"$text$resultsPREG_PATTERN_ORDER);
  79.     foreach($results[1as $tag{
  80.         list($group,$name)=explode("."strtolower($tag));
  81.         getlodeltext($name$group$id$contents$status$lang '--');
  82.     }
  83. }
  84.  
  85. $dao &getDAO('translations');
  86. $daotexts &getDAO('texts');
  87.  
  88. require 'view.php';
  89.  
  90. $vos $dao->findMany("textgroups='interface'");
  91. print_R($vos);
  92. foreach($vos as $vo{
  93.     $texts $daotexts->findMany("textgroup='install' AND lang='".$vo->lang."'");
  94.     if (!$textscontinue;
  95.     echo $vo->lang,"\n";
  96.     $tags array();
  97.     foreach($texts as $text{
  98.         $tags[]=$text->textgroup.".".$text->name;
  99.     }
  100.     generateLangCache($vo->lang,"tpl/install-lang-".$vo->lang.".html",$tags);
  101. }
  102.  
  103. ?>

Documentation generated on Thu, 19 Jun 2008 05:07:48 +0200 by phpDocumentor 1.4.0a2