Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 2001-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * All rights reserved 00007 * 00008 * This script is part of the TYPO3 project. The TYPO3 project is 00009 * free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * The GNU General Public License can be found at 00015 * http://www.gnu.org/copyleft/gpl.html. 00016 * A copy is found in the textfile GPL.txt and important notices to the license 00017 * from the author is found in LICENSE.txt distributed with these scripts. 00018 * 00019 * 00020 * This script is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * This copyright notice MUST APPEAR in all copies of the script! 00026 ***************************************************************/ 00033 require_once(t3lib_extMgm::extPath("kickstarter")."class.tx_kickstarter_sectionbase.php"); 00034 00035 class tx_kickstarter_compilefiles extends tx_kickstarter_sectionbase { 00036 00037 // Internal: 00038 var $fileArray=array(); 00039 var $ext_tables=array(); 00040 var $ext_tca=array(); 00041 var $ext_tables_sql=array(); 00042 var $ext_localconf=array(); 00043 var $ext_locallang=array(); 00044 var $ext_locallang_db=array(); 00045 00046 var $extKey=""; 00047 00048 var $charMaxLng = 2; // Varchars are created instead of chars when over this length. 00049 00050 00051 function makeFilesArray($extKey) { 00052 00053 $this->ext_localconf=array(); 00054 $this->ext_tables=array(); 00055 $this->fileArray=array(); 00056 00057 00058 00059 /* 00060 if (is_array($this->wizArray["tables"])) { 00061 reset($this->wizArray["tables"]); 00062 while(list($k,$config)=each($this->wizArray["tables"])) { 00063 $this->renderExtPart_tables($k,$config,$extKey); 00064 } 00065 } 00066 */ 00067 00068 foreach($this->wizArray as $catID=>$catData) { 00069 if($this->sections[$catID]) { 00070 $path = t3lib_div::getFileAbsFileName($this->sections[$catID]['filepath']); 00071 if(is_file($path)) { 00072 require_once($path); 00073 $section = t3lib_div::makeInstance($this->sections[$catID]['classname']); 00074 $section->wizard = &$this; 00075 00076 foreach($catData as $k=>$config) { 00077 $section->render_extPart($k,$config,$extKey); 00078 } 00079 } 00080 } 00081 } 00082 00083 00084 00085 /* 00086 if (is_array($this->wizArray["pi"])) { 00087 reset($this->wizArray["pi"]); 00088 while(list($k,$config)=each($this->wizArray["pi"])) { 00089 $this->renderExtPart_PI($k,$config,$extKey); 00090 $this->EM_CONF_presets["clearCacheOnLoad"]=1; 00091 } 00092 $this->EM_CONF_presets["dependencies"][]="cms"; 00093 } 00094 */ 00095 00096 if (is_array($this->wizArray["sv"])) { 00097 reset($this->wizArray["sv"]); 00098 while(list($k,$config)=each($this->wizArray["sv"])) { 00099 $this->EM_CONF_presets["clearCacheOnLoad"]=1; 00100 } 00101 } 00102 00103 // Write the ext_localconf.php file: 00104 if (count($this->ext_localconf)) { 00105 $this->addFileToFileArray("ext_localconf.php",trim($this->wrapBody(" 00106 <?php 00107 if (!defined ('TYPO3_MODE')) die ('Access denied.'); 00108 ", 00109 implode(chr(10),$this->ext_localconf), 00110 "?> 00111 ",0))); 00112 } 00113 // Write the ext_tables.php file: 00114 if (count($this->ext_tables)) { 00115 $this->addFileToFileArray("ext_tables.php",trim($this->wrapBody(" 00116 <?php 00117 if (!defined ('TYPO3_MODE')) die ('Access denied.'); 00118 00119 ",implode(chr(10),$this->ext_tables)," 00120 ?> 00121 ",0))); 00122 } 00123 // Write the tca.php file: 00124 if (count($this->ext_tca)) { 00125 $this->addFileToFileArray("tca.php",trim($this->wrapBody(" 00126 <?php 00127 if (!defined ('TYPO3_MODE')) die ('Access denied.'); 00128 00129 ",implode(chr(10),$this->ext_tca)," 00130 ?> 00131 ",0))); 00132 } 00133 // Write the ext_tables.sql file: 00134 if (count($this->ext_tables_sql)) { 00135 $this->addFileToFileArray("ext_tables.sql",trim($this->sPS(implode(chr(10),$this->ext_tables_sql)))); 00136 } 00137 // Local lang file: 00138 if (count($this->ext_locallang)) { 00139 $this->addLocalLangFile($this->ext_locallang,"locallang.php",'Language labels for extension "'.$extKey.'"'); 00140 } 00141 // Local lang DB file: 00142 if (count($this->ext_locallang_db)) { 00143 $this->addLocalLangFile($this->ext_locallang_db,"locallang_db.php",'Language labels for database tables/fields belonging to extension "'.$extKey.'"'); 00144 } 00145 00146 // The form used to generate the extension: 00147 $this->dontPrintImages = 1; 00148 $this->addFileToFileArray("doc/wizard_form.html",trim($this->sPS(' 00149 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 00150 00151 <html> 00152 <head> 00153 <title>Untitled</title> 00154 </head> 00155 00156 <body> 00157 00158 '.$this->totalForm().' 00159 </body> 00160 </html> 00161 '))); 00162 $this->addFileToFileArray("doc/wizard_form.dat",serialize($this->wizArray)); 00163 00164 $this->addFileToFileArray("ChangeLog", 00165 '(add new changes on top of this file) 00166 00167 '.date("y-m-d").' '.$this->userField('name').' <'.$this->userField('email').'> 00168 00169 * Initial release 00170 ' ); 00171 00172 $this->addFileToFileArray("README.txt",' 00173 Feel free to add some documentation or simply add a link to the online manual. 00174 ' ); 00175 00176 // icon: 00177 $this->addFileToFileArray("ext_icon.gif",t3lib_div::getUrl(t3lib_extMgm::extPath("kickstarter")."res/notfound.gif")); 00178 00179 00180 # debug($this->wizArray); 00181 # debug ($this->fileArray); 00182 # return $dataArr; 00183 } 00184 00185 00186 00187 } 00188 00189 // Include extension? 00190 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/kickstarter/class.tx_kickstarter_compilefiles.php"]) { 00191 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/kickstarter/class.tx_kickstarter_compilefiles.php"]); 00192 } 00193 00194 ?>