📄 db_new_content_el.php
字号:
$this->content.= $this->doc->spacer(20); // Select position $code = $LANG->getLL('sel2',1).'<br /><br />'; // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable: $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id,'mod.SHARED'); $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']),'') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3'; $colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$colPosList))); // Removing duplicates, if any // Finally, add the content of the column selector to the content: $code.= $posMap->printContentElementColumns($this->id,0,$colPosList,1,$this->R_URI); $this->content.= $this->doc->section($LANG->getLL('2_selectPosition'),$code,0,1); } // IF there is a return-url set, then print a go-back link: if ($this->R_URI) { $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>'; $this->content.= $this->doc->section('',$code,0,1); } // Add CSH: $this->content.= $this->doc->section('',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'],'<br/>'),0,1); // Add a very high clear-gif, 700 px (so that the link to the anchor "sel2" shows this part in top for sure...) $this->content.= $this->doc->section('','<img src="clear.gif" width="1" height="700" alt="" />',0,1); } else { // In case of no access: $this->content = ''; $this->content.= $this->doc->startPage($LANG->getLL('newContentElement')); $this->content.= $this->doc->header($LANG->getLL('newContentElement')); $this->content.= $this->doc->spacer(5); } } /** * Print out the accumulated content: * * @return void */ function printContent() { global $SOBE; $this->content.= $this->doc->endPage(); echo $this->content; } /*************************** * * OTHER FUNCTIONS: * ***************************/ /** * Returns the content of wizardArray() function... * * @return array Returns the content of wizardArray() function... */ function getWizardItems() { return $this->wizardArray(); } /** * Returns the array of elements in the wizard display. * For the plugin section there is support for adding elements there from a global variable. * * @return array */ function wizardArray() { global $LANG,$TBE_MODULES_EXT; $wizardItems = array( 'common' => array('header'=>$LANG->getLL('common')), 'common_regularText' => array( // Regular text element 'icon'=>'gfx/c_wiz/regular_text.gif', 'title'=>$LANG->getLL('common_regularText_title'), 'description'=>$LANG->getLL('common_regularText_description'), 'tt_content_defValues' => array( 'CType' => 'text' ) ), 'common_textImage' => array( // Text with image 'icon'=>'gfx/c_wiz/text_image_right.gif', 'title'=>$LANG->getLL('common_textImage_title'), 'description'=>$LANG->getLL('common_textImage_description'), 'tt_content_defValues' => array( 'CType' => 'textpic', 'imageorient' => 17 ) ), 'common_imagesOnly' => array( // Images only 'icon'=>'gfx/c_wiz/images_only.gif', 'title'=>$LANG->getLL('common_imagesOnly_title'), 'description'=>$LANG->getLL('common_imagesOnly_description'), 'tt_content_defValues' => array( 'CType' => 'image', 'imagecols' => 2 ) ), 'common_bulletList' => array( // Bullet list 'icon'=>'gfx/c_wiz/bullet_list.gif', 'title'=>$LANG->getLL('common_bulletList_title'), 'description'=>$LANG->getLL('common_bulletList_description'), 'tt_content_defValues' => array( 'CType' => 'bullets', ) ), 'common_table' => array( // Table 'icon'=>'gfx/c_wiz/table.gif', 'title'=>$LANG->getLL('common_table_title'), 'description'=>$LANG->getLL('common_table_description'), 'tt_content_defValues' => array( 'CType' => 'table', ) ), 'special' => array('header'=>$LANG->getLL('special')), 'special_filelinks' => array( // Filelinks 'icon'=>'gfx/c_wiz/filelinks.gif', 'title'=>$LANG->getLL('special_filelinks_title'), 'description'=>$LANG->getLL('special_filelinks_description'), 'tt_content_defValues' => array( 'CType' => 'uploads', ) ), 'special_multimedia' => array( // Multimedia 'icon'=>'gfx/c_wiz/multimedia.gif', 'title'=>$LANG->getLL('special_multimedia_title'), 'description'=>$LANG->getLL('special_multimedia_description'), 'tt_content_defValues' => array( 'CType' => 'multimedia', ) ), 'special_sitemap' => array( // Sitemap 'icon'=>'gfx/c_wiz/sitemap2.gif', 'title'=>$LANG->getLL('special_sitemap_title'), 'description'=>$LANG->getLL('special_sitemap_description'), 'tt_content_defValues' => array( 'CType' => 'menu', 'menu_type' => 2 ) ), 'special_plainHTML' => array( // Plain HTML 'icon'=>'gfx/c_wiz/html.gif', 'title'=>$LANG->getLL('special_plainHTML_title'), 'description'=>$LANG->getLL('special_plainHTML_description'), 'tt_content_defValues' => array( 'CType' => 'html', ) ), 'forms' => array('header'=>$LANG->getLL('forms')), 'forms_mail' => array( // Mail form 'icon'=>'gfx/c_wiz/mailform.gif', 'title'=>$LANG->getLL('forms_mail_title'), 'description'=>$LANG->getLL('forms_mail_description'), 'tt_content_defValues' => array( 'CType' => 'mailform', 'bodytext' => trim('# Example content:Name: | *name = input,40 | Enter your name hereEmail: | *email=input,40 |Address: | address=textarea,40,5 |Contact me: | tv=check | 1|formtype_mail = submit | Send form!|html_enabled=hidden | 1|subject=hidden| This is the subject ') ) ), 'forms_search' => array( // Search form 'icon'=>'gfx/c_wiz/searchform.gif', 'title'=>$LANG->getLL('forms_search_title'), 'description'=>$LANG->getLL('forms_search_description'), 'tt_content_defValues' => array( 'CType' => 'search', ) ), 'forms_login' => array( // Login form 'icon'=>'gfx/c_wiz/login_form.gif', 'title'=>$LANG->getLL('forms_login_title'), 'description'=>$LANG->getLL('forms_login_description'), 'tt_content_defValues' => array( 'CType' => 'login', ) ), 'plugins' => array('header'=>$LANG->getLL('plugins')), 'plugins_general' => array( // General plugin 'icon'=>'gfx/c_wiz/user_defined.gif', 'title'=>$LANG->getLL('plugins_general_title'), 'description'=>$LANG->getLL('plugins_general_description'), 'tt_content_defValues' => array( 'CType' => 'list', ) ), ); // PLUG-INS: if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) { reset($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']); while(list($class,$path)=each($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) { $modObj = t3lib_div::makeInstance($class); $wizardItems = $modObj->proc($wizardItems); } } // Remove elements where preset values are not allowed: $this->removeInvalidElements($wizardItems); return $wizardItems; } /** * Checks the array for elements which might contain unallowed default values and will unset them! * 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). * * @param array Wizard items, passed by reference * @return void */ function removeInvalidElements(&$wizardItems) { global $TCA; // Load full table definition: t3lib_div::loadTCA('tt_content'); // Get TCEFORM from TSconfig of current page $row = array('pid'=>$this->id); $TCEFORM_TSconfig = t3lib_BEfunc::getTCEFORM_TSconfig('tt_content',$row); $removeItems = t3lib_div::trimExplode(',',$TCEFORM_TSconfig['CType']['removeItems'],1); $headersUsed = Array(); // Traverse wizard items: foreach($wizardItems as $key => $cfg) { // Exploding parameter string, if any (old style) if ($wizardItems[$key]['params']) { // Explode GET vars recursively $tempGetVars = t3lib_div::explodeUrl2Array($wizardItems[$key]['params'],TRUE); // 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). if (is_array($tempGetVars['defVals']['tt_content'])) { $wizardItems[$key]['tt_content_defValues'] = array_merge(is_array($wizardItems[$key]['tt_content_defValues']) ? $wizardItems[$key]['tt_content_defValues'] : array(), $tempGetVars['defVals']['tt_content']); unset($tempGetVars['defVals']['tt_content']); $wizardItems[$key]['params'] = t3lib_div::implodeArrayForUrl('',$tempGetVars); } } // If tt_content_defValues are defined...: if (is_array($wizardItems[$key]['tt_content_defValues'])) { // Traverse field values: foreach($wizardItems[$key]['tt_content_defValues'] as $fN => $fV) { if (is_array($TCA['tt_content']['columns'][$fN])) { // Get information about if the field value is OK: $config = &$TCA['tt_content']['columns'][$fN]['config']; $authModeDeny = $config['type']=='select' && $config['authMode'] && !$GLOBALS['BE_USER']->checkAuthMode('tt_content',$fN,$fV,$config['authMode']); if ($authModeDeny || ($fN=='CType' && in_array($fV,$removeItems))) { // Remove element all together: unset($wizardItems[$key]); break; } else { // Add the parameter: $wizardItems[$key]['params'].= '&defVals[tt_content]['.$fN.']='.rawurlencode($fV); $tmp = explode('_', $key); $headersUsed[$tmp[0]] = $tmp[0]; } } } } } // remove headers without elements foreach ($wizardItems as $key => $cfg) { $tmp = explode('_',$key); if ($tmp[0] && !$tmp[1] && !in_array($tmp[0], $headersUsed)) { unset($wizardItems[$key]); } } }}// Include extension?if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_new_content_el.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_new_content_el.php']);}// Make instance:$SOBE = t3lib_div::makeInstance('SC_db_new_content_el');$SOBE->init();// Include files?foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);$SOBE->main();$SOBE->printContent();?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -