TCEForms: allow to create many sections at once
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 12 Jul 2007 11:26:58 +0000 (11:26 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 12 Jul 2007 11:26:58 +0000 (11:26 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2400 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/sysext/lang/locallang_core.xml

index 4ba5c92..a9de0fb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-12  Dmitry Dulepov  <dmitry@typo3.org>
+
+       * TCEForms: allow to create many sections at once
+
 2007-07-11  Oliver Hader  <oh@inpublica.de>
 
        * Fixed bug #5331: Remove the caption wrap on images if no caption is set (thanks to Georg Ringer)
index 3f75b8a..9f6c8a7 100755 (executable)
@@ -2340,9 +2340,14 @@ class t3lib_TCEforms     {
                                                                $opt=array();
                                                                $opt[]='<option value=""></option>';
                                                                foreach($value['el'] as $kk => $vv)     {
-                                                                       $opt[]='<option value="'.$kk.'">'.htmlspecialchars($this->getLL('l_new') . ' "'.$this->sL($value['el'][$kk]['tx_templavoila']['title']).'"').'</option>';
+                                                                       $opt[]='<option value="'.$kk.'">'.htmlspecialchars($this->sL($value['el'][$kk]['tx_templavoila']['title'])).'</option>';
                                                                }
-                                                               $rowCells['formEl']='<select name="flexFormsCmdData'.$formPrefix.'['.$key.'][value]">'.implode('',$opt).'</select>';
+                                                               $rowCells['formEl']=$this->getLL('l_new_section') . ' <select name="flexFormsCmdData'.$formPrefix.'['.$key.'][value]">'.implode('',$opt).'</select> ';
+                                                               $rowCells['formEl'].=$this->getLL('l_count') . ' <select name="flexFormsCmdData'.$formPrefix.'['.$key.'][count]">';
+                                                               for ($i = 1; $i <= 10; $i++) {
+                                                                       $rowCells['formEl'].='<option value="' . $i . '">' . $i . '</option>';
+                                                               }
+                                                               $rowCells['formEl'].='</select>';
                                                        }
 
                                                                // Put row together
@@ -2375,24 +2380,25 @@ class t3lib_TCEforms    {
                                                                }
                                                        }
 
-
-
                                                                // New form?
                                                        if ($cmdData[$key]['value'])    {
                                                                $newSectionEl = $value['el'][$cmdData[$key]['value']];
                                                                if (is_array($newSectionEl))    {
-                                                                       $tRows = $this->getSingleField_typeFlex_draw(
-                                                                               array($cmdData[$key]['value'] => $newSectionEl),
-                                                                               array(),
-                                                                               array(),
-                                                                               $table,
-                                                                               $field,
-                                                                               $row,
-                                                                               $PA,
-                                                                               $formPrefix.'['.$key.'][el]['.($cc+1).']',
-                                                                               $level+1,
-                                                                               $tRows
-                                                                       );
+                                                                       $newElCount = max(1, intval($cmdData[$key]['count']));
+                                                                       for ($newElNum = 0; $newElNum < $newElCount; $newElNum++) {
+                                                                               $tRows = $this->getSingleField_typeFlex_draw(
+                                                                                       array($cmdData[$key]['value'] => $newSectionEl),
+                                                                                       array(),
+                                                                                       array(),
+                                                                                       $table,
+                                                                                       $field,
+                                                                                       $row,
+                                                                                       $PA,
+                                                                                       $formPrefix.'['.$key.'][el]['.($cc+1+$newElNum).']',
+                                                                                       $level+1,
+                                                                                       $tRows
+                                                                               );
+                                                                       }
                                                                }
                                                        }
                                                } else {
@@ -5580,4 +5586,4 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms.php']);
 }
-?>
\ No newline at end of file
+?>
index 06aca70..7fd85ec 100755 (executable)
@@ -87,6 +87,8 @@ Do you want to continue WITHOUT saving?</label>
                        <label index="labels.setAllCheckboxes">Select All Checkboxes</label>
                        <label index="labels.changeInOrig">Changed in original translation</label>
                        <label index="labels.expandAll">Expand all</label>
+                       <label index="labels.new_section">Create new:</label>
+                       <label index="labels.count">Quantity:</label>
                        <label index="ver.online">ONLINE</label>
                        <label index="ver.mgm">Version Management</label>
                        <label index="ver.selVer">Select version:</label>