[TASK] Deprecate functions in page module
authorGeorg <mail@ringerge.org>
Thu, 7 Jul 2011 12:18:00 +0000 (14:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 9 Jul 2011 21:03:55 +0000 (23:03 +0200)
The page module has a direct a support for extensions
like tt_calendar, tt_guest and others.

Those extensions can use other ways to show records
in page module and no need for it in core.

Change-Id: I037e7ce6e912e7fdf1416747eb9f54353266632b
Resolves: #27940
Reviewed-on: http://review.typo3.org/3104
Reviewed-by: Stefan Neufeind
Reviewed-by: Tolleiv Nietsch
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/config_default.php
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/layout/db_layout.php

index fdcf36d..f54c0f6 100644 (file)
@@ -623,7 +623,19 @@ $TYPO3_CONF_VARS = array(
                ),
        ),
        'EXTCONF' => array(             // Here you may add manually set configuration options for your extensions. Eg. $TYPO3_CONF_VARS['EXTCONF']['my_extension_key']['my_option'] = 'my_value';
-//             '--key--' => array()
+               'cms' => array(
+                       'db_layout' => array(
+                               'addTables' => array(
+                                       'fe_users' => array(
+                                               0 => array(
+                                                       'MENU' => '',
+                                                       'fList' => 'username,usergroup,name,email,telephone,address,zip,city',
+                                                       'icon' => TRUE,
+                                               )
+                                       )
+                               )
+                       )
+               ),
        ),
        'SVCONF' => array(              // Here you may add manually set configuration options for services.
 //             Eg.  ...['service_type']['setup']['my_option'] = 'my_value'; Setup options how to handle the service (call it or not and how when)
@@ -966,4 +978,4 @@ $SIM_EXEC_TIME = $EXEC_TIME;                        // $SIM_EXEC_TIME is set to $EXEC_TIME but can be
 $ACCESS_TIME = $EXEC_TIME - ($EXEC_TIME % 60);         // $ACCESS_TIME is a common time in minutes for access control
 $SIM_ACCESS_TIME = $ACCESS_TIME;               // if $SIM_EXEC_TIME is changed this value must be set accordingly
 
-?>
\ No newline at end of file
+?>
index 93d6910..543b308 100755 (executable)
@@ -110,7 +110,6 @@ class tx_cms_layout extends recordList {
                        return $this->getExternalTables($id, $table);
                } else {
                        // Branch out based on table name:
-                       // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
                        switch ($table) {
                                case 'pages':
                                        return $this->getTable_pages($id);
@@ -118,33 +117,6 @@ class tx_cms_layout extends recordList {
                                case 'tt_content':
                                        return $this->getTable_tt_content($id);
                                        break;
-                               case 'fe_users':
-                                       return $this->getTable_fe_users($id);
-                                       break;
-                               case 'sys_note':
-                                       return $this->getTable_sys_note($id);
-                                       break;
-                               case 'tt_board':
-                                       return $this->getTable_tt_board($id);
-                                       break;
-                               case 'tt_address':
-                                       return $this->getTable_tt_address($id);
-                                       break;
-                               case 'tt_links':
-                                       return $this->getTable_tt_links($id);
-                                       break;
-                               case 'tt_guest':
-                                       return $this->getTable_tt_guest($id);
-                                       break;
-                               case 'tt_news':
-                                       return $this->getTable_tt_news($id);
-                                       break;
-                               case 'tt_calender':
-                                       return $this->getTable_tt_calender($id);
-                                       break;
-                               case 'tt_products':
-                                       return $this->getTable_tt_products($id);
-                                       break;
                        }
                }
        }
@@ -841,8 +813,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_fe_users($id) {
+               t3lib_div::logDeprecatedFunction();
 
                $this->addElement_tdParams = array(
                        'username' => ' nowrap="nowrap"',
@@ -866,8 +840,11 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_sys_note($id) {
+               t3lib_div::logDeprecatedFunction();
+
                if (!t3lib_extMgm::isLoaded('sys_note')) {
                        return '';
                }
@@ -962,8 +939,11 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
+
         */
        function getTable_tt_board($id) {
+               t3lib_div::logDeprecatedFunction();
 
                // Initialize:
                $delClause = t3lib_BEfunc::deleteClause('tt_board') . t3lib_BEfunc::versioningPlaceholderClause('tt_board');
@@ -1045,8 +1025,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_address($id) {
+               t3lib_div::logDeprecatedFunction();
 
                // Define fieldlist to show:
                switch ($GLOBALS['SOBE']->MOD_SETTINGS['tt_address']) {
@@ -1075,8 +1057,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_links($id) {
+               t3lib_div::logDeprecatedFunction();
 
                // Define fieldlist to show:
                switch ($GLOBALS['SOBE']->MOD_SETTINGS['tt_links']) {
@@ -1101,8 +1085,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_guest($id) {
+               t3lib_div::logDeprecatedFunction();
 
                // Define fieldlist to show:
                $fList = 'title;cr_name;cr_email,note';
@@ -1116,8 +1102,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_news($id) {
+               t3lib_div::logDeprecatedFunction();
 
                $this->addElement_tdParams = array(
                        'title' => ' nowrap="nowrap"',
@@ -1137,8 +1125,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_calender($id) {
+               t3lib_div::logDeprecatedFunction();
 
                $type = $GLOBALS['SOBE']->MOD_SETTINGS['tt_calender'];
                switch ($type) {
@@ -1187,8 +1177,10 @@ class tx_cms_layout extends recordList {
         *
         * @param       integer         Page id
         * @return      string          HTML for the listing
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function getTable_tt_products($id) {
+               t3lib_div::logDeprecatedFunction();
 
                $type = $GLOBALS['SOBE']->MOD_SETTINGS['tt_products'];
                switch ($type) {
@@ -2102,8 +2094,10 @@ class tx_cms_layout extends recordList {
         * @param       string          Additional query part.
         * @param       string          HTML content to prefix items with (to draw the proper tree-graphics)
         * @return      array           $theRows, but with added content
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function tt_board_getTree($theRows, $parent, $pid, $qWhere, $treeIcons) {
+               t3lib_div::logDeprecatedFunction();
 
                // Select tt_board elements:
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_board', 'pid=' . intval($pid) . ' AND parent=' . intval($parent) . $qWhere, '', 'crdate');
@@ -2137,8 +2131,10 @@ class tx_cms_layout extends recordList {
         * @param       array           The record row
         * @param       string          Reply count, if applicable.
         * @return      string          Return content of element (table row)
+        * @deprecated since TYPO3 4.6, will be removed in TYPO3 4.8
         */
        function tt_board_drawItem($table, $row, $re) {
+               t3lib_div::logDeprecatedFunction();
 
                // Building data-arary with content:
                $theData = Array();
@@ -2574,22 +2570,22 @@ class tx_cms_layout extends recordList {
         */
        function getTableMenu($id) {
 
-               // Initialize:
+                       // Initialize:
                $this->activeTables = array();
-               $theTables = explode(',', 'tt_content,fe_users,tt_address,tt_links,tt_board,tt_guest,tt_calender,tt_products,tt_news'); // NOTICE: This serves double function: Both being tables names (all) and for most others also being extension keys for the extensions they are related to!
+               $theTables = array('tt_content');
 
-               // External tables:
+                       // External tables:
                if (is_array($this->externalTables)) {
                        $theTables = array_unique(array_merge($theTables, array_keys($this->externalTables)));
                }
 
-               // Traverse tables to check:
+                       // Traverse tables to check:
                foreach ($theTables as $tName) {
 
-                       // Check access and whether the proper extensions are loaded:
+                               // Check access and whether the proper extensions are loaded:
                        if ($GLOBALS['BE_USER']->check('tables_select', $tName) && (t3lib_extMgm::isLoaded($tName) || t3lib_div::inList('fe_users,tt_content', $tName) || isset($this->externalTables[$tName]))) {
 
-                               // Make query to count records from page:
+                                       // Make query to count records from page:
                                $c = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
                                        'uid',
                                        $tName,
@@ -2598,10 +2594,10 @@ class tx_cms_layout extends recordList {
                                                                t3lib_BEfunc::versioningPlaceholderClause($tName)
                                );
 
-                               // If records were found (or if "tt_content" is the table...):
+                                       // If records were found (or if "tt_content" is the table...):
                                if ($c || t3lib_div::inList('tt_content', $tName)) {
 
-                                       // Add row to menu:
+                                               // Add row to menu:
                                        $out .= '
                                        <td><a href="#' . $tName . '"></a>' .
                                                        t3lib_iconWorks::getSpriteIconForRecord(
@@ -2610,7 +2606,7 @@ class tx_cms_layout extends recordList {
                                                                array('title' => $GLOBALS['LANG']->sL($GLOBALS['TCA'][$tName]['ctrl']['title'], 1))
                                                        ) . '</td>';
 
-                                       // ... and to the internal array, activeTables we also add table icon and title (for use elsewhere)
+                                               // ... and to the internal array, activeTables we also add table icon and title (for use elsewhere)
                                        $this->activeTables[$tName] =
                                                        t3lib_iconWorks::getSpriteIconForRecord(
                                                                $tName,
@@ -2622,11 +2618,8 @@ class tx_cms_layout extends recordList {
                        }
                }
 
-               // Wrap cells in table tags:
+                       // Wrap cells in table tags:
                $out = '
-
-
-
                        <!--
                                Menu of tables on the page (table menu)
                        -->
@@ -2635,7 +2628,7 @@ class tx_cms_layout extends recordList {
                                </tr>
                        </table>';
 
-               // Return the content:
+                       // Return the content:
                return $out;
        }
 
@@ -2662,4 +2655,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']);
 }
 
-?>
\ No newline at end of file
+?>
index 898047a..27a045d 100755 (executable)
@@ -255,31 +255,6 @@ class SC_db_layout {
        function menuConfig()   {
                        // MENU-ITEMS:
                $this->MOD_MENU = array(
-                       'tt_board' => array(
-                               0 => $GLOBALS['LANG']->getLL('m_tt_board_0'),
-                               'expand' => $GLOBALS['LANG']->getLL('m_tt_board_expand')
-                       ),
-                       'tt_address' => array(
-                               0 => $GLOBALS['LANG']->getLL('m_tt_address_0'),
-                               1 => $GLOBALS['LANG']->getLL('m_tt_address_1'),
-                               2 => $GLOBALS['LANG']->getLL('m_tt_address_2')
-                       ),
-                       'tt_links' => array(
-                               0 => $GLOBALS['LANG']->getLL('m_default'),
-                               1 => $GLOBALS['LANG']->getLL('m_tt_links_1'),
-                               2 => $GLOBALS['LANG']->getLL('m_tt_links_2')
-                       ),
-                       'tt_calender' => array (
-                               0 => $GLOBALS['LANG']->getLL('m_default'),
-                               'date' => $GLOBALS['LANG']->getLL('m_tt_calender_date'),
-                               'date_ext' => $GLOBALS['LANG']->getLL('m_tt_calender_date_ext'),
-                               'todo' => $GLOBALS['LANG']->getLL('m_tt_calender_todo'),
-                               'todo_ext' => $GLOBALS['LANG']->getLL('m_tt_calender_todo_ext')
-                       ),
-                       'tt_products' => array (
-                               0 => $GLOBALS['LANG']->getLL('m_default'),
-                               'ext' => $GLOBALS['LANG']->getLL('m_tt_products_ext')
-                       ),
                        'tt_content_showHidden' => '',
                        'showPalettes' => '',
                        'showDescriptions' => '',
@@ -300,7 +275,7 @@ class SC_db_layout {
                //              array ('default' => array(
                //                              'MENU' => 'LLL:EXT:tx_myext/locallang_db.xml:menuDefault',
                //                              'fList' =>  'title,description,image',
-               //                              'icon' => TRUE),
+               //                              'icon' => TRUE));
                if (is_array($this->externalTables)) {
                        foreach ($this->externalTables as $table => $tableSettings) {
                                // delete the default settings from above
@@ -1017,80 +992,55 @@ class SC_db_layout {
                        t3lib_div::loadTCA($table);
 
                        if (!isset($dblist->externalTables[$table]))    {
-                                       // Creating special conditions for each table:
-                               switch($table)  {
-                                       case 'tt_board':
-                                               $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_board]',$this->MOD_SETTINGS['tt_board'],$this->MOD_MENU['tt_board'],'db_layout.php','');
-                                       break;
-                                       case 'tt_address':
-                                               $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_address]',$this->MOD_SETTINGS['tt_address'],$this->MOD_MENU['tt_address'],'db_layout.php','');
-                                       break;
-                                       case 'tt_links':
-                                               $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_links]',$this->MOD_SETTINGS['tt_links'],$this->MOD_MENU['tt_links'],'db_layout.php','');
-                                       break;
-                                       case 'tt_calender':
-                                               $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_calender]',$this->MOD_SETTINGS['tt_calender'],$this->MOD_MENU['tt_calender'],'db_layout.php','');
-                                       break;
-                                       case 'tt_products':
-                                               $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_products]',$this->MOD_SETTINGS['tt_products'],$this->MOD_MENU['tt_products'],'db_layout.php','');
-                                       break;
-                                       case 'tt_guest':
-                                       case 'tt_news':
-                                       case 'fe_users':
-                                               // Nothing
-                                       break;
-                                       case 'tt_content':
-                                               $q_count = $this->getNumberOfHiddenElements();
-                                               $h_func_b = t3lib_BEfunc::getFuncCheck(
-                                                       $this->id,
-                                                       'SET[tt_content_showHidden]',
-                                                       $this->MOD_SETTINGS['tt_content_showHidden'],
-                                                       'db_layout.php',
-                                                       '',
-                                                       'id="checkTt_content_showHidden"'
-                                               ) . '<label for="checkTt_content_showHidden">' .
-                                               (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('hiddenCE')) : $GLOBALS['LANG']->getLL('hiddenCE') . ' (' . $q_count . ')') . '</label>';
+                               $q_count = $this->getNumberOfHiddenElements();
+                               $h_func_b = t3lib_BEfunc::getFuncCheck(
+                                       $this->id,
+                                       'SET[tt_content_showHidden]',
+                                       $this->MOD_SETTINGS['tt_content_showHidden'],
+                                       'db_layout.php',
+                                       '',
+                                       'id="checkTt_content_showHidden"'
+                               ) . '<label for="checkTt_content_showHidden">' .
+                               (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('hiddenCE')) : $GLOBALS['LANG']->getLL('hiddenCE') . ' (' . $q_count . ')') . '</label>';
 
-                                               $dblist->tt_contentConfig['showCommands'] = 1;  // Boolean: Display up/down arrows and edit icons for tt_content records
-                                               $dblist->tt_contentConfig['showInfo'] = 1;              // Boolean: Display info-marks or not
-                                               $dblist->tt_contentConfig['single'] = 0;                // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
+                               $dblist->tt_contentConfig['showCommands'] = 1;  // Boolean: Display up/down arrows and edit icons for tt_content records
+                               $dblist->tt_contentConfig['showInfo'] = 1;              // Boolean: Display info-marks or not
+                               $dblist->tt_contentConfig['single'] = 0;                // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
 
-                                               if ($this->MOD_SETTINGS['function'] == 4) {
-                                                               // grid view
-                                                       $dblist->tt_contentConfig['showAsGrid'] = 1;
-                                               }
+                               if ($this->MOD_SETTINGS['function'] == 4) {
+                                               // grid view
+                                       $dblist->tt_contentConfig['showAsGrid'] = 1;
+                               }
 
-                                                       // Setting up the tt_content columns to show:
-                                               if (is_array($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'])) {
-                                                       $colList = array();
-                                                       $tcaItems = t3lib_div::callUserFunction( 'EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getColPosListItemsParsed' , $this->id, $this );
-                                                       foreach($tcaItems as $temp)     {
-                                                               $colList[] = $temp[1];
-                                                       }
-                                               } else {        // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
-                                                       $colList = array('1','0','2','3');
-                                               }
-                                               if (strcmp($this->colPosList,''))       {
-                                                       $colList = array_intersect(t3lib_div::intExplode(',',$this->colPosList),$colList);
-                                               }
+                                       // Setting up the tt_content columns to show:
+                               if (is_array($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'])) {
+                                       $colList = array();
+                                       $tcaItems = t3lib_div::callUserFunction( 'EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getColPosListItemsParsed' , $this->id, $this );
+                                       foreach($tcaItems as $temp)     {
+                                               $colList[] = $temp[1];
+                                       }
+                               } else {        // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
+                                       $colList = array('1','0','2','3');
+                               }
+                               if (strcmp($this->colPosList,''))       {
+                                       $colList = array_intersect(t3lib_div::intExplode(',',$this->colPosList),$colList);
+                               }
 
-                                                       // If only one column found, display the single-column view.
-                                               if (count($colList) === 1 && !$this->MOD_SETTINGS['function'] === 4) {
-                                                       $dblist->tt_contentConfig['single'] = 1;        // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
-                                                       $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other)
-                                               }
-                                               $dblist->tt_contentConfig['cols'] = implode(',',$colList);              // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
-                                               $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
-                                               $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
-
-                                                       // If the function menu is set to "Language":
-                                               if ($this->MOD_SETTINGS['function']==2) {
-                                                       $dblist->tt_contentConfig['single'] = 0;
-                                                       $dblist->tt_contentConfig['languageMode'] = 1;
-                                                       $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
-                                                       $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language;
-                                               }
-                                       break;
+                                       // If only one column found, display the single-column view.
+                               if (count($colList) === 1 && !$this->MOD_SETTINGS['function'] === 4) {
+                                       $dblist->tt_contentConfig['single'] = 1;        // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
+                                       $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other)
+                               }
+                               $dblist->tt_contentConfig['cols'] = implode(',',$colList);              // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
+                               $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
+                               $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
+
+                                       // If the function menu is set to "Language":
+                               if ($this->MOD_SETTINGS['function']==2) {
+                                       $dblist->tt_contentConfig['single'] = 0;
+                                       $dblist->tt_contentConfig['languageMode'] = 1;
+                                       $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
+                                       $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language;
                                }
                        } else {
                                if (isset($this->MOD_SETTINGS) && isset($this->MOD_MENU)) {
@@ -1407,4 +1357,4 @@ $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
\ No newline at end of file
+?>