[TASK] Clean up phpDoc comments in typo3/sysext/
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 22 Jun 2012 22:19:14 +0000 (00:19 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 23 Jun 2012 09:08:26 +0000 (11:08 +0200)
Clean up provides:

* Provide correct parameter names in phpDoc
* Provide correct data types in phpDoc
* CGLify phpDoc (remove tabs)

Change-Id: I86ee97b8d1827efca265daa62b488b64c657c095
Resolves: #38322
Releases: 6.0
Reviewed-on: http://review.typo3.org/12304
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
17 files changed:
typo3/sysext/tstemplate/ext_tables.php
typo3/sysext/tstemplate/ts/conf.php
typo3/sysext/tstemplate/ts/index.php
typo3/sysext/tstemplate_analyzer/class.tx_tstemplateanalyzer.php
typo3/sysext/tstemplate_analyzer/ext_tables.php
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
typo3/sysext/tstemplate_ceditor/ext_tables.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/tstemplate_info/ext_tables.php
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php
typo3/sysext/tstemplate_objbrowser/ext_tables.php
typo3/sysext/viewpage/Classes/Controller/ViewController.php
typo3/sysext/viewpage/ext_tables.php
typo3/sysext/wizard_crpages/class.tx_wizardcrpages_webfunc_2.php
typo3/sysext/wizard_crpages/ext_tables.php
typo3/sysext/wizard_sortpages/class.tx_wizardsortpages_webfunc_2.php
typo3/sysext/wizard_sortpages/ext_tables.php

index 1d8c247..8c7d75b 100644 (file)
@@ -1,5 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE')  t3lib_extMgm::addModule('web', 'ts', '', t3lib_extMgm::extPath($_EXTKEY).'ts/');
+if (TYPO3_MODE == 'BE') {
+       t3lib_extMgm::addModule('web', 'ts', '', t3lib_extMgm::extPath($_EXTKEY).'ts/');
+}
 ?>
\ No newline at end of file
index 75c0c7c..90a3173 100644 (file)
@@ -8,6 +8,4 @@ $MCONF['name'] = 'web_ts';
 $MLANG['default']['tabs_images']['tab'] = 'ts1.gif';
 $MLANG['default']['ll_ref'] = 'LLL:EXT:tstemplate/ts/locallang_mod.xml';
 
-
-
 ?>
\ No newline at end of file
index b5b6ed4..bf7b6ae 100644 (file)
  *     $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"]  = Directory of default resources. Eg. "fileadmin/res/" or so.
  *
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate/ts/locallang.xml');
 $BE_USER->modAccess($MCONF, TRUE);
 
-
-// ***************************
-// Script Classes
-// ***************************
+       // Script Classes
 class SC_mod_web_ts_index extends t3lib_SCbase {
        var $perms_clause;
        var $e;
@@ -52,6 +49,11 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
        var $modMenu_dontValidateList = '';
        var $modMenu_setDefaultList = '';
 
+       /**
+        * Init
+        *
+        * @return void
+        */
        function init() {
 
                parent::init();
@@ -68,16 +70,26 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                }
        }
 
+       /**
+        * Clear cache
+        *
+        * @return void
+        */
        function clearCache() {
                if (t3lib_div::_GP('clear_all_cache')) {
                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                       /* @var $tce t3lib_TCEmain */
+                       /** @var $tce t3lib_TCEmain */
                        $tce->stripslashes_values = 0;
                        $tce->start(array(), array());
                        $tce->clear_cacheCmd('all');
                }
        }
 
+       /**
+        * Main
+        *
+        * @return void
+        */
        function main() {
 
                        // Template markers
@@ -87,8 +99,8 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                        'CONTENT' => ''
                );
 
-               // Access check...
-               // The page will show only if there is a valid page and if this page may be viewed by the user
+                       // Access check...
+                       // 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);
                $this->access = is_array($this->pageinfo) ? 1 : 0;
 
@@ -160,7 +172,6 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                        $markers['CONTENT'] = $this->content;
                } else {
                                // If no access or if ID == zero
-
                        $this->doc->inDocStylesArray[] = '
                                TABLE#ts-overview tr.t3-row-header { background-color: #A2AAB8; }
                                TABLE#ts-overview tr td {padding: 2px;}
@@ -205,9 +216,7 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                        ' . $GLOBALS['LANG']->getLL('overview') . '
                        <br /><br />' . $table);
 
-                       // ********************************************
-                       // RENDER LIST of pages with templates, END
-                       // ********************************************
+                               // RENDER LIST of pages with templates, END
 
                                // Setting up the buttons and markers for docheader
                        $docHeaderButtons = $this->getButtons();
@@ -223,6 +232,11 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                );
        }
 
+       /**
+        * Print content
+        *
+        * @return void
+        */
        function printContent() {
                echo $this->content;
        }
@@ -230,7 +244,7 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
        /**
         * Create the panel of buttons for submitting the form or otherwise perform operations.
         *
-        * @return      array   all available buttons as an assoc. array
+        * @return array All available buttons as an assoc. array
         */
        protected function getButtons() {
 
@@ -330,10 +344,15 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                return $buttons;
        }
 
-       // ***************************
        // OTHER FUNCTIONS:
-       // ***************************
 
