Public Member Functions | |
| init () | |
| Constructor, initializing internal variables. | |
| main () | |
| Creating the module output. | |
| printContent () | |
| Print out the accumulated content:. | |
| getWizardItems () | |
| Returns the content of wizardArray() function... | |
| wizardArray () | |
| Returns the array of elements in the wizard display. | |
Public Attributes | |
| $id | |
| $sys_language = 0 | |
| $R_URI = '' | |
| $colPos | |
| $uid_pid | |
| $modTSconfig = array() | |
| $doc | |
| $include_once = array() | |
| $content | |
| $access | |
|
|
Returns the content of wizardArray() function...
Definition at line 387 of file db_new_content_el.php. Referenced by main(). 00387 {
00388 return $this->wizardArray();
00389 }
|
|
|
Constructor, initializing internal variables.
Definition at line 175 of file db_new_content_el.php. References t3lib_BEfunc::getModTSconfig(), and t3lib_BEfunc::readPageAccess(). 00175 {
00176 global $BE_USER,$BACK_PATH,$TBE_MODULES_EXT;
00177
00178 // Setting class files to include:
00179 if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
00180 $this->include_once = array_merge($this->include_once,$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
00181 }
00182
00183 // Setting internal vars:
00184 $this->id = intval(t3lib_div::_GP('id'));
00185 $this->sys_language = intval(t3lib_div::_GP('sys_language_uid'));
00186 $this->R_URI = t3lib_div::_GP('returnUrl');
00187 $this->colPos = t3lib_div::_GP('colPos');
00188 $this->uid_pid = intval(t3lib_div::_GP('uid_pid'));
00189
00190 $this->MCONF['name'] = 'xMOD_db_new_content_el';
00191 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
00192
00193 // Starting the document template object:
00194 $this->doc = t3lib_div::makeInstance('mediumDoc');
00195 $this->doc->docType= 'xhtml_trans';
00196 $this->doc->backPath = $BACK_PATH;
00197 $this->doc->JScode='';
00198 $this->doc->form='<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
00199
00200 // Getting the current page and receiving access information (used in main())
00201 $perms_clause = $BE_USER->getPagePermsClause(1);
00202 $pageinfo = t3lib_BEfunc::readPageAccess($this->id,$perms_clause);
00203 $this->access = is_array($pageinfo) ? 1 : 0;
00204 }
|
|
|
Creating the module output.
Definition at line 211 of file db_new_content_el.php. References $LANG, t3lib_iconWorks::getIconImage(), t3lib_BEfunc::getModTSconfig(), t3lib_BEfunc::getRecord(), t3lib_BEfunc::getRecordTitle(), getWizardItems(), header(), and table(). 00211 {
00212 global $LANG,$BACK_PATH;
00213
00214 if ($this->id && $this->access) {
00215
00216 // Init position map object:
00217 $posMap = t3lib_div::makeInstance('ext_posMap');
00218 $posMap->cur_sys_language = $this->sys_language;
00219 $posMap->backPath = $BACK_PATH;
00220
00221 if ((string)$this->colPos!='') { // If a column is pre-set:
00222 if ($this->uid_pid<0) {
00223 $row=array();
00224 $row['uid']=abs($this->uid_pid);
00225 } else {
00226 $row='';
00227 }
00228 $onClickEvent = $posMap->onClickInsertRecord($row,$this->colPos,'',$this->uid_pid,$this->sys_language);
00229 } else {
00230 $onClickEvent='';
00231 }
00232
00233 $this->doc->JScode=$this->doc->wrapScriptTags('
00234 function goToalt_doc() { //
00235 '.$onClickEvent.'
00236 }
00237 ');
00238
00239
00240 // ***************************
00241 // Creating content
00242 // ***************************
00243 $this->content='';
00244 $this->content.=$this->doc->startPage($LANG->getLL('newContentElement'));
00245 $this->content.=$this->doc->header($LANG->getLL('newContentElement'));
00246 $this->content.=$this->doc->spacer(5);
00247
00248 $elRow = t3lib_BEfunc::getRecord('pages',$this->id);
00249 $hline = t3lib_iconWorks::getIconImage('pages',$elRow,$BACK_PATH,' title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($elRow,'pages')).'" align="top"');
00250 $hline.= t3lib_BEfunc::getRecordTitle('pages',$elRow,1);
00251 $this->content.=$this->doc->section('',$hline,0,1);
00252 $this->content.=$this->doc->spacer(10);
00253
00254
00255 // Wizard
00256 $code='';
00257 $lines=array();
00258 $wizardItems = $this->getWizardItems();
00259
00260 // Traverse items for the wizard.
00261 // An item is either a header or an item rendered with a radio button and title/description and icon:
00262 $cc=0;
00263 foreach($wizardItems as $k => $wInfo) {
00264 if ($wInfo['header']) {
00265 if ($cc>0) $lines[]='
00266 <tr>
00267 <td colspan="3"><br /></td>
00268 </tr>';
00269 $lines[]='
00270 <tr class="bgColor5">
00271 <td colspan="3"><strong>'.htmlspecialchars($wInfo['header']).'</strong></td>
00272 </tr>';
00273 } else {
00274 $tL=array();
00275
00276 // Radio button:
00277 $oC = "document.editForm.defValues.value=unescape('".rawurlencode($wInfo['params'])."');goToalt_doc();".(!$onClickEvent?"document.location='#sel2';":'');
00278 $tL[]='<input type="radio" name="tempB" value="'.htmlspecialchars($k).'" onclick="'.htmlspecialchars($this->doc->thisBlur().$oC).'" />';
00279
00280 // Onclick action for icon/title:
00281 $aOnClick = 'document.editForm.tempB['.$cc.'].checked=1;'.$this->doc->thisBlur().$oC.'return false;';
00282
00283 // Icon:
00284 $iInfo = @getimagesize($wInfo['icon']);
00285 $tL[]='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,$wInfo['icon'],'').' alt="" /></a>';
00286
00287 // Title + description:
00288 $tL[]='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><strong>'.htmlspecialchars($wInfo['title']).'</strong><br />'.nl2br(htmlspecialchars(trim($wInfo['description']))).'</a>';
00289
00290 // Finally, put it together in a table row:
00291 $lines[]='
00292 <tr>
00293 <td valign="top">'.implode('</td>
00294 <td valign="top">',$tL).'</td>
00295 </tr>';
00296 $cc++;
00297 }
00298 }
00299 // Add the wizard table to the content:
00300 $code.=$LANG->getLL('sel1',1).'<br /><br />
00301
00302
00303 <!--
00304 Content Element wizard table:
00305 -->
00306 <table border="0" cellpadding="1" cellspacing="2" id="typo3-ceWizardTable">
00307 '.implode('',$lines).'
00308 </table>';
00309 $this->content.=$this->doc->section(!$onClickEvent?$LANG->getLL('1_selectType'):'',$code,0,1);
00310
00311
00312
00313 // If the user must also select a column:
00314 if (!$onClickEvent) {
00315
00316 // Add anchor "sel2"
00317 $this->content.=$this->doc->section('','<a name="sel2"></a>');
00318 $this->content.=$this->doc->spacer(20);
00319
00320 // Select position
00321 $code=$LANG->getLL('sel2',1).'<br /><br />';
00322
00323 // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
00324 $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id,'mod.SHARED');
00325 $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']),'') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
00326 $colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$colPosList))); // Removing duplicates, if any
00327
00328 // Finally, add the content of the column selector to the content:
00329 $code.=$posMap->printContentElementColumns($this->id,0,$colPosList,1,$this->R_URI);
00330 $this->content.=$this->doc->section($LANG->getLL('2_selectPosition'),$code,0,1);
00331 }
00332
00333 // IF there is a return-url set, then print a go-back link:
00334 if ($this->R_URI) {
00335 $code='<br /><br /><a href="'.htmlspecialchars($this->R_URI).'" class="typo3-goBack"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/goback.gif','width="14" height="14"').' alt="" />'.$LANG->getLL('goBack',1).'</a>';
00336 $this->content.=$this->doc->section('',$code,0,1);
00337 }
00338
00339 // Add CSH:
00340 $this->content.= $this->doc->section('',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'],'<br/>'),0,1);
00341
00342 // Add a very high clear-gif, 700 px (so that the link to the anchor "sel2" shows this part in top for sure...)
00343 $this->content.=$this->doc->section('','<img src="clear.gif" width="1" height="700" alt="" />',0,1);
00344
00345 } else { // In case of no access:
00346 $this->content='';
00347 $this->content.=$this->doc->startPage($LANG->getLL('newContentElement'));
00348 $this->content.=$this->doc->header($LANG->getLL('newContentElement'));
00349 $this->content.=$this->doc->spacer(5);
00350 }
00351 }
|
|
|
Print out the accumulated content:.
Definition at line 358 of file db_new_content_el.php. 00358 {
00359 global $SOBE;
00360
00361 $this->content.= $this->doc->endPage();
00362 echo $this->content;
00363 }
|
|
|
Returns the array of elements in the wizard display. For the plugin section there is support for adding elements there from a global variable.
Definition at line 397 of file db_new_content_el.php. References $LANG, header(), menu(), and table(). 00397 {
00398 global $LANG,$TBE_MODULES_EXT;
00399
00400 $wizardItems = array(
00401 'common' => array('header'=>$LANG->getLL('common')),
00402 'common_1' => array(
00403 'icon'=>'gfx/c_wiz/regular_text.gif',
00404 'title'=>$LANG->getLL('common_1_title'),
00405 'description'=>$LANG->getLL('common_1_description'),
00406 'params'=>'&defVals[tt_content][CType]=text'
00407 ),
00408 'common_2' => array(
00409 'icon'=>'gfx/c_wiz/text_image_below.gif',
00410 'title'=>$LANG->getLL('common_2_title'),
00411 'description'=>$LANG->getLL('common_2_description'),
00412 'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=8'
00413 ),
00414 'common_3' => array(
00415 'icon'=>'gfx/c_wiz/text_image_right.gif',
00416 'title'=>$LANG->getLL('common_3_title'),
00417 'description'=>$LANG->getLL('common_3_description'),
00418 'params'=>'&defVals[tt_content][CType]=textpic&defVals[tt_content][imageorient]=17'
00419 ),
00420 'common_4' => array(
00421 'icon'=>'gfx/c_wiz/images_only.gif',
00422 'title'=>$LANG->getLL('common_4_title'),
00423 'description'=>$LANG->getLL('common_4_description'),
00424 'params'=>'&defVals[tt_content][CType]=image&defVals[tt_content][imagecols]=2'
00425 ),
00426 'common_5' => array(
00427 'icon'=>'gfx/c_wiz/bullet_list.gif',
00428 'title'=>$LANG->getLL('common_5_title'),
00429 'description'=>$LANG->getLL('common_5_description'),
00430 'params'=>'&defVals[tt_content][CType]=bullets'
00431 ),
00432 'common_6' => array(
00433 'icon'=>'gfx/c_wiz/table.gif',
00434 'title'=>$LANG->getLL('common_6_title'),
00435 'description'=>$LANG->getLL('common_6_description'),
00436 'params'=>'&defVals[tt_content][CType]=table'
00437 ),
00438 'special' => array('header'=>$LANG->getLL('special')),
00439 'special_1' => array(
00440 'icon'=>'gfx/c_wiz/filelinks.gif',
00441 'title'=>$LANG->getLL('special_1_title'),
00442 'description'=>$LANG->getLL('special_1_description'),
00443 'params'=>'&defVals[tt_content][CType]=uploads'
00444 ),
00445 'special_2' => array(
00446 'icon'=>'gfx/c_wiz/multimedia.gif',
00447 'title'=>$LANG->getLL('special_2_title'),
00448 'description'=>$LANG->getLL('special_2_description'),
00449 'params'=>'&defVals[tt_content][CType]=multimedia'
00450 ),
00451 'special_3' => array(
00452 'icon'=>'gfx/c_wiz/sitemap2.gif',
00453 'title'=>$LANG->getLL('special_3_title'),
00454 'description'=>$LANG->getLL('special_3_description'),
00455 'params'=>'&defVals[tt_content][CType]=menu&defVals[tt_content][menu_type]=2'
00456 ),
00457 'special_4' => array(
00458 'icon'=>'gfx/c_wiz/html.gif',
00459 'title'=>$LANG->getLL('special_4_title'),
00460 'description'=>$LANG->getLL('special_4_description'),
00461 'params'=>'&defVals[tt_content][CType]=html'
00462 ),
00463
00464
00465 'forms' => array('header'=>$LANG->getLL('forms')),
00466 'forms_1' => array(
00467 'icon'=>'gfx/c_wiz/mailform.gif',
00468 'title'=>$LANG->getLL('forms_1_title'),
00469 'description'=>$LANG->getLL('forms_1_description'),
00470 'params'=>'&defVals[tt_content][CType]=mailform&defVals[tt_content][bodytext]='.rawurlencode(trim('
00471 # Example content:
00472 Name: | *name = input,40 | Enter your name here
00473 Email: | *email=input,40 |
00474 Address: | address=textarea,40,5 |
00475 Contact me: | tv=check | 1
00476
00477 |formtype_mail = submit | Send form!
00478 |html_enabled=hidden | 1
00479 |subject=hidden| This is the subject
00480 '))
00481 ),
00482 'forms_2' => array(
00483 'icon'=>'gfx/c_wiz/searchform.gif',
00484 'title'=>$LANG->getLL('forms_2_title'),
00485 'description'=>$LANG->getLL('forms_2_description'),
00486 'params'=>'&defVals[tt_content][CType]=search'
00487 ),
00488 'forms_3' => array(
00489 'icon'=>'gfx/c_wiz/login_form.gif',
00490 'title'=>$LANG->getLL('forms_3_title'),
00491 'description'=>$LANG->getLL('forms_3_description'),
00492 'params'=>'&defVals[tt_content][CType]=login'
00493 ),
00494 'plugins' => array('header'=>$LANG->getLL('plugins')),
00495 'plugins_1' => array(
00496 'icon'=>'gfx/c_wiz/user_defined.gif',
00497 'title'=>$LANG->getLL('plugins_1_title'),
00498 'description'=>$LANG->getLL('plugins_1_description'),
00499 'params'=>'&defVals[tt_content][CType]=list'
00500 ),
00501 );
00502
00503
00504 // PLUG-INS:
00505 if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
00506 reset($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
00507 while(list($class,$path)=each($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
00508 $modObj = t3lib_div::makeInstance($class);
00509 $wizardItems = $modObj->proc($wizardItems);
00510 }
00511 }
00512
00513 return $wizardItems;
00514 }
|
|
|
Definition at line 168 of file db_new_content_el.php. |
|
|
Definition at line 158 of file db_new_content_el.php. |
|
|
Definition at line 167 of file db_new_content_el.php. |
|
|
Definition at line 163 of file db_new_content_el.php. |
|
|
Definition at line 155 of file db_new_content_el.php. |
|
|
Definition at line 166 of file db_new_content_el.php. |
|
|
Definition at line 162 of file db_new_content_el.php. |
|
|
Definition at line 157 of file db_new_content_el.php. |
|
|
Definition at line 156 of file db_new_content_el.php. |
|
|
Definition at line 159 of file db_new_content_el.php. |
1.3.8-20040913