Documentation TYPO3 par Ameos

class.tx_kickstarter_wizard.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2001-2004 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")."modfunc1/class.tx_kickstarter_compilefiles.php");
00034 
00035 class tx_kickstarter_wizard extends tx_kickstarter_compilefiles {
00036         var $varPrefix = "kickstarter";         // redundant from "extrep"
00037         var $siteBackPath = "";
00038         var $EMmode=1;  // If run from Extension Manager, set to 1.
00039 
00040         var $wizArray=array();
00041 
00042         var $extKey_nusc = "myext";
00043         var $extKey = "my_ext";
00044         var $printWOP=0;
00045         var $outputWOP=0;
00046         var $saveKey="";
00047         var $pObj;
00048 
00049         var $afterContent;
00050 
00051         var $options = array(
00052                 "emconf" => array("General info", "Enter general information about the extension here: Title, description, category, author..."),
00053                 "tables" => array("New Database Tables", "Add database tables which can be edited inside the backend. These tables will be added to the global TCA array in TYPO3.","cm.png"),
00054                 "fields" => array("Extend existing Tables", "Add custom fields to existing tables, such as the 'pages', 'tt_content', 'fe_users' or 'be_users' table."),
00055                 "pi" => array("Frontend Plugins", "Create frontend plugins. Plugins are web applications running on the website itself (not in the backend of TYPO3). The default guestbook, message board, shop, rating feature etc. are examples of plugins. Even this very interface (the Extension Kickstarter) is a plugin (extension key 'kickstarter')."),
00056                 "module" => array("Backend Modules", "Create backend modules. A module is normally recognized as the application behind one of the TYPO3 backend menuitems. Examples are the Web>Page, Web>List, User>Setup, Doc module etc. In a more loose sense, all applications integrated with existing module (see below) also belongs to the 'module' category."),
00057                 "moduleFunction" => array("Integrate in existing Modules", "Extend existing modules with new function-menu items. Examples are extensions such as 'User>Task Center, Messaging' which adds internal messaging to TYPO3. Or 'Web>Info, Page TSconfig' which shows the Page TSconfiguration for a page. Or 'Web>Func, Wizards, Sort pages' which is a wizard for re-ordering pages in a folder."),
00058                 "cm" => array("Clickmenu items", "Adds a custom item to the clickmenus of database records. This is a very cool way to integrate small tools of your own in an elegant way!"),
00059                 'sv' => array('Services', 'Create a Services class. With a Services extension you can extend TYPO3 (or an extension which use Services) with functionality, without any changes to the code which use that service.'),
00060                 "ts" => array("Static TypoScript code", "Adds static TypoScript Setup and Constants code - just like a static template would do."),
00061                 "TSconfig" => array("TSconfig", "Adds default Page-TSconfig or User-TSconfig. Can be used to preset options inside TYPO3."),
00062                 "languages" => array("Setup languages", "Start here by entering the number of system languages you want to use in your extension."),
00063         );
00064 
00065         var $languages = array(
00066                 "dk" => "Danish",
00067                 "de" => "German",
00068                 "no" => "Norwegian",
00069                 "it" => "Italian",
00070                 "fr" => "French",
00071                 "es" => "Spanish",
00072                 "nl" => "Dutch",
00073                 "cz" => "Czech",
00074                 "pl" => "Polish",
00075                 "si" => "Slovenian",
00076                 "fi" => "Finnish",
00077                 "tr" => "Turkish",
00078                 "se" => "Swedish",
00079                 "pt" => "Portuguese",
00080                 "ru" => "Russian",
00081                 "ro" => "Romanian",
00082                 "ch" => "Chinese",
00083                 "sk" => "Slovak",
00084                 "lt" => "Lithuanian",
00085                 'is' => 'Icelandic',
00086                 'hr' => 'Croatian',
00087                 'hu' => 'Hungarian',
00088                 'gl' => 'Greenlandic',
00089                 'th' => 'Thai',
00090                 'gr' => 'Greek',
00091                 'hk' => 'Chinese (Trad)',
00092                 'eu' => 'Basque',
00093                 'bg' => 'Bulgarian',
00094                 'br' => 'Brazilian Portuguese',
00095                 'et' => 'Estonian',
00096                 'ar' => 'Arabic',
00097                 'he' => 'Hebrew',
00098                 'ua' => 'Ukrainian',
00099                 'lv' => 'Latvian',
00100                 'jp' => 'Japanese',
00101                 'vn' => 'Vietnamese',
00102                 'ca' => 'Catalan',
00103                 'ba' => 'Bosnian',
00104                 'kr' => 'Korean',
00105         );
00106         var $reservedTypo3Fields="uid,pid,endtime,starttime,sorting,fe_group,hidden,deleted,cruser_id,crdate,tstamp";
00107         var $mysql_reservedFields="data,table,field,key,desc";
00108 
00109                 // Internal:
00110         var $selectedLanguages = array();
00111         var $usedNames=array();
00112         var $fileArray=array();
00113         var $ext_tables=array();
00114         var $ext_localconf=array();
00115         var $ext_locallang=array();
00116 
00117         var $color = array("#C8D0B3","#FEE7B5","#eeeeee");
00118 
00119         var $modData;
00120 
00121         function tx_kickstarter_wizard() {
00122           $this->modData = t3lib_div::_POST($this->varPrefix);
00123         }
00124 
00125 
00126         function initWizArray() {
00127                 $inArray = unserialize(base64_decode($this->modData["wizArray_ser"]));
00128                 $this->wizArray = is_array($inArray) ? $inArray : array();
00129                 if (is_array($this->modData["wizArray_upd"]))   {
00130                         $this->wizArray = t3lib_div::array_merge_recursive_overrule($this->wizArray,$this->modData["wizArray_upd"]);
00131                 }
00132 
00133                 $lA = is_array($this->wizArray["languages"]) ? current($this->wizArray["languages"]) : "";
00134                 if (is_array($lA))      {
00135                         reset($lA);
00136                         while(list($k,$v)=each($lA))    {
00137                                 if ($v && isset($this->languages[$k]))  {
00138                                         $this->selectedLanguages[$k]=$this->languages[$k];
00139                                 }
00140                         }
00141                 }
00142         }
00143 
00144         function mgm_wizard()   {
00145                 $this->initWizArray();
00146 
00147                 $saveKey = $this->saveKey = $this->wizArray["save"]["extension_key"] = trim($this->wizArray["save"]["extension_key"]);
00148                 $this->outputWOP = $this->wizArray["save"]["print_wop_comments"] ? 1 : 0;
00149 
00150 
00151 
00152                 if ($saveKey)   {
00153                         $this->extKey=$saveKey;
00154                         $this->extKey_nusc=str_replace("_","",$saveKey);
00155                 }
00156 
00157                 if ($this->modData["viewResult"])       {
00158                         $this->modData["wizAction"]="";
00159                         $this->modData["wizSubCmd"]="";
00160                         if ($saveKey)   {
00161                                 $content = $this->view_result();
00162                         } else $content = $this->fw("<strong>Error:</strong> Please enter an extension key first!<BR><BR>");
00163                 } elseif ($this->modData["WRITE"])      {
00164                         $this->modData["wizAction"]="";
00165                         $this->modData["wizSubCmd"]="";
00166                         if ($saveKey)   {
00167                                 $this->makeFilesArray($this->saveKey);
00168                                 $uploadArray = $this->makeUploadArray($this->saveKey,$this->fileArray);
00169                                 $this->pObj->importExtFromRep(0,$this->modData["loc"],0,$uploadArray);
00170                         } else $content = $this->fw("<strong>Error:</strong> Please enter an extension key first!<BR><BR>");
00171                 } elseif ($this->modData["totalForm"])  {
00172                         $content = $this->totalForm();
00173                 } elseif ($this->modData["downloadAsFile"])     {
00174                         if ($saveKey)   {
00175                                 $this->makeFilesArray($this->saveKey);
00176                                 $uploadArray = $this->makeUploadArray($this->saveKey,$this->fileArray);
00177                                 $backUpData = $this->makeUploadDataFromArray($uploadArray);
00178                                 $filename="T3X_".$saveKey."-".str_replace(".","_","0.0.0").".t3x";
00179                                 $mimeType = "application/octet-stream";
00180                                 Header("Content-Type: ".$mimeType);
00181                                 Header("Content-Disposition: attachment; filename=".$filename);
00182                                 echo $backUpData;
00183                                 exit;
00184                         } else $content = $this->fw("<strong>Error:</strong> Please enter an extension key first!<BR><BR>");
00185                 } else {
00186                         $action = explode(":",$this->modData["wizAction"]);
00187                         if ((string)$action[0]=="deleteEl")     {
00188                                 unset($this->wizArray[$action[1]][$action[2]]);
00189                         }
00190 
00191                         $content = $this->getFormContent();
00192                 }
00193                 $wasContent = $content?1:0;
00194                 $content = '
00195                 <script language="javascript" type="text/javascript">
00196                         function setFormAnchorPoint(anchor)     {
00197                                 document.'.$this->varPrefix.'_wizard.action = unescape("'.rawurlencode($this->linkThisCmd()).'")+"#"+anchor;
00198                         }
00199                 </script>
00200                 <table border=0 cellpadding=0 cellspacing=0>
00201                         <form action="'.$this->linkThisCmd().'" method="POST" name="'.$this->varPrefix.'_wizard">
00202                         <tr>
00203                                 <td valign=top>'.$this->sidemenu().'</td>
00204                                 <td>&nbsp;&nbsp;&nbsp;</td>
00205                                 <td valign=top>'.$content.'
00206                                         <input type="hidden" name="'.$this->piFieldName("wizArray_ser").'" value="'.htmlspecialchars(base64_encode(serialize($this->wizArray))).'" /><BR>';
00207 
00208                 if ((string)$this->modData["wizSubCmd"])        {
00209                         if ($wasContent)        $content.='<input name="update2" type="submit" value="Update..."> ';
00210                 }
00211                 $content.='
00212                                         <input type="hidden" name="'.$this->piFieldName("wizAction").'" value="'.$this->modData["wizAction"].'">
00213                                         <input type="hidden" name="'.$this->piFieldName("wizSubCmd").'" value="'.$this->modData["wizSubCmd"].'">
00214                                         '.$this->cmdHiddenField().'
00215                                 </td>
00216                         </tr>
00217                         </form>
00218                 </table>'.$this->afterContent;
00219 
00220                 return $content;
00221         }
00222 
00226         function getFormContent()       {
00227                 switch((string)$this->modData["wizSubCmd"])     {
00228                         case "tables":
00229                                 $content.=$this->add_cat_tables();
00230                         break;
00231                         case "fields":
00232                                 $content.=$this->add_cat_fields();
00233                         break;
00234                         case "pi":
00235                                 $content.=$this->add_cat_pi();
00236                         break;
00237                         case "TSconfig":
00238                                 $content.=$this->add_cat_TSconfig();
00239                         break;
00240                         case "ts":
00241                                 $content.=$this->add_cat_ts();
00242                         break;
00243                         case "cm":
00244                                 $content.=$this->add_cat_cm();
00245                         break;
00246                         case "module":
00247                                 $content.=$this->add_cat_module();
00248                         break;
00249                         case "moduleFunction":
00250                                 $content.=$this->add_cat_moduleFunction();
00251                         break;
00252                         case "languages":
00253                                 $content.=$this->add_cat_languages();
00254                         break;
00255                         case 'sv':
00256                                 $content.=$this->add_cat_services();
00257                         break;
00258                         case "emconf":
00259                                 $content.=$this->add_cat_emconf();
00260                         break;
00261                         default:
00262                         break;
00263                 }
00264                 return $content;
00265         }
00266 
00270         function totalForm()    {
00271                 $buf = array($this->printWOP,$this->dontPrintImages);
00272                 $this->printWOP = 1;
00273 
00274                 reset($this->options);
00275                 $lines=array();
00276                 while(list($k,$v)=each($this->options)) {
00277                         // Add items:
00278                         $items = $this->wizArray[$k];
00279                         if (is_array($items))   {
00280                                 reset($items);
00281                                 while(list($k2,$conf)=each($items))     {
00282                                         $this->modData["wizSubCmd"]=$k;
00283                                         $this->modData["wizAction"]="edit:".$k2;
00284                                         $lines[]=$this->getFormContent();
00285                                 }
00286                         }
00287                 }
00288 
00289                 $this->modData["wizSubCmd"]="";
00290                 $this->modData["wizAction"]="";
00291                 list($this->printWOP,$this->dontPrintImages) = $buf;
00292 
00293                 $content = implode("<HR>",$lines);
00294                 return $content;
00295         }
00296 
00300         function sidemenu()     {
00301 #debug($this->modData);
00302                 $actionType = $this->modData["wizSubCmd"].":".$this->modData["wizAction"];
00303                 $singles = "emconf,save,ts,TSconfig,languages";
00304                 reset($this->options);
00305                 $lines=array();
00306                 while(list($k,$v)=each($this->options)) {
00307                         // Add items:
00308                         $items = $this->wizArray[$k];
00309                         $c=0;
00310                         $iLines=array();
00311                         if (is_array($items))   {
00312                                 reset($items);
00313                                 while(list($k2,$conf)=each($items))     {
00314                                         $dummyTitle = t3lib_div::inList($singles,$k) ? "[Click to Edit]" : "<em>Item ".$k2."</em>";
00315                                         $isActive = !strcmp($k.":edit:".$k2,$actionType);
00316                                         $delIcon = $this->linkStr('<img src="'.$this->siteBackPath.'t3lib/gfx/garbage.gif" width="11" height="12" border="0" title="Remove item">',"","deleteEl:".$k.":".$k2);
00317                                         $iLines[]='<tr'.($isActive?$this->bgCol(2,-30):$this->bgCol(2)).'><td>'.$this->fw($this->linkStr($this->bwWithFlag($conf["title"]?$conf["title"]:$dummyTitle,$isActive),$k,'edit:'.$k2)).'</td><td>'.$delIcon.'</td></tr>';
00318                                         $c=$k2;
00319                                 }
00320                         }
00321                         if (!t3lib_div::inList($singles,$k) || !count($iLines)) {
00322                                 $c++;
00323                                 $addIcon = $this->linkStr('<img src="'.$this->siteBackPath.'t3lib/gfx/add.gif" width="12" height="12" border="0" title="Add item">',$k,'edit:'.$c);
00324                         } else {$addIcon = "";}
00325 
00326                         $lines[]='<tr'.$this->bgCol(1).'><td nowrap><strong>'.$this->fw($v[0]).'</strong></td><td>'.$addIcon.'</td></tr>';
00327                         $lines = array_merge($lines,$iLines);
00328                 }
00329 
00330                 $lines[]='<tr><td>&nbsp;</td><td></td></tr>';
00331 
00332                 $lines[]='<tr><td width=150>
00333                 '.$this->fw("Enter extension key:").'<BR>
00334                 <input type="text" name="'.$this->piFieldName("wizArray_upd").'[save][extension_key]" value="'.$this->wizArray["save"]["extension_key"].'">
00335                 '.($this->wizArray["save"]["extension_key"]?"":'<BR><a href="http://typo3.org/1382.0.html" target="_blank"><font color=red>Make sure to enter the right extension key from the beginning here!</font> You can register one here.</a>').'
00336                 </td><td></td></tr>';
00337 # onClick="setFormAnchorPoint(\'_top\')"
00338                 $lines[]='<tr><td><input type="submit" value="Update..."></td><td></td></tr>';
00339                 $lines[]='<tr><td><input type="submit" name="'.$this->piFieldName("totalForm").'" value="Total form"></td><td></td></tr>';
00340 
00341                 if ($this->saveKey)     {
00342                         $lines[]='<tr><td><input type="submit" name="'.$this->piFieldName("viewResult").'" value="View result"></td><td></td></tr>';
00343                         $lines[]='<tr><td><input type="submit" name="'.$this->piFieldName("downloadAsFile").'" value="D/L as file"></td><td></td></tr>';
00344                         $lines[]='<tr><td>
00345                         <input type="hidden" name="'.$this->piFieldName("wizArray_upd").'[save][print_wop_comments]" value="0"><input type="checkbox" name="'.$this->piFieldName("wizArray_upd").'[save][print_wop_comments]" value="1" '.($this->wizArray["save"]["print_wop_comments"]?" CHECKED":"").'>'.$this->fw("Print WOP comments").'
00346                         </td><td></td></tr>';
00347                 }
00348 
00349                 /* HOOK: Place a hook here, so additional output can be integrated */
00350                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['sidemenu'])) {
00351                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['sidemenu'] as $_funcRef) {
00352                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00353                   }
00354                 }
00355 
00356                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00357                 return $content;
00358         }
00359 
00363         function view_result()  {
00364                 $this->makeFilesArray($this->saveKey);
00365 
00366                 $keyA = array_keys($this->fileArray);
00367                 asort($keyA);
00368 
00369                 $filesOverview1=array();
00370                 $filesOverview2=array();
00371                 $filesContent=array();
00372                 reset($keyA);
00373 
00374                         $filesOverview1[]= '<tr'.$this->bgCol(1).'>
00375                                 <td><strong>'.$this->fw("Filename:").'</strong></td>
00376                                 <td><strong>'.$this->fw("Size:").'</strong></td>
00377                                 <td><strong>'.$this->fw("&nbsp;").'</strong></td>
00378                         </tr>';
00379 
00380                 while(list(,$fileName)=each($keyA))     {
00381                         $data = $this->fileArray[$fileName];
00382 
00383                         $fI = pathinfo($fileName);
00384                         if (t3lib_div::inList("php,sql,txt",strtolower($fI["extension"])))      {
00385                                 $linkToFile='<strong><a href="#'.md5($fileName).'">'.$this->fw("&nbsp;View&nbsp;").'</a></strong>';
00386                                 $filesContent[]='<tr'.$this->bgCol(1).'>
00387                                 <td><a name="'.md5($fileName).'"></a><strong>'.$this->fw($fileName).'</strong></td>
00388                                 </tr>
00389                                 <tr>
00390                                         <td>'.$this->preWrap($data["content"]).'</td>
00391                                 </tr>';
00392                         } else $linkToFile=$this->fw("&nbsp;");
00393 
00394                         $line = '<tr'.$this->bgCol(2).'>
00395                                 <td>'.$this->fw($fileName).'</td>
00396                                 <td>'.$this->fw(t3lib_div::formatSize($data["size"])).'</td>
00397                                 <td>'.$linkToFile.'</td>
00398                         </tr>';
00399                         if (strstr($fileName,"/"))      {
00400                                 $filesOverview2[]=$line;
00401                         } else {
00402                                 $filesOverview1[]=$line;
00403                         }
00404                 }
00405 
00406                 $content = '<table border=0 cellpadding=1 cellspacing=2>'.implode("",$filesOverview1).implode("",$filesOverview2).'</table>';
00407                 $content.= $this->fw("<BR><strong>Author name:</strong> ".$GLOBALS['BE_USER']->user['realName']."
00408                                                         <BR><strong>Author email:</strong> ".$GLOBALS['BE_USER']->user['email']);
00409 
00410 
00411                 $content.= '<BR><BR>';
00412                 if (!$this->EMmode)     {
00413                         $content.='<input type="submit" name="'.$this->piFieldName("WRITE").'" value="WRITE to \''.$this->saveKey.'\'">';
00414                 } else {
00415                         $content.='
00416                                 <strong>'.$this->fw("Write to location:").'</strong><BR>
00417                                 <select name="'.$this->piFieldName("loc").'">'.
00418                                         ($this->pObj->importAsType("G")?'<option value="G">Global: '.$this->pObj->typePaths["G"].$this->saveKey."/".(@is_dir(PATH_site.$this->pObj->typePaths["G"].$this->saveKey)?" (OVERWRITE)":" (empty)").'</option>':'').
00419                                         ($this->pObj->importAsType("L")?'<option value="L">Local: '.$this->pObj->typePaths["L"].$this->saveKey."/".(@is_dir(PATH_site.$this->pObj->typePaths["L"].$this->saveKey)?" (OVERWRITE)":" (empty)").'</option>':'').
00420                                 '</select>
00421                                 <input type="submit" name="'.$this->piFieldName("WRITE").'" value="WRITE" onClick="return confirm(\'If the setting in the selectorbox says OVERWRITE\nthen the current extension in that location WILL be overridden! Totally!\nPlease decide if you want to continue.\n\n(Remember, this is a *kickstarter* - not an editor!)\');">
00422                         ';
00423                 }
00424 
00425 
00426                 $this->afterContent= '<BR><table border=0 cellpadding=1 cellspacing=2>'.implode("",$filesContent).'</table>';
00427                 return $content;
00428         }
00429 
00433         function add_cat_pi()   {
00434                 $lines=array();
00435 
00436                 $catID = "pi";
00437 
00438                 $action = explode(":",$this->modData["wizAction"]);
00439                 if ($action[0]=="edit") {
00440                         $this->regNewEntry($catID,$action[1]);
00441                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"<strong>Edit Plugin #".$action[1]."</strong>",$action[1]);
00442                         $piConf = $this->wizArray[$catID][$action[1]];
00443                         $ffPrefix='['.$catID.']['.$action[1].']';
00444 
00445 
00446                                 // Enter title of the plugin
00447                         $subContent="<strong>Enter a title for the plugin:</strong><BR>".
00448                                 $this->renderStringBox_lang("title",$ffPrefix,$piConf);
00449                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00450 
00451                         $subContent = $this->renderCheckBox($ffPrefix."[plus_user_obj]",$piConf["plus_user_obj"])."USER cObjects are cached. Make it a non-cached USER_INT instead<BR>";
00452                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00453 
00454                         $subContent = $this->renderCheckBox($ffPrefix."[plus_not_staticTemplate]",$piConf["plus_not_staticTemplate"])."Enable this option if you want the TypoScript code to be set by default. Otherwise the code will go into a static template file which must be included in the template record (recommended is to <em>not</em> set this option).<BR>";
00455                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00456 
00457 
00458                                 // Position
00459                         if (is_array($this->wizArray["fields"]))        {
00460                                 $optValues = array(
00461                                         "0" => "",
00462                                 );
00463                                 reset($this->wizArray["fields"]);
00464                                 while(list($kk,$fC)=each($this->wizArray["fields"]))    {
00465                                         if ($fC["which_table"]=="tt_content")   {
00466                                                 $optValues[$kk]=($fC["title"]?$fC["title"]:"Item ".$kk)." (".count($fC["fields"])." fields)";
00467                                         }
00468                                 }
00469                                 if (count($optValues)>1)        {
00470                                         $subContent="<strong>Apply a set of extended fields</strong><BR>
00471                                                 If you have configured a set of extra fields (Extend existing Tables) for the tt_content table, you can have them assigned to this plugin.
00472                                                 <BR>".
00473                                                 $this->renderSelectBox($ffPrefix."[apply_extended]",$piConf["apply_extended"],$optValues);
00474                                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00475                                 }
00476                         }
00477 
00478 /*                              // Enter title of the plugin
00479                         $subContent="<strong>Enter a 'key'-string for the plugin:</strong><BR>".
00480                                 $this->renderStringBox($ffPrefix."[keystring]",$piConf["keystring"]).
00481                                 "<BR>(<em>A key string is used as a sub-prefix to the class name, in the database as identification of the plugin etc. If you don't specify any, the wizard will make one based on the title above.<BR>
00482                                         Example: If your extension has the extension key 'my_extension' and you enter the key value 'crazymenu', then the class, additional fields etc. will be named 'tx_myextension_crazymenu'<BR>
00483                                         Use a-z characters only.</em>)"
00484                                 ;
00485                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00486 */
00487 
00488 
00489 
00490 
00491                                 // Insert Plugin
00492                         if (is_array($this->wizArray["tables"]))        {
00493                                 $optValues = array(
00494                                         "0" => "",
00495                                 );
00496                                 reset($this->wizArray["tables"]);
00497                                 while(list($kk,$fC)=each($this->wizArray["tables"]))    {
00498                                         $optValues[$kk]=($fC["tablename"]||$fC["title"]?$fC["title"]." (".$this->returnName($this->extKey,"tables").($fC["tablename"]?"_".$fC["tablename"]:"").")":"Item ".$kk)." (".count($fC["fields"])." fields)";
00499                                 }
00500                                 $incListing="<BR><BR>If you have configured custom tables you can select one of the tables to list by default as an example:
00501                                                 <BR>".
00502                                                 $this->renderSelectBox($ffPrefix."[list_default]",$piConf["list_default"],$optValues);
00503                                 $incListing.="<BR>".$this->renderCheckBox($ffPrefix."[list_default_listmode]",$piConf["list_default_listmode"]).
00504                                         "Listing: Sections instead of table-rows";
00505                                 $incListing.="<BR>".$this->renderCheckBox($ffPrefix."[list_default_singlemode]",$piConf["list_default_singlemode"]).
00506                                         "Singleview: Sections instead of table-rows";
00507                         } else $incListing="";
00508 
00509 
00510                         if (!$piConf["addType"])        $piConf["addType"]="list_type";
00511                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"list_type").
00512                                 $this->textSetup(
00513                                 "Add to 'Insert Plugin' list in Content Elements",
00514                                 "Most frontend plugins should be added to the Plugin list of Content Element type 'Insert Plugin'. This is what happens with most other plugins you know of.".
00515                                 $this->resImg("pi_pi.png").
00516                                 "<BR>".$this->renderCheckBox($ffPrefix."[plus_wiz]",$piConf["plus_wiz"]).
00517                                 "Add icon to 'New Content Element' wizard:".
00518                                 $this->resImg("pi_cewiz.png").
00519                                 "Write a description for the entry (if any):<BR>".
00520                                 $this->renderStringBox_lang("plus_wiz_description",$ffPrefix,$piConf).$incListing
00521                                 );
00522                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00523 
00524                                 // Text box
00525                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"textbox").
00526                                 $this->textSetup("Add as a 'Textbox' type",
00527                                 "The Textbox Content Element is not very common but has a confortable set of fields: Bodytext and image upload.".
00528                                 $this->resImg("pi_textbox.png"));
00529                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00530 
00531                                 // Menu/Sitemap
00532                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"menu_sitemap").
00533                                 $this->textSetup("Add as a 'Menu/Sitemap' item",
00534                                         "Adds the plugin to the Menu/Sitemap list. Use this if your plugin is a list of links to pages or elements on the website. An alternative sitemap? Or some special kind of menu in a special design?".
00535                                         $this->resImg("pi_menu_sitemap.png"));
00536                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00537 
00538                                 // New content element
00539                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"ce").
00540                                 $this->textSetup("Add as a totally new Content Element type",
00541                                         "You can also take the plunge into a whole new content element type! Scarry eh?".
00542                                         $this->resImg("pi_ce.png").
00543 /*                                      $this->renderCheckBox($ffPrefix."[plus_rte]",$piConf["plus_rte"])."Enable Rich Text editing for the bodytext field<BR>".
00544                                         $this->renderCheckBox($ffPrefix."[plus_images]",$piConf["plus_images"])."Enable images-field<BR>".
00545                                         $this->renderCheckBox($ffPrefix."[plus_no_header]",$piConf["plus_images"])."Disable header rendering<BR>".
00546                                         $this->renderCheckBox($ffPrefix."[plus_insert_check]",$piConf["plus_insert_check"])."Insert a custom checkbox field<BR>".
00547                                         $this->renderCheckBox($ffPrefix."[plus_insert_select]",$piConf["plus_insert_select"])."Insert a custom select field<BR>".
00548                                         $this->renderCheckBox($ffPrefix."[plus_insert_string]",$piConf["plus_insert_string"])."Insert a custom text string field<BR>".
00549                                         $this->renderCheckBox($ffPrefix."[plus_insert_file]",$piConf["plus_insert_file"])."Insert a custom file field<BR>".
00550         */                              ''
00551                                 );
00552                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00553 
00554                                 // New header type
00555                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"header").
00556                                 $this->textSetup("Add as a new header type",
00557                                         "Finally you might insert a new header type here:".
00558                                         $this->resImg("pi_header.png"));
00559                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00560 
00561                                 // Processing of tags in content.
00562                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"typotags").
00563                                 $this->textSetup("Processing of userdefined tag",
00564                                                 htmlspecialchars("If you wish the plugin to proces content from a userdefined tag in Content Element text-fields, enter the tagname here. Eg. if you wish the tags <mytag>This is the content</mytag> to be your userdefined tags, just enter 'mytag' in this field (lowercase a-z, 0-9 and underscore):")."<BR>".
00565                                                         $this->renderStringBox($ffPrefix."[tag_name]",$piConf["tag_name"])
00566                                         );
00567                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00568 
00569                                 // Just include library
00570                         $subContent=$this->renderRadioBox($ffPrefix."[addType]",$piConf["addType"],"includeLib").
00571                                 $this->textSetup("Just include library",
00572                                         "In this case your library is just included when pages are rendered.<BR><BR>".
00573                                         $this->renderCheckBox($ffPrefix."[plus_user_ex]",$piConf["plus_user_ex"])."Provide TypoScript example for USER cObject in 'page.1000'<BR>"
00574                                         );
00575                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00576                 }
00577 
00578                 /* HOOK: Place a hook here, so additional output can be integrated */
00579                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_pi'])) {
00580                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_pi'] as $_funcRef) {
00581                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00582                   }
00583                 }
00584 
00585                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00586                 return $content;
00587         }
00588 
00592         function add_cat_ts()   {
00593                 $lines=array();
00594 
00595                 $catID = "ts";
00596                 $action = explode(":",$this->modData["wizAction"]);
00597                 if ($action[0]=="edit") {
00598                         $action[1]=1;
00599                         $this->regNewEntry($catID,$action[1]);
00600 
00601                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00602                         $piConf = $this->wizArray[$catID][$action[1]];
00603                         $ffPrefix='['.$catID.']['.$action[1].']';
00604 
00605                                 // Enter constants
00606                         $subContent="<strong>Constants:</strong><BR>".
00607                                 $this->renderTextareaBox($ffPrefix."[constants]",$piConf["constants"]);
00608                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00609 
00610                                 // Enter setup
00611                         $subContent="<strong>Setup:</strong><BR>".
00612                                 $this->renderTextareaBox($ffPrefix."[setup]",$piConf["setup"]);
00613                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00614                 }
00615 
00616                 /* HOOK: Place a hook here, so additional output can be integrated */
00617                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_ts'])) {
00618                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_ts'] as $_funcRef) {
00619                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00620                   }
00621                 }
00622 
00623                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00624                 return $content;
00625         }
00626 
00630         function add_cat_TSconfig()     {
00631                 $lines=array();
00632 
00633                 $catID = "TSconfig";
00634                 $action = explode(":",$this->modData["wizAction"]);
00635                 if ($action[0]=="edit") {
00636                         $action[1]=1;
00637                         $this->regNewEntry($catID,$action[1]);
00638 
00639                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00640                         $piConf = $this->wizArray[$catID][$action[1]];
00641                         $ffPrefix='['.$catID.']['.$action[1].']';
00642 
00643                                 // Enter Page TSconfige
00644                         $subContent="<strong>Default Page TSconfig:</strong><BR>".
00645                                 $this->renderTextareaBox($ffPrefix."[page_TSconfig]",$piConf["page_TSconfig"]);
00646                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00647 
00648                                 // Enter User TSconfig
00649                         $subContent="<strong>Default User TSconfig:</strong><BR>".
00650                                 $this->renderTextareaBox($ffPrefix."[user_TSconfig]",$piConf["user_TSconfig"]);
00651                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00652                 }
00653 
00654                 /* HOOK: Place a hook here, so additional output can be integrated */
00655                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_tsconfig'])) {
00656                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_tsconfig'] as $_funcRef) {
00657                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00658                   }
00659                 }
00660 
00661                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00662                 return $content;
00663         }
00664 
00668         function add_cat_module()       {
00669                 $lines=array();
00670 
00671                 $catID = "module";
00672                 $action = explode(":",$this->modData["wizAction"]);
00673                 if ($action[0]=="edit") {
00674                         $this->regNewEntry($catID,$action[1]);
00675                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00676                         $piConf = $this->wizArray[$catID][$action[1]];
00677                         $ffPrefix='['.$catID.']['.$action[1].']';
00678 
00679                                 // Enter title of the module
00680                         $subContent="<strong>Enter a title for the module:</strong><BR>".
00681                                 $this->renderStringBox_lang("title",$ffPrefix,$piConf);
00682                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00683 
00684                                 // Description
00685                         $subContent="<strong>Enter a description:</strong><BR>".
00686                                 $this->renderStringBox_lang("description",$ffPrefix,$piConf);
00687                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00688 
00689                                 // Description
00690                         $subContent="<strong>Enter a tab label (shorter description):</strong><BR>".
00691                                 $this->renderStringBox_lang("tablabel",$ffPrefix,$piConf);
00692                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00693 
00694                                 // Position
00695                         $optValues = array(
00696                                 "web" => "Sub in Web-module",
00697                                 "file" => "Sub in File-module",
00698                                 "user" => "Sub in User-module",
00699                                 "tools" => "Sub in Tools-module",
00700                                 "help" => "Sub in Help-module",
00701                                 "_MAIN" => "New main module"
00702                         );
00703                         $subContent="<strong>Sub- or main module?</strong><BR>".
00704                                 $this->renderSelectBox($ffPrefix."[position]",$piConf["position"],$optValues).
00705                                 $this->resImg("module.png");
00706                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00707 
00708                                 // Sub-position
00709                         $optValues = array(
00710                                 "0" => "Bottom (default)",
00711                                 "top" => "Top",
00712                                 "web_after_page" => "If in Web-module, after Web>Page",
00713                                 "web_before_info" => "If in Web-module, before Web>Info",
00714                         );
00715                         $subContent="<strong>Position in module menu?</strong><BR>".
00716                                 $this->renderSelectBox($ffPrefix."[subpos]",$piConf["subpos"],$optValues);
00717                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00718 
00719                                 // Admin only
00720                         $subContent = $this->renderCheckBox($ffPrefix."[admin_only]",$piConf["admin_only"])."Admin-only access!<BR>";
00721                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00722 
00723                                 // Options
00724                         $subContent = $this->renderCheckBox($ffPrefix."[interface]",$piConf["interface"])."Allow other extensions to interface with function menu<BR>";
00725 #                       $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00726                 }
00727 
00728                 /* HOOK: Place a hook here, so additional output can be integrated */
00729                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_module'])) {
00730                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_module'] as $_funcRef) {
00731                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00732                   }
00733                 }
00734 
00735                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00736                 return $content;
00737         }
00738 
00742         function add_cat_moduleFunction()       {
00743                 $lines=array();
00744 
00745                 $catID = "moduleFunction";
00746                 $action = explode(":",$this->modData["wizAction"]);
00747                 if ($action[0]=="edit") {
00748                         $this->regNewEntry($catID,$action[1]);
00749                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00750                         $piConf = $this->wizArray[$catID][$action[1]];
00751                         $ffPrefix='['.$catID.']['.$action[1].']';
00752 
00753                                 // Enter title of the module function
00754                         $subContent="<strong>Enter the title of function-menu item:</strong><BR>".
00755                                 $this->renderStringBox_lang("title",$ffPrefix,$piConf);
00756                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00757 
00758                                 // Position
00759                         $optValues = array(
00760                                 "web_func" => "Web>Func",
00761                                 "web_func_wizards" => "Web>Func, Wizards",
00762                                 "web_info" => "Web>Info",
00763                                 "web_ts" => "Web>Template",
00764                                 "user_task" => "User>Task Center",
00765                         );
00766                         $subContent="<strong>Sub- or main module?</strong><BR>".
00767                                 $this->renderSelectBox($ffPrefix."[position]",$piConf["position"],$optValues).
00768                                 "<BR><BR>These images gives you an idea what the options above means:".
00769                                 $this->resImg("modulefunc_task.png").
00770                                 $this->resImg("modulefunc_func.png");
00771                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00772 
00773                 }
00774 
00775                 /* HOOK: Place a hook here, so additional output can be integrated */
00776                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_moduleFunction'])) {
00777                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_moduleFunction'] as $_funcRef) {
00778                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00779                   }
00780                 }
00781 
00782                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00783                 return $content;
00784         }
00785 
00789         function add_cat_cm()   {
00790                 $lines=array();
00791 
00792                 $catID = "cm";
00793                 $action = explode(":",$this->modData["wizAction"]);
00794                 if ($action[0]=="edit") {
00795                         $this->regNewEntry($catID,$action[1]);
00796                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00797                         $piConf = $this->wizArray[$catID][$action[1]];
00798                         $ffPrefix='['.$catID.']['.$action[1].']';
00799 
00800                                 // Enter title of the module function
00801                         $subContent="<strong>Title of the ClickMenu element:</strong><BR>".
00802                                 $this->renderStringBox_lang("title",$ffPrefix,$piConf);
00803                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00804 
00805                                 // Position
00806                         $optValues = array(
00807                                 "bottom" => "Insert in bottom",
00808                                 "top" => "Insert in top",
00809                                 "before_delete" => "Insert before the 'Delete' item",
00810                         );
00811                         $subContent="<strong>Options</strong><BR>".
00812                                 $this->renderSelectBox($ffPrefix."[options]",$piConf["options"],$optValues);
00813                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00814 
00815                                 // Admin only
00816                         $subContent =$this->resImg("cm.png");
00817                         $subContent.= $this->renderCheckBox($ffPrefix."[second_level]",$piConf["second_level"])."Activate a second-level menu.<BR>";
00818                         $subContent.= $this->renderCheckBox($ffPrefix."[only_page]",$piConf["only_page"])."Add only if the click menu is on a 'Page' (example)<BR>";
00819                         $subContent.= $this->renderCheckBox($ffPrefix."[only_if_edit]",$piConf["only_if_edit"])."Only active if item is editable.<BR>";
00820                         $subContent.= $this->renderCheckBox($ffPrefix."[remove_view]",$piConf["remove_view"])."Remove 'Show' element (example)<BR>";
00821                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00822                 }
00823 
00824                 /* HOOK: Place a hook here, so additional output can be integrated */
00825                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_cm'])) {
00826                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_cm'] as $_funcRef) {
00827                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00828                   }
00829                 }
00830 
00831                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00832                 return $content;
00833         }
00834 
00835 
00839         function add_cat_languages()    {
00840                 $lines=array();
00841 
00842                 $catID = "languages";
00843                 $action = explode(":",$this->modData["wizAction"]);
00844                 if ($action[0]=="edit") {
00845                         $action[1]=1;
00846                         $this->regNewEntry($catID,$action[1]);
00847 
00848                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00849                         $piConf = $this->wizArray[$catID][$action[1]];
00850                         $ffPrefix='['.$catID.']['.$action[1].']';
00851 
00852                                 // Admin only
00853                         $subContent ="";
00854                         reset($this->languages);
00855                         while(list($k,$v)=each($this->languages))       {
00856                                 $subContent.= $this->renderCheckBox($ffPrefix."[".$k."]",$piConf[$k]).$v."<BR>";
00857                         }
00858                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($this->textSetup("Enter which languages to setup:",$subContent)).'</td></tr>';
00859                 }
00860 
00861                 /* HOOK: Place a hook here, so additional output can be integrated */
00862                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_languages'])) {
00863                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_languages'] as $_funcRef) {
00864                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00865                   }
00866                 }
00867 
00868                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
00869                 return $content;
00870         }
00871 
00872 
00876         function add_cat_services()     {
00877                 $lines=array();
00878 
00879                 $catID = 'sv';
00880                 $action = explode(':',$this->modData['wizAction']);
00881                 if ($action[0]=='edit') {
00882                         $this->regNewEntry($catID,$action[1]);
00883 
00884                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],'<strong>Edit Service #'.$action[1].'</strong>',$action[1]);
00885                         $piConf = $this->wizArray[$catID][$action[1]];
00886                         $ffPrefix='['.$catID.']['.$action[1].']';
00887 
00888                         if (!$this->EMmode && $this->saveKey)   {
00889                                 $extKeyRec = $this->pObj->getExtKeyRecord($this->saveKey);
00890                         }
00891 
00892                                 // Title
00893                         $subContent='<strong>Title:</strong><br />'.
00894                                 $this->renderStringBox($ffPrefix.'[title]',$piConf['title']?$piConf['title']:$extKeyRec['title']);
00895                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00896 
00897                                 // Description
00898                         $subContent='<strong>Description:</strong><br />'.
00899                                 $this->renderStringBox($ffPrefix.'[description]',$piConf['description']?$piConf['description']:$extKeyRec['description']);
00900                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00901 
00902                         $lines[]='<tr><td>&nbsp;</td><td></td></tr>';
00903 
00904                                 // Type
00905                         $subContent='<strong>Service type:</strong><br />'.
00906                                 $this->renderStringBox($ffPrefix.'[type]',$piConf['type']?$piConf['type']:$extKeyRec['type']).'<br />'.
00907                                 'Enter here the key to define which type of service this should be.<br />Examples: "textExtract", "metaExtract".';
00908                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00909 
00910                                 // SubType
00911                         $subContent='<strong>Sub type(s) (comma list):</strong><br />'.
00912                                 $this->renderStringBox($ffPrefix.'[subtype]',$piConf['subtype']?$piConf['subtype']:$extKeyRec['subtype']).'<br />'.
00913                                 'Possible subtypes are defined by the service type.<br />You have read the service type documentation.<br />Example: using subtypes for file types (doc, txt, pdf, ...) the service might work for.';
00914                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00915 
00916                         $lines[]='<tr><td>&nbsp;</td><td></td></tr>';
00917 
00918                                 // Priority
00919                         $optValues = Array(
00920                                 '50' => 'default (50)',
00921                                 '10' => 'very low (10)',
00922                                 '20' => 'low (20)',
00923                                 '40' => 'bit lower (40)',
00924                                 '60' => 'bit higher (60)',
00925                                 '80' => 'high (80)',
00926                                 '100' => 'Very high (100)',
00927                         );
00928                         $subContent='<strong>Priority:</strong><br />'.
00929                                 $this->renderSelectBox($ffPrefix.'[priority]',$piConf['priority'],$optValues).'<br />'.
00930                                 '50 = medium priority. <br />The priority of services can be changed by admin configuration.';
00931                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00932 
00933                                 // Quality
00934                         $quality = $piConf['quality']?$piConf['quality']:$extKeyRec['quality'];
00935                         $quality = $quality ? $quality : '50';
00936                         $subContent='<strong>Quality:</strong><br />'.
00937                                 $this->renderStringBox($ffPrefix.'[quality]',$quality).'<br />'.
00938                                 'The numbering of the quality is defined by the service type.<br />You have read the service type documentation.<br />The default quality range is 0-100.';
00939                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00940 
00941 
00942                                 // OS Dependencies
00943                         $optValues = Array(
00944                                 '' => 'no special dependency',
00945                                 'unix' => 'Unix only',
00946                                 'win' => 'Windows only',
00947 //                              'unix,win' => 'Unix or Windows',
00948                         );
00949 
00950                         $lines[]='<tr><td>&nbsp;</td><td></td></tr>';
00951 
00952                         $subContent='<strong>Operating System dependency:</strong><br />'.
00953                                 $this->renderSelectBox($ffPrefix.'[os]',$piConf['os'],$optValues);
00954                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00955 
00956                                 // Exec dependencies
00957                         $subContent='<strong>External program(s) (comma list):</strong><br />'.
00958                                 $this->renderStringBox($ffPrefix.'[exec]',$piConf['exec']).'<br />'.
00959                                 'Program(s) needed to run this service (eg. "perl").';
00960                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00961                 }
00962 
00963                 /* HOOK: Place a hook here, so additional output can be integrated */
00964                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_services'])) {
00965                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_services'] as $_funcRef) {
00966                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00967                   }
00968                 }
00969 
00970                 $content = '<table border="0" cellpadding="2" cellspacing="2">'.implode('',$lines).'</table>';
00971                 return $content;
00972         }
00973 
00977         function add_cat_emconf()       {
00978                 $lines=array();
00979 
00980                 $catID = "emconf";
00981                 $action = explode(":",$this->modData["wizAction"]);
00982                 if ($action[0]=="edit") {
00983                         $action[1]=1;
00984                         $this->regNewEntry($catID,$action[1]);
00985 
00986                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
00987                         $piConf = $this->wizArray[$catID][$action[1]];
00988                         $ffPrefix='['.$catID.']['.$action[1].']';
00989 
00990                         if (!$this->EMmode && $this->saveKey)   {
00991                                 $extKeyRec = $this->pObj->getExtKeyRecord($this->saveKey);
00992                         }
00993 
00994                                 // Title
00995                         $subContent="<strong>Title:</strong><BR>".
00996                                 $this->renderStringBox($ffPrefix."[title]",$piConf["title"]?$piConf["title"]:$extKeyRec["title"]);
00997                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00998 
00999                                 // Description
01000                         $subContent="<strong>Description:</strong><BR>".
01001                                 $this->renderStringBox($ffPrefix."[description]",$piConf["description"]?$piConf["description"]:$extKeyRec["description"]);
01002                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01003 
01004                                 // Sub-position
01005                         $optValues = Array(
01006                                 '' => '',
01007                                 'fe' => 'Frontend',
01008                                 'plugin' => 'Frontend Plugins',
01009                                 'be' => 'Backend',
01010                                 'module' => 'Backend Modules',
01011                                 'services' => 'Services',
01012                                 'example' => 'Examples',
01013                                 'misc' => 'Miscellaneous',
01014                                 'templates' => 'Templates',
01015                                 'doc' => 'Documentation',
01016                         );
01017                         $subContent="<strong>Category:</strong><BR>".
01018                                 $this->renderSelectBox($ffPrefix."[category]",$piConf["category"],$optValues);
01019                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01020 
01021 
01022 
01023 
01024                                 // State
01025                         $optValues = Array(
01026                                 "alpha" => "Alpha (Very initial development)",
01027                                 "beta" => "Beta (Under current development, should work partly)",
01028                                 "stable" => "Stable (Stable and used in production)",
01029                                 "experimental" => "Experimental (Nobody knows if this is going anywhere yet...)",
01030                                 "test" => "Test (Test extension, demonstrates concepts etc.)",
01031                         );
01032                         $subContent="<strong>State</strong><BR>".
01033                                 $this->renderSelectBox($ffPrefix."[state]",$piConf["state"],$optValues);
01034                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01035 
01036                                 // Dependencies
01037                         $subContent="<strong>Dependencies (comma list of extkeys):</strong><BR>".
01038                                 $this->renderStringBox($ffPrefix."[dependencies]",$piConf["dependencies"]);
01039                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01040 
01041 
01042 
01043 
01044                                 // Author
01045                         $subContent="<strong>Author Name:</strong><BR>".
01046                                 $this->renderStringBox($ffPrefix."[author]",$piConf["author"]?$piConf["author"]:$GLOBALS['BE_USER']->user['realName']);
01047                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01048 
01049                                 // Author/Email
01050                         $subContent="<strong>Author email:</strong><BR>".
01051                                 $this->renderStringBox($ffPrefix."[author_email]",$piConf["author_email"]?$piConf["author_email"]:$GLOBALS['BE_USER']->user['email']);
01052                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01053                 }
01054 
01055                 /* HOOK: Place a hook here, so additional output can be integrated */
01056                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_emconf'])) {
01057                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_emconf'] as $_funcRef) {
01058                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
01059                   }
01060                 }
01061 
01062                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
01063                 return $content;
01064         }
01065 
01069         function add_cat_save() {
01070                 $lines = array();
01071 
01072                 $catID = "save";
01073                 $action = explode(":",$this->modData["wizAction"]);
01074                 if ($action[0]=="edit") {
01075                         $action[1] = 1;
01076                         $this->regNewEntry($catID,$action[1]);
01077 
01078                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
01079                         $piConf = $this->wizArray[$catID];
01080                         $ffPrefix = '['.$catID.']';
01081 
01082 
01083                         $optValues = array();
01084                         $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tx_extrep_keytable', 'owner_fe_user='.intval($GLOBALS['TSFE']->fe_user->user['uid']).$GLOBALS['TSFE']->sys_page->enableFields('tx_extrep_keytable'));
01085                         while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
01086                                 $subres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'tx_extrep_repository', 'extension_uid='.intval($row['uid']).' AND emconf_state IN ("alpha","beta","stable")'.$GLOBALS['TSFE']->sys_page->enableFields('tx_extrep_repository'));
01087                                 list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($subres);
01088                                 if (!$count)    {
01089                                         $optValues[$row["extension_key"]]=$row["extension_key"].": ".$row["title"];
01090                                 }
01091                         }
01092                         if (count($optValues))  {
01093                                 $subContent = $this->renderSelectBox($ffPrefix."[extension_key]",$piConf["extension_key"],$optValues);
01094                         } else {
01095                                 $subContent = '<strong>Error:</strong> The Kickstarter allows you only to save to extensions which are not yet upgraded to alpha, beta or stable state. None of these were found, so you should register a new extension key before you can save!';
01096                         }
01097 
01098                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($this->textSetup("Select an extension key to save to:",$subContent)).'</td></tr>';
01099                 }
01100 
01101 
01102                 $this->makeRepositoryUpdateArray($piConf["extension_key"]);
01103 
01104                 /* HOOK: Place a hook here, so additional output can be integrated */
01105                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_save'])) {
01106                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_save'] as $_funcRef) {
01107                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
01108                   }
01109                 }
01110 
01111                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
01112                 return $content;
01113         }
01114 
01118         function add_cat_fields()       {
01119                 $lines=array();
01120 
01121                 $catID = "fields";
01122                 $action = explode(":",$this->modData["wizAction"]);
01123                 if ($action[0]=="edit") {
01124                         $this->regNewEntry($catID,$action[1]);
01125                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
01126                         $piConf = $this->wizArray[$catID][$action[1]];
01127                         $ffPrefix='['.$catID.']['.$action[1].']';
01128 
01129                 }
01130 
01131 
01132                                 // Header field
01133                         $optValues = array(
01134                                 "tt_content" => "Content (tt_content)",
01135                                 "fe_users" => "Frontend Users (fe_users)",
01136                                 "fe_groups" => "Frontend Groups (fe_groups)",
01137                                 "be_users" => "Backend Users (be_users)",
01138                                 "be_groups" => "Backend Groups (be_groups)",
01139                                 "tt_news" => "News (tt_news)",
01140                                 "tt_address" => "Address (tt_address)",
01141                                 "pages" => "Pages (pages)",
01142                         );
01143 
01144                         foreach($GLOBALS['TCA'] as $tablename => $tableTCA) {
01145                                 if(!$optValues[$tablename]) {
01146                                         $optValues[$tablename] = $GLOBALS['LANG']->sL($tableTCA['ctrl']['title']).' ('.$tablename.')';
01147                                 }
01148                         }
01149 
01150                         $subContent = "<strong>Which table:<BR></strong>".
01151                                         $this->renderSelectBox($ffPrefix."[which_table]",$piConf["which_table"],$optValues).
01152                                         $this->whatIsThis("Select the table which should be extended with these extra fields.");
01153                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).
01154                                 '<input type="hidden" name="'.$this->piFieldName("wizArray_upd").$ffPrefix.'[title]" value="'.($piConf["which_table"]?$optValues[$piConf["which_table"]]:"").'"></td></tr>';
01155 
01156 
01157 
01158 
01159 
01160                                 // PRESETS:
01161                         $selPresetBox=$this->presetBox($piConf["fields"]);
01162 
01163                                 // FIelds
01164                         $c=array(0);
01165                         $this->usedNames=array();
01166                         if (is_array($piConf["fields"]))        {
01167                                 $piConf["fields"] = $this->cleanFieldsAndDoCommands($piConf["fields"],$catID,$action[1]);
01168 
01169                                         // Do it for real...
01170                                 reset($piConf["fields"]);
01171                                 while(list($k,$v)=each($piConf["fields"]))      {
01172                                         $c[]=$k;
01173                                         $subContent=$this->renderField($ffPrefix."[fields][".$k."]",$v);
01174                                         $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw("<strong>FIELD:</strong> <em>".$v["fieldname"]."</em>").'</td></tr>';
01175                                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01176                                 }
01177                         }
01178 
01179 
01180                                 // New field:
01181                         $k=max($c)+1;
01182                         $v=array();
01183                         $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw("<strong>NEW FIELD:</strong>").'</td></tr>';
01184                         $subContent=$this->renderField($ffPrefix."[fields][".$k."]",$v,1);
01185                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01186 
01187 
01188                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw("<BR><BR>Load preset fields: <BR>".$selPresetBox).'</td></tr>';
01189 
01190                 /* HOOK: Place a hook here, so additional output can be integrated */
01191                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_fields'])) {
01192                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_fields'] as $_funcRef) {
01193                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
01194                   }
01195                 }
01196 
01197                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
01198                 return $content;
01199         }
01200 
01204         function add_cat_tables()       {
01205                 $lines=array();
01206 
01207                 $catID = "tables";
01208                 $action = explode(":",$this->modData["wizAction"]);
01209                 if ($action[0]=="edit") {
01210                         $this->regNewEntry($catID,$action[1]);
01211                         $lines = $this->catHeaderLines($lines,$catID,$this->options[$catID],"&nbsp;",$action[1]);
01212                         $piConf = $this->wizArray[$catID][$action[1]];
01213                         $ffPrefix='['.$catID.']['.$action[1].']';
01214 
01215                                 // Unique table name:
01216                         $table_suffixes=array();
01217                         if (is_array($this->wizArray[$catID]))  {
01218                                 reset($this->wizArray[$catID]);
01219                                 while(list($kk,$vv)=each($this->wizArray[$catID]))      {
01220                                         if (!strcmp($action[1],$kk))    {
01221                                                 if (count($table_suffixes) && t3lib_div::inList(implode(",",$table_suffixes),$vv["tablename"]."Z"))     {
01222                                                         $piConf["tablename"].=$kk;
01223                                                 }
01224                                                 break;
01225                                         }
01226                                         $table_suffixes[]=$vv["tablename"]."Z";
01227                                 }
01228                         }
01229 
01230 
01231                                 // Enter title of the table
01232                         $subContent="<strong>Tablename:</strong><BR>".
01233                                 $this->returnName($this->extKey,"tables")."_".$this->renderStringBox($ffPrefix."[tablename]",$piConf["tablename"]).
01234                                 "<BR><strong>Notice:</strong> Use characters a-z0-9 only. Only lowercase, no spaces.<BR>
01235                                 This becomes the table name in the database. ";
01236                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01237 
01238 
01239                                 // Enter title of the table
01240                         $subContent="<strong>Title of the table:</strong><BR>".
01241                                 $this->renderStringBox_lang("title",$ffPrefix,$piConf);
01242                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01243 
01244 
01245 
01246                                 // Fields - overview
01247                         $c=array(0);
01248                         $this->usedNames=array();
01249                         if (is_array($piConf["fields"]))        {
01250                                 $piConf["fields"] = $this->cleanFieldsAndDoCommands($piConf["fields"],$catID,$action[1]);
01251 
01252                                 // Do it for real...
01253                                 reset($piConf["fields"]);
01254                                 $lines[]='<tr'.$this->bgCol(1).'><td><strong> Fields Overview </strong></td></tr>';
01255 //                              $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw($v[1]).'</td></tr>';
01256                                 $lines[]='<tr><td></td></tr>';
01257 
01258                                 $subContent ='<tr '.$this->bgCol(2).'>
01259                                         <td><strong>Name</strong></td>
01260                                         <td><strong>Title</strong></td>
01261                                         <td><strong>Type</strong></td>
01262                                         <td><strong>Exclude?</strong></td>
01263                                         <td><strong>Details</strong></td>
01264                                 </tr>';
01265                                 while(list($k,$v)=each($piConf["fields"]))      {
01266                                         $c[]=$k;
01267                                         $subContent .=$this->renderFieldOverview($ffPrefix."[fields][".$k."]",$v);
01268                                 }
01269                                 $lines[]='<tr'.$this->bgCol(3).'><td><table>'.$this->fw($subContent).'</table></td></tr>';
01270                         }
01271 
01272                         $lines[]='<tr'.$this->bgCol(1).'><td><strong> Edit Fields </strong></td></tr>';
01273 //                      $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw($v[1]).'</td></tr>';
01274                         $lines[]='<tr><td></td></tr>';
01275 
01276 
01277 
01278 
01279                                 // Admin only
01280                         $subContent = "";
01281                         $subContent.= $this->renderCheckBox($ffPrefix."[add_deleted]",$piConf["add_deleted"],1)."Add 'Deleted' field ".$this->whatIsThis("Whole system: If a table has a deleted column, records are never really deleted, just 'marked deleted'. Thus deleted records can actually be restored by clearing a deleted-flag later.\nNotice that all attached files are also not deleted from the server, so if you expect the table to hold some heavy size uploads, maybe you should not set this...")."<BR>";
01282                         $subContent.= $this->renderCheckBox($ffPrefix."[add_hidden]",$piConf["add_hidden"],1)."Add 'Hidden' flag ".$this->whatIsThis("Frontend: The 'Hidden' flag will prevent the record from being displayed on the frontend.")."<BR>".$this->resImg("t_flag_hidden.png",'hspace=20','','<BR><BR>');
01283                         $subContent.= $this->renderCheckBox($ffPrefix."[add_starttime]",$piConf["add_starttime"])."Add 'Starttime' ".$this->whatIsThis("Frontend: If a 'Starttime' is set, the record will not be visible on the website, before that date arrives.")."<BR>".$this->resImg("t_flag_starttime.png",'hspace=20','','<BR><BR>');
01284                         $subContent.= $this->renderCheckBox($ffPrefix."[add_endtime]",$piConf["add_endtime"])."Add 'Endtime' ".$this->whatIsThis("Frontend: If a 'Endtime' is set, the record will be hidden from that date and into the future.")."<BR>".$this->resImg("t_flag_endtime.png",'hspace=20','','<BR><BR>');
01285                         $subContent.= $this->renderCheckBox($ffPrefix."[add_access]",$piConf["add_access"])."Add 'Access group' ".$this->whatIsThis("Frontend: If a frontend user group is set for a record, only frontend users that are members of that group will be able to see the record.")."<BR>".$this->resImg("t_flag_access.png",'hspace=20','','<BR><BR>');
01286                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01287 
01288                                 // Sorting
01289                         $optValues = array(
01290                                 "crdate" => "[crdate]",
01291                                 "cruser_id" => "[cruser_id]",
01292                                 "tstamp" => "[tstamp]",
01293                         );
01294                         $subContent = "";
01295                         $subContent.= $this->renderCheckBox($ffPrefix."[localization]",$piConf["localization"])."Enabled localization features".$this->whatIsThis("If set, the records will have a selector box for language and a reference field which can point back to the original default translation for the record. These features are part of the internal framework for localization.").'<BR>';
01296                         $subContent.= $this->renderCheckBox($ffPrefix."[versioning]",$piConf["versioning"])."Enable versioning ".$this->whatIsThis("If set, you will be able to versionize records from this table. Highly recommended if the records are passed around in a workflow.").'<BR>';
01297                         $subContent.= $this->renderCheckBox($ffPrefix."[sorting]",$piConf["sorting"])."Manual ordering of records ".$this->whatIsThis("If set, the records can be moved up and down relative to each other in the backend. Just like Content Elements. Otherwise they are sorted automatically by any field you specify").'<BR>';
01298                         $subContent.= $this->textSetup("","If 'Manual ordering' is not set, order the table by this field:<BR>".
01299                                 $this->renderSelectBox($ffPrefix."[sorting_field]",$piConf["sorting_field"],$this->currentFields($optValues,$piConf["fields"]))."<BR>".
01300                                 $this->renderCheckBox($ffPrefix."[sorting_desc]",$piConf["sorting_desc"])." Descending");
01301                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01302 
01303                                 // Type field
01304                         $optValues = array(
01305                                 "0" => "[none]",
01306                         );
01307                         $subContent = "<strong>'Type-field', if any:<BR></strong>".
01308                                         $this->renderSelectBox($ffPrefix."[type_field]",$piConf["type_field"],$this->currentFields($optValues,$piConf["fields"])).
01309                                         $this->whatIsThis("A 'type-field' is the field in the table which determines how the form is rendered in the backend, eg. which fields are shown under which circumstances.\nFor instance the Content Element table 'tt_content' has a type-field, CType. The value of this field determines if the editing form shows the bodytext field as is the case when the type is 'Text' or if also the image-field should be shown as when the type is 'Text w/Image'");
01310                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01311 
01312                                 // Header field
01313                         $optValues = array(
01314                                 "0" => "[none]",
01315                         );
01316                         $subContent = "<strong>Label-field:<BR></strong>".
01317                                         $this->renderSelectBox($ffPrefix."[header_field]",$piConf["header_field"],$this->currentFields($optValues,$piConf["fields"])).
01318                                         $this->whatIsThis("A 'label-field' is the field used as record title in the backend.");
01319                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01320 
01321                                 // Icon
01322                         $optValues = array(
01323                                 "default.gif" => "Default (white)",
01324                                 "default_black.gif" => "Black",
01325                                 "default_gray4.gif" => "Gray",
01326                                 "default_blue.gif" => "Blue",
01327                                 "default_green.gif" => "Green",
01328                                 "default_red.gif" => "Red",
01329                                 "default_yellow.gif" => "Yellow",
01330                                 "default_purple.gif" => "Purple",
01331                         );
01332 
01333                         $subContent= $this->renderSelectBox($ffPrefix."[defIcon]",$piConf["defIcon"],$optValues)." Default icon ".$this->whatIsThis("All tables have at least one associated icon. Select which default icon you wish. You can always substitute the file with another.");
01334                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01335 
01336                                 // Allowed on pages
01337                         $subContent = "<strong>Allowed on pages:<BR></strong>".
01338                                         $this->renderCheckBox($ffPrefix."[allow_on_pages]",$piConf["allow_on_pages"])." Allow records from this table to be created on regular pages.";
01339                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01340 
01341                                 // Allowed in "Insert Records"
01342                         $subContent = "<strong>Allowed in 'Insert Records' field in content elements:<BR></strong>".
01343                                         $this->renderCheckBox($ffPrefix."[allow_ce_insert_records]",$piConf["allow_ce_insert_records"])." Allow records from this table to be linked to by content elements.";
01344                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01345 
01346                                 // Add new button
01347                         $subContent = "<strong>Add 'Save and new' button in forms:<BR></strong>".
01348                                         $this->renderCheckBox($ffPrefix."[save_and_new]",$piConf["save_and_new"])." Will add an additional save-button to forms by which you can save the item and instantly create the next.";
01349                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01350 
01351 
01352                         $subContent = "<strong>Notice on fieldnames:<BR></strong>".
01353                                 "Don't use fieldnames from this list of reserved names/words: <BR>
01354                                 <blockquote><em>".implode(", ",explode(",",$this->reservedTypo3Fields.",".$this->mysql_reservedFields))."</em></blockquote>";
01355                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01356 
01357 
01358 
01359                                 // PRESETS:
01360                         $selPresetBox=$this->presetBox($piConf["fields"]);
01361 
01362                                 // Fields
01363                         $c=array(0);
01364                         $this->usedNames=array();
01365                         if (is_array($piConf["fields"]))        {
01366 
01367                                 // Do it for real...
01368                                 reset($piConf["fields"]);
01369                                 while(list($k,$v)=each($piConf["fields"]))      {
01370                                         $c[]=$k;
01371                                         $subContent=$this->renderField($ffPrefix."[fields][".$k."]",$v);
01372                                         $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw("<strong>FIELD:</strong> <em>".$v["fieldname"]."</em>").'</td></tr>';
01373                                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01374                                 }
01375                         }
01376 
01377                                 // New field:
01378                         $k=max($c)+1;
01379                         $v=array();
01380                         $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw("<strong>NEW FIELD:</strong>").'</td></tr>';
01381                         $subContent=$this->renderField($ffPrefix."[fields][".$k."]",$v,1);
01382                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
01383 
01384 
01385                         $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw("<BR><BR>Load preset fields: <BR>".$selPresetBox).'</td></tr>';
01386                 }
01387 
01388                 /* HOOK: Place a hook here, so additional output can be integrated */
01389                 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_tables'])) {
01390                   foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_tables'] as $_funcRef) {
01391                     $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
01392                   }
01393                 }
01394 
01395                 $content = '<table border=0 cellpadding=2 cellspacing=2>'.implode("",$lines).'</table>';
01396 
01397                 return $content;
01398         }
01399 
01403         function renderFieldOverview($prefix,$fConf,$dontRemove=0)      {
01404                         // Sorting
01405                 $optTypes = array(
01406                         "" => "",
01407                         "input" => "String input",
01408                         "input+" => "String input, advanced",
01409                         "textarea" => "Text area",
01410                         "textarea_rte" => "Text area with RTE",
01411                         "textarea_nowrap" => "Text area, No wrapping",
01412                         "check" => "Checkbox, single",
01413                         "check_4" => "Checkbox, 4 boxes in a row",
01414                         "check_10" => "Checkbox, 10 boxes in two rows (max)",
01415                         "link" => "Link",
01416                         "date" => "Date",
01417                         "datetime" => "Date and time",
01418                         "integer" => "Integer, 10-1000",
01419                         "select" => "Selectorbox",
01420                         "radio" => "Radio buttons",
01421                         "rel" => "Database relation",
01422                         "files" => "Files",
01423                 );
01424                 $optEval = array(
01425                         "" => "",
01426                         "date" => "Date (day-month-year)",
01427                         "time" => "Time (hours, minutes)",
01428                         "timesec" => "Time + seconds",
01429                         "datetime" => "Date + Time",
01430                         "year" => "Year",
01431                         "int" => "Integer",
01432                         "int+" => "Integer 0-1000",
01433                         "double2" => "Floating point, x.xx",
01434                         "alphanum" => "Alphanumeric only",
01435                         "upper" => "Upper case",
01436                         "lower" => "Lower case",
01437                 );
01438                 $optRte = array(
01439                         "tt_content" => "Transform like 'Bodytext'",
01440                         "basic" => "Typical (based on CSS)",
01441                         "moderate" => "Transform images / links",
01442                         "none" => "No transform",
01443                         "custom" => "Custom transform"
01444                 );
01445 
01446                 switch($fConf['type']) {
01447                         case 'rel':
01448                                 if ($fConf['conf_rel_table'] == '_CUSTOM') {
01449                                         $details .= $fConf['conf_custom_table_name'];
01450                                 } else {
01451                                         $details .= $fConf['conf_rel_table'];
01452                                 }
01453                         break;
01454                         case 'input+':
01455                                 if($fConf['conf_varchar']) $details[] = 'varchar';
01456                                 if($fConf['conf_unique']) $details[] = ($fConf['conf_unique'] == 'L') ?  'unique (page)': 'unique (site)';
01457                                 if($fConf['conf_eval']) $details[] = $optEval[$fConf['conf_eval']];
01458                                 $details = implode(', ', (array) $details);
01459                         break;
01460                         case 'check_10':
01461                         case 'check_4':
01462                                 $details = ($fConf['conf_numberBoxes'] ? $fConf['conf_numberBoxes'] : '4') . ' checkboxes';
01463                         break;
01464                         case 'radio':
01465                                 if($fConf['conf_select_items']) $details = $fConf['conf_select_items'] . ' options';
01466                         break;
01467                         case 'select':
01468                                 if($fConf['conf_select_items']) $details[] = $fConf['conf_select_items'] . ' options';
01469                                 if($fConf['conf_select_pro']) $details[] = 'preprocessing';
01470                                 $details = implode(', ', (array) $details);
01471                         break;
01472                         case 'textarea_rte':
01473                                 if($fConf['conf_rte']) $details = $optRte[$fConf['conf_rte']];
01474                         break;
01475                         case 'files':
01476                                 $details[] = $fConf['conf_files_type'];
01477                                 $details[] = $fConf['conf_files'] . ' files';
01478                                 $details[] = $fConf['conf_max_filesize'] . ' kB';
01479                                 $details = implode(', ', (array) $details);
01480                         break;
01481                 }
01482                 return sprintf('<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>',
01483                         $fConf['fieldname'],
01484                         $fConf['title'],
01485                         $optTypes[$fConf['type']],
01486                         $fConf['exludeField'] ? 'Yes' : '',
01487                         $details
01488                         );
01489         }
01490 
01491 
01492         function presetBox(&$piConfFields)      {
01493                 $_PRESETS = $this->modData["_PRESET"];
01494 
01495                 $optValues = array();
01496 
01497                 /* Static Presets from DB-Table are disabled. Just leave the code in here for possible future use */
01498                 //              $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'kickstarter_static_presets', '');
01499                 //              while($presetRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
01500                 //                      $optValues[] = '<option value="'.htmlspecialchars($presetRow["fieldname"]).'">'.htmlspecialchars($presetRow["title"]." (".$presetRow["fieldname"].", type: ".$presetRow["type"].")").'</option>';
01501                 //                      if (is_array($_PRESETS) && in_array($presetRow["fieldname"],$_PRESETS)) {
01502                 //                              if (!is_array($piConfFields))   $piConfFields=array();
01503                 //                              $piConfFields[] = unserialize($presetRow["appdata"]);
01504                 //                      }
01505                 //              }
01506 
01507                         // Session presets:
01508                 $ses_optValues=array();
01509                 $sesdat = $GLOBALS["BE_USER"]->getSessionData("kickstarter");
01510                 if (is_array($sesdat["presets"]))       {
01511                         reset($sesdat["presets"]);
01512                         while(list($kk1,$vv1)=each($sesdat["presets"])) {
01513                                 if (is_array($vv1))     {
01514                                         reset($vv1);
01515                                         while(list($kk2,$vv2)=each($vv1))       {
01516                                                 $ses_optValues[]='<option value="'.htmlspecialchars($kk1.".".$vv2["fieldname"]).'">'.htmlspecialchars($kk1.": ".$vv2["title"]." (".$vv2["fieldname"].", type: ".$vv2["type"].")").'</option>';
01517                                                 if (is_array($_PRESETS) && in_array($kk1.".".$vv2["fieldname"],$_PRESETS))      {
01518                                                         if (!is_array($piConfFields))   $piConfFields=array();
01519                                                         $piConfFields[] = $vv2;
01520                                                 }
01521                                         }
01522                                 }
01523                         }
01524                 }
01525                 if (count($ses_optValues))      {
01526                         $optValues = array_merge($optValues,count($optValues)?array('<option value=""></option>'):array(),array('<option value="">__Fields picked up in this session__:</option>'),$ses_optValues);
01527                 }
01528                 if (count($optValues))          $selPresetBox = '<select name="'.$this->piFieldName("_PRESET").'[]" size='.t3lib_div::intInRange(count($optValues),1,10).' multiple>'.implode("",$optValues).'</select>';
01529                 return $selPresetBox;
01530         }
01531         function cleanFieldsAndDoCommands($fConf,$catID,$action)        {
01532                 $newFConf=array();
01533                 $downFlag=0;
01534                 reset($fConf);
01535                 while(list($k,$v)=each($fConf)) {
01536                         if ($v["type"] && trim($v["fieldname"]))        {
01537                                 $v["fieldname"] = $this->cleanUpFieldName($v["fieldname"]);
01538 
01539                                 if (!$v["_DELETE"])     {
01540                                         $newFConf[$k]=$v;
01541                                         if (t3lib_div::_GP($this->varPrefix.'_CMD_'.$v["fieldname"].'_UP_x') || $downFlag)      {
01542                                                 if (count($newFConf)>=2)        {
01543                                                         $lastKeys = array_slice(array_keys($newFConf),-2);
01544 
01545                                                         $buffer = Array();
01546                                                         $buffer[$lastKeys[1]] = $newFConf[$lastKeys[1]];
01547                                                         $buffer[$lastKeys[0]] = $newFConf[$lastKeys[0]];
01548 
01549                                                         unset($newFConf[$lastKeys[0]]);
01550                                                         unset($newFConf[$lastKeys[1]]);
01551 
01552                                                         $newFConf[$lastKeys[1]] = $buffer[$lastKeys[1]];
01553                                                         $newFConf[$lastKeys[0]] = $buffer[$lastKeys[0]];
01554                                                 }
01555                                                 $downFlag=0;
01556                                         } elseif (t3lib_div::_GP($this->varPrefix.'_CMD_'.$v["fieldname"].'_DOWN_x'))   {
01557                                                 $downFlag=1;
01558                                         }
01559                                 }
01560 
01561                                         // PRESET:
01562                                 //                              if (t3lib_div::_GP($this->varPrefix.'_CMD_'.$v["fieldname"].'_SAVE_x')) {
01563                                 //                                      $datArr=Array(
01564                                 //                                              "fieldname" => $v["fieldname"],
01565                                 //                                              "title" => $v["title"],
01566 //                                              "type" => $v["type"],
01567 //                                              "appdata" => serialize($v),
01568 //                                              "tstamp" => time()
01569 //                                      );
01570 
01571 //                                      $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('fieldname', 'kickstarter_static_presets', 'fieldname="'.$GLOBALS['TYPO3_DB']->quoteStr($v['fieldname'], 'kickstarter_static_presets').'"');
01572 //                                      if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) || $v["_DELETE"])  {
01573 //                                              if ($v["_DELETE"])      {
01574 //                                                      $GLOBALS['TYPO3_DB']->exec_DELETEquery('kickstarter_static_presets', 'fieldname="'.$GLOBALS['TYPO3_DB']->quoteStr($v['fieldname'], 'kickstarter_static_presets').'"');
01575 //                                              } else {
01576 //                                                      $GLOBALS['TYPO3_DB']->exec_UPDATEquery('kickstarter_static_presets', 'fieldname="'.$GLOBALS['TYPO3_DB']->quoteStr($v['fieldname'], 'kickstarter_static_presets').'"', $datArr);
01577 //                                              }
01578 //                                      } else {
01579 //                                              $GLOBALS['TYPO3_DB']->exec_INSERTquery("kickstarter_static_presets", $datArr);
01580 //                                      }
01581 //                              }
01582                         } else {
01583                           //                            unset($this->wizArray[$catID][$action]["fields"][$k]);
01584                           //                            unset($fConf[$k]);
01585                         }
01586                 }
01587                 //              debug($newFConf);
01588                 $this->wizArray[$catID][$action]["fields"] = $newFConf;
01589                 $sesdat = $GLOBALS["BE_USER"]->getSessionData("kickstarter");
01590                 $sesdat["presets"][$this->extKey."-".$catID."-".$action]=$newFConf;
01591                 $GLOBALS["BE_USER"]->setAndSaveSessionData("kickstarter",$sesdat);
01592 
01593 #debug($newFConf);
01594                 return $newFConf;
01595         }
01596 
01597 
01598         function renderField($prefix,$fConf,$dontRemove=0)      {
01599                 $onCP = $this->getOnChangeParts($prefix."[fieldname]");
01600                 $fieldName = $this->renderStringBox($prefix."[fieldname]",$fConf["fieldname"]).
01601                         (!$dontRemove?" (Remove:".$this->renderCheckBox($prefix."[_DELETE]",0).')'.
01602                                 '<input type="image" hspace=2 src="'.$this->siteBackPath.TYPO3_mainDir.'gfx/pil2up.gif" name="'.$this->varPrefix.'_CMD_'.$fConf["fieldname"].'_UP" onClick="'.$onCP[1].'">'.
01603                                 '<input type="image" hspace=2 src="'.$this->siteBackPath.TYPO3_mainDir.'gfx/pil2down.gif" name="'.$this->varPrefix.'_CMD_'.$fConf["fieldname"].'_DOWN" onClick="'.$onCP[1].'">'.
01604                                 '<input type="image" hspace=2 src="'.$this->siteBackPath.TYPO3_mainDir.'gfx/savesnapshot.gif" name="'.$this->varPrefix.'_CMD_'.$fConf["fieldname"].'_SAVE" onClick="'.$onCP[1].'" title="Save this field setting as a preset.">':'');
01605 
01606                 $fieldTitle = ((string)$fConf["type"] != 'passthrough') ? $this->renderStringBox_lang("title",$prefix,$fConf) : '';
01607                 $typeCfg = "";
01608 
01609                         // Sorting
01610                 $optValues = array(
01611                         "" => "",
01612                         "input" => "String input",
01613                         "input+" => "String input, advanced",
01614                         "textarea" => "Text area",
01615                         "textarea_rte" => "Text area with RTE",
01616                         "textarea_nowrap" => "Text area, No wrapping",
01617                         "check" => "Checkbox, single",
01618                         "check_4" => "Checkbox, 4 boxes in a row",
01619                         "check_10" => "Checkbox, 10 boxes in two rows (max)",
01620                         "link" => "Link",
01621                         "date" => "Date",
01622                         "datetime" => "Date and time",
01623                         "integer" => "Integer, 10-1000",
01624                         "select" => "Selectorbox",
01625                         "radio" => "Radio buttons",
01626                         "rel" => "Database relation",
01627                         "files" => "Files",
01628                         "none" => "Not editable, only displayed",
01629                         "passthrough" => "[Passthrough]",
01630                 );
01631                 $typeCfg.=$this->renderSelectBox($prefix."[type]",$fConf["type"],$optValues);
01632                 $typeCfg.=$this->renderCheckBox($prefix."[excludeField]",isset($fConf["excludeField"])?$fConf["excludeField"]:1)." Is Exclude-field ".$this->whatIsThis("If a field is marked 'Exclude-field', users can edit it ONLY if the field is specifically listed in one of the backend user groups of the user.\nIn other words, if a field is marked 'Exclude-field' you can control which users can edit it and which cannot.")."<BR>";
01633 
01634                 $fDetails="";
01635                 switch((string)$fConf["type"])  {
01636                         case "input+":
01637                                 $typeCfg.=$this->resImg("t_input.png",'','');
01638 
01639                                 $fDetails.=$this->renderStringBox($prefix."[conf_size]",$fConf["conf_size"],50)." Field width (5-48 relative, 30 default)<BR>";
01640                                 $fDetails.=$this->renderStringBox($prefix."[conf_max]",$fConf["conf_max"],50)." Max characters<BR>";
01641                                 $fDetails.=$this->renderCheckBox($prefix."[conf_required]",$fConf["conf_required"])."Required<BR>";
01642                                 $fDetails.=$this->resImg("t_input_required.png",'hspace=20','','<BR><BR>');
01643 
01644                                 $fDetails.=$this->renderCheckBox($prefix."[conf_varchar]",$fConf["conf_varchar"])."Create VARCHAR, not TINYTEXT field (if not forced INT)<BR>";
01645 
01646                                 $fDetails.=$this->renderCheckBox($prefix."[conf_check]",$fConf["conf_check"])."Apply checkbox<BR>";
01647                                 $fDetails.=$this->resImg("t_input_check.png",'hspace=20','','<BR><BR>');
01648 
01649                                 $optValues = array(
01650                                         "" => "",
01651                                         "date" => "Date (day-month-year)",
01652                                         "time" => "Time (hours, minutes)",
01653                                         "timesec" => "Time + seconds",
01654                                         "datetime" => "Date + Time",
01655                                         "year" => "Year",
01656                                         "int" => "Integer",
01657                                         "int+" => "Integer 0-1000",
01658                                         "double2" => "Floating point, x.xx",
01659                                         "alphanum" => "Alphanumeric only",
01660                                         "upper" => "Upper case",
01661                                         "lower" => "Lower case",
01662                                 );
01663                                 $fDetails.="<BR>Evaluate value to:<BR>".$this->renderSelectBox($prefix."[conf_eval]",$fConf["conf_eval"],$optValues)."<BR>";
01664                                 $fDetails.=$this->renderCheckBox($prefix."[conf_stripspace]",$fConf["conf_stripspace"])."Strip space<BR>";
01665                                 $fDetails.=$this->renderCheckBox($prefix."[conf_pass]",$fConf["conf_pass"])."Is password field<BR>";
01666                                 $fDetails.=$this->resImg("t_input_password.png",'hspace=20','','<BR><BR>');
01667 
01668                                 $fDetails.="<BR>";
01669                                 $fDetails.=$this->renderRadioBox($prefix."[conf_unique]",$fConf["conf_unique"],"G")."Unique in whole database<BR>";
01670                                 $fDetails.=$this->renderRadioBox($prefix."[conf_unique]",$fConf["conf_unique"],"L")."Unique inside parent page<BR>";
01671                                 $fDetails.=$this->renderRadioBox($prefix."[conf_unique]",$fConf["conf_unique"],"")."Not unique (default)<BR>";
01672                                 $fDetails.="<BR>";
01673                                 $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_color]",$fConf["conf_wiz_color"])."Add colorpicker wizard<BR>";
01674                                 $fDetails.=$this->resImg("t_input_colorwiz.png",'hspace=20','','<BR><BR>');
01675                                 $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_link]",$fConf["conf_wiz_link"])."Add link wizard<BR>";
01676                                 $fDetails.=$this->resImg("t_input_link2.png",'hspace=20','','<BR><BR>');
01677                         break;
01678                         case "input":
01679                                 $typeCfg.=$this->resImg("t_input.png",'','');
01680 
01681                                 $fDetails.=$this->renderStringBox($prefix."[conf_size]",$fConf["conf_size"],50)." Field width (5-48 relative, 30 default)<BR>";
01682                                 $fDetails.=$this->renderStringBox($prefix."[conf_max]",$fConf["conf_max"],50)." Max characters<BR>";
01683                                 $fDetails.=$this->renderCheckBox($prefix."[conf_required]",$fConf["conf_required"])."Required<BR>";
01684                                 $fDetails.=$this->resImg("t_input_required.png",'hspace=20','','<BR><BR>');
01685 
01686                                 $fDetails.=$this->renderCheckBox($prefix."[conf_varchar]",$fConf["conf_varchar"])."Create VARCHAR, not TINYTEXT field<BR>";
01687                         break;
01688                         case "textarea":
01689                         case "textarea_nowrap":
01690                                 $typeCfg.=$this->resImg("t_textarea.png",'','');
01691 
01692                                 $fDetails.=$this->renderStringBox($prefix."[conf_cols]",$fConf["conf_cols"],50)." Textarea width (5-48 relative, 30 default)<BR>";
01693                                 $fDetails.=$this->renderStringBox($prefix."[conf_rows]",$fConf["conf_rows"],50)." Number of rows (height)<BR>";
01694                                 $fDetails.="<BR>";
01695                                 $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_example]",$fConf["conf_wiz_example"])."Add wizard example<BR>";
01696                                 $fDetails.=$this->resImg("t_textarea_wiz.png",'hspace=20','','<BR><BR>');
01697                         break;
01698                         case "textarea_rte":
01699                                 $typeCfg.=$this->resImg($fConf["conf_rte"]!="tt_content"?"t_rte.png":"t_rte2.png",'','');
01700 
01701                                 $optValues = array(
01702                                         "tt_content" => "Transform content like the Content Element 'Bodytext' field (default/old)",
01703                                         "basic" => "Typical basic setup (new 'Bodytext' field based on CSS stylesheets)",
01704                                         "moderate" => "Moderate transform of images and links",
01705                                         "none" => "No transformation at all",
01706                                         "custom" => "Custom"
01707                                 );
01708                                 $fDetails.="<BR>Rich Text Editor Mode:<BR>".$this->renderSelectBox($prefix."[conf_rte]",$fConf["conf_rte"],$optValues)."<BR>";
01709                                 if ((string)$fConf["conf_rte"]=="custom")       {
01710                                         $optValues = array(
01711                                                 "cut" => array("Cut button"),
01712                                                 "copy" => array("Copy button"),
01713                                                 "paste" => array("Paste button"),
01714                                                 "formatblock" => array("Paragraph formatting","<DIV>, <P>"),
01715                                                 "class" => array("Character formatting","<SPAN>)"),
01716                                                 "fontstyle" => array("Font face","<FONT face=>)"),
01717                                                 "fontsize" => array("Font size","<FONT size=>)"),
01718                                                 "textcolor" => array("Font color","<FONT color=>"),
01719                                                 "bold" => array("Bold","<STRONG>, <B>"),
01720                                                 "italic" => array("italic","<EM>, <I>"),
01721                                                 "underline" => array("Underline","<U>"),
01722                                                 "left" => array("Left align","<DIV>, <P>"),
01723                                                 "center" => array("Center align","<DIV>, <P>"),
01724                                                 "right" => array("Right align","<DIV>, <P>"),
01725                                                 "orderedlist" => array("Ordered bulletlist","<OL>, <LI>"),
01726                                                 "unorderedlist" => array("Unordered bulletlist","<UL>, <LI>"),
01727                                                 "outdent" => array("Outdent block","<BLOCKQUOTE>"),
01728                                                 "indent" => array("Indent block","<BLOCKQUOTE>"),
01729                                                 "link" => array("Link","<A>"),
01730                                                 "table" => array("Table","<TABLE>, <TR>, <TD>"),
01731                                                 "image" => array("Image","<IMG>"),
01732                                                 "line" => array("Ruler","<HR>"),
01733                                                 "user" => array("User defined",""),
01734                                                 "chMode" => array("Edit source?","")
01735                                         );
01736                                         $subLines=array();
01737                                         $subLines[]='<tr>
01738                                                 <td>&nbsp;</td>
01739                                                 <td>&nbsp;</td>
01740                                                 <td><strong>'.$this->fw("Button name:").'</strong></td>
01741                                                 <td><strong>'.$this->fw("Tags allowed:").'</strong></td>
01742                                         </tr>';
01743                                         reset($optValues);
01744                                         while(list($kk,$vv)=each($optValues))   {
01745                                                 $subLines[]='<tr>
01746                                                         <td>'.$this->renderCheckBox($prefix."[conf_rte_b_".$kk."]",$fConf["conf_rte_b_".$kk]).'</td>
01747                                                         <td>'.$this->resIcon($kk.".png").'</td>
01748                                                         <td>'.$this->fw($vv[0]).'</td>
01749                                                         <td>'.$this->fw(htmlspecialchars($vv[1])).'</td>
01750                                                 </tr>';
01751                                         }
01752                                         $fDetails.='<table border=0 cellpadding=2 cellspacing=2>'.implode("",$subLines).'</table><BR>';
01753 
01754                                         $fDetails.="<BR><strong>Define specific colors:</strong><BR>
01755                                                 <em>Notice: Use only HEX-values for colors ('blue' should be #0000ff etc.)</em><BR>";
01756                                         for($a=1;$a<4;$a++)     {
01757                                                 $fDetails.="Color #".$a.": ".$this->renderStringBox($prefix."[conf_rte_color".$a."]",$fConf["conf_rte_color".$a],70)."<BR>";
01758                                         }
01759                                         $fDetails.=$this->resImg("t_rte_color.png",'','','<BR><BR>');
01760 
01761                                         $fDetails.=$this->renderCheckBox($prefix."[conf_rte_removecolorpicker]",$fConf["conf_rte_removecolorpicker"])."Hide colorpicker<BR>";
01762                                         $fDetails.=$this->resImg("t_rte_colorpicker.png",'hspace=20','','<BR><BR>');
01763 
01764                                         $fDetails.="<BR><strong>Define classes:</strong><BR>";
01765                                         for($a=1;$a<7;$a++)     {
01766                                                 $fDetails.="Class Title:".$this->renderStringBox($prefix."[conf_rte_class".$a."]",$fConf["conf_rte_class".$a],100).
01767                                                         "<BR>CSS Style: {".$this->renderStringBox($prefix."[conf_rte_class".$a."_style]",$fConf["conf_rte_class".$a."_style"],250)."}".
01768                                                 "<BR>";
01769                                         }
01770                                         $fDetails.=$this->resImg("t_rte_class.png",'','','<BR><BR>');
01771 
01772 #                                       $fDetails.=$this->renderCheckBox($prefix."[conf_rte_removePdefaults]",$fConf["conf_rte_removePdefaults"])."<BR>";
01773                                         $optValues = array(
01774                                                 "0" => "",
01775                                                 "1" => "Hide Hx and PRE from Paragraph selector.",
01776                                                 "H2H3" => "Hide all, but H2,H3,P,PRE",
01777                                         );
01778                                         $fDetails.="<BR>Hide Paragraph Items:<BR>".$this->renderSelectBox($prefix."[conf_rte_removePdefaults]",$fConf["conf_rte_removePdefaults"],$optValues)."<BR>";
01779                                         $fDetails.=$this->resImg("t_rte_hideHx.png",'hspace=20','','<BR><BR>');
01780 
01781                                         $fDetails.="<BR><strong>Misc:</strong><BR>";
01782 //                                      $fDetails.=$this->renderCheckBox($prefix."[conf_rte_custom_php_processing]",$fConf["conf_rte_custom_php_processing"])."Custom PHP processing of content<BR>";
01783                                         $fDetails.=$this->renderCheckBox($prefix."[conf_rte_div_to_p]",isset($fConf["conf_rte_div_to_p"])?$fConf["conf_rte_div_to_p"]:1).htmlspecialchars("Convert all <DIV> to <P>")."<BR>";
01784                                 }
01785 
01786                                 $fDetails.="<BR>";
01787                                 $fDetails.=$this->renderCheckBox($prefix."[conf_rte_fullscreen]",isset($fConf["conf_rte_fullscreen"])?$fConf["conf_rte_fullscreen"]:1)."Fullscreen link<BR>";
01788                                 $fDetails.=$this->resImg("t_rte_fullscreen.png",'hspace=20','','<BR><BR>');
01789 
01790                                 if (t3lib_div::inList("moderate,basic,custom",$fConf["conf_rte"]))      {
01791                                         $fDetails.="<BR>";
01792                                         $fDetails.=$this->renderCheckBox($prefix."[conf_rte_separateStorageForImages]",isset($fConf["conf_rte_separateStorageForImages"])?$fConf["conf_rte_separateStorageForImages"]:1)."Storage of images in separate folder (in uploads/[extfolder]/rte/)<BR>";
01793                                 }
01794                                 if (t3lib_div::inList("moderate,custom",$fConf["conf_rte"]))    {
01795                                         $fDetails.="<BR>";
01796                                         $fDetails.=$this->renderCheckBox($prefix."[conf_mode_cssOrNot]",isset($fConf["conf_mode_cssOrNot"])?$fConf["conf_mode_cssOrNot"]:1)."Use 'ts_css' transformation instead of 'ts_images-ts-reglinks'<BR>";
01797                                 }
01798                         break;
01799                         case "check":
01800                                 $typeCfg.=$this->resImg("t_input_link.png",'','');
01801                                 $fDetails.=$this->renderCheckBox($prefix."[conf_check_default]",$fConf["conf_check_default"])."Checked by default<BR>";
01802                         break;
01803                         case "select":
01804                         case "radio":
01805                                 if ($fConf["type"]=="radio")    {
01806                                         $typeCfg.=$this->resImg("t_radio.png",'','');
01807                                 } else  {
01808                                         $typeCfg.=$this->resImg("t_sel.png",'','');
01809                                 }
01810                                 $fDetails.="<BR><strong>Define values:</strong><BR>";
01811                                 $subLines=array();
01812                                         $subLines[]='<tr>
01813                                                 <td valign=top>'.$this->fw("Item label:").'</td>
01814                                                 <td valign=top>'.$this->fw("Item value:").'</td>
01815                                         </tr>';
01816                                 $nItems = $fConf["conf_select_items"] = isset($fConf["conf_select_items"])?t3lib_div::intInRange(intval($fConf["conf_select_items"]),0,20):4;
01817                                 for($a=0;$a<$nItems;$a++)       {
01818                                         $subLines[]='<tr>
01819                                                 <td valign=top>'.$this->fw($this->renderStringBox_lang("conf_select_item_".$a,$prefix,$fConf)).'</td>
01820                                                 <td valign=top>'.$this->fw($this->renderStringBox($prefix."[conf_select_itemvalue_".$a."]",isset($fConf["conf_select_itemvalue_".$a])?$fConf["conf_select_itemvalue_".$a]:$a,50)).'</td>
01821                                         </tr>';
01822                                 }
01823                                 $fDetails.='<table border=0 cellpadding=2 cellspacing=2>'.implode("",$subLines).'</table><BR>';
01824                                 $fDetails.=$this->renderStringBox($prefix."[conf_select_items]",$fConf["conf_select_items"],50)." Number of values<BR>";
01825 
01826                                 if ($fConf["type"]=="select")   {
01827                                         $fDetails.=$this->renderCheckBox($prefix."[conf_select_icons]",$fConf["conf_select_icons"])."Add a dummy set of icons<BR>";
01828                                         $fDetails.=$this->resImg("t_select_icons.png",'hspace=20','','<BR><BR>');
01829 
01830                                         $fDetails.=$this->renderStringBox($prefix."[conf_relations]",t3lib_div::intInRange($fConf["conf_relations"],1,1000),50)." Max number of relations<BR>";
01831                                         $fDetails.=$this->renderStringBox($prefix."[conf_relations_selsize]",t3lib_div::intInRange($fConf["conf_relations_selsize"],1,50),50)." Size of selector box<BR>";
01832 
01833                                         $fDetails.=$this->renderCheckBox($prefix."[conf_select_pro]",$fConf["conf_select_pro"])."Add pre-processing with PHP-function<BR>";
01834                                 }
01835                         break;
01836                         case "rel":
01837                                 if ($fConf["conf_rel_type"]=="group" || !$fConf["conf_rel_type"])       {
01838                                         $typeCfg.=$this->resImg("t_rel_group.png",'','');
01839                                 } elseif(intval($fConf["conf_relations"])>1)    {
01840                                         $typeCfg.=$this->resImg("t_rel_selmulti.png",'','');
01841                                 } elseif(intval($fConf["conf_relations_selsize"])>1)    {
01842                                         $typeCfg.=$this->resImg("t_rel_selx.png",'','');
01843                                 } else {
01844                                         $typeCfg.=$this->resImg("t_rel_sel1.png",'','');
01845                                 }
01846 
01847 
01848                                 $optValues = array(
01849                                         "pages" => "Pages table, (pages)",
01850                                         "fe_users" => "Frontend Users, (fe_users)",
01851                                         "fe_groups" => "Frontend Usergroups, (fe_groups)",
01852                                         "tt_content" => "Content elements, (tt_content)",
01853                                         "_CUSTOM" => "Custom table (enter name below)",
01854                                         "_ALL" => "All tables allowed!",
01855                                 );
01856                                 if ($fConf["conf_rel_type"]!="group")   {unset($optValues["_ALL"]);}
01857                                 $optValues = $this->addOtherExtensionTables($optValues);
01858                                 $fDetails.="<BR>Create relation to table:<BR>".$this->renderSelectBox($prefix."[conf_rel_table]",$fConf["conf_rel_table"],$optValues)."<BR>";
01859                                 if ($fConf["conf_rel_table"]=="_CUSTOM")        $fDetails.="Custom table name: ".$this->renderStringBox($prefix."[conf_custom_table_name]",$fConf["conf_custom_table_name"],200)."<BR>";
01860 
01861                                 $optValues = array(
01862                                         "group" => "Field with Element Browser",
01863                                         "select" => "Selectorbox, select global",
01864                                         "select_cur" => "Selectorbox, select from current page",
01865                                         "select_root" => "Selectorbox, select from root page",
01866                                         "select_storage" => "Selectorbox, select from storage page",
01867                                 );
01868                                 $fDetails.="<BR>Type:<BR>".$this->renderSelectBox($prefix."[conf_rel_type]",$fConf["conf_rel_type"]?$fConf["conf_rel_type"]:"group",$optValues)."<BR>";
01869                                 if (t3lib_div::intInRange($fConf["conf_relations"],1,1000)==1 && $fConf["conf_rel_type"]!="group")      {
01870                                         $fDetails.=$this->renderCheckBox($prefix."[conf_rel_dummyitem]",$fConf["conf_rel_dummyitem"])."Add a blank item to the selector<BR>";
01871                                 }
01872 
01873                                 $fDetails.=$this->renderStringBox($prefix."[conf_relations]",t3lib_div::intInRange($fConf["conf_relations"],1,1000),50)." Max number of relations<BR>";
01874                                 $fDetails.=$this->renderStringBox($prefix."[conf_relations_selsize]",t3lib_div::intInRange($fConf["conf_relations_selsize"],1,50),50)." Size of selector box<BR>";
01875                                 $fDetails.=$this->renderCheckBox($prefix."[conf_relations_mm]",$fConf["conf_relations_mm"])."True M-M relations (otherwise commalist of values)<BR>";
01876 
01877 
01878                                 if ($fConf["conf_rel_type"]!="group")   {
01879                                         $fDetails.="<BR>";
01880                                         $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_addrec]",$fConf["conf_wiz_addrec"])."Add 'Add record' link<BR>";
01881                                         $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_listrec]",$fConf["conf_wiz_listrec"])."Add 'List records' link<BR>";
01882                                         $fDetails.=$this->renderCheckBox($prefix."[conf_wiz_editrec]",$fConf["conf_wiz_editrec"])."Add 'Edit record' link<BR>";
01883                                         $fDetails.=$this->resImg("t_rel_wizards.png",'hspace=20','','<BR><BR>');
01884                                 }
01885                         break;
01886                         case "files":
01887                                 if ($fConf["conf_files_type"]=="images")        {
01888                                         $typeCfg.=$this->resImg("t_file_img.png",'','');
01889                                 } elseif ($fConf["conf_files_type"]=="webimages")       {
01890                                         $typeCfg.=$this->resImg("t_file_web.png",'','');
01891                                 } else {
01892                                         $typeCfg.=$this->resImg("t_file_all.png",'','');
01893                                 }
01894 
01895                                 $optValues = array(
01896                                         "images" => "Imagefiles",
01897                                         "webimages" => "Web-imagefiles (gif,jpg,png)",
01898                                         "all" => "All files, except php/php3 extensions",
01899                                 );
01900                                 $fDetails.="<BR>Extensions:<BR>".$this->renderSelectBox($prefix."[conf_files_type]",$fConf["conf_files_type"],$optValues)."<BR>";
01901 
01902                                 $fDetails.=$this->renderStringBox($prefix."[conf_files]",t3lib_div::intInRange($fConf["conf_files"],1,1000),50)." Max number of files<BR>";
01903                                 $fDetails.=$this->renderStringBox($prefix."[conf_max_filesize]",t3lib_div::intInRange($fConf["conf_max_filesize"],1,1000,500),50)." Max filesize allowed (kb)<BR>";
01904                                 $fDetails.=$this->renderStringBox($prefix."[conf_files_selsize]",t3lib_div::intInRange($fConf["conf_files_selsize"],1,50),50)." Size of selector box<BR>";
01905                                 $fDetails.=$this->resImg("t_file_size.png",'','','<BR><BR>');
01906 //                              $fDetails.=$this->renderCheckBox($prefix."[conf_files_mm]",$fConf["conf_files_mm"])."DB relations (very rare choice, normally the commalist is fine enough)<BR>";
01907                                 $fDetails.=$this->renderCheckBox($prefix."[conf_files_thumbs]",$fConf["conf_files_thumbs"])."Show thumbnails<BR>";
01908                                 $fDetails.=$this->resImg("t_file_thumb.png",'hspace=20','','<BR><BR>');
01909                         break;
01910                         case "integer":
01911                                 $typeCfg.=$this->resImg("t_integer.png",'','');
01912                         break;
01913                         case "check_4":
01914                         case "check_10":
01915                                 if ((string)$fConf["type"]=="check_4")  {
01916                                         $typeCfg.=$this->resImg("t_check4.png",'','');
01917                                 } else {
01918                                         $typeCfg.=$this->resImg("t_check10.png",'','');
01919                                 }
01920                                 $nItems= t3lib_div::intInRange($fConf["conf_numberBoxes"],1,10,(string)$fConf["type"]=="check_4"?4:10);
01921                                 $fDetails.=$this->renderStringBox($prefix."[conf_numberBoxes]",$nItems,50)." Number of checkboxes<BR>";
01922 
01923                                 for($a=0;$a<$nItems;$a++)       {
01924                                         $fDetails.="<BR>Label ".($a+1).":<BR>".$this->renderStringBox_lang("conf_boxLabel_".$a,$prefix,$fConf);
01925                                 }
01926                         break;
01927                         case "date":
01928                                 $typeCfg.=$this->resImg("t_date.png",'','');
01929                         break;
01930                         case "datetime":
01931                                 $typeCfg.=$this->resImg("t_datetime.png",'','');
01932                         break;
01933                         case "link":
01934                                 $typeCfg.=$this->resImg("t_link.png",'','');
01935                         break;
01936                 }
01937 
01938                 if ($fConf["type"])     $typeCfg.=$this->textSetup("",$fDetails);
01939 
01940                 $content='<table border=0 cellpadding=0 cellspacing=0>
01941                         <tr><td valign=top>'.$this->fw("Field name:").'</td><td valign=top>'.$this->fw($fieldName).'</td></tr>
01942                         <tr><td valign=top>'.$this->fw("Field title:").'</td><td valign=top>'.$this->fw($fieldTitle).'</td></tr>
01943                         <tr><td valign=top>'.$this->fw("Field type:").'</td><td valign=top>'.$this->fw($typeCfg).'</td></tr>
01944                 </table>';
01945                 return $content;
01946         }
01947 
01948 
01949         function currentFields($addFields,$fArr)        {
01950                 if (is_array($fArr))    {
01951                         reset($fArr);
01952                         while(list($k,$v)=each($fArr))  {
01953                                 if ($v["type"] && trim($v["fieldname"]))        {
01954                                         $addFields[trim($v["fieldname"])]=$v["fieldname"].": ".$v["title"];
01955                                 }
01956                         }
01957                 }
01958                 return $addFields;
01959         }
01960         function addOtherExtensionTables($optValues)    {
01961                 if (is_array($this->wizArray["tables"]))        {
01962                         reset($this->wizArray["tables"]);
01963                         while(list($k,$info)=each($this->wizArray["tables"]))   {
01964                                 if (trim($info["tablename"]))   {
01965                                         $tableName = $this->returnName($this->extKey,"tables",trim($info["tablename"]));
01966                                         $optValues[$tableName]="Extension table: ".$info["title"]." (".$tableName.")";
01967                                 }
01968                         }
01969                 }
01970                 return $optValues;
01971         }
01972         function cleanUpFieldName($str) {
01973                 $fieldName = ereg_replace("[^[:alnum:]_]","",strtolower($str));
01974                 if (!$fieldName || t3lib_div::inList($this->reservedTypo3Fields.",".$this->mysql_reservedFields,$fieldName) || in_array($fieldName,$this->usedNames))   {
01975                         $fieldName.=($fieldName?"_":"").t3lib_div::shortmd5(microtime());
01976                 }
01977                 $this->usedNames[]=$fieldName;
01978                 return $fieldName;
01979         }
01980         function whatIsThis($str)       {
01981                 return ' <a href="#" title="'.htmlspecialchars($str).'" style="cursor:help" onClick="alert('.$GLOBALS['LANG']->JScharCode($str).');return false;">(What is this?)</a>';
01982         }
01983         function renderStringBox_lang($fieldName,$ffPrefix,$piConf)     {
01984                 $content = $this->renderStringBox($ffPrefix."[".$fieldName."]",$piConf[$fieldName])." [English]";
01985                 if (count($this->selectedLanguages))    {
01986                         $lines=array();
01987                         reset($this->selectedLanguages);
01988                         while(list($k,$v)=each($this->selectedLanguages))       {
01989                                 $lines[]=$this->renderStringBox($ffPrefix."[".$fieldName."_".$k."]",$piConf[$fieldName."_".$k])." [".$v."]";
01990                         }
01991                         $content.=$this->textSetup("",implode("<BR>",$lines));
01992                 }
01993                 return $content;
01994         }
01995 
01996         function textSetup($header,$content)    {
01997                 return ($header?"<strong>".$header."</strong><BR>":"")."<blockquote>".trim($content)."</blockquote>";
01998         }
01999         function resImg($name,$p='align="center"',$pre="<BR>",$post="<BR>")     {
02000                 if ($this->dontPrintImages)     return "<BR>";
02001                 $imgRel = $this->path_resources().$name;
02002                 $imgInfo = @getimagesize(PATH_site.$imgRel);
02003                 return $pre.'<img src="'.$this->siteBackPath.$imgRel.'" '.$imgInfo[3].($p?" ".$p:"").' vspace=5 border=1 style="border:solid 1px;">'.$post;
02004         }
02005         function resIcon($name,$p="")   {
02006                 if ($this->dontPrintImages)     return "";
02007                 $imgRel = $this->path_resources("icons/").$name;
02008                 if (!@is_file(PATH_site.$imgRel))       return "";
02009                 $imgInfo = @getimagesize(PATH_site.$imgRel);
02010                 return '<img src="'.$this->siteBackPath.$imgRel.'" '.$imgInfo[3].($p?" ".$p:"").'>';
02011         }
02012         function path_resources($subdir="res/") {
02013                 return substr(t3lib_extMgm::extPath("kickstarter"),strlen(PATH_site)).$subdir;
02014         }
02015         function getOnChangeParts($prefix)      {
02016                 $md5h=t3lib_div::shortMd5($this->piFieldName("wizArray_upd").$prefix);
02017                 return array('<a name="'.$md5h.'"></a>',"setFormAnchorPoint('".$md5h."');");
02018         }
02019         function renderCheckBox($prefix,$value,$defVal=0)       {
02020                 if (!isset($value))     $value=$defVal;
02021                 $onCP = $this->getOnChangeParts($prefix);
02022                 return $this->wopText($prefix).$onCP[0].'<input type="hidden" name="'.$this->piFieldName("wizArray_upd").$prefix.'" value="0"><input type="checkbox" name="'.$this->piFieldName("wizArray_upd").$prefix.'" value="1"'.($value?" CHECKED":"").' onClick="'.$onCP[1].'"'.$this->wop($prefix).'>';
02023         }
02024         function renderTextareaBox($prefix,$value)      {
02025                 $onCP = $this->getOnChangeParts($prefix);
02026                 return $this->wopText($prefix).$onCP[0].'<textarea name="'.$this->piFieldName("wizArray_upd").$prefix.'" style="width:600px;" rows="10" wrap="OFF" onChange="'.$onCP[1].'" title="'.htmlspecialchars("WOP:".$prefix).'"'.$this->wop($prefix).'>'.t3lib_div::formatForTextarea($value).'</textarea>';
02027         }
02028         function renderStringBox($prefix,$value,$width=200)     {
02029                 $onCP = $this->getOnChangeParts($prefix);
02030                 return $this->wopText($prefix).$onCP[0].'<input type="text" name="'.$this->piFieldName("wizArray_upd").$prefix.'" value="'.htmlspecialchars($value).'" style="width:'.$width.'px;" onChange="'.$onCP[1].'"'.$this->wop($prefix).'>';
02031         }
02032         function renderRadioBox($prefix,$value,$thisValue)      {
02033                 $onCP = $this->getOnChangeParts($prefix);
02034                 return $this->wopText($prefix).$onCP[0].'<input type="radio" name="'.$this->piFieldName("wizArray_upd").$prefix.'" value="'.$thisValue.'"'.(!strcmp($value,$thisValue)?" CHECKED":"").' onClick="'.$onCP[1].'"'.$this->wop($prefix).'>';
02035         }
02036         function renderSelectBox($prefix,$value,$optValues)     {
02037                 $onCP = $this->getOnChangeParts($prefix);
02038                 $opt=array();
02039                 $isSelFlag=0;
02040                 reset($optValues);
02041                 while(list($k,$v)=each($optValues))     {
02042                         $sel = (!strcmp($k,$value)?" SELECTED":"");
02043                         if ($sel)       $isSelFlag++;
02044                         $opt[]='<option value="'.htmlspecialchars($k).'"'.$sel.'>'.htmlspecialchars($v).'</option>';
02045                 }
02046                 if (!$isSelFlag && strcmp("",$value))   $opt[]='<option value="'.$value.'" SELECTED>'.htmlspecialchars("CURRENT VALUE '".$value."' DID NOT EXIST AMONG THE OPTIONS").'</option>';
02047                 return $this->wopText($prefix).$onCP[0].'<select name="'.$this->piFieldName("wizArray_upd").$prefix.'" onChange="'.$onCP[1].'"'.$this->wop($prefix).'>'.implode("",$opt).'</select>';
02048         }
02049         function wop($prefix)   {
02050                 return ' title="'.htmlspecialchars("WOP: ".$prefix).'"';
02051         }
02052         function wopText($prefix)       {
02053                 return $this->printWOP?'<font face="verdana,arial,sans-serif" size=1 color=#999999>'.htmlspecialchars($prefix).':</font><BR>':'';
02054         }
02055         function catHeaderLines($lines,$k,$v,$altHeader="",$index="")   {
02056                                         $lines[]='<tr'.$this->bgCol(1).'><td><strong>'.$this->fw($v[0]).'</strong></td></tr>';
02057                                         $lines[]='<tr'.$this->bgCol(2).'><td>'.$this->fw($v[1]).'</td></tr>';
02058                                         $lines[]='<tr><td></td></tr>';
02059                 return $lines;
02060         }
02061         function linkCurrentItems($cat) {
02062                 $items = $this->wizArray[$cat];
02063                 $lines=array();
02064                 $c=0;
02065                 if (is_array($items))   {
02066                         reset($items);
02067                         while(list($k,$conf)=each($items))      {
02068                                 $lines[]='<strong>'.$this->linkStr($conf["title"]?$conf["title"]:"<em>Item ".$k."</em>",$cat,'edit:'.$k).'</strong>';
02069                                 $c=$k;
02070                         }
02071                 }
02072                 if (!t3lib_div::inList("save,ts,TSconfig,languages",$cat) || !count($lines))    {
02073                         $c++;
02074                         if (count($lines))      $lines[]='';
02075                         $lines[]=$this->linkStr('Add new item',$cat,'edit:'.$c);
02076                 }
02077                 return $this->fw(implode("<BR>",$lines));
02078         }
02079         function linkStr($str,$wizSubCmd,$wizAction)    {
02080                 return '<a href="#" onClick="
02081                         document.'.$this->varPrefix.'_wizard[\''.$this->piFieldName("wizSubCmd").'\'].value=\''.$wizSubCmd.'\';
02082                         document.'.$this->varPrefix.'_wizard[\''.$this->piFieldName("wizAction").'\'].value=\''.$wizAction.'\';
02083                         document.'.$this->varPrefix.'_wizard.submit();
02084                         return false;">'.$str.'</a>';
02085         }
02086         function bgCol($n,$mod=0)       {
02087                 $color = $this->color[$n-1];
02088                 if ($mod)       $color = t3lib_div::modifyHTMLcolor($color,$mod,$mod,$mod);
02089                 return ' bgColor="'.$color.'"';
02090         }
02091         function regNewEntry($k,$index) {
02092                 if (!is_array($this->wizArray[$k][$index]))     {
02093                         $this->wizArray[$k][$index]=array();
02094                 }
02095         }
02096         function bwWithFlag($str,$flag) {
02097                 if ($flag)      $str = '<strong>'.$str.'</strong>';
02098                 return $str;
02099         }
02103         function makeUploadDataFromArray($uploadArray)  {
02104                 if (is_array($uploadArray))     {
02105                         $serialized = serialize($uploadArray);
02106                         $md5 = md5($serialized);
02107 
02108                         $content=$md5.":";
02109 /*                      if ($this->gzcompress)  {
02110                                 $content.="gzcompress:";
02111                                 $content.=gzcompress($serialized);
02112                         } else {
02113         */                      $content.=":";
02114                                 $content.=$serialized;
02115 //                      }
02116                 }
02117                 return $content;
02118         }
02122         function makeUploadArray($extKey,$files)        {
02123                 $uploadArray=array();
02124                 $uploadArray["extKey"]=$extKey;
02125                 $uploadArray["EM_CONF"]=Array(
02126                         "title" => "[No title]",
02127                         "description" => "[Enter description of extension]",
02128                         "category" => "example",
02129                         "author" => $this->userfield("name"),
02130                         "author_email" => $this->userfield("email"),
02131 
02132                 );
02133 
02134                 $uploadArray["EM_CONF"] = array_merge($uploadArray["EM_CONF"],$this->makeEMCONFpreset(""));
02135 
02136                 if (is_array($this->_addArray)) {
02137                         $uploadArray["EM_CONF"] = array_merge($uploadArray["EM_CONF"],$this->_addArray);
02138                 }
02139                 $uploadArray["misc"]["codelines"]=0;
02140                 $uploadArray["misc"]["codebytes"]=0;
02141                 $uploadArray["techInfo"] = "";
02142 
02143                 $uploadArray["FILES"] = $files;
02144                 return $uploadArray;
02145         }
02146 
02153         function linkThisCmd($uPA=array())      {
02154           $url = t3lib_div::linkThisScript($uPA);
02155           return $url;
02156         }
02157 
02164         function fw($str)       {
02165                 return '<span style="font-family:verdana,arial,sans-serif; font-size:10px;">'.$str.'</span>';
02166         }
02167 
02168 
02169         function piFieldName($key)      {
02170                 return $this->varPrefix."[".$key."]";
02171         }
02172         function cmdHiddenField()       {
02173                 return '<input type="hidden"  name="'.$this->piFieldName("cmd").'" value="'.htmlspecialchars($this->currentCMD).'">';
02174         }
02175 
02176         function preWrap($str)  {
02177                 $str = str_replace(chr(9),"&nbsp;&nbsp;&nbsp;&nbsp;",htmlspecialchars($str));
02178                 $str = '<pre>'.$str.'</pre>';
02179                 return $str;
02180         }
02181 }
02182 
02183 // Include extension?
02184 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/kickstarter/modfunc1/class.tx_kickstarter_wizard.php"]) {
02185         include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/kickstarter/modfunc1/class.tx_kickstarter_wizard.php"]);
02186 }
02187 
02188 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6