+       /**
+        * Wrap title for link in template
+        *
+        * @param string $title
+        * @param string $onlyKey
+        * @return string
+        */
        function linkWrapTemplateTitle($title, $onlyKey = '') {
                $urlParameters = array(
                                'id' => $this->id,
@@ -347,11 +366,18 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                return $title;
        }
 
+       /**
+        * No template
+        *
+        * @param integer $newStandardTemplate
+        * @return string
+        */
        function noTemplate($newStandardTemplate = 0) {
-
-               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
-               /* @var $tmpl t3lib_tsparser_ext */
-               $tmpl->tt_track = FALSE;        // Do not log time-performance information
+                       // Defined global here!
+               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
+               /** @var $tmpl t3lib_tsparser_ext */
+                       // Do not log time-performance information
+               $tmpl->tt_track = FALSE;
                $tmpl->init();
                $theOutput = '';
                $flashMessage = t3lib_div::makeInstance(
@@ -365,7 +391,8 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
 
                        // New standard?
                if ($newStandardTemplate) {
-                       if (t3lib_extMgm::isLoaded('statictemplates')) { // check wether statictemplates are supported
+                               // check wether statictemplates are supported
+                       if (t3lib_extMgm::isLoaded('statictemplates')) {
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');
                                $opt = '';
                                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
@@ -406,9 +433,11 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
        }
 
        function templateMenu() {
-               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
-               /* @var $tmpl t3lib_tsparser_ext */
-               $tmpl->tt_track = FALSE;        // Do not log time-performance information
+                       // Defined global here!
+               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
+               /** @var $tmpl t3lib_tsparser_ext */
+                       // Do not log time-performance information
+               $tmpl->tt_track = FALSE;
                $tmpl->init();
                $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
                $menu = '';
@@ -426,10 +455,17 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                return $menu;
        }
 
+       /**
+        * Create template
+        *
+        * @param integer $id
+        * @param integer $actTemplateId
+        * @return string
+        */
        function createTemplate($id, $actTemplateId = 0) {
                if (t3lib_div::_GP('createExtension') || t3lib_div::_GP('createExtension_x')) {
                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                       /* @var $tce t3lib_TCEmain */
+                       /** @var $tce t3lib_TCEmain */
                        $tce->stripslashes_values = 0;
                        $recData = array();
                        $recData['sys_template']['NEW'] = array(
@@ -442,7 +478,7 @@ class SC_mod_web_ts_index extends t3lib_SCbase {
                        return $tce->substNEWwithIDs['NEW'];
                } elseif (t3lib_div::_GP('newWebsite')) {
                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                       /* @var $tce t3lib_TCEmain */
+                       /** @var $tce t3lib_TCEmain */
                        $tce->stripslashes_values = 0;
                        $recData = array();
 
@@ -477,9 +513,16 @@ page.10.value = HELLO WORLD!
                }
        }
 
-       // ********************************************
        // RENDER LIST of pages with templates, BEGIN
-       // ********************************************
+
+       /**
+        * Set page in array
+        *
+        * @param array $pArray
+        * @param array $rlArr
+        * @param array $row
+        * @return void
+        */
        function setInPageArray(&$pArray, $rlArr, $row) {
                ksort($rlArr);
                reset($rlArr);
@@ -500,6 +543,14 @@ page.10.value = HELLO WORLD!
                }
        }
 
+       /**
+        * Render the list
+        *
+        * @param array $pArray
+        * @param array $lines
+        * @param integer $c
+        * @return array
+        */
        function renderList($pArray, $lines = array(), $c = 0) {
                if (is_array($pArray)) {
                        reset($pArray);
@@ -536,7 +587,7 @@ page.10.value = HELLO WORLD!
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_mod_web_ts_index');
 /* @var $SOBE SC_mod_web_ts_index */
 $SOBE->init();
@@ -545,10 +596,11 @@ $SOBE->init();
 foreach($SOBE->include_once as $INC_FILE) {
        include_once($INC_FILE);
 }
-$SOBE->checkExtObj();  // Checking for first level external objects
+       // Checking for first level external objects
+$SOBE->checkExtObj();
 
 $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
 
-?>
+?>
\ No newline at end of file
index c58031e..7763bb9 100644 (file)
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 /**
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_analyzer/locallang.xml');
 
 class tx_tstemplateanalyzer extends t3lib_extobjbase {
+       /**
+        * Init
+        *
+        * @param object $pObj
+        * @param array $conf
+        * @return void
+        */
        function init(&$pObj, $conf) {
                parent::init($pObj, $conf);
 
                $this->pObj->modMenu_setDefaultList.= ',ts_analyzer_checkLinenum,ts_analyzer_checkSyntax';
        }
 
+       /**
+        * Mod menu
+        *
+        * @return array
+        */
        function modMenu() {
                return array (
                        'ts_analyzer_checkSetup' => '1',
@@ -48,6 +60,13 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                );
        }
 
+       /**
+        * Initialize editor
+        *
+        * @param integer $pageId
+        * @param integer $template_uid
+        * @return integer
+        */
        function initialize_editor($pageId, $template_uid=0) {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
 
@@ -70,23 +89,22 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                }
        }
 
+       /**
+        * Main
+        *
+        * @return string
+        */
        function main() {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
 
-               // **************************
-               // Checking for more than one template an if, set a menu...
-               // **************************
+                       // Checking for more than one template an if, set a menu...
                $manyTemplatesMenu = $this->pObj->templateMenu();
                $template_uid = 0;
                if ($manyTemplatesMenu) {
                        $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
                }
 
-               // **************************
-               // Main
-               // **************************
-
-               // BUGBUG: Should we check if the uset may at all read and write template-records???
+                       // BUGBUG: Should we check if the uset may at all read and write template-records???
                $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);              // initialize
                if ($existTemplate) {
                        $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('currentTemplate', TRUE),
@@ -107,14 +125,14 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
 
                $hierarArr = array();
                $head = '<tr class="t3-row-header">';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('title', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('rootlevel', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('clearSetup', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('clearConstants', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('pid', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('rootline', TRUE) . '</td>';
-               $head.= '<td>' . $GLOBALS['LANG']->getLL('nextLevel', TRUE) . '</td>';
-               $head.= '</tr>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('title', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('rootlevel', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('clearSetup', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('clearConstants', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('pid', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('rootline', TRUE) . '</td>';
+               $head .= '<td>' . $GLOBALS['LANG']->getLL('nextLevel', TRUE) . '</td>';
+               $head .= '</tr>';
                $hierar = implode(array_reverse($GLOBALS['tmpl']->ext_getTemplateHierarchyArr($GLOBALS['tmpl']->hierarchyInfoArr, '', array(), 1)), '');
                $hierar= '<table id="ts-analyzer" cellpadding="0" cellspacing="0">' . $head . $hierar . '</table>';
 
@@ -134,7 +152,7 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
 
 
                        // Output options
-               $theOutput.=$this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', TRUE), '', FALSE, TRUE);
+               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions', TRUE), '', FALSE, TRUE);
                $addParams = t3lib_div::_GET('template') ? '&template=' . t3lib_div::_GET('template') : '';
                $theOutput .= '<div class="tst-analyzer-options">' .
                        t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_analyzer_checkLinenum]', $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], '', $addParams, 'id="checkTs_analyzer_checkLinenum"') .
@@ -149,90 +167,88 @@ class tx_tstemplateanalyzer extends t3lib_extobjbase {
                                :
                                ''
                        ) . '</div>';
-               $theOutput.=$this->pObj->doc->spacer(25);
-
-
-
-                               // Output Constants
-                       if (t3lib_div::_GET('template')) {
-                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', TRUE), '', 0, 1);
-                               $theOutput .= $this->pObj->doc->sectionEnd();
-                               $theOutput .= '
-                                       <table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
-                               ';
-                                       // Don't know why -2 and not 0... :-) But works.
-                               $GLOBALS['tmpl']->ext_lineNumberOffset = -2;
-                               $GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'const';
-                               $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']))) + 1;
-
-                               reset($GLOBALS['tmpl']->clearList_const);
-                               foreach ($GLOBALS['tmpl']->constants as $key => $val) {
-                                       $cVal = current($GLOBALS['tmpl']->clearList_const);
-                                       if ($cVal == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
-                                               $theOutput .= '
-                                                       <tr>
-                                                               </td><td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[$cVal]) . '</strong></td></tr>
-                                                       <tr>
-                                                               <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' .
-                                                               $GLOBALS['tmpl']->ext_outputTS(array($val), $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], 0) .
-                                                               '</td></tr></table>
-                                                               </td>
-                                                       </tr>
-                                               ';
-                                               if (t3lib_div::_GET('template') != 'all') {
-                                                       break;
-                                               }
+               $theOutput .=$this->pObj->doc->spacer(25);
+
+                       // Output Constants
+               if (t3lib_div::_GET('template')) {
+                       $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants', TRUE), '', 0, 1);
+                       $theOutput .= $this->pObj->doc->sectionEnd();
+                       $theOutput .= '
+                               <table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
+                       ';
+                               // Don't know why -2 and not 0... :-) But works.
+                       $GLOBALS['tmpl']->ext_lineNumberOffset = -2;
+                       $GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'const';
+                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants']))) + 1;
+
+                       reset($GLOBALS['tmpl']->clearList_const);
+                       foreach ($GLOBALS['tmpl']->constants as $key => $val) {
+                               $cVal = current($GLOBALS['tmpl']->clearList_const);
+                               if ($cVal == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
+                                       $theOutput .= '
+                                               <tr>
+                                                       </td><td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[$cVal]) . '</strong></td></tr>
+                                               <tr>
+                                                       <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' .
+                                                       $GLOBALS['tmpl']->ext_outputTS(array($val), $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'], $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'], 0) .
+                                                       '</td></tr></table>
+                                                       </td>
+                                               </tr>
+                                       ';
+                                       if (t3lib_div::_GET('template') != 'all') {
+                                               break;
                                        }
-                                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
-                                       next($GLOBALS['tmpl']->clearList_const);
                                }
-                               $theOutput .= '
-                                       </table>
-                               ';
+                               $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
+                               next($GLOBALS['tmpl']->clearList_const);
                        }
+                       $theOutput .= '
+                               </table>
+                       ';
+               }
 
                        // Output setup
-                       if (t3lib_div::_GET('template')) {
-                               $theOutput .= $this->pObj->doc->spacer(15);
-                               $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', TRUE), '', 0, 1);
-                               $theOutput .= $this->pObj->doc->sectionEnd();
-                               $theOutput .= '
-                                       <table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
-                               ';
-                               $GLOBALS['tmpl']->ext_lineNumberOffset = 0;
-                               $GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'setup';
-                               $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']))) + 1;
-
-                               reset($GLOBALS['tmpl']->clearList_setup);
-                               foreach ($GLOBALS['tmpl']->config as $key => $val) {
-                                       if (current($GLOBALS['tmpl']->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
-                                               $theOutput .= '
-                                                       <tr>
-                                                               <td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[current($GLOBALS['tmpl']->clearList_setup)]) . '</strong></td></tr>
-                                                       <tr>
-                                                               <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' .
-                                                                       $GLOBALS['tmpl']->ext_outputTS(
-                                                                               array($val),
-                                                                               $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'],
-                                                                               $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'],
-                                                                               $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'],
-                                                                               $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'],
-                                                                               0) .
-                                                                               '</td></tr></table>
-                                                               </td>
-                                                       </tr>
-                                               ';
-                                               if (t3lib_div::_GET('template') != 'all') {
-                                                       break;
-                                               }
+               if (t3lib_div::_GET('template')) {
+                       $theOutput .= $this->pObj->doc->spacer(15);
+                       $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('setup', TRUE), '', 0, 1);
+                       $theOutput .= $this->pObj->doc->sectionEnd();
+                       $theOutput .= '
+                               <table class="ts-typoscript" border="0" cellpadding="1" cellspacing="0">
+                       ';
+                       $GLOBALS['tmpl']->ext_lineNumberOffset = 0;
+                       $GLOBALS['tmpl']->ext_lineNumberOffset_mode = 'setup';
+                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, t3lib_TSparser::checkIncludeLines('' . $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup']))) + 1;
+
+                       reset($GLOBALS['tmpl']->clearList_setup);
+                       foreach ($GLOBALS['tmpl']->config as $key => $val) {
+                               if (current($GLOBALS['tmpl']->clearList_setup) == t3lib_div::_GET('template') || t3lib_div::_GET('template') == 'all') {
+                                       $theOutput .= '
+                                               <tr>
+                                                       <td class="bgColor2"><strong>' . htmlspecialchars($GLOBALS['tmpl']->templateTitles[current($GLOBALS['tmpl']->clearList_setup)]) . '</strong></td></tr>
+                                               <tr>
+                                                       <td class="bgColor2"><table border="0" cellpadding="0" cellspacing="0" class="bgColor0" width="100%"><tr><td nowrap="nowrap">' .
+                                                               $GLOBALS['tmpl']->ext_outputTS(
+                                                                       array($val),
+                                                                       $this->pObj->MOD_SETTINGS['ts_analyzer_checkLinenum'],
+                                                                       $this->pObj->MOD_SETTINGS['ts_analyzer_checkComments'],
+                                                                       $this->pObj->MOD_SETTINGS['ts_analyzer_checkCrop'],
+                                                                       $this->pObj->MOD_SETTINGS['ts_analyzer_checkSyntax'],
+                                                                       0) .
+                                                                       '</td></tr></table>
+                                                       </td>
+                                               </tr>
+                                       ';
+                                       if (t3lib_div::_GET('template') != 'all') {
+                                               break;
                                        }
-                                       $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
-                                       next($GLOBALS['tmpl']->clearList_setup);
                                }
-                               $theOutput .= '
-                                       </table>
-                               ';
+                               $GLOBALS['tmpl']->ext_lineNumberOffset += count(explode(LF, $val)) + 1;
+                               next($GLOBALS['tmpl']->clearList_setup);
                        }
+                       $theOutput .= '
+                               </table>
+                       ';
+               }
 
                return $theOutput;
        }
index f04783f..3de2fa9 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_ts',
                'tx_tstemplateanalyzer',
index a886cc9..2325260 100644 (file)
  * localconf-variables:
  * $TYPO3_CONF_VARS['MODS']['web_ts']['onlineResourceDir'] = 'fileadmin/fonts/';               // This is the path (must be in "fileadmin/" !!) where the web_ts/constant-editor submodule fetches online resources. Put fonts (ttf) and standard images here!
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_ceditor/locallang.xml');
 
 class tx_tstemplateceditor extends t3lib_extobjbase {
+       /**
+        * Initialize editor
+        *
+        * @param integer $pageId
+        * @param integer $template_uid
+        * @return integer
+        */
        function initialize_editor($pageId, $template_uid=0) {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
                global $tmpl,$tplRow,$theConstants;
@@ -48,19 +55,31 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
 
                $tmpl->ext_localGfxPrefix = t3lib_extMgm::extPath('tstemplate_ceditor');
                $tmpl->ext_localWebGfxPrefix = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('tstemplate_ceditor');
-
-               $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);  // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
-               if (is_array($tplRow))  {       // IF there was a template...
+                       // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
+                       // IF there was a template...
+               if (is_array($tplRow)) {
                                // Gets the rootLine
                        $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
                        $rootLine = $sys_page->getRootLine($pageId);
-                       $tmpl->runThroughTemplates($rootLine, $template_uid);   // This generates the constants/config + hierarchy info for the template.
-                       $theConstants = $tmpl->generateConfig_constants();      // The editable constants are returned in an array.
-                       $tmpl->ext_categorizeEditableConstants($theConstants);  // The returned constants are sorted in categories, that goes into the $tmpl->categories array
-                       $tmpl->ext_regObjectPositions($tplRow['constants']);            // This array will contain key=[expanded constantname], value=linenumber in template. (after edit_divider, if any)
+                               // This generates the constants/config + hierarchy info for the template.
+                       $tmpl->runThroughTemplates($rootLine, $template_uid);
+                               // The editable constants are returned in an array.
+                       $theConstants = $tmpl->generateConfig_constants();
+                               // The returned constants are sorted in categories, that goes into the $tmpl->categories array
+                       $tmpl->ext_categorizeEditableConstants($theConstants);
+                               // This array will contain key=[expanded constantname], value=linenumber in template. (after edit_divider, if any)
+                       $tmpl->ext_regObjectPositions($tplRow['constants']);
                        return 1;
                }
        }
+
+       /**
+        * Display example
+        *
+        * @param string $theOutput
+        * @return string
+        */
        function displayExample($theOutput) {
                global $tmpl;
                if ($tmpl->helpConfig['imagetag'] || $tmpl->helpConfig['description'] || $tmpl->helpConfig['header']) {
@@ -74,37 +93,30 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                return $theOutput;
        }
 
+       /**
+        * Main
+        *
+        * @return string
+        */
        function main() {
                global $TYPO3_CONF_VARS;
                global $tmpl, $tplRow, $theConstants;
 
                $theOutput = '';
 
-               // **************************
-               // Create extension template
-               // **************************
+                       // Create extension template
                $this->pObj->createTemplate($this->pObj->id);
 
-
-
-
-               // **************************
-               // Checking for more than one template an if, set a menu...
-               // **************************
+                       // Checking for more than one template an if, set a menu...
                $manyTemplatesMenu = $this->pObj->templateMenu();
                $template_uid = 0;
                if ($manyTemplatesMenu) {
                        $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
                }
 
-
-
-               // **************************
-               // Main
-               // **************************
-
-               // BUGBUG: Should we check if the uset may at all read and write template-records???
-               $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); // initialize
+                       // BUGBUG: Should we check if the uset may at all read and write template-records???
+                       // initialize
+               $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
 
                if ($existTemplate) {
                        $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
@@ -132,7 +144,7 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                                }
                        }
 
-                       // Output edit form
+                               // Output edit form
                        $tmpl->ext_readDirResources($TYPO3_CONF_VARS['MODS']['web_ts']['onlineResourceDir']);
                        $tmpl->ext_resourceDims();
 
@@ -184,4 +196,4 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                return $theOutput;
        }
 }
-?>
+?>
\ No newline at end of file
index e6888be..b5fd297 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_ts',
                'tx_tstemplateceditor',
index 3d44592..915049c 100644 (file)
@@ -30,19 +30,23 @@ $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_info/locallang.xml');
 /**
  * This class displays the Info/Modify screen of the Web > Template module
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 class tx_tstemplateinfo extends t3lib_extobjbase {
 
-       public $tce_processed = FALSE;  // indicator for t3editor, whether data is stored
+       /**
+        * Indicator for t3editor, whether data is stored
+        * @var boolean
+        */
+       public $tce_processed = FALSE;
 
        /**
         * Creates a row for a HTML table
         *
-        * @param       string          $label: The label to be shown (e.g. 'Title:', 'Sitetitle:')
-        * @param       string          $data: The data/information to be shown (e.g. 'Template for my site')
-        * @param       string          $field: The field/variable to be sent on clicking the edit icon (e.g. 'title', 'sitetitle')
-        * @return      string          A row for a HTML table
+        * @param string $label The label to be shown (e.g. 'Title:', 'Sitetitle:')
+        * @param string $data The data/information to be shown (e.g. 'Template for my site')
+        * @param string $field The field/variable to be sent on clicking the edit icon (e.g. 'title', 'sitetitle')
+        * @return string A row for a HTML table
         */
        function tableRow($label, $data, $field) {
                $ret = '<tr><td>';
@@ -50,7 +54,7 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                'id' => $this->pObj->id,
                        );
                $aHref = t3lib_BEfunc::getModuleUrl('web_ts', $urlParameters);
-               $ret.= '<a href="' . htmlspecialchars($aHref . '&e[' . $field . ']=1') . '">' .
+               $ret .= '<a href="' . htmlspecialchars($aHref . '&e[' . $field . ']=1') . '">' .
                        t3lib_iconWorks::getSpriteIcon('actions-document-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:editField', TRUE))) . '<strong>' . $label . '&nbsp;&nbsp;</strong></a>';
                $ret .= '</td><td width="80%" class="bgColor4">' . $data . '&nbsp;</td></tr>';
                return $ret;
@@ -59,9 +63,9 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
        /**
         * Renders HTML table with available template resources/files
         *
-        * @param       string          $resources: List of  resources/files to be shown (e.g. 'file_01.txt,file.txt')
-        * @param       boolean         $func: Whether to render functions like 'to top' or 'delete' for each resource (default: FALSE)
-        * @return      string          HTML table with available template resources/files
+        * @param string $resources List of  resources/files to be shown (e.g. 'file_01.txt,file.txt')
+        * @param boolean $func Whether to render functions like 'to top' or 'delete' for each resource (default: FALSE)
+        * @return string HTML table with available template resources/files
         */
        function procesResources($resources, $func=FALSE) {
                $arr = t3lib_div::trimExplode(',', $resources.',,', 1);
@@ -103,15 +107,16 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
        /**
         * Renders HTML table with all available template resources/files in the current rootline that could be copied
         *
-        * @param       integer         $id: The uid of the current page
-        * @param       integer         $template_uid: The uid of the template record to be rendered (only if more than one template on the current page)
-        * @return      string          HTML table with all available template resources/files in the current rootline that could be copied
+        * @param integer $id The uid of the current page
+        * @param integer $template_uid The uid of the template record to be rendered (only if more than one template on the current page)
+        * @return string HTML table with all available template resources/files in the current rootline that could be copied
         */
        function resourceListForCopy($id, $template_uid) {
                global $tmpl;
                $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
                $rootLine = $sys_page->getRootLine($id);
-               $tmpl->runThroughTemplates($rootLine, $template_uid);   // This generates the constants/config + hierarchy info for the template.
+                       // This generates the constants/config + hierarchy info for the template.
+               $tmpl->runThroughTemplates($rootLine, $template_uid);
                $theResources = t3lib_div::trimExplode(',', $tmpl->resources, 1);
                foreach ($theResources as $k => $v) {
                        $fI = pathinfo($v);
@@ -129,16 +134,17 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
         * Create an instance of t3lib_tsparser_ext in $GLOBALS['tmpl'] and looks for the first (visible) template
         * record. If $template_uid was given and greater than zero, this record will be checked.
         *
-        * @param       integer         $id: The uid of the current page
-        * @param       integer         $template_uid: The uid of the template record to be rendered (only if more than one template on the current page)
-        * @return      boolean         Returns TRUE if a template record was found, otherwise FALSE
+        * @param integer $pageId The uid of the current page
+        * @param integer $template_uid: The uid of the template record to be rendered (only if more than one template on the current page)
+        * @return boolean Returns TRUE if a template record was found, otherwise FALSE
         */
-       function initialize_editor($pageId, $template_uid=0) {
+       function initialize_editor($pageId, $template_uid = 0) {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
                global $tmpl,$tplRow,$theConstants;
-
-               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
-               $tmpl->tt_track = 0;    // Do not log time-performance information
+                       // Defined global here!
+               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
+                       // Do not log time-performance information
+               $tmpl->tt_track = 0;
                $tmpl->init();
 
                        // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
@@ -153,9 +159,9 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
        /**
         * Process template row after loading
         *
-        * @param       array   $tplRow: template row
-        * @return      array   preprocessed template row
-        * @author      Fabrizio Branca <typo3@fabrizio-branca.de>
+        * @param array $tplRow Template row
+        * @return array Preprocessed template row
+        * @author Fabrizio Branca <typo3@fabrizio-branca.de>
         */
        function processTemplateRowAfterLoading(array $tplRow) {
                if ($this->pObj->MOD_SETTINGS['includeTypoScriptFileContent']) {
@@ -170,9 +176,9 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
        /**
         * Process template row before saving
         *
-        * @param       array   $tplRow: template row
-        * @return      array   preprocessed template row
-        * @author      Fabrizio Branca <typo3@fabrizio-branca.de>
+        * @param array $tplRow Template row
+        * @return array Preprocessed template row
+        * @author Fabrizio Branca <typo3@fabrizio-branca.de>
         */
        function processTemplateRowBeforeSaving(array $tplRow) {
                if ($this->pObj->MOD_SETTINGS['includeTypoScriptFileContent']) {
@@ -184,7 +190,7 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
        /**
         * The main processing method if this class
         *
-        * @return      string          Information of the template status or the taken actions as HTML string
+        * @return string Information of the template status or the taken actions as HTML string
         */
        function main() {
                global $BACK_PATH;
@@ -197,33 +203,24 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
 
                t3lib_div::loadTCA('sys_template');
 
-
-
-
-               // **************************
-               // Checking for more than one template an if, set a menu...
-               // **************************
+                       // Checking for more than one template an if, set a menu...
                $manyTemplatesMenu = $this->pObj->templateMenu();
                $template_uid = 0;
                if ($manyTemplatesMenu) {
                        $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
                }
 
-
-               // **************************
-               // Initialize
-               // **************************
-               $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);              // initialize
+                       // Initialize
+               $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
 
                if ($existTemplate) {
                        $saveId = ($tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid']);
                }
-               // **************************
-               // Create extension template
-               // **************************
+
+                       // Create extension template
                $newId = $this->pObj->createTemplate($this->pObj->id, $saveId);
                if($newId) {
-                       // switch to new template
+                       // Switch to new template
                        $urlParameters = array(
                                        'id' => $this->pObj->id,
                                        'SET[templatesOnPage]' => $newId,
@@ -243,7 +240,8 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                $resList = $tplRow['resources'];
 
                                $tmp_upload_name = '';
-                               $tmp_newresource_name = '';     // Set this to blank
+                                       // Set this to blank
+                               $tmp_newresource_name = '';
 
                                if (is_array($POST['data'])) {
                                        foreach ($POST['data'] as $field => $val) {
@@ -340,7 +338,8 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                                $fI = t3lib_div::split_fileref($edit['filename']);
                                                if (@is_file($path) && t3lib_div::getFileAbsFileName($path) && t3lib_div::inList($this->pObj->textExtensions, $fI['fileext']))  {               // checks that have already been done.. Just to make sure
                                                                // @TODO: Check if the hardcorded value already has a config member, otherwise create one
-                                                       if (filesize($path) < 30720)    {       // checks that have already been done.. Just to make sure
+                                                               // Checks that have already been done.. Just to make sure
+                                                       if (filesize($path) < 30720) {
                                                                t3lib_div::writeFile($path, $edit['file']);
 
                                                                $theOutput.= $this->pObj->doc->spacer(10);
@@ -363,7 +362,7 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                }
                        }
 
-                               // hook Post updating template/TCE processing
+                               // Hook post updating template/TCE processing
                        if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'])) {
                                $postTCEProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'];
                                if (is_array($postTCEProcessingHook)) {
index 8dc44a9..5654218 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_ts',
                'tx_tstemplateinfo',
index bdd03c9..838d219 100644 (file)
@@ -30,12 +30,19 @@ $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_objbrowser/locallang.xml');
 /**
  * This class displays the submodule "TypoScript Object Browser" inside the Web > Template module
  *
- * @author             Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package            TYPO3
- * @subpackage tx_tstemplateobjbrowser
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @package TYPO3
+ * @subpackage tx_tstemplateobjbrowser
  */
 class tx_tstemplateobjbrowser extends t3lib_extobjbase {
 
+       /**
+        * Init
+        *
+        * @param object $pObj
+        * @param array $conf
+        * @return void
+        */
        function init(&$pObj, $conf) {
                parent::init($pObj, $conf);
 
@@ -43,6 +50,11 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                $this->pObj->modMenu_setDefaultList .= ',ts_browser_fixedLgd,ts_browser_showComments';
        }
 
+       /**
+        * Mod menu
+        *
+        * @return array
+        */
        function modMenu() {
                $modMenu = array (
                        'ts_browser_type' => array(
@@ -70,9 +82,10 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                        'ts_browser_alphaSort' => '1',
                );
 
-               foreach(array('setup', 'const') as $bType) {
+               foreach (array('setup', 'const') as $bType) {
                        $addKey = t3lib_div::_GET('addKey');
-                       if (is_array($addKey))  {               // If any plus-signs were clicked, it's registred.
+                               // If any plus-signs were clicked, it's registred.
+                       if (is_array($addKey)) {
                                reset($addKey);
                                if (current($addKey)) {
                                        $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][key($addKey)] = key($addKey);
@@ -92,12 +105,12 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
        }
 
        /**
-        * [Describe function...]
+        * Verify TS objects
         *
-        * @param       [type]          $propertyArray: ...
-        * @param       [type]          $parentType: ...
-        * @param       [type]          $parentValue: ...
-        * @return      [type]          ...
+        * @param array $propertyArray
+        * @param string $parentType
+        * @param string $parentValue
+        * @return array
         */
        function verify_TSobjects($propertyArray, $parentType, $parentValue) {
                $TSobjTable = array(
@@ -135,14 +148,16 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                        if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType], $parentValue))) {
                                $ObjectKind = $parentValue;
                        } else {
-                               $ObjectKind = '';       // Object kind is "" if it should be known.
+                                       // Object kind is "" if it should be known.
+                               $ObjectKind = '';
                        }
                } else {
-                       $ObjectKind = $parentValue;     // If parentType is not given, then it can be anything. Free.
+                               // If parentType is not given, then it can be anything. Free.
+                       $ObjectKind = $parentValue;
                }
 
                if ($ObjectKind && is_array($TSobjTable[$ObjectKind])) {
-                       $result=array();
+                       $result = array();
                        if (is_array($propertyArray))           {
                                foreach ($propertyArray as $key => $val) {
                                        if (t3lib_utility_Math::canBeInterpretedAsInteger($key))        {       // If num-arrays
@@ -157,35 +172,38 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
        }
 
        /**
-        * [Describe function...]
+        * Initialize editor
         *
-        * @param       [type]          $pageId: ...
-        * @param       [type]          $template_uid: ...
-        * @return      [type]          ...
+        * @param integer $pageId
+        * @param integer $template_uid
+        * @return integer
         */
        function initialize_editor($pageId, $template_uid=0) {
                        // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
                global $tmpl,$tplRow,$theConstants;
-
-               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
-               $tmpl->tt_track = 0;    // Do not log time-performance information
+                       // Defined global here!
+               $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
+                       // Do not log time-performance information
+               $tmpl->tt_track = 0;
                $tmpl->init();
 
                                // Gets the rootLine
                $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
                $rootLine = $sys_page->getRootLine($pageId);
-               $tmpl->runThroughTemplates($rootLine, $template_uid);   // This generates the constants/config + hierarchy info for the template.
-
-               $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);  // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
-               if (is_array($tplRow))  {       // IF there was a template...
+                       // This generates the constants/config + hierarchy info for the template.
+               $tmpl->runThroughTemplates($rootLine, $template_uid);
+                       // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
+               $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
+                       // IF there was a template...
+               if (is_array($tplRow)) {
                        return 1;
                }
        }
 
        /**
-        * [Describe function...]
+        * Main
         *
-        * @return      [type]          ...
+        * @return string
         */
        function main() {
                global $BACK_PATH;
@@ -193,24 +211,14 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
 
                $POST = t3lib_div::_POST();
 
-               // **************************
-               // Checking for more than one template an if, set a menu...
-               // **************************
+                       // Checking for more than one template an if, set a menu...
                $manyTemplatesMenu = $this->pObj->templateMenu();
                $template_uid = 0;
                if ($manyTemplatesMenu) {
                        $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
                }
 
-
-
-
-
-               // **************************
-               // Main
-               // **************************
-
-               // BUGBUG: Should we check if the uset may at all read and write template-records???
+                       // BUGBUG: Should we check if the uset may at all read and write template-records???
                $bType = $this->pObj->MOD_SETTINGS['ts_browser_type'];
                $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);              // initialize
                if ($existTemplate) {
@@ -309,23 +317,26 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
 
                $tsbr = t3lib_div::_GET('tsbr');
                $update=0;
-               if (is_array($tsbr))    {               // If any plus-signs were clicked, it's registred.
+               if (is_array($tsbr)) {          // If any plus-signs were clicked, it's registred.
                        $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]);
                        $update=1;
                }
 
-               if ($POST['Submit'])    {               // If any POST-vars are send, update the condition array
+               if ($POST['Submit']) {          // If any POST-vars are send, update the condition array
                        $this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions'];
                        $update=1;
                }
-               if ($update)    { $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS); }
-
+               if ($update) {
+                       $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS);
+               }
 
                $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
                $tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy';  // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
 
                $tmpl->constantMode = $this->pObj->MOD_SETTINGS['ts_browser_const'];
-               if ($this->pObj->sObj && $tmpl->constantMode)   {$tmpl->constantMode = 'untouched';}
+               if ($this->pObj->sObj && $tmpl->constantMode) {
+                       $tmpl->constantMode = 'untouched';
+               }
 
                $tmpl->regexMode = $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'];
                $tmpl->fixedLgd = $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'];
@@ -512,7 +523,7 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                                </table>
                        ';
 
-                       // second row options
+                               // second row options
                        $menu = '<div class="tsob-menu-row2">';
                        $menu .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_browser_showComments]', $this->pObj->MOD_SETTINGS['ts_browser_showComments'], '', '', 'id="checkTs_browser_showComments"');
                        $menu .= '<label for="checkTs_browser_showComments">' . $GLOBALS['LANG']->getLL('displayComments') . '</label>';
@@ -552,4 +563,4 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                return $theOutput;
        }
 }
-?>
+?>
\ No newline at end of file
index 6c002b4..d8649a4 100644 (file)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_ts',
                'tx_tstemplateobjbrowser',
index 497fb94..69418ca 100644 (file)
@@ -90,7 +90,7 @@ class Tx_Viewpage_Controller_ViewController extends Tx_Extbase_MVC_Controller_Ac
        /**
         * Get admin command
         *
-        * @param $pageId
+        * @param integer $pageId
         * @return string
         */
        protected function getAdminCommand($pageId) {
@@ -108,7 +108,7 @@ class Tx_Viewpage_Controller_ViewController extends Tx_Extbase_MVC_Controller_Ac
         * for a page id or a page tree.
         * The method checks if a type is set for the given id and returns the additional GET string.
         *
-        * @param $pageId
+        * @param integer $pageId
         * @return string
         */
        protected function getTypeParameterIfSet($pageId) {
@@ -124,7 +124,7 @@ class Tx_Viewpage_Controller_ViewController extends Tx_Extbase_MVC_Controller_Ac
        /**
         * Get domain name for requested page id
         *
-        * @param $pageId
+        * @param integer $pageId
         * @return boolean|string Domain name if there is one, FALSE if not
         */
        protected function getDomainName($pageId) {
index 9465dfa..682919b 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
-if (!defined ('TYPO3_MODE')) {
-       die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
 }
 
 if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
index cab380f..573a160 100755 (executable)
  * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 /**
  * Creates the "Create pages" wizard
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tx_wizardcrpages
  */
@@ -50,24 +50,24 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
        protected $loremIpsumObject = NULL;
 
        /**
-       * Complete tsConfig
-       *
-       * @var array
-       */
+       * Complete tsConfig
+       *
+       * @var array
+       */
        protected $tsConfig = array();
 
        /**
-       * Part of tsConfig with TCEFORM.pages. settings
-       *
-       * @var array
-       */
+       * Part of tsConfig with TCEFORM.pages. settings
+       *
+       * @var array
+       */
        protected $pagesTsConfig = array();
 
 
        /**
         * Adds menu items... but I think this is not used at all. Looks very much like some testing code. If anyone cares to check it we can remove it some day...
         *
-        * @return      array
+        * @return array
         * @ignore
         */
        function modMenu() {
@@ -85,12 +85,12 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Main function creating the content for the module.
         *
-        * @return      string          HTML content for the module, actually a "section" made through the parent object in $this->pObj
+        * @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
         */
        function main() {
                global $SOBE, $LANG;
 
-               $theCode='';
+               $theCode = '';
 
                $this->tsConfig = t3lib_BEfunc::getPagesTSconfig($this->pObj->id);
                $this->pagesTsConfig = isset($this->tsConfig['TCEFORM.']['pages.']) ? $this->tsConfig['TCEFORM.']['pages.'] : array();
@@ -100,8 +100,8 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
                if (t3lib_extMgm::isLoaded('lorem_ipsum')) {
                        $this->loremIpsumObject = t3lib_div::getUserObj('EXT:lorem_ipsum/class.tx_loremipsum_wiz.php:tx_loremipsum_wiz');
                }
-
-               $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);   // create new pages here?
+                       // Create new pages here?
+               $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(8);
                $pRec = t3lib_BEfunc::getRecord('pages', $this->pObj->id, 'uid', ' AND ' . $m_perms_clause);
                $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
                $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
@@ -242,7 +242,7 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Return the helpbubble image tag.
         *
-        * @return      string          HTML code for a help-bubble image.
+        * @return string HTML code for a help-bubble image.
         */
        function helpBubble() {
                return '<img src="' . $GLOBALS['BACK_PATH'] . 'gfx/helpbubble.gif" width="14" height="14" hspace="2" align="top" alt="" />';
@@ -251,8 +251,8 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Return one line in the form
         *
-        * @param       mixed   $index An integer: the line counter for which to create the line. Use "#" to create an template for javascript (used by ExtJS)
-        * @return      string  HTML code for one input line for one new page
+        * @param mixed $index An integer: the line counter for which to create the line. Use "#" to create an template for javascript (used by ExtJS)
+        * @return string HTML code for one input line for one new page
         */
        protected function getFormLine($index) {
                $backPath = $GLOBALS['BACK_PATH'];
@@ -270,10 +270,10 @@ class tx_wizardcrpages_webfunc_2 extends t3lib_extobjbase {
                $content = '<label for="page_new_' . $index . '"> ' . $GLOBALS['LANG']->getLL('wiz_newPages_page') .' '. $label;
                $content .= ':&nbsp;</label>';
 
-                       // title
+                       // Title
                $content .= '<input type="text" id="page_new_' . $index . '" name="data[pages][NEW' . $index . '][title]"' . $this->pObj->doc->formWidth(35) . ' />&nbsp';
 
-                       // lorem ipsum link, if available
+                       // Lorem ipsum link, if available
                $content .= (is_object($this->loremIpsumObject) ?
                        '<a href="#" onclick="' . htmlspecialchars($this->loremIpsumObject->getHeaderTitleJS('document.forms[0][\'data[pages][NEW' .
                        $index . '][title]\'].value', 'title')) . '">' . $this->loremIpsumObject->getIcon('', $this->pObj->doc->backPath) . '</a>'
index 2bae844..1467251 100755 (executable)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_func',
                'tx_wizardcrpages_webfunc_2',
index 03f30e7..040d830 100755 (executable)
  * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 /**
  * Creates the "Sort pages" wizard
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage tx_wizardsortpages
  */
@@ -44,7 +44,7 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Adds menu items... but I think this is not used at all. Looks very much like some testing code. If anyone cares to check it we can remove it some day...
         *
-        * @return      array
+        * @return array
         * @ignore
         */
        function modMenu() {
@@ -58,7 +58,7 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Main function creating the content for the module.
         *
-        * @return      string          HTML content for the module, actually a "section" made through the parent object in $this->pObj
+        * @return string HTML content for the module, actually a "section" made through the parent object in $this->pObj
         */
        function main() {
                global $SOBE,$LANG;
@@ -69,22 +69,22 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
 
                        $theCode='';
 
-                               // check if user has modify permissions to
+                               // Check if user has modify permissions to
                        $sys_pages = t3lib_div::makeInstance('t3lib_pageSelect');
                        $sortByField = t3lib_div::_GP('sortByField');
                        if ($sortByField) {
-                               $menuItems=array();
+                               $menuItems = array();
                                if (t3lib_div::inList('title,subtitle,crdate,tstamp', $sortByField)) {
                                        $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', $sortByField, '', 0);
-                               } elseif ($sortByField=='REV') {
+                               } elseif ($sortByField == 'REV') {
                                        $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', 'sorting', '', 0);
                                        $menuItems = array_reverse($menuItems);
                                }
                                if (count($menuItems)) {
                                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                                       $tce->stripslashes_values=0;
+                                       $tce->stripslashes_values = 0;
                                        $menuItems = array_reverse($menuItems);
-                                       $cmd=array();
+                                       $cmd = array();
                                        foreach ($menuItems as $r) {
                                                $cmd['pages'][$r['uid']]['move']=$this->pObj->id;
                                        }
@@ -94,15 +94,15 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
                                }
                        }
 
-                               //
+
                        $menuItems = $sys_pages->getMenu($this->pObj->id, '*', 'sorting', '', 0);
-                       $lines=array();
-                               $lines[]= '<tr class="t3-row-header">
-                                       <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title') . '</td>
-                                       ' . (t3lib_extMgm::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '').'
-                                       <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td>
-                                       <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td>
-                                       </tr>';
+                       $lines = array();
+                       $lines[]= '<tr class="t3-row-header">
+                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title') . '</td>
+                               ' . (t3lib_extMgm::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '').'
+                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td>
+                               <td>' . $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td>
+                               </tr>';
                        foreach ($menuItems as $rec) {
                                $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(2);   // edit permissions for that page!
                                $pRec = t3lib_BEfunc::getRecord ('pages', $rec['uid'], 'uid', ' AND '.$m_perms_clause);
@@ -120,7 +120,7 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
 
                        if (count($menuItems)) {
                                        // Menu:
-                               $lines=array();
+                               $lines = array();
                                $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_title'), 'title');
                                if (t3lib_extMgm::isLoaded('cms')) $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_subtitle'), 'subtitle');
                                $lines[] = $this->wiz_linkOrder($LANG->getLL('wiz_changeOrder_tChange'), 'tstamp');
@@ -143,9 +143,9 @@ class tx_wizardsortpages_webfunc_2 extends t3lib_extobjbase {
        /**
         * Creates a link for the sorting order
         *
-        * @param       string          Title of the link
-        * @param       string          Field to sort by
-        * @return      string          HTML string
+        * @param string $title Title of the link
+        * @param string $order Field to sort by
+        * @return string HTML string
         */
        function wiz_linkOrder($title, $order) {
                return '&nbsp; &nbsp;<a class="t3-link" href="' . htmlspecialchars('index.php?id=' . $GLOBALS['SOBE']->id . '&sortByField=' . $order) . '" onclick="return confirm('.$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_changeOrder_msg1')) . ')">' . htmlspecialchars($title) . '</a>';
index afc3064..bb598a7 100755 (executable)
@@ -1,7 +1,9 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined('TYPO3_MODE')) {
+       die('Access denied.');
+}
 
-if (TYPO3_MODE=='BE') {
+if (TYPO3_MODE == 'BE') {
        t3lib_extMgm::insertModuleFunction(
                'web_func',
                'tx_wizardsortpages_webfunc_2',