db_new_content_el.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2008 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 ***************************************************************/
00027 /**
00028  * New content elements wizard
00029  * (Part of the 'cms' extension)
00030  *
00031  * $Id: db_new_content_el.php 4630 2008-12-30 11:12:29Z ohader $
00032  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
00033  * XHTML compatible.
00034  *
00035  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00036  */
00037 /**
00038  * [CLASS/FUNCTION INDEX of SCRIPT]
00039  *
00040  *
00041  *
00042  *  101: class ext_posMap extends t3lib_positionMap
00043  *  111:     function wrapRecordTitle($str,$row)
00044  *  125:     function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)
00045  *
00046  *
00047  *  153: class SC_db_new_content_el
00048  *  176:     function init()
00049  *  212:     function main()
00050  *  359:     function printContent()
00051  *
00052  *              SECTION: OTHER FUNCTIONS:
00053  *  388:     function getWizardItems()
00054  *  398:     function wizardArray()
00055  *  549:     function removeInvalidElements(&$wizardItems)
00056  *
00057  * TOTAL FUNCTIONS: 8
00058  * (This index is automatically created/updated by the extension "extdeveval")
00059  *
00060  */
00061 
00062 
00063 unset($MCONF);
00064 require('conf.php');
00065 require($BACK_PATH.'init.php');
00066 require($BACK_PATH.'template.php');
00067 
00068     // Unset MCONF/MLANG since all we wanted was back path etc. for this particular script.
00069 unset($MCONF);
00070 unset($MLANG);
00071 
00072     // Merging locallang files/arrays:
00073 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
00074 $LOCAL_LANG_orig = $LOCAL_LANG;
00075 $LANG->includeLLFile('EXT:cms/layout/locallang_db_new_content_el.xml');
00076 $LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($LOCAL_LANG_orig,$LOCAL_LANG);
00077 
00078     // Exits if 'cms' extension is not loaded:
00079 t3lib_extMgm::isLoaded('cms',1);
00080 
00081     // Include needed libraries:
00082 require_once(PATH_t3lib.'class.t3lib_page.php');
00083 require_once(PATH_t3lib.'class.t3lib_positionmap.php');
00084 
00085 
00086 
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 /**
00095  * Local position map class
00096  *
00097  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00098  * @package TYPO3
00099  * @subpackage core
00100  */
00101 class ext_posMap extends t3lib_positionMap {
00102     var $dontPrintPageInsertIcons = 1;
00103 
00104     /**
00105      * Wrapping the title of the record - here we just return it.
00106      *
00107      * @param   string      The title value.
00108      * @param   array       The record row.
00109      * @return  string      Wrapped title string.
00110      */
00111     function wrapRecordTitle($str,$row) {
00112         return $str;
00113     }
00114 
00115     /**
00116      * Create on-click event value.
00117      *
00118      * @param   array       The record.
00119      * @param   string      Column position value.
00120      * @param   integer     Move uid
00121      * @param   integer     PID value.
00122      * @param   integer     System language
00123      * @return  string
00124      */
00125     function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0) {
00126         $table='tt_content';
00127 
00128         $location=$this->backPath.'alt_doc.php?edit[tt_content]['.(is_array($row)?-$row['uid']:$pid).']=new&defVals[tt_content][colPos]='.$vv.'&defVals[tt_content][sys_language_uid]='.$sys_lang.'&returnUrl='.rawurlencode($GLOBALS['SOBE']->R_URI);
00129 
00130         return 'window.location.href=\''.$location.'\'+document.editForm.defValues.value; return false;';
00131     }
00132 }
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 /**
00147  * Script Class for the New Content element wizard
00148  *
00149  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00150  * @package TYPO3
00151  * @subpackage core
00152  */
00153 class SC_db_new_content_el {
00154 
00155         // Internal, static (from GPvars):
00156     var $id;                    // Page id
00157     var $sys_language=0;        // Sys language
00158     var $R_URI='';              // Return URL.
00159     var $colPos;                // If set, the content is destined for a specific column.
00160     var $uid_pid;               //
00161 
00162         // Internal, static:
00163     var $modTSconfig=array();   // Module TSconfig.
00164 
00165     /**
00166      * Internal backend template object
00167      *
00168      * @var mediumDoc
00169      */
00170     var $doc;
00171 
00172         // Internal, dynamic:
00173     var $include_once = array();    // Includes a list of files to include between init() and main() - see init()
00174     var $content;                   // Used to accumulate the content of the module.
00175     var $access;                // Access boolean.
00176 
00177     /**
00178      * Constructor, initializing internal variables.
00179      *
00180      * @return  void
00181      */
00182     function init() {
00183         global $BE_USER,$BACK_PATH,$TBE_MODULES_EXT;
00184 
00185             // Setting class files to include:
00186         if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']))   {
00187             $this->include_once = array_merge($this->include_once,$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
00188         }
00189 
00190             // Setting internal vars:
00191         $this->id = intval(t3lib_div::_GP('id'));
00192         $this->sys_language = intval(t3lib_div::_GP('sys_language_uid'));
00193         $this->R_URI = t3lib_div::_GP('returnUrl');
00194         $this->colPos = t3lib_div::_GP('colPos');
00195         $this->uid_pid = intval(t3lib_div::_GP('uid_pid'));
00196 
00197         $this->MCONF['name'] = 'xMOD_db_new_content_el';
00198         $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
00199 
00200             // Starting the document template object:
00201         $this->doc = t3lib_div::makeInstance('template');
00202         $this->doc->backPath = $BACK_PATH;
00203         $this->doc->setModuleTemplate('templates/db_new_content_el.html');
00204         $this->doc->JScode='';
00205         $this->doc->form='<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
00206 
00207             // Setting up the context sensitive menu:
00208         $this->doc->getContextMenuCode();
00209 
00210             // Getting the current page and receiving access information (used in main())
00211         $perms_clause = $BE_USER->getPagePermsClause(1);
00212         $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$perms_clause);
00213         $this->access = is_array($this->pageinfo) ? 1 : 0;
00214     }
00215 
00216     /**
00217      * Creating the module output.
00218      *
00219      * @return  void
00220      */
00221     function main() {
00222         global $LANG,$BACK_PATH;
00223 
00224         if ($this->id && $this->access) {
00225 
00226                 // Init position map object:
00227             $posMap = t3lib_div::makeInstance('ext_posMap');
00228             $posMap->cur_sys_language = $this->sys_language;
00229             $posMap->backPath = $BACK_PATH;
00230 
00231             if ((string)$this->colPos!='')  {   // If a column is pre-set:
00232                 if ($this->uid_pid<0)   {
00233                     $row=array();
00234                     $row['uid']=abs($this->uid_pid);
00235                 } else {
00236                     $row='';
00237                 }
00238                 $onClickEvent = $posMap->onClickInsertRecord($row,$this->colPos,'',$this->uid_pid,$this->sys_language);
00239             } else {
00240                 $onClickEvent='';
00241             }
00242 
00243             $this->doc->JScode=$this->doc->wrapScriptTags('
00244                 function goToalt_doc()  {   //
00245                     '.$onClickEvent.'
00246                 }
00247             ');
00248 
00249 
00250             // ***************************
00251             // Creating content
00252             // ***************************
00253             $this->content='';
00254             $this->content.=$this->doc->header($LANG->getLL('newContentElement'));
00255             $this->content.=$this->doc->spacer(5);
00256 
00257                 // Wizard
00258             $code='';
00259             $lines=array();
00260             $wizardItems = $this->getWizardItems();
00261 
00262                 // Traverse items for the wizard.
00263                 // An item is either a header or an item rendered with a radio button and title/description and icon:
00264             $cc=0;
00265             foreach ($wizardItems as $k => $wInfo)  {
00266                 if ($wInfo['header'])   {
00267                     if ($cc>0) $lines[]='
00268                         <tr>
00269                             <td colspan="3"><br /></td>
00270                         </tr>';
00271                     $lines[]='
00272                         <tr class="bgColor5">
00273                             <td colspan="3"><strong>'.htmlspecialchars($wInfo['header']).'</strong></td>
00274                         </tr>';
00275                 } else {
00276                     $tL=array();
00277 
00278                         // Radio button:
00279                     $oC = "document.editForm.defValues.value=unescape('".rawurlencode($wInfo['params'])."');goToalt_doc();".(!$onClickEvent?"window.location.hash='#sel2';":'');
00280                     $tL[]='<input type="radio" name="tempB" value="'.htmlspecialchars($k).'" onclick="'.htmlspecialchars($this->doc->thisBlur().$oC).'" />';
00281 
00282                         // Onclick action for icon/title:
00283                     $aOnClick = 'document.getElementsByName(\'tempB\')['.$cc.'].checked=1;'.$this->doc->thisBlur().$oC.'return false;';
00284 
00285                         // Icon:
00286                     $iInfo = @getimagesize($wInfo['icon']);
00287                     $tL[]='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($this->doc->backPath,$wInfo['icon'],'').' alt="" /></a>';
00288 
00289                         // Title + description:
00290                     $tL[]='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><strong>'.htmlspecialchars($wInfo['title']).'</strong><br />'.nl2br(htmlspecialchars(trim($wInfo['description']))).'</a>';
00291 
00292                         // Finally, put it together in a table row:
00293                     $lines[]='
00294                         <tr>
00295                             <td valign="top">'.implode('</td>
00296                             <td valign="top">',$tL).'</td>
00297                         </tr>';
00298                     $cc++;
00299                 }
00300             }
00301                 // Add the wizard table to the content:
00302             $code.=$LANG->getLL('sel1',1).'<br /><br />
00303 
00304 
00305             <!--
00306                 Content Element wizard table:
00307             -->
00308                 <table border="0" cellpadding="1" cellspacing="2" id="typo3-ceWizardTable">
00309                     '.implode('',$lines).'
00310                 </table>';
00311             $this->content.= $this->doc->section(!$onClickEvent?$LANG->getLL('1_selectType'):'',$code,0,1);
00312 
00313 
00314 
00315                 // If the user must also select a column:
00316             if (!$onClickEvent) {
00317 
00318                     // Add anchor "sel2"
00319                 $this->content.= $this->doc->section('','<a name="sel2"></a>');
00320                 $this->content.= $this->doc->spacer(20);
00321 
00322                     // Select position
00323                 $code = $LANG->getLL('sel2',1).'<br /><br />';
00324 
00325                     // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
00326                 $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id,'mod.SHARED');
00327                 $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']),'') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
00328                 $colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$colPosList)));        // Removing duplicates, if any
00329 
00330                     // Finally, add the content of the column selector to the content:
00331                 $code.= $posMap->printContentElementColumns($this->id,0,$colPosList,1,$this->R_URI);
00332                 $this->content.= $this->doc->section($LANG->getLL('2_selectPosition'),$code,0,1);
00333             }
00334         } else {        // In case of no access:
00335             $this->content = '';
00336             $this->content.= $this->doc->header($LANG->getLL('newContentElement'));
00337             $this->content.= $this->doc->spacer(5);
00338         }
00339 
00340             // Setting up the buttons and markers for docheader
00341         $docHeaderButtons = $this->getButtons();
00342         $markers['CSH'] = $docHeaderButtons['csh'];
00343         $markers['CONTENT'] = $this->content;
00344 
00345             // Build the <body> for the module
00346         $this->content = $this->doc->startPage($LANG->getLL('newContentElement'));
00347         $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
00348         $this->content.= $this->doc->endPage();
00349         $this->content = $this->doc->insertStylesAndJS($this->content);
00350     }
00351 
00352     /**
00353      * Print out the accumulated content:
00354      *
00355      * @return  void
00356      */
00357     function printContent() {
00358         echo $this->content;
00359     }
00360 
00361     /**
00362      * Create the panel of buttons for submitting the form or otherwise perform operations.
00363      *
00364      * @return  array   all available buttons as an assoc. array
00365      */
00366     protected function getButtons() {
00367         global $LANG, $BACK_PATH;
00368 
00369         $buttons = array(
00370             'csh' => '',
00371             'back' => ''
00372         );
00373 
00374 
00375         if ($this->id && $this->access) {
00376                 // CSH
00377             $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'], '', TRUE);
00378 
00379                 // Back
00380             if ($this->R_URI)   {
00381                 $buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack">' .
00382                     '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/goback.gif') . ' alt="" title="' . $LANG->getLL('goBack', 1) . '" />' .
00383                     '</a>';
00384             }
00385         }
00386 
00387 
00388         return $buttons;
00389     }
00390 
00391 
00392 
00393 
00394 
00395 
00396 
00397 
00398 
00399     /***************************
00400      *
00401      * OTHER FUNCTIONS:
00402      *
00403      ***************************/
00404 
00405 
00406     /**
00407      * Returns the content of wizardArray() function...
00408      *
00409      * @return  array       Returns the content of wizardArray() function...
00410      */
00411     function getWizardItems()   {
00412         return $this->wizardArray();
00413     }
00414 
00415     /**
00416      * Returns the array of elements in the wizard display.
00417      * For the plugin section there is support for adding elements there from a global variable.
00418      *
00419      * @return  array
00420      */
00421     function wizardArray()  {
00422         global $LANG,$TBE_MODULES_EXT;
00423 
00424         $wizardItems = array(
00425             'common' => array('header'=>$LANG->getLL('common')),
00426             'common_regularText' => array(  // Regular text element
00427                 'icon'=>'gfx/c_wiz/regular_text.gif',
00428                 'title'=>$LANG->getLL('common_regularText_title'),
00429                 'description'=>$LANG->getLL('common_regularText_description'),
00430                 'tt_content_defValues' => array(
00431                     'CType' => 'text'
00432                 )
00433             ),
00434             'common_textImage' => array(    // Text with image
00435                 'icon'=>'gfx/c_wiz/text_image_right.gif',
00436                 'title'=>$LANG->getLL('common_textImage_title'),
00437                 'description'=>$LANG->getLL('common_textImage_description'),
00438                 'tt_content_defValues' => array(
00439                     'CType' => 'textpic',
00440                     'imageorient' => 17
00441                 )
00442             ),
00443             'common_imagesOnly' => array(   // Images only
00444                 'icon'=>'gfx/c_wiz/images_only.gif',
00445                 'title'=>$LANG->getLL('common_imagesOnly_title'),
00446                 'description'=>$LANG->getLL('common_imagesOnly_description'),
00447                 'tt_content_defValues' => array(
00448                     'CType' => 'image',
00449                     'imagecols' => 2
00450                 )
00451             ),
00452             'common_bulletList' => array(   // Bullet list
00453                 'icon'=>'gfx/c_wiz/bullet_list.gif',
00454                 'title'=>$LANG->getLL('common_bulletList_title'),
00455                 'description'=>$LANG->getLL('common_bulletList_description'),
00456                 'tt_content_defValues' => array(
00457                     'CType' => 'bullets',
00458                 )
00459             ),
00460             'common_table' => array(    // Table
00461                 'icon'=>'gfx/c_wiz/table.gif',
00462                 'title'=>$LANG->getLL('common_table_title'),
00463                 'description'=>$LANG->getLL('common_table_description'),
00464                 'tt_content_defValues' => array(
00465                     'CType' => 'table',
00466                 )
00467             ),
00468             'special' => array('header'=>$LANG->getLL('special')),
00469             'special_filelinks' => array(   // Filelinks
00470                 'icon'=>'gfx/c_wiz/filelinks.gif',
00471                 'title'=>$LANG->getLL('special_filelinks_title'),
00472                 'description'=>$LANG->getLL('special_filelinks_description'),
00473                 'tt_content_defValues' => array(
00474                     'CType' => 'uploads',
00475                 )
00476             ),
00477             'special_multimedia' => array(  // Multimedia
00478                 'icon'=>'gfx/c_wiz/multimedia.gif',
00479                 'title'=>$LANG->getLL('special_multimedia_title'),
00480                 'description'=>$LANG->getLL('special_multimedia_description'),
00481                 'tt_content_defValues' => array(
00482                     'CType' => 'multimedia',
00483                 )
00484             ),
00485             'special_sitemap' => array( // Sitemap
00486                 'icon'=>'gfx/c_wiz/sitemap2.gif',
00487                 'title'=>$LANG->getLL('special_sitemap_title'),
00488                 'description'=>$LANG->getLL('special_sitemap_description'),
00489                 'tt_content_defValues' => array(
00490                     'CType' => 'menu',
00491                     'menu_type' => 2
00492                 )
00493             ),
00494             'special_plainHTML' => array(   // Plain HTML
00495                 'icon'=>'gfx/c_wiz/html.gif',
00496                 'title'=>$LANG->getLL('special_plainHTML_title'),
00497                 'description'=>$LANG->getLL('special_plainHTML_description'),
00498                 'tt_content_defValues' => array(
00499                     'CType' => 'html',
00500                 )
00501             ),
00502             'forms' => array('header'=>$LANG->getLL('forms')),
00503             'forms_mail' => array(  // Mail form
00504                 'icon'=>'gfx/c_wiz/mailform.gif',
00505                 'title'=>$LANG->getLL('forms_mail_title'),
00506                 'description'=>$LANG->getLL('forms_mail_description'),
00507                 'tt_content_defValues' => array(
00508                     'CType' => 'mailform',
00509                     'bodytext' => trim('
00510 # Example content:
00511 Name: | *name = input,40 | Enter your name here
00512 Email: | *email=input,40 |
00513 Address: | address=textarea,40,5 |
00514 Contact me: | tv=check | 1
00515 
00516 |formtype_mail = submit | Send form!
00517 |html_enabled=hidden | 1
00518 |subject=hidden| This is the subject
00519                     ')
00520                 )
00521             ),
00522             'forms_search' => array(    // Search form
00523                 'icon'=>'gfx/c_wiz/searchform.gif',
00524                 'title'=>$LANG->getLL('forms_search_title'),
00525                 'description'=>$LANG->getLL('forms_search_description'),
00526                 'tt_content_defValues' => array(
00527                     'CType' => 'search',
00528                 )
00529             ),
00530             'forms_login' => array( // Login form
00531                 'icon'=>'gfx/c_wiz/login_form.gif',
00532                 'title'=>$LANG->getLL('forms_login_title'),
00533                 'description'=>$LANG->getLL('forms_login_description'),
00534                 'tt_content_defValues' => array(
00535                     'CType' => 'login',
00536                 )
00537             ),
00538             'plugins' => array('header'=>$LANG->getLL('plugins')),
00539             'plugins_general' => array( // General plugin
00540                 'icon'=>'gfx/c_wiz/user_defined.gif',
00541                 'title'=>$LANG->getLL('plugins_general_title'),
00542                 'description'=>$LANG->getLL('plugins_general_description'),
00543                 'tt_content_defValues' => array(
00544                     'CType' => 'list',
00545                 )
00546             ),
00547         );
00548 
00549 
00550             // PLUG-INS:
00551         if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']))   {
00552             reset($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
00553             while(list($class,$path)=each($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']))  {
00554                 $modObj = t3lib_div::makeInstance($class);
00555                 $wizardItems = $modObj->proc($wizardItems);
00556             }
00557         }
00558 
00559             // Remove elements where preset values are not allowed:
00560         $this->removeInvalidElements($wizardItems);
00561 
00562         return $wizardItems;
00563     }
00564 
00565     /**
00566      * Checks the array for elements which might contain unallowed default values and will unset them!
00567      * Looks for the "tt_content_defValues" key in each element and if found it will traverse that array as fieldname / value pairs and check. The values will be added to the "params" key of the array (which should probably be unset or empty by default).
00568      *
00569      * @param   array       Wizard items, passed by reference
00570      * @return  void
00571      */
00572     function removeInvalidElements(&$wizardItems)   {
00573         global $TCA;
00574 
00575             // Load full table definition:
00576         t3lib_div::loadTCA('tt_content');
00577 
00578             // Get TCEFORM from TSconfig of current page
00579         $row = array('pid' => $this->id);
00580         $TCEFORM_TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig('tt_content', $row);
00581         $removeItems = t3lib_div::trimExplode(',', $TCEFORM_TSconfig['CType']['removeItems'], 1);
00582         $keepItems = t3lib_div::trimExplode(',', $TCEFORM_TSconfig['CType']['keepItems'], 1);
00583 
00584         $headersUsed = Array();
00585             // Traverse wizard items:
00586         foreach($wizardItems as $key => $cfg)   {
00587 
00588                 // Exploding parameter string, if any (old style)
00589             if ($wizardItems[$key]['params'])   {
00590                     // Explode GET vars recursively
00591                 $tempGetVars = t3lib_div::explodeUrl2Array($wizardItems[$key]['params'],TRUE);
00592                     // If tt_content values are set, merge them into the tt_content_defValues array, unset them from $tempGetVars and re-implode $tempGetVars into the param string (in case remaining parameters are around).
00593                 if (is_array($tempGetVars['defVals']['tt_content']))    {
00594                     $wizardItems[$key]['tt_content_defValues'] = array_merge(is_array($wizardItems[$key]['tt_content_defValues']) ? $wizardItems[$key]['tt_content_defValues'] : array(), $tempGetVars['defVals']['tt_content']);
00595                     unset($tempGetVars['defVals']['tt_content']);
00596                     $wizardItems[$key]['params'] = t3lib_div::implodeArrayForUrl('',$tempGetVars);
00597                 }
00598             }
00599 
00600                 // If tt_content_defValues are defined...:
00601             if (is_array($wizardItems[$key]['tt_content_defValues']))   {
00602 
00603                     // Traverse field values:
00604                 foreach($wizardItems[$key]['tt_content_defValues'] as $fN => $fV)   {
00605                     if (is_array($TCA['tt_content']['columns'][$fN]))   {
00606                             // Get information about if the field value is OK:
00607                         $config = &$TCA['tt_content']['columns'][$fN]['config'];
00608                         $authModeDeny = ($config['type']=='select' && $config['authMode'] && !$GLOBALS['BE_USER']->checkAuthMode('tt_content', $fN, $fV, $config['authMode']));
00609                         $isNotInKeepItems = (count($keepItems) && !in_array($fV, $keepItems));
00610 
00611                         if ($authModeDeny || ($fN=='CType' && in_array($fV,$removeItems)) || $isNotInKeepItems) {
00612                                 // Remove element all together:
00613                             unset($wizardItems[$key]);
00614                             break;
00615                         } else {
00616                                 // Add the parameter:
00617                             $wizardItems[$key]['params'].= '&defVals[tt_content]['.$fN.']='.rawurlencode($fV);
00618                             $tmp = explode('_', $key);
00619                             $headersUsed[$tmp[0]] = $tmp[0];
00620                         }
00621                     }
00622                 }
00623             }
00624         }
00625             // remove headers without elements
00626         foreach ($wizardItems as $key => $cfg)  {
00627             $tmp = explode('_',$key);
00628             if ($tmp[0] && !$tmp[1] && !in_array($tmp[0], $headersUsed))    {
00629                 unset($wizardItems[$key]);
00630             }
00631         }
00632     }
00633 }
00634 
00635 
00636 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_new_content_el.php'])    {
00637     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_new_content_el.php']);
00638 }
00639 
00640 
00641 
00642 // Make instance:
00643 $SOBE = t3lib_div::makeInstance('SC_db_new_content_el');
00644 $SOBE->init();
00645 
00646 // Include files?
00647 foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
00648 
00649 $SOBE->main();
00650 $SOBE->printContent();
00651 
00652 ?>

Generated on Sat Jan 3 04:23:30 2009 for TYPO3 API by  doxygen 1.4.7