Index: typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php
===================================================================
--- typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php (revision 8632)
+++ typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php (working copy)
@@ -56,6 +56,11 @@
*/
class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
+ protected $loremIpsumObject = NULL;
+ protected $tsConfig = array();
+ protected $pagesTsConfig = array();
+
+
/**
* Adds menu items... but I think this is not used at all. Looks very much like some testing code. If anyone cares to check it we can remove it some day...
*
@@ -84,6 +89,15 @@
$theCode='';
+ $this->tsConfig = t3lib_BEfunc::getPagesTSconfig($this->pObj->id);
+ $this->pagesTsConfig = isset($this->tsConfig['TCEFORM.']['pages.']) ? $this->tsConfig['TCEFORM.']['pages.'] : array();
+
+
+ // Create loremIpsum code:
+ if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
+ $this->loremIpsumObject = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
+ }
+
$m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8); // create new pages here?
$pRec = t3lib_BEfunc::getRecord('pages',$this->pObj->id,'uid',' AND '.$m_perms_clause);
$sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
@@ -100,6 +114,8 @@
}
$firstRecord = true;
+ $previousIdentifier = '';
+
foreach ($data['pages'] as $identifier => $dat) {
if (!trim($dat['title'])) {
unset($data['pages'][$identifier]);
@@ -158,23 +174,55 @@
}
$theCode.= '
' . $LANG->getLL('wiz_newPages_currentMenu') . '
' . implode('
', $lines);
} else {
- // Create loremIpsum code:
- if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
- $loremIpsumObj = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
- }
+
// Display create form
$lines = array();
for ($a = 0; $a < 9; $a++) {
- $lines[] = 'pObj->doc->formWidth(35) . ' />'.
- (is_object($loremIpsumObj) ? '' . $loremIpsumObj->getIcon('', $this->pObj->doc->backPath) . '' : '');
+ $lines[] = $this->getFormLine($a);
}
- $theCode.= ''.$LANG->getLL('wiz_newPages').':
'.implode('
',$lines).
+ $theCode .= '' . $LANG->getLL('wiz_newPages').':
' .
+ '' . implode('', $lines) . '
' .
+ '
' .
+ '' .
+
'
';
+
+ // Add ExtJS inlne code
+ $extCode = '
+ var tpl = "' . addslashes(str_replace(
+ array(LF, TAB),
+ array('', ''),
+ $this->getFormLine('#')
+ )) . '", i, line, div, bg, label;
+ var lineCounter = 9;
+ Ext.get("createNewFormFields").on("click", function() {
+ div = Ext.get("formFieldContainer");
+ for (i = 0; i < 5; i++) {
+ label = lineCounter + i + 1;
+ bg = label % 2 === 0 ? 6 : 4;
+ line = String.format(tpl, (lineCounter + i), label, bg);
+ div.insertHtml("beforeEnd", line);
+ }
+ lineCounter += 5;
+ });
+ ';
+
+ /** @var t3lib_pageRenderer **/
+ $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
+
+ $pageRenderer->loadExtJS();
+ $pageRenderer->addExtOnReadyCode($extCode);
+ $pageRenderer->addCssInlineBlock('tx_wizardcrpages_webfunc_2', '
+ #formFieldContainer {float: left;margin: 0 0 10px 0;}
+ .clearLeft {clear: left;}
+ #formFieldContainer label {width: 70px;display: inline-block;}
+ #formFieldContainer input {margin:4px 2px;padding:1px;vertical-align:middle}
+ #formFieldContainer span {padding: 0 3px;}
+ ');
}
} else {
$theCode.=$GLOBALS['TBE_TEMPLATE']->rfw($LANG->getLL('wiz_newPages_errorMsg1'));
@@ -195,6 +243,82 @@
function helpBubble() {
return 'pObj->doc->helpStyle().' alt="" />';
}
+
+ public function getFormLine($index) {
+ $backPath = $GLOBALS['BACK_PATH'];
+
+ if (is_numeric(($index))) {
+ $backgroundClass = $index % 2 === 0 ? 'bgColor4' : 'bgColor6';
+ $label = $index + 1;
+ } else {
+ // used as template for ExtJS
+ $index = '{0}';
+ $backgroundClass = 'bgColor{2}';
+ $label = '{1}';
+ }
+
+ $content = '';
+
+ // title
+ $content .= 'pObj->doc->formWidth(35) . ' /> ';
+
+ $content .= '' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.php:LGL.type') . '';
+ $content .= '';
+
+ $content .= (is_object($this->loremIpsumObject) ?
+ '' . $this->loremIpsumObject->getIcon('', $this->pObj->doc->backPath) . ''
+ : '');
+
+ return '' . $content . '
';
+ }
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php']) {
Index: typo3/sysext/wizard_crpages/locallang.xml
===================================================================
--- typo3/sysext/wizard_crpages/locallang.xml (revision 8632)
+++ typo3/sysext/wizard_crpages/locallang.xml (working copy)
@@ -19,6 +19,7 @@
+