Some code cleanup.
authortomkraw <tomkraw@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 15 Aug 2013 18:32:50 +0000 (18:32 +0000)
committertomkraw <tomkraw@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 15 Aug 2013 18:32:50 +0000 (18:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/tk_mobiledetector/trunk@79012 735d13b6-9817-0410-8766-e36946ffe9aa

Classes/Hook/DeviceInfo.php
Classes/ParseRdf.php
Classes/Xclass/ConditionMatcher.php
class.ux_t3lib_matchcondition_frontend.php
lib/class.tx_parse_rdf.php
mod2/conf.php
mod2/index.php
pi1/class.tx_tkmobiledetector_pi1.php
pi1/class.tx_tkmobiledetector_pi1_wizicon.php

index 98d5ba3..865ce4d 100644 (file)
@@ -23,8 +23,7 @@
  * GNU General Public License for more details.
  *
  * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/ 
-
+ ***************************************************************/
  /**
  * Class to handle and determine device specific information.
  *
index bf4c0d6..2e66a21 100644 (file)
@@ -573,6 +573,6 @@ class ParseRdf {
 
  
  if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php']);
+       require_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php']);
 }
 ?>
index 209e6e6..f8cca6a 100644 (file)
  *
  * This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/ 
-
+/**
+ * Class extends ConditionMatcher class with new Typoscript 
+ * conditions.
+ *
+ * @author     Tomasz Krawczyk <tomasz@typo3.pl>
+ * @package    TYPO3
+ * @subpackage tk_mobiledetector
+ */
 class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher {
-       
+
        private $extKey = 'tk_mobiledetector';
 
        /**
-        * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
+        * Evaluates a TypoScript condition given as input, eg. 
+        * "[browser=net][...(other conditions)...]"
         *
         * @param       string          $string: The condition to match against its criterias.
         * @return      boolean         Whether the condition matched
@@ -40,8 +48,9 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
 
                $result = parent::evaluateCondition($string);
                if (is_bool($result)) {
-                       if($result)
+                       if($result) {
                                return $result;
+                       }
                }
 
                $browserInfo = array();
@@ -57,16 +66,18 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                        case 'vendor':
                                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
-                                       if ($this->searchStringWildcard($browserInfo['vendor'], $test))
+                                       if ($this->searchStringWildcard($browserInfo['vendor'], $test)) {
                                                return TRUE;
+                                       }
                                }
                                break;
 
                        case 'model':
                                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
-                                       if ($this->searchStringWildcard($browserInfo['model'], $test))
+                                       if ($this->searchStringWildcard($browserInfo['model'], $test)) {
                                                return TRUE;
+                                       }
                                }
                                break;
 
@@ -93,12 +104,13 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                                foreach ($values as $test) {
                                        $browsers = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('|', $browserInfo['browser_name'], TRUE);
                                        foreach ($browsers as $browser) {
-                                               if ($this->searchStringWildcard($browser, $test))
+                                               if ($this->searchStringWildcard($browser, $test)) {
                                                        return TRUE;
+                                               }
                                        }
                                }
                                break;
-                               
+
                        case 'browser_version':
                                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
@@ -116,7 +128,7 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                                        return TRUE;
                                }
                                break;
-                               
+
                        case 'html_tables':
                                if (intval($browserInfo['html_tables']) == intval($value)) {
                                        return TRUE;
@@ -156,8 +168,9 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                        case 'os':
                                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
-                                       if ($this->searchStringWildcard($browserInfo['os'], $test))
+                                       if ($this->searchStringWildcard($browserInfo['os'], $test)) {
                                                return TRUE;
+                                       }
                                }
                                break;
 
@@ -173,8 +186,9 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                        case 'os_vendor':
                                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
-                                       if ($this->searchStringWildcard($browserInfo['os_vendor'], $test))
+                                       if ($this->searchStringWildcard($browserInfo['os_vendor'], $test)) {
                                                return TRUE;
+                                       }
                                }
                                break;
 
@@ -206,7 +220,6 @@ class ux_ConditionMatcher extends \TYPO3\CMS\Frontend\Configuration\TypoScript\C
                                break;
                }
                return FALSE;
-       }
-       
+       }
 }
-?>
+?>
\ No newline at end of file
index 6f30cd2..586eb94 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
  * Copyright notice
  *
- * (c) 2011 Tomasz Krawczyk <tomasz@typo3.pl>
+ * (c) 2013 Tomasz Krawczyk <tomasz@typo3.pl>
  * All rights reserved
  *
  * This script is part of the TYPO3 project. The TYPO3 project is
  * GNU General Public License for more details.
  *
  * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/ 
-
-class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
-       
+ ***************************************************************/
+/**\r
+ * Class extends t3lib_matchCondition_frontend class with new Typoscript 
+ * conditions.\r
+ *\r
+ * @author     Tomasz Krawczyk <tomasz@typo3.pl>\r
+ * @package    TYPO3\r
+ * @subpackage tk_mobiledetector\r
+ */\r
+class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend { 
        private $extKey = 'tk_mobiledetector';
        
-       
        /**
-        * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
+        * Evaluates a TypoScript condition given as input, eg. 
+        * "[browser=net][...(other conditions)...]"
         *
-        * @param       string          $string: The condition to match against its criterias.
+        * @param       string          $string: The condition to match against its 
+        *                      criterias.
         * @return      boolean         Whether the condition matched
         * @see t3lib_tsparser::parse()
         */
@@ -41,19 +48,18 @@ class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
 
                $result = parent::evaluateCondition($string);
                if (is_bool($result)) {
-                       if($result)
+                       if ($result == TRUE)
                                return $result;
                }
 
                $browserInfo = array();
-               $browserInfo = parent::getBrowserInfo(t3lib_div::getIndpEnv('HTTP_USER_AGENT'));        
-               
-               list($key, $value) = t3lib_div::trimExplode('=', $string, FALSE, 2);
-
+               $browserInfo = parent::getBrowserInfo(t3lib_div::getIndpEnv('HTTP_USER_AGENT'));
                if (!array_key_exists('uaprof', $browserInfo)) {
                        return FALSE;
                }
 
+               list($key, $value) = t3lib_div::trimExplode('=', $string, FALSE, 2);
+
                switch ($key) {
                        case 'vendor':
                                $values = t3lib_div::trimExplode(',', $value, TRUE);
@@ -105,7 +111,7 @@ class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
                                        }
                                }
                                break;
-                               
+
                        case 'browser_version':
                                $values = t3lib_div::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
@@ -123,7 +129,7 @@ class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
                                        return TRUE;
                                }
                                break;
-                               
+
                        case 'html_tables':
                                if (intval($browserInfo['html_tables']) == intval($value)) {
                                        return TRUE;
@@ -206,7 +212,7 @@ class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
                                        return TRUE;
                                }
                                break;
-                               
+
                        case 'call_str':
                                $values = t3lib_div::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
@@ -217,13 +223,11 @@ class ux_t3lib_matchCondition_frontend extends t3lib_matchCondition_frontend {
                                break;
                }
                return FALSE;
-       }
-       
-       
-
+       }
 }
 
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/class.ux_t3lib_matchcondition_frontend.php']) {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/class.ux_t3lib_matchcondition_frontend.php']);
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']
+       ['ext/tk_mobiledetector/class.ux_t3lib_matchcondition_frontend.php']) {
+       require_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/class.ux_t3lib_matchcondition_frontend.php']);
 }
 ?>
