Fixed bug #15580: Add calls to logDeprecatedFunction() for more deprecated functions...
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_pibase.php
index 86ebca3..7f2e984 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2010 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * This script contains the parent class, 'pibase', providing an API with the most basic methods for frontend plugins
  *
  * $Id$
- * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj
+ * Revised for TYPO3 3.6 June/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
  * This class contains functions which assists these plugins in creating lists, searching, displaying menus, page-browsing (next/previous/1/2/3) and handling links.
  * Functions are all prefixed "pi_" which is reserved for this class. Those functions can of course be overridden in the extension classes (that is the point...)
  *
- * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
+ * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tslib
  */
@@ -218,9 +218,9 @@ class tslib_pibase {
                                $GLOBALS['TSFE']->reqCHash();
                        }
                }
-               if ($GLOBALS['TSFE']->config['config']['language'])     {
+               if (!empty($GLOBALS['TSFE']->config['config']['language'])) {
                        $this->LLkey = $GLOBALS['TSFE']->config['config']['language'];
-                       if ($GLOBALS['TSFE']->config['config']['language_alt']) {
+                       if (!empty($GLOBALS['TSFE']->config['config']['language_alt'])) {
                                $this->altLLkey = $GLOBALS['TSFE']->config['config']['language_alt'];
                        }
                }
@@ -566,7 +566,7 @@ class tslib_pibase {
                                        $links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_last','Last >>',$hscText),$wrapper['disabledLinkWrap']);
                                }
                        }
-                       $theLinks = $this->cObj->wrap(implode(chr(10),$links),$wrapper['browseLinksWrap']);
+                       $theLinks = $this->cObj->wrap(implode(LF,$links),$wrapper['browseLinksWrap']);
                } else {
                        $theLinks = '';
                }
@@ -789,7 +789,7 @@ class tslib_pibase {
         * @param       string          $data: CSS data
         * @param       string          If $selector is set to any CSS selector, eg 'P' or 'H1' or 'TABLE' then the style $data will regard those HTML-elements only
         * @return      void
-        * @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, I think this function should not be used (and probably isn't used anywhere). It was a part of a concept which was left behind quite quickly.
+        * @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.6, I think this function should not be used (and probably isn't used anywhere). It was a part of a concept which was left behind quite quickly.
         * @obsolete
         * @private
         */
@@ -1050,24 +1050,25 @@ class tslib_pibase {
         * @return      mixed           The query build.
         * @access private
         * @deprecated since TYPO3 3.6, this function will be removed in TYPO3 4.5, use pi_exec_query() instead!
+        * @todo        Deprecated but still used in the Core!
         */
        function pi_list_query($table,$count=0,$addWhere='',$mm_cat='',$groupBy='',$orderBy='',$query='',$returnQueryArray=FALSE)       {
 
-                       // Begin Query:
+               // Begin Query:
                if (!$query)    {
                                // Fetches the list of PIDs to select from.
                                // TypoScript property .pidList is a comma list of pids. If blank, current page id is used.
                                // TypoScript property .recursive is a int+ which determines how many levels down from the pids in the pid-list subpages should be included in the select.
                        $pidList = $this->pi_getPidList($this->conf['pidList'],$this->conf['recursive']);
                        if (is_array($mm_cat))  {
-                               $query='FROM '.$table.','.$mm_cat['table'].','.$mm_cat['mmtable'].chr(10).
-                                               ' WHERE '.$table.'.uid='.$mm_cat['mmtable'].'.uid_local AND '.$mm_cat['table'].'.uid='.$mm_cat['mmtable'].'.uid_foreign '.chr(10).
-                                               (strcmp($mm_cat['catUidList'],'')?' AND '.$mm_cat['table'].'.uid IN ('.$mm_cat['catUidList'].')':'').chr(10).
-                                               ' AND '.$table.'.pid IN ('.$pidList.')'.chr(10).
-                                               $this->cObj->enableFields($table).chr(10);      // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries!
+                               $query='FROM '.$table.','.$mm_cat['table'].','.$mm_cat['mmtable'].LF.
+                                               ' WHERE '.$table.'.uid='.$mm_cat['mmtable'].'.uid_local AND '.$mm_cat['table'].'.uid='.$mm_cat['mmtable'].'.uid_foreign '.LF.
+                                               (strcmp($mm_cat['catUidList'],'')?' AND '.$mm_cat['table'].'.uid IN ('.$mm_cat['catUidList'].')':'').LF.
+                                               ' AND '.$table.'.pid IN ('.$pidList.')'.LF.
+                                               $this->cObj->enableFields($table).LF;   // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries!
                        } else {
-                               $query='FROM '.$table.' WHERE pid IN ('.$pidList.')'.chr(10).
-                                               $this->cObj->enableFields($table).chr(10);      // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries!
+                               $query='FROM '.$table.' WHERE pid IN ('.$pidList.')'.LF.
+                                               $this->cObj->enableFields($table).LF;   // This adds WHERE-clauses that ensures deleted, hidden, starttime/endtime/access records are NOT selected, if they should not! Almost ALWAYS add this to your queries!
                        }
                }
 
@@ -1077,11 +1078,11 @@ class tslib_pibase {
                $WHERE = trim($WHERE);
 
                        // Add '$addWhere'
-               if ($addWhere)  {$WHERE.=' '.$addWhere.chr(10);}
+               if ($addWhere)  {$WHERE.=' '.$addWhere.LF;}
 
                        // Search word:
                if ($this->piVars['sword'] && $this->internal['searchFieldList'])       {
-                       $WHERE.=$this->cObj->searchWhere($this->piVars['sword'],$this->internal['searchFieldList'],$table).chr(10);
+                       $WHERE.=$this->cObj->searchWhere($this->piVars['sword'],$this->internal['searchFieldList'],$table).LF;
                }
 
                if ($count) {