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
00031 require_once(t3lib_extMgm::extPath("kickstarter")."class.tx_kickstarter_sectionbase.php");
00032
00033 class tx_kickstarter_section_sv extends tx_kickstarter_sectionbase {
00034 var $sectionID = 'sv';
00035
00039 function render_wizard() {
00040 $lines=array();
00041
00042 $action = explode(':',$this->wizard->modData['wizAction']);
00043 if ($action[0]=='edit') {
00044 $this->regNewEntry($this->sectionID,$action[1]);
00045
00046 $lines = $this->catHeaderLines($lines,$this->sectionID,$this->wizard->options[$this->sectionID],'<strong>Edit Service #'.$action[1].'</strong>',$action[1]);
00047 $piConf = $this->wizard->wizArray[$this->sectionID][$action[1]];
00048 $ffPrefix='['.$this->sectionID.']['.$action[1].']';
00049
00050 if (!$this->wizard->EMmode && $this->wizard->saveKey) {
00051 $extKeyRec = $this->wizard->pObj->getExtKeyRecord($this->saveKey);
00052 }
00053
00054
00055 $subContent='<strong>Title:</strong><br />'.
00056 $this->renderStringBox($ffPrefix.'[title]',$piConf['title']?$piConf['title']:$extKeyRec['title']);
00057 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00058
00059
00060 $subContent='<strong>Description:</strong><br />'.
00061 $this->renderStringBox($ffPrefix.'[description]',$piConf['description']?$piConf['description']:$extKeyRec['description']);
00062 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00063
00064 $lines[]='<tr><td> </td><td></td></tr>';
00065
00066
00067 $subContent='<strong>Service type:</strong><br />'.
00068 $this->renderStringBox($ffPrefix.'[type]',$piConf['type']?$piConf['type']:$extKeyRec['type']).'<br />'.
00069 'Enter here the key to define which type of service this should be.<br />Examples: "textExtract", "metaExtract".';
00070 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00071
00072
00073 $subContent='<strong>Sub type(s) (comma list):</strong><br />'.
00074 $this->renderStringBox($ffPrefix.'[subtype]',$piConf['subtype']?$piConf['subtype']:$extKeyRec['subtype']).'<br />'.
00075 '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.';
00076 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00077
00078 $lines[]='<tr><td> </td><td></td></tr>';
00079
00080
00081 $optValues = Array(
00082 '50' => 'default (50)',
00083 '10' => 'very low (10)',
00084 '20' => 'low (20)',
00085 '40' => 'bit lower (40)',
00086 '60' => 'bit higher (60)',
00087 '80' => 'high (80)',
00088 '100' => 'Very high (100)',
00089 );
00090 $subContent='<strong>Priority:</strong><br />'.
00091 $this->renderSelectBox($ffPrefix.'[priority]',$piConf['priority'],$optValues).'<br />'.
00092 '50 = medium priority. <br />The priority of services can be changed by admin configuration.';
00093 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00094
00095
00096 $quality = $piConf['quality']?$piConf['quality']:$extKeyRec['quality'];
00097 $quality = $quality ? $quality : '50';
00098 $subContent='<strong>Quality:</strong><br />'.
00099 $this->renderStringBox($ffPrefix.'[quality]',$quality).'<br />'.
00100 '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.';
00101 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00102
00103
00104
00105 $optValues = Array(
00106 '' => 'no special dependency',
00107 'unix' => 'Unix only',
00108 'win' => 'Windows only',
00109
00110 );
00111
00112 $lines[]='<tr><td> </td><td></td></tr>';
00113
00114 $subContent='<strong>Operating System dependency:</strong><br />'.
00115 $this->renderSelectBox($ffPrefix.'[os]',$piConf['os'],$optValues);
00116 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00117
00118
00119 $subContent='<strong>External program(s) (comma list):</strong><br />'.
00120 $this->renderStringBox($ffPrefix.'[exec]',$piConf['exec']).'<br />'.
00121 'Program(s) needed to run this service (eg. "perl").';
00122 $lines[]='<tr'.$this->bgCol(3).'><td>'.$this->fw($subContent).'</td></tr>';
00123 }
00124
00125
00126 if(is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_services'])) {
00127 foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['kickstarter']['add_cat_services'] as $_funcRef) {
00128 $lines = t3lib_div::callUserFunction($_funcRef, $lines, $this);
00129 }
00130 }
00131
00132 $content = '<table border="0" cellpadding="2" cellspacing="2">'.implode('',$lines).'</table>';
00133 return $content;
00134 }
00135
00136
00137
00138
00139
00140
00141
00142
00146 function render_extPart($k,$config,$extKey) {
00147 $WOP='[sv]['.$k.']';
00148 $cN = $this->returnName($extKey,'class','sv'.$k);
00149 $pathSuffix = 'sv'.$k.'/';
00150
00151 $this->wizard->ext_tables[]=$this->sPS('
00152 '.$this->WOPcomment('WOP:'.$WOP.'[type]').'
00153 t3lib_extMgm::addService($_EXTKEY, \''.$config['type'].'\' , \''.$cN.'\' ,
00154 array(
00155
00156 \'title\' => \''.addslashes($config['title']).'\','.$this->WOPcomment(' WOP:'.$WOP.'[title]').'
00157 \'description\' => \''.addslashes($config['description']).'\','.$this->WOPcomment(' WOP:'.$WOP.'[description]').'
00158
00159 \'subtype\' => \''.$config['subtype'].'\','.$this->WOPcomment(' WOP:'.$WOP.'[subtype]').'
00160
00161 \'available\' => TRUE,
00162 \'priority\' => '.$config['priority'].','.$this->WOPcomment(' WOP:'.$WOP.'[priority]').'
00163 \'quality\' => '.$config['quality'].','.$this->WOPcomment(' WOP:'.$WOP.'[quality]').'
00164
00165 \'os\' => \''.$config['os'].'\','.$this->WOPcomment(' WOP:'.$WOP.'[os]').'
00166 \'exec\' => \''.$config['exec'].'\','.$this->WOPcomment(' WOP:'.$WOP.'[exec]').'
00167
00168 \'classFile\' => t3lib_extMgm::extPath($_EXTKEY).\'sv'.$k.'/class.'.$cN.'.php\',
00169 \'className\' => \''.$cN.'\',
00170 )
00171 );
00172 ');
00173
00174 $innerMainContent = $this->sPS('
00175
00179 function init() {
00180 $available = parent::init();
00181
00182
00183
00184
00185
00186
00187
00188
00189 return $available;
00190 }
00191
00201 function process($content=\'\', $type=\'\', $conf=array()) {
00202
00203
00204
00205
00206 return FALSE;
00207 }
00208 ');
00209
00210 $indexContent= $this->wrapBody('
00211 require_once(PATH_t3lib.\'class.t3lib_svbase.php\');
00212
00213 class '.$cN.' extends t3lib_svbase {
00214 var $prefixId = \''.$cN.'\';
00215 var $scriptRelPath = \''.($pathSuffix.'class.'.$cN.'.php').'\';
00216 var $extKey = \''.$extKey.'\';
00217
00218 ',$innerMainContent,'
00219 }
00220 ');
00221 $this->addFileToFileArray($pathSuffix."class.".$cN.".php",$this->PHPclassFile($extKey,$pathSuffix."class.".$cN.".php",$indexContent,"Service '".$config['title']."' for the '".$extKey."' extension."));
00222
00223 }
00224
00225 }
00226
00227
00228
00229 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/kickstarter/sections/class.tx_kickstarter_section_sv.php']) {
00230 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/kickstarter/sections/class.tx_kickstarter_section_sv.php']);
00231 }
00232
00233
00234 ?>