\ No newline at end of file
index 87e8ac4..e35c78f 100644 (file)
  *
  * This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/ 
-
 require_once(t3lib_extMgm::extPath('tk_mobiledetector') . 'constants.php');
- /**
+/**
  * Utility class for rdf-xml processing.
  *
  * $Id$
@@ -35,139 +33,138 @@ require_once(t3lib_extMgm::extPath('tk_mobiledetector') . 'constants.php');
  * @author     Tomasz Krawczyk <tomasz@typo3.pl>
  */
 class tx_parse_rdf {
-       
+
        private $strData;
        private $strScreen;
        private $strUrl;
        private $arCaps = array();
 
+    /**\r
+     * Class constructor\r
+     *\r
+     * @return void\r
+     */\r
        public function __construct($strLink) {
                $this->strUrl = $strLink;
+               return;
        }
-       
-       
+
        private function strToBool($strVal) {
                $bRes = 0;
                $strTmp = strtoupper($strVal);
-               
-               if ($strTmp == 'YES')
+
+               if ($strTmp == 'YES') {
                        $bRes = 1;
-                       
+               }
+
                return $bRes;
        }
 
-
        public function loadXmlFromUrl() {
                
                $bRes = FALSE;
                
-               if ($this->strUrl == '')
+               if ($this->strUrl == '') {
                        return $bRes;
-               
-               $strXML = t3lib_div::getURL($this->strUrl);             
-               if ($strXML) {
+               }
 
-                       $this->strData = $strXML;
+               $strXml = t3lib_div::getURL($this->strUrl);             
+               if ($strXml) {
+                       $this->strData = $strXml;
                        $bRes = TRUE;
                }
                
                return $bRes;
        }
-       
-       
+
        public function checkXmlStr() {
        
                $bRes = FALSE;
                
-               if ($this->strData == '')
+               if ($this->strData == '') {
                        return $bRes;
+               }
 
                $oXml = @simplexml_load_string($this->strData);
-               if(is_object($oXml)) {
+               if (is_object($oXml)) {
                        $bRes = TRUE;
                }
                
                return $bRes;
        }
 
-
-       private function getXmlValues($strXPath) {
+       private function getXmlValues($strXpath) {
                
                $arrRes = array();
                
-               if ($this->strData == '')
+               if ($this->strData == '') {
                        return $arrRes;
+               }
 
                if (!$this->checkXmlStr($this->strData)) {
-
                        $this->strUrl = '';
                        return $arrRes;
                }
                
                $oXml = @simplexml_load_string($this->strData);
-               if(!is_object($oXml)) {
+               if (!is_object($oXml)) {
                        $this->strUrl = '';
                        return $arrRes;
                }
 
-               $result = $oXml->xpath($strXPath);
+               $result = $oXml->xpath($strXpath);
 
-               while(list( , $node) = each($result)) {
+               while (list (, $node) = each($result)) {
                        $arrRes[] = $node;
                }
 
                return $arrRes;
        }
 
-
        public function getVendor() {           
 
-               $sTmp = '';     
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:Vendor';
-               $a = $this->getXmlValues($strXP);
-               
-               if (!empty($a))
-                       $sTmp =  substr($a[0], 0, DB_VENDOR_LENGTH);
-               
-               $this->arCaps['vendor'] = trim($sTmp);
+               $sTmp = '';             
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:Vendor';
+               $a = $this->getXmlValues($strXp);
+
+               if (!empty($a)) {
+                       $sTmp = trim(substr($a[0], 0, DB_VENDOR_LENGTH));
+               }
+
+               $this->arCaps['vendor'] = $sTmp;
                return $sTmp;
        }
-       
 
        public function getModel() {
-               
-               $sTmp = '';
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:Model';
-               $a = $this->getXmlValues($strXP);
 
-               if (!empty($a))
-                       $sTmp =  substr($a[0], 0, DB_MODEL_LENGTH);
-                       
-               $this->arCaps['model'] = trim($sTmp);
+               $sTmp = '';             
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:Model';
+               $a = $this->getXmlValues($strXp);
+
+               if (!empty($a)) {
+                       $sTmp = trim(substr($a[0], 0, DB_MODEL_LENGTH));
+               }
+
+               $this->arCaps['model'] = $sTmp;
                return $sTmp;
        }
 
-
        public function getScreenWidth() {
 
                $iRes = 0;
-               
                if ($this->strScreen == '') {
-               
-                       $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:ScreenSize';
-                       $a = $this->getXmlValues($strXP);
+                       $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:ScreenSize';
+                       $a = $this->getXmlValues($strXp);
                        
-                       if (empty($a))                  
+                       if (empty($a)) {
                                $this->strScreen = '';
-                       else
-                               $this->strScreen = $a[0];                       
+                       } else {
+                               $this->strScreen = $a[0];
+                       }
                }
-               
+
                if ($this->strScreen != '') {
-               
-                       $arrTmp = t3lib_div::trimExplode('x', $this->strScreen, true);
+                       $arrTmp = t3lib_div::trimExplode('x', $this->strScreen, TRUE);
                        $strTmp = substr($arrTmp[0], 0, DB_SCREEN_WIDTH_LENGTH);                
                        $iRes = intval($strTmp);
                }
@@ -176,32 +173,31 @@ class tx_parse_rdf {
                return $iRes;
        }
 
-
        public function getScreenHeight() {
-               
+
                $iRes = 0;
 
                if ($this->strScreen == '') {
-                       $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:ScreenSize';
-                       $a = $this->getXmlValues($strXP);
+                       $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:ScreenSize';
+                       $a = $this->getXmlValues($strXp);
 
-                       if (empty($a))
+                       if (empty($a)) {
                                $this->strScreen = '';
-                       else    
+                       } else {
                                $this->strScreen = $a[0];
+                       }
                }
-               if ($this->strScreen != '') {
-               
-                       $arrTmp = t3lib_div::trimExplode('x', $this->strScreen, true);
+
+               if ($this->strScreen != '') {           
+                       $arrTmp = t3lib_div::trimExplode('x', $this->strScreen, TRUE);
                        $strTmp = substr($arrTmp[1], 0, DB_SCREEN_HEIGHT_LENGTH);
                        $iRes = intval($strTmp);
                }               
-               
+
                $this->arCaps['screen_height'] = $iRes;         
                return $iRes;
        }
 
-
     /**
      * Extracts browser(s) name(s).
      *
@@ -210,198 +206,179 @@ class tx_parse_rdf {
      */
        public function getBrowserName() {
                
-               $sTmp = '';
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:BrowserName';
-               $a = $this->getXmlValues($strXP);
+               $sTmp = '';             
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:BrowserName';
+               $a = $this->getXmlValues($strXp);
 
                if (!empty($a)) {
-                       $sTmp = '';
-                       while(list( , $node) = each($a)) {
+                       while (list (, $node) = each($a)) {
                                $sTmp .= $node . '|';
                        }
-                       $sTmp = substr($sTmp, 0, DB_BROWSER_NAME_LENGTH);
+                       $sTmp = trim(substr($sTmp, 0, DB_BROWSER_NAME_LENGTH));
                }
 
-               $this->arCaps['browser_name'] = trim($sTmp);
+               $this->arCaps['browser_name'] = $sTmp;
                return $sTmp;
        }
 
-
        public function getBrowserVersion() {
                
-               $sTmp = '';
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:BrowserVersion';
-               $a = $this->getXmlValues($strXP);
+               $sTmp = '';             
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:BrowserVersion';
+               $a = $this->getXmlValues($strXp);
 
                if (!empty($a)) {
-                       while(list( , $node) = each($a)) {
-                               $sTmp .= $node . '|';
+                       while ( list(, $node) = each($a)) {
+                               $sTmp .= trim($node) . '|';
                        }
                        $sTmp = substr($sTmp, 0, DB_BROWSER_VERSION_LENGTH);
                }
 
-               $this->arCaps['browser_version'] = trim($sTmp);
+               $this->arCaps['browser_version'] = $sTmp;
                return $sTmp;
        }
 
-       
        public function getFrames() {
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:FramesCapable';
-               $a = $this->getXmlValues($strXP);
-               
-               if (empty($a))
-                       $intTmp = 0;
-               else
+
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:FramesCapable';
+               $a = $this->getXmlValues($strXp);
+
+               $intTmp = 0;
+               if (!empty($a)) {
                        $intTmp = $this->strToBool(substr($a[0], 0, DB_FRAMES_LENGTH));
-               
+               }
+
                $this->arCaps['frames'] = $intTmp;      
                return $intTmp;
        }
-       
 
        public function getTables() {
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:TablesCapable';
-               $a = $this->getXmlValues($strXP);
-               
-               if (empty($a))
-                       $intTmp = 0;
-               else
+
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:TablesCapable';
+               $a = $this->getXmlValues($strXp);
+
+               $intTmp = 0;
+               if (!empty($a)) {
                        $intTmp = $this->strToBool(substr($a[0], 0, DB_TABLES_LENGTH));
-               
-               $this->arCaps['html_tables'] = $intTmp; 
+               }
+
+               $this->arCaps['html_tables'] = $intTmp;
                return $intTmp;
        }
-       
 
        public function getJava() {
+
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:JavaEnabled';
+               $a = $this->getXmlValues($strXp);
                
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:JavaEnabled';
-               $a = $this->getXmlValues($strXP);
-               
-               if (empty($a))
-                       $intTmp = 0;
-               else
+               $intTmp = 0;
+               if (!empty($a)) {
                        $intTmp = $this->strToBool(substr($a[0], 0, DB_JAVA_LENGTH));
-               
+               }
+
                $this->arCaps['java'] = $intTmp;        
                return $intTmp;
        }
 
-       
        public function getJavaScript() {
                
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:JavaScriptEnabled';
-               $a = $this->getXmlValues($strXP);
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:JavaScriptEnabled';
+               $a = $this->getXmlValues($strXp);
                
-               if (empty($a))
-                       $intTmp = 0;
-               else
+               $intTmp = 0;
+               if (!empty($a)) {
                        $intTmp = $this->strToBool(substr($a[0], 0, DB_JAVASCRIPT_LENGTH));
-               
+               }
+
                $this->arCaps['javascript'] = $intTmp;  
                return $intTmp;
        }
        
-               
        public function getHtmlVersion() {
-               
+
                $sTmp = '';
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:HtmlVersion';
+               $a = $this->getXmlValues($strXp);
 
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:HtmlVersion';
-               $a = $this->getXmlValues($strXP);
-               
                if (!empty($a)) {
-                       $sTmp =  substr($a[0], 0, DB_HTML_VERSION_LENGTH);
+                       $sTmp = trim(substr($a[0], 0, DB_HTML_VERSION_LENGTH));
                }
-               
-               $this->arCaps['html_version'] = trim($sTmp);
+
+               $this->arCaps['html_version'] = $sTmp;
                return $sTmp;
        }
 
-
        public function getXhtmlVersion() {
                
                $sTmp = '';
-
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:XhtmlVersion';
-               $a = $this->getXmlValues($strXP);
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:XhtmlVersion';
+               $a = $this->getXmlValues($strXp);
                
                if (empty($a)) {
-                       $sTmp =  substr($a[0], 0, DB_XHTML_VERSION_LENGTH);
+                       $sTmp = trim(substr($a[0], 0, DB_XHTML_VERSION_LENGTH));
                }
                        
-               $this->arCaps['xhtml_version'] = trim($sTmp);
+               $this->arCaps['xhtml_version'] = $sTmp;
                return $sTmp;
        }
 
+       public function getOsName() {
 
-       public function getOSName() {
-               
                $sTmp = '';
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSName';
+               $a = $this->getXmlValues($strXp);
 
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSName';
-               $a = $this->getXmlValues($strXP);
-               
                if (!empty($a)) {
-                       $sTmp =  substr($a[0], 0, DB_OS_NAME_LENGTH);
+                       $sTmp = trim(substr($a[0], 0, DB_OS_NAME_LENGTH));
                }
-                       
-               $this->arCaps['os'] = trim($sTmp);
+
+               $this->arCaps['os'] = $sTmp;
                return $sTmp;
        }
 
+       public function getOsVersion() {
 
-       public function getOSVersion() {
-               
                $sTmp = '';
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSVersion';
-               $a = $this->getXmlValues($strXP);
-               
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSVersion';
+               $a = $this->getXmlValues($strXp);
+
                if (!empty($a)) {
-                       $sTmp =  substr($a[0], 0, DB_OS_VERSION_LENGTH);
+                       $sTmp = trim(substr($a[0], 0, DB_OS_VERSION_LENGTH));
                }                       
-       
-               $this->arCaps['os_version'] = trim($sTmp);
+
+               $this->arCaps['os_version'] = $sTmp;
                return $sTmp;
        }
-       
-       
-       public function getOSVendor() {
-               
+
+       public function getOsVendor() {
+
                $sTmp = '';
-               
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSVendor';
-               $a = $this->getXmlValues($strXP);
-               
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:OSVendor';
+               $a = $this->getXmlValues($strXp);
+
                if (!empty($a)) {
-                       $sTmp = substr($a[0], 0, DB_OS_VENDOR_LENGTH);
+                       $sTmp = trim(substr($a[0], 0, DB_OS_VENDOR_LENGTH));
                }
-               
-               $this->arCaps['os_vendor'] = trim($sTmp);
+
+               $this->arCaps['os_vendor'] = $sTmp;
                return $sTmp;
        }
 
-
        public function getGIF() {
-               
+
                $iRes = 0;
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
-               $a = $this->getXmlValues($strXP);
-               
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
+               $a = $this->getXmlValues($strXp);
+
                if (!empty($a)) {
 
                        $sTmp = '';
-                       while(list( , $node) = each($a)) {
+                       while (list (, $node) = each($a)) {
                                $sTmp .= $node . '|';
                        }
-                       $a = t3lib_div::trimExplode('|', $sTmp, true);
+                       $a = t3lib_div::trimExplode('|', $sTmp, TRUE);
                        
-                       if (in_array('image/gif', $a, true)) {
+                       if (in_array('image/gif', $a, TRUE)) {
                                $iRes = 1;
                        }
                }
@@ -410,54 +387,51 @@ class tx_parse_rdf {
                return $iRes;
        }
 
-
        public function getJPG() {
                
                $iRes = 0;
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
-               $a = $this->getXmlValues($strXP);
-               
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
+               $a = $this->getXmlValues($strXp);
+
                if (!empty($a)) {
                        $sTmp = '';
-                       while(list( , $node) = each($a)) {
+                       while (list (, $node) = each($a)) {
                                $sTmp .= $node . '|';
                        }
-                       $a = t3lib_div::trimExplode('|', $sTmp, true);
+                       $a = t3lib_div::trimExplode('|', $sTmp, TRUE);
 
-                       if (in_array('image/jpg', $a, true) || in_array('image/jpeg', $a, true)) {
+                       if (in_array('image/jpg', $a, TRUE) || in_array('image/jpeg', $a, TRUE)) {
                                $iRes = 1;
                        }
                }
-               
+
                $this->arCaps['jpg'] = $iRes;           
                return $iRes;
        }
 
-
        public function getPNG() {
-               
+
                $iRes = 0;
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
-               $a = $this->getXmlValues($strXP);
-               
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:CcppAccept/rdf:Bag/rdf:li';
+               $a = $this->getXmlValues($strXp);
+
                if (!empty($a)) {
-               
+
                        $sTmp = '';
-                       while(list( , $node) = each($a)) {
+                       while ( list(, $node) = each($a)) {
                                $sTmp .= $node . '|';
                        }
-                       $a = t3lib_div::trimExplode('|', $sTmp, true);
+                       $a = t3lib_div::trimExplode('|', $sTmp, TRUE);
 
-                       if (in_array('image/png', $a, true)) {
+                       if (in_array('image/png', $a, TRUE)) {
                                $iRes = 1;
                        }
                }
-               
+
                $this->arCaps['png'] = $iRes;           
                return $iRes;
        }
 
-
     /**
      * Get mobile possibility to make phone calls directly from the web page.
      * 
@@ -466,18 +440,18 @@ class tx_parse_rdf {
        public function getCallStr() {
                
                $sRes = 'tel:';
-               $strXP = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:WtaiLibraries/rdf:Bag/rdf:li';
-               $a = $this->getXmlValues($strXP);
+               $strXp = '/rdf:RDF/rdf:Description/prf:component/rdf:Description/prf:WtaiLibraries/rdf:Bag/rdf:li';
+               $a = $this->getXmlValues($strXp);
 
                if (!empty($a)) {
 
                        $sTmp = '';
-                       while(list( , $node) = each($a)) {
+                       while ( list(, $node) = each($a)) {
                                $sTmp .= $node . '|';
                        }
-                       $a = t3lib_div::trimExplode('|', $sTmp, true);
+                       $a = t3lib_div::trimExplode('|', $sTmp, TRUE);
 
-                       if (in_array('WTA.Public.makeCall', $a, true)) {
+                       if (in_array('WTA.Public.makeCall', $a, TRUE)) {
                                $sRes = 'wtai://wp/mc;';
                        }
                }
@@ -486,18 +460,17 @@ class tx_parse_rdf {
                return $sRes;
        }
        
-
        private function fixByBrowserName() {
-       
+
                if ($this->arCaps['browser_name'] != '') {
-                       
+
                        $arBrowsers = array();
-                       $arTmpBrowsers = t3lib_div::trimExplode('|', $this->arCaps['browser_name'], true);
-                       
-                       foreach($arTmpBrowsers as $browser) {
-                       
+                       $arTmpBrowsers = t3lib_div::trimExplode('|', $this->arCaps['browser_name'], TRUE);
+
+                       foreach ($arTmpBrowsers as $browser) {
+
                                if (strstr($browser, 'Internet Explorer') !== FALSE) {
-                               
+
                                        $this->arCaps['os'] = 'Windows Mobile OS';
                                        $this->arCaps['os_vendor'] = 'Microsoft';
                                        $browser = 'Microsoft Mobile Explorer';
@@ -505,10 +478,10 @@ class tx_parse_rdf {
                                $arBrowsers[] = $browser;
                        }
                        $this->arCaps['browser_name'] = implode('|', $arBrowsers);
-               } 
+               }
+               return;
        }
 
-
     /**
      * Windows Mobile 6 and newer supports both strings 'tel:' and 'wtai://wp/mc;'
         * http://msdn.microsoft.com/en-us/library/dd938878.aspx
@@ -518,29 +491,31 @@ class tx_parse_rdf {
         *
      * @return void
      */
-       private function fixCallStrByOS() {
-               
+       private function fixCallStrByOs() {
+
                if (($this->arCaps['os'] == 'Windows Mobile OS') || 
-                       ($this->arCaps['os'] == 'webOS') ||
-                       ($this->arCaps['os'] == 'iPhone OS') ) {
-                       
+                       ($this->arCaps['os'] == 'webOS') || 
+                       ($this->arCaps['os'] == 'iPhone OS')) {
+
                        $this->arCaps['call_str'] = 'tel:';
                }
-               
+
                if ($this->arCaps['os'] == 'Android') {
-               
+
                        $this->arCaps['call_str'] = 'wtai://wp/mc;';
                }
+               return;
        }
 
        
        public function getCapabilities() {
 
                $arrCaps = array();
-               
-               if ($this->strUrl == '')
+
+               if ($this->strUrl == '') {
                        return $arrCaps;
-                               
+               }
+
                $this->getVendor();             
                $this->getModel();
                $this->getScreenWidth();
@@ -553,26 +528,25 @@ class tx_parse_rdf {
                $this->getJavaScript();
                $this->getHtmlVersion();
                $this->getXhtmlVersion();
-               $this->getOSName();
-               $this->getOSVersion();
-               $this->getOSVendor();
+               $this->getOsName();
+               $this->getOsVersion();
+               $this->getOsVendor();
                $this->getGIF();
                $this->getJPG();
                $this->getPNG();
                $this->getCallStr();
-               
+
                $this->fixByBrowserName();
-               $this->fixCallStrByOS();
+               $this->fixCallStrByOs();
 
                $this->arCaps['uaprof'] = $this->strUrl;
 
                return $this->arCaps;
-       }
-       
+       }       
 }
-
  
- if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php']);
+ if (defined('TYPO3_MODE') && 
+       isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php'])) {
+       require_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/lib/class.parse_rdf.php']);
 }
-?>
+?>
\ No newline at end of file
index c7e3b6b..8630c9c 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
        // DO NOT REMOVE OR CHANGE THESE 2 LINES:
 $MCONF['name'] = 'tools_txtkmobiledetectorM2';
 $MCONF['script'] = '_DISPATCH';
index 7f16700..434fbc4 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-
-
 $GLOBALS['LANG']->includeLLFile('EXT:tk_mobiledetector/Language/Backend/mod2/locallang.xml');
-//require_once(PATH_t3lib . 'class.t3lib_scbase.php');
 $GLOBALS['BE_USER']->modAccess($MCONF, 1);     // This checks permissions and exits if the users has no permission for entry.
-       // DEFAULT initialization of a module [END]
-
 
 require_once(t3lib_extMgm::extPath('tk_mobiledetector') . 'hook/class.tx_device_info.php');
 
@@ -39,12 +34,11 @@ require_once(t3lib_extMgm::extPath('tk_mobiledetector') . 'hook/class.tx_device_
  * @subpackage tx_tkmobiledetector
  */
 class tx_tkmobiledetector_module2 extends t3lib_SCbase {
-       
+
        protected $pageinfo;
        protected $extKey = 'tk_mobiledetector';
-       protected $extConf = array(); // Extension configuration 
+       protected $extConf = array(); // Extension configuration
        protected $tableName = 'tx_tkmobiledetector_devices';
-       
 
        /**
         * Initializes the module.
@@ -52,6 +46,7 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
         * @return void
         */
        public function init() {
+
                parent::init();
 
                        // Get extension configuration
@@ -64,6 +59,7 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
         * @return      void
         */
        public function menuConfig() {
+
                $this->MOD_MENU = array(
                        'function' => array(
                                'func_menu'  => $GLOBALS['LANG']->getLL('func_menu'),
@@ -77,16 +73,19 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
 
        /**
         * Main function of the module. Write the content to $this->content
-        * If you chose "web" as main module, you will need to consider the $this->id parameter which will contain the uid-number of the page clicked in the page tree
+        * If you chose "web" as main module, you will need to consider the 
+        * $this->id parameter which will contain the uid-number of the page
+        * clicked in the page tree.
         *
         * @return void
         */
        public function main() {
                        // Access check!
-                       // The page will show only if there is a valid page and if this page may be viewed by the user
+                       // The page will show only if there is a valid page and if this
+                       // page may be viewed by the user.
                $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
                $access = is_array($this->pageinfo) ? 1 : 0;
-       
+
                        // Initialize doc
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->setModuleTemplate(t3lib_extMgm::extPath('tk_mobiledetector') . 'mod2/mod_template.html');
@@ -94,36 +93,31 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                $this->doc->docType = 'xhtml_trans';
 
                if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) {
-                       
                                // Draw the form
                        $this->doc->form = '<form action="" method="post" enctype="multipart/form-data">';
-
                                // JavaScript
-                       $this->doc->JScode = '
-                               <script language="javascript" type="text/javascript">
+                       $this->doc->JScode = '<script language="javascript" type="text/javascript">
                                        script_ended = 0;
                                        function jumpToUrl(URL) {
                                                document.location = URL;
                                        }
-                               </script>
-                       ';
-                       $this->doc->postCode='
-                               <script language="javascript" type="text/javascript">
+                               </script>';
+
+                       $this->doc->postCode='<script language="javascript" type="text/javascript">
                                        script_ended = 1;
                                        if (top.fsMod) top.fsMod.recentIds["web"] = 0;
-                               </script>
-                       ';
-                       
+                               </script>';
+
                        $docHeaderButtons = $this->getButtons();
-                       
                                // Render content:
                        $strBody = $this->moduleContent();                      
-
                                // Compile document
                        $markers = array();
-                       $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
+                       $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu(0, 'SET[function]', 
+                               $this->MOD_SETTINGS['function'], 
+                               $this->MOD_MENU['function']);
                        $markers['CONTENT'] = $strBody;
-                       
+
                                // Build the <body> for the module
                        $this->content = $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
                        $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
@@ -138,6 +132,7 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
         * @return void
         */
        public function printContent() {
+
                //$this->content .= $this->doc->endPage();
                echo $this->content;
        }
@@ -145,9 +140,10 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
        /**
         * Generates the module content.
         *
-        * @return void
+        * @return string
         */
        protected function moduleContent() {
+
                switch ((string)$this->MOD_SETTINGS['function']) {
                        case 'func_menu':
                                $strCnt = $this->functionMenu();
@@ -165,18 +161,21 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                                $strCnt = $this->functionExchangeDevices();
                                $content .= $this->doc->section($GLOBALS['LANG']->getLL('function1'), $strCnt, 0, 1);
                                break;
+                       default:
+                               $content = '';
+                               break;
                }
-               
                return $content;
        }
-       
 
        /**
-        * Creates the panel of buttons for submitting the form or otherwise perform operations.
+        * Creates the panel of buttons for submitting the form or otherwise
+        * perform operations.
         *
         * @return array All available buttons as an assoc.
         */
-       protected function getButtons() {
+       protected function getButtons() {
+
                $buttons = array(
                        'csh' => '',
                        'shortcut' => '',
@@ -195,39 +194,34 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
 
 
        protected function functionMenu() {
-               
+
                $availableModFuncs = array('func_stats', 'func_check', 'func_exch');
-               
                $moduleTitle = $GLOBALS['LANG']->getLL('func_menu_description');
+
                $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE); 
-               
                $content .= '<dl class="t3-overview-list">';
-               
-               foreach($availableModFuncs as $modFunc) {
+
+               foreach ($availableModFuncs as $modFunc) {
                        $link        = 'mod.php?id=0&amp;M=tools_txtkmobiledetectorM2&amp;SET[function]=' . $modFunc;
                        $title       = $GLOBALS['LANG']->getLL($modFunc);
                        $description = $GLOBALS['LANG']->getLL($modFunc . '_description');
 
-                       $icon = '<img src="' . 
-                               t3lib_extMgm::extRelPath($this->extKey) . 'ext_icon.gif' .
-                               '" width="18" height="16" title="' . $title . '" alt="' . $title . '" />';
+                       $icon = '<img src="' . t3lib_extMgm::extRelPath($this->extKey) . 'ext_icon.gif" width="18" height="16" title="' . 
+                               $title . '" alt="' . $title . '" />';
 
-                       $content .= '
-                               <dt><a href="' . $link . '">' . $icon . $title . '</a></dt>
-                               <dd>' . $description . '</dd>
-                       ';
+                       $content .= '<dt><a href="' . $link . '">' . $icon . $title . '</a></dt><dd>' . $description . '</dd>';
                }
                $content .= '</dl>';
-               
+
                return $content;
        }
 
 
        protected function functionDeviceStatistics() {
-       
+
                $moduleTitle = $GLOBALS['LANG']->getLL('func_stats');
-               $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE); 
-       
+               $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE);
+
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                        'ast, Count( uid )',
                        $this->tableName,
@@ -236,11 +230,10 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                        'ast',
                        '0,3'
                );
-               
+
                if ($res) {
-               
                        $content .= '<table width="400" cellspacing="0" cellpadding="10" border="0" class="typo3-dblist">';
-                       
+
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res)) {
 
                                $content .= '<tr>';
@@ -255,6 +248,9 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                                        case 2:
                                                $content .= $GLOBALS['LANG']->getLL('stat2');
                                                break;
+                                       default:
+                                               $content .= '&nbsp;';
+                                               break;
                                }
                                $content .= '</strong></td>';
                                $content .= '<td>' . $row[1] . '</td>';
@@ -264,11 +260,10 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                        
                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
-               
+
                return $content;
        }
 
-
        private function buildInputForm() {
 
                $content = '<fieldset>';                
@@ -287,21 +282,21 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                return $content;
        }
 
-
        private function buildDeviceCapsTable($arrData, $isNew = 0) {
-               
-               if ($isNew == 1)
+
+               if ($isNew == 1) {
                        $moduleTitle = $GLOBALS['LANG']->getLL('new_device_added');
-               else
+               } else {
                        $moduleTitle = $GLOBALS['LANG']->getLL('known_device');
+               }
 
                $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE); 
                
                if (!empty($arrData)) {
 
                        $content .= '<table width="700" border="0" cellpadding="5" cellspacing="0" class="typo3-dblist">';
-                       
-                       foreach($arrData as $key => $value) {
+
+                       foreach ($arrData as $key => $value) {
                                $content .= '<tr>';
                                $content .= '<td><strong>' . $key . '</strong></td>';
                                $content .= '<td>' . $value . '</td>';
@@ -309,27 +304,26 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                        }
                        $content .= '</table>';
                }
-               
+
                return $content;
        }
-       
-       
+
        protected function functionCheckAndAddDeviceCaps() {
-               
+
                $moduleTitle = $GLOBALS['LANG']->getLL('func_check');
                $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE);            
                $content .= $this->buildInputForm();
-               
+
                $strUrl = t3lib_div::_POST('furl');
 
-               if($strUrl != '') {
+               if ($strUrl != '') {
 
                        $pObj = new tx_device_info();
                        $pObj->disableBrowserHeaders();
                        $strUrl = $pObj->checkSetLink($strUrl);
-                       
+
                        if ($strUrl != '') {
-                       
+
                                if ($pObj->loadProfileFromDB()) {
 
                                        $arrCaps = $pObj->getDeviceData();
@@ -341,9 +335,8 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                                        $arrCaps = array();
                                        $iEx = $pObj->getExternalData($arrCaps);
                                        if ($iEx == 0) {
-                                               
+
                                                $savRes = $pObj->saveProfileToDB($arrCaps);
-                                               
                                                switch($savRes) {
                                                        case 0:
                                                                $content .= $this->buildDeviceCapsTable($arrCaps, 1);
@@ -362,49 +355,45 @@ class tx_tkmobiledetector_module2 extends t3lib_SCbase {
                                                                break;
                                                }
                                        } else {
-                                               
+
                                                switch($iEx) {
                                                        case 1:
                                                                $sMsg = sprintf($GLOBALS['LANG']->getLL('download_device_caps_error'), $strUrl, $strUrl);
                                                                $content .= $sMsg;
                                                                break;
-                                                               
+
                                                        case 2:
                                                                $content .= $GLOBALS['LANG']->getLL('xml_syntax_error');
                                                                break;
-                                               }
-                                       
+
+                                                       default:
+                                                               $content .= '';
+                                                               break;
+                                               }                                       
                                        }
                                }
                        } else {
                                $content .= $GLOBALS['LANG']->getLL('incorrect_url');
                        }
                }
-               
+
                return $content;
        }
-       
-       
+
        protected function functionExchangeDevices() {
 
                $moduleTitle = $GLOBALS['LANG']->getLL('func_exch');
                $content = $this->doc->section($moduleTitle, $content, FALSE, TRUE); 
-       
                $content .= $GLOBALS['LANG']->getLL('not_finished');
-               
+
                return $content;
        }
 }
 
-
-
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/mod2/index.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/mod2/index.php']);
+       require_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/mod2/index.php']);
 }
 
-
-
-
        // Make instance:
 /** @var $SOBE tx_tkmobiledetector_module2 */
 $SOBE = t3lib_div::makeInstance('tx_tkmobiledetector_module2');
@@ -412,7 +401,7 @@ $SOBE->init();
 
        // Include files?
 foreach ($SOBE->include_once as $INC_FILE) {
-       include_once($INC_FILE);
+       require_once($INC_FILE);
 }
 
 $SOBE->main();
index 25d82a8..f636a4f 100644 (file)
@@ -290,6 +290,6 @@ class tx_tkmobiledetector_pi1 extends tslib_pibase {
 }
  
 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1.php']);
+       require_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1.php']);
 } 
-?>
+?>
\ No newline at end of file
index f7a6092..d4b77f2 100644 (file)
@@ -42,14 +42,13 @@ class tx_tkmobiledetector_pi1_wizicon {
         * @param       array           $wizardItems: The wizard items
         * @return      Modified array with wizard items
         */
-       public function proc($wizardItems)      {
-
-               $LL = $this->includeLocalLang();
+       public function proc($wizardItems) {
+               $ll = $this->includeLocalLang();
 
                $wizardItems['plugins_tx_tkmobiledetector_pi1'] = array(
                        'icon' => t3lib_extMgm::extRelPath('tk_mobiledetector') . 'pi1/ce_wiz.gif',
-                       'title' => $GLOBALS['LANG']->getLLL('pi1_title', $LL),
-                       'description' => $GLOBALS['LANG']->getLLL('pi1_plus_wiz_description', $LL),
+                       'title' => $GLOBALS['LANG']->getLLL('pi1_title', $ll),
+                       'description' => $GLOBALS['LANG']->getLLL('pi1_plus_wiz_description', $ll),
                        'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=tk_mobiledetector_pi1'
                );
 
@@ -58,12 +57,12 @@ class tx_tkmobiledetector_pi1_wizicon {
 
 
        /**
-        * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file.
+        * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found
+        * in that file.
         *
         * @return      The array with language labels
         */
-       protected function includeLocalLang()   {
-
+       protected function includeLocalLang() {
                $llFile = t3lib_extMgm::extPath('tk_mobiledetector') . 'Language/Backend/locallang.xml';
                $version = class_exists('t3lib_utility_VersionNumber')
                                ? t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version)
@@ -81,8 +80,8 @@ class tx_tkmobiledetector_pi1_wizicon {
        }
 }
 
-
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1_wizicon.php'])    {
-       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1_wizicon.php']);
+if (defined('TYPO3_MODE') && 
+       $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1_wizicon.php'])  {
+       require_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tk_mobiledetector/pi1/class.tx_tkmobiledetector_pi1_wizicon.php']);
 }
 ?>
\ No newline at end of file