00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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";
00037 var $siteBackPath = "";
00038 var $EMmode=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
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> </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
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
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> </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
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(" ").'</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(" View ").'</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(" ");
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
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
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
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
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
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
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
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
00544
00545
00546
00547
00548
00549
00550 ''
00551 );
00552 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00553
00554
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
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
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
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]," ",$action[1]);
00602 $piConf = $this->wizArray[$catID][$action[1]];
00603 $ffPrefix='['.$catID.']['.$action[1].']';
00604
00605
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
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
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]," ",$action[1]);
00640 $piConf = $this->wizArray[$catID][$action[1]];
00641 $ffPrefix='['.$catID.']['.$action[1].']';
00642
00643
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
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
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]," ",$action[1]);
00676 $piConf = $this->wizArray[$catID][$action[1]];
00677 $ffPrefix='['.$catID.']['.$action[1].']';
00678
00679
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
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
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
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
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
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
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
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]," ",$action[1]);
00750 $piConf = $this->wizArray[$catID][$action[1]];
00751 $ffPrefix='['.$catID.']['.$action[1].']';
00752
00753
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
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
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]," ",$action[1]);
00797 $piConf = $this->wizArray[$catID][$action[1]];
00798 $ffPrefix='['.$catID.']['.$action[1].']';
00799
00800
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
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
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
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]," ",$action[1]);
00849 $piConf = $this->wizArray[$catID][$action[1]];
00850 $ffPrefix='['.$catID.']['.$action[1].']';
00851
00852
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
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
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
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> </td><td></td></tr>';
00903
00904
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
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> </td><td></td></tr>';
00917
00918
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 '10