106 if (is_array(
$GLOBALS[
'TBE_MODULES_EXT'][
'xMOD_db_new_content_el'][
'addElClasses'])) {
107 $this->include_once = array_merge($this->include_once,
$GLOBALS[
'TBE_MODULES_EXT'][
'xMOD_db_new_content_el'][
'addElClasses']);
115 $this->MCONF[
'name'] =
'xMOD_db_new_content_el';
118 $this->config =
$config[
'mod.'][
'wizards.'][
'newContentElement.'];
121 $this->doc->backPath =
$GLOBALS[
'BACK_PATH'];
122 $this->doc->setModuleTemplate(
'EXT:backend/Resources/Private/Templates/db_new_content_el.html');
123 $this->doc->JScode =
'';
124 $this->doc->form =
'<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
126 $this->doc->getContextMenuCode();
128 $perms_clause =
$GLOBALS[
'BE_USER']->getPagePermsClause(1);
130 $this->access = is_array($this->pageinfo) ? 1 : 0;
140 if ($this->
id && $this->access) {
144 $posMap->backPath =
$GLOBALS[
'BACK_PATH'];
146 if (isset($this->colPos)) {
147 if ($this->uid_pid < 0) {
149 $row[
'uid'] = abs($this->uid_pid);
153 $this->onClickEvent = $posMap->onClickInsertRecord($row, $this->colPos,
'', $this->uid_pid, $this->sys_language);
155 $this->onClickEvent =
'';
161 $this->content .=
'<div id="user-setup-wrapper">';
162 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'newContentElement'));
163 $this->content .= $this->doc->spacer(5);
168 $this->elementWrapper[
'section'] = array(
'<ul class="contentelement-wizard list-unstyled">',
'</ul>');
170 $this->elementWrapperForTabs = $this->elementWrapper;
172 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms'][
'db_new_content_el'][
'wizardItemsHook'])) {
173 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'cms'][
'db_new_content_el'][
'wizardItemsHook'] as $classData) {
175 if (!$hookObject instanceof \
TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface) {
176 throw new \UnexpectedValueException(
'$hookObject must implement interface TYPO3\\CMS\\Backend\\Wizard\\NewContentElementWizardHookInterface', 1227834741);
178 $hookObject->manipulateWizardItems($wizardItems, $this);
181 if ($this->config[
'renderMode'] ==
'tabs' && $this->elementWrapperForTabs != $this->elementWrapper) {
183 $this->elementWrapper = $this->elementWrapperForTabs;
186 $this->doc->JScode = $this->doc->wrapScriptTags(
' 187 function goToalt_doc() { // 188 ' . $this->onClickEvent .
' 191 if(top.refreshMenu) { 194 top.TYPO3ModuleMenu.refreshMenu(); 200 $menuItems = array();
201 foreach ($wizardItems as $k => $wInfo) {
202 if ($wInfo[
'header']) {
203 $menuItems[] = array(
204 'label' => htmlspecialchars($wInfo[
'header']),
205 'content' => $this->elementWrapper[
'section'][0]
207 $key = count($menuItems) - 1;
211 if (!$this->onClickEvent) {
213 $oC =
'document.editForm.defValues.value=unescape(\'' . rawurlencode($wInfo[
'params']) .
'\');goToalt_doc();
' . (!$this->onClickEvent ? 'window.location.hash=\
'#sel2\';' :
'');
214 $content .=
'<div class="contentelement-wizard-item-input"><input type="radio" name="tempB" value="' . htmlspecialchars($k) .
'" onclick="' . htmlspecialchars($oC) .
'" /></div>';
216 $aOnClick =
'document.getElementsByName(\'tempB\')[' . $cc .
'].checked=1;' . $oC .
'return false;';
218 $aOnClick =
"document.editForm.defValues.value=unescape('".rawurlencode($wInfo[
'params']).
"');goToalt_doc();".(!$this->onClickEvent?
"window.location.hash='#sel2';":
'');
221 $menuItems[$key][
'content'] .=
223 <div class="contentelement-wizard-item"> 225 <div class="contentelement-wizard-item-icon"> 226 <a href="#" onclick="' . htmlspecialchars($aOnClick) .
'"> 230 <div class="contentelement-wizard-item-text"> 231 <a href="#" onclick="' . htmlspecialchars($aOnClick) .
'"> 232 <strong>' . htmlspecialchars($wInfo[
'title']) .
'</strong> 233 <br />' . nl2br(htmlspecialchars(trim($wInfo[
'description']))) .
242 foreach ($menuItems as $key => $val) {
243 $menuItems[$key][
'content'] .= $this->elementWrapper[
'section'][1];
246 if ($this->config[
'renderMode'] ==
'tabs') {
247 $code =
$GLOBALS[
'LANG']->getLL(
'sel1', 1) .
'<br /><br />' . $this->doc->getDynTabMenu($menuItems,
'new-content-element-wizard', FALSE, FALSE);
249 $code =
$GLOBALS[
'LANG']->getLL(
'sel1', 1) .
'<br /><br />';
250 foreach ($menuItems as $section) {
251 $code .=
'<h3 class="divider">' . $section[
'label'] .
'</h3>' . $section[
'content'];
254 $this->content .= $this->doc->section(!$this->onClickEvent ?
$GLOBALS[
'LANG']->getLL(
'1_selectType') :
'', $code, 0, 1);
256 if (!$this->onClickEvent) {
258 $this->content .= $this->doc->section(
'',
'<a name="sel2"></a>');
259 $this->content .= $this->doc->spacer(20);
261 $code =
$GLOBALS[
'LANG']->getLL(
'sel2', 1) .
'<br /><br />';
265 $colPosIds = array_map(
function($element){
return (
int)$element[1]; }, $colPosArray);
267 $colPosList = implode(
',', array_unique($colPosIds));
269 $code .= $posMap->printContentElementColumns($this->
id, 0, $colPosList, 1, $this->R_URI);
270 $this->content .= $this->doc->section(
$GLOBALS[
'LANG']->getLL(
'2_selectPosition'), $code, 0, 1);
273 $this->content .=
'</div>';
277 $this->content .= $this->doc->header(
$GLOBALS[
'LANG']->getLL(
'newContentElement'));
278 $this->content .= $this->doc->spacer(5);
282 $markers[
'CSH'] = $docHeaderButtons[
'csh'];
285 $this->content = $this->doc->startPage(
$GLOBALS[
'LANG']->getLL(
'newContentElement'));
286 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
287 $this->content .= $this->doc->sectionEnd();
288 $this->content .= $this->doc->endPage();
289 $this->content = $this->doc->insertStylesAndJS($this->content);
312 if ($this->
id && $this->access) {
315 $buttons[
'back'] =
'<a href="' . htmlspecialchars($this->R_URI) .
'" class="typo3-goBack" title="' .
$GLOBALS[
'LANG']->getLL(
'goBack', TRUE) .
'">' .
IconUtility::getSpriteIcon(
'actions-view-go-back') .
'</a>';
344 if (is_array($this->config)) {
345 $wizards = $this->config[
'wizardItems.'];
348 $wizardItems = array();
349 if (is_array($wizards)) {
350 foreach ($wizards as $groupKey => $wizardGroup) {
351 $groupKey = preg_replace(
'/\\.$/',
'', $groupKey);
353 $showAll = in_array(
'*', $showItems, TRUE);
354 $groupItems = array();
355 if (is_array($appendWizards[$groupKey .
'.'][
'elements.'])) {
356 $wizardElements = array_merge((array) $wizardGroup[
'elements.'], $appendWizards[$groupKey .
'.'][
'elements.']);
358 $wizardElements = $wizardGroup[
'elements.'];
360 if (is_array($wizardElements)) {
361 foreach ($wizardElements as $itemKey => $itemConf) {
362 $itemKey = preg_replace(
'/\\.$/',
'', $itemKey);
363 if ($showAll || in_array($itemKey, $showItems)) {
366 $groupItems[$groupKey .
'_' . $itemKey] = $tmpItem;
371 if (count($groupItems)) {
373 $wizardItems = array_merge($wizardItems, $groupItems);
388 if (!is_array($wizardElements)) {
389 $wizardElements = array();
391 if (is_array(
$GLOBALS[
'TBE_MODULES_EXT'][
'xMOD_db_new_content_el'][
'addElClasses'])) {
392 foreach (
$GLOBALS[
'TBE_MODULES_EXT'][
'xMOD_db_new_content_el'][
'addElClasses'] as $class => $path) {
395 $wizardElements = $modObj->proc($wizardElements);
398 $returnElements = array();
399 foreach ($wizardElements as $key => $wizardItem) {
400 preg_match(
'/^[a-zA-Z0-9]+_/', $key, $group);
401 $wizardGroup = $group[0] ? substr($group[0], 0, -1) .
'.' : $key;
402 $returnElements[$wizardGroup][
'elements.'][substr($key, strlen($wizardGroup)) .
'.'] = $wizardItem;
404 return $returnElements;
415 $itemConf[
'title'] =
$GLOBALS[
'LANG']->sL($itemConf[
'title']);
416 $itemConf[
'description'] =
$GLOBALS[
'LANG']->sL($itemConf[
'description']);
417 $itemConf[
'tt_content_defValues'] = $itemConf[
'tt_content_defValues.'];
418 unset($itemConf[
'tt_content_defValues.']);
430 'header' =>
$GLOBALS[
'LANG']->sL($wizardGroup[
'header'])
444 $row = array(
'pid' => $this->
id);
446 $headersUsed = array();
448 foreach ($wizardItems as $key => $cfg) {
450 if ($wizardItems[$key][
'params']) {
456 if (is_array($tempGetVars[
'defVals'][
'tt_content'])) {
457 $wizardItems[$key][
'tt_content_defValues'] = array_merge(
458 is_array($wizardItems[$key][
'tt_content_defValues'])
459 ? $wizardItems[$key][
'tt_content_defValues']
461 $tempGetVars[
'defVals'][
'tt_content']
463 unset($tempGetVars[
'defVals'][
'tt_content']);
468 if (is_array($wizardItems[$key][
'tt_content_defValues'])) {
470 foreach ($wizardItems[$key][
'tt_content_defValues'] as $fN => $fV) {
471 if (is_array(
$GLOBALS[
'TCA'][
'tt_content'][
'columns'][$fN])) {
474 $authModeDeny =
$config[
'type'] ==
'select' &&
$config[
'authMode']
475 && !
$GLOBALS[
'BE_USER']->checkAuthMode(
'tt_content', $fN, $fV,
$config[
'authMode']);
477 if (!isset($removeItems[$fN])) {
480 if (!isset($keepItems[$fN])) {
483 $isNotInKeepItems = count($keepItems[$fN]) && !in_array($fV, $keepItems[$fN]);
484 if ($authModeDeny || $fN ===
'CType' && in_array($fV, $removeItems[$fN]) || $isNotInKeepItems) {
486 unset($wizardItems[$key]);
490 $wizardItems[$key][
'params'] .=
'&defVals[tt_content][' . $fN .
']=' . rawurlencode($fV);
491 $tmp = explode(
'_', $key);
492 $headersUsed[$tmp[0]] = $tmp[0];
499 foreach ($wizardItems as $key => $cfg) {
500 $tmp = explode(
'_', $key);
501 if ($tmp[0] && !$tmp[1] && !in_array($tmp[0], $headersUsed)) {
502 unset($wizardItems[$key]);
wizard_getItem($groupKey, $itemKey, $itemConf)
wizard_appendWizards($wizardElements)
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
static explodeUrl2Array($string, $multidim=FALSE)
static readPageAccess($id, $perms_clause)
static getTCEFORM_TSconfig($table, $row)
static getModTSconfig($id, $TSref)
removeInvalidElements(&$wizardItems)
static cshItem($table, $field, $BACK_PATH, $wrap='', $onlyIconMode=FALSE, $styleAttrib='')
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
wizard_getGroupHeader($groupKey, $wizardGroup)
static getSpriteIcon($iconName, array $options=array(), array $overlays=array())
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
static sanitizeLocalUrl($url='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static getPagesTSconfig($id, $rootLine=NULL, $returnPartArray=FALSE)