[TASK] Clean up phpDoc comments in typo3/
authorWouter Wolters <typo3@wouterwolters.nl>
Tue, 12 Jun 2012 17:36:51 +0000 (19:36 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 14 Jun 2012 21:20:46 +0000 (23:20 +0200)
Clean up phpDoc comments for the following classes:

* typo3/class.webpagetree.php
* typo3/cleaner_check.sh
* typo3/cleaner_fix.sh
* typo3/cli_dispatch.phpsh
* typo3/db_new.php
* typo3/dummy.php
* typo3/file_edit.php
* typo3/file_newfolder.php
* typo3/file_rename.php
* typo3/file_upload.php

Clean up provides:

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

Change-Id: Ia91597115348f3ce72c1b2ac991344f9eaf3f445
Resolves: #37968
Releases: 6.0
Reviewed-on: http://review.typo3.org/11999
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/class.webpagetree.php
typo3/cleaner_check.sh
typo3/cleaner_fix.sh
typo3/cli_dispatch.phpsh
typo3/db_new.php
typo3/dummy.php
typo3/file_edit.php
typo3/file_newfolder.php
typo3/file_rename.php
typo3/file_upload.php

index dc6552c..6e2c03a 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Page navigation tree for the Web module
  *
  * Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author     Benjamin Mack   <bmack@xnos.org>
- *
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Benjamin Mack <bmack@xnos.org>
  *
  * [CLASS/FUNCTION INDEX of SCRIPT]
  *
- *
- *
  *   71: class webPageTree extends t3lib_browseTree
  *   81:     function webPageTree()
  *   92:     function wrapIcon($icon, &$row)
  *
  * TOTAL FUNCTIONS: 9
  * (This index is automatically created/updated by the extension "extdeveval")
- *
  */
 
-
 /**
  * Extension class for the t3lib_browsetree class, specially made
  * for browsing pages in the Web module
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @author     Benjamin Mack   <bmack@xnos.org>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Benjamin Mack <bmack@xnos.org>
  * @package TYPO3
  * @subpackage core
  * @see class t3lib_browseTree
@@ -72,12 +68,11 @@ class webPageTree extends t3lib_browseTree {
        var $ext_IconMode;
        var $ext_separateNotinmenuPages;
        var $ext_alphasortNotinmenuPages;
-       var $ajaxStatus = FALSE; // Indicates, whether the ajax call was successful, i.e. the requested page has been found
+               // Indicates, whether the ajax call was successful, i.e. the requested page has been found
+       var $ajaxStatus = FALSE;
 
        /**
         * Calls init functions
-        *
-        * @return      void
         */
        function __construct() {
                $this->init();
@@ -86,9 +81,9 @@ class webPageTree extends t3lib_browseTree {
        /**
         * Wrapping icon in browse tree
         *
-        * @param       string          Icon IMG code
-        * @param       array           Data row for element.
-        * @return      string          Page icon
+        * @param string $thePageIcon Icon IMG code
+        * @param array $row Data row for element.
+        * @return string Page icon
         */
        function wrapIcon($thePageIcon, &$row) {
                        // If the record is locked, present a warning sign.
@@ -97,7 +92,9 @@ class webPageTree extends t3lib_browseTree {
                        $lockIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
                                t3lib_iconWorks::getSpriteIcon('status-warning-in-use', array('title'=>htmlspecialchars($lockInfo['msg']))).
                                '</a>';
-               } else $lockIcon = '';
+               } else {
+                       $lockIcon = '';
+               }
 
                        // Wrap icon in click-menu link.
                if (!$this->ext_IconMode) {
@@ -131,14 +128,14 @@ class webPageTree extends t3lib_browseTree {
        /**
         * Adds a red "+" to the input string, $str, if the field "php_tree_stop" in the $row (pages) is set
         *
-        * @param       string          Input string, like a page title for the tree
-        * @param       array           record row with "php_tree_stop" field
-        * @return      string          Modified string
+        * @param string $str Input string, like a page title for the tree
+        * @param array $row Record row with "php_tree_stop" field
+        * @return string Modified string
         * @access private
         */
        function wrapStop($str, $row) {
                if ($row['php_tree_stop']) {
-                       $str.='<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a> ';
+                       $str .= '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a> ';
                }
                return $str;
        }
@@ -146,13 +143,13 @@ class webPageTree extends t3lib_browseTree {
        /**
         * Wrapping $title in a-tags.
         *
-        * @param       string          Title string
-        * @param       string          Item record
-        * @param       integer         Bank pointer (which mount point number)
-        * @return      string
-        * @access      private
+        * @param string $title Title string
+        * @param string $row Item record
+        * @param integer $bank Bank pointer (which mount point number)
+        * @return string
+        * @access private
         */
-       function wrapTitle($title, $row, $bank=0) {
+       function wrapTitle($title, $row, $bank = 0) {
                        // Hook for overriding the page title
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.webpagetree.php']['pageTitleOverlay'])) {
                        $_params = array('title' => &$title, 'row' => &$row);
@@ -170,12 +167,11 @@ class webPageTree extends t3lib_browseTree {
                return '<span class="dragTitle" id="dragTitleID_'.$row['uid'].'">'.$thePageTitle.'</span>';
        }
 
-
        /**
         * Compiles the HTML code for displaying the structure found inside the ->tree array
         *
-        * @param       array           "tree-array" - if blank string, the internal ->tree array is used.
-        * @return      string          The HTML code for the tree
+        * @param array $treeArr "tree-array" - if blank string, the internal ->tree array is used.
+        * @return string The HTML code for the tree
         */
        function printTree($treeArr = '') {
                $titleLen = intval($this->BE_USER->uc['titleLen']);
@@ -191,74 +187,84 @@ class webPageTree extends t3lib_browseTree {
                        // -- evaluate AJAX request
                        // IE takes anchor as parameter
                $PM = t3lib_div::_GP('PM');
-               if(($PMpos = strpos($PM, '#')) !== FALSE) { $PM = substr($PM, 0, $PMpos); }
+               if (($PMpos = strpos($PM, '#')) !== FALSE) {
+                       $PM = substr($PM, 0, $PMpos);
+               }
                $PM = explode('_', $PM);
                if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) && is_array($PM) && count($PM) == 4 && $PM[2] != 0) {
-                       if($PM[1]) {
+                       if ($PM[1]) {
                                $expandedPageUid = $PM[2];
                                $ajaxOutput = '';
-                               $invertedDepthOfAjaxRequestedItem = 0; // We don't know yet. Will be set later.
+                                       // We don't know yet. Will be set later.
+                               $invertedDepthOfAjaxRequestedItem = 0;
                                $doExpand = TRUE;
-                       } else  {
+                       } else {
                                $collapsedPageUid = $PM[2];
                                $doCollapse = TRUE;
                        }
                }
 
-               // we need to count the opened <ul>'s every time we dig into another level,
-               // so we know how many we have to close when all children are done rendering
+                       // We need to count the opened <ul>'s every time we dig into another level,
+                       // so we know how many we have to close when all children are done rendering
                $closeDepth = array();
 
-               foreach($treeArr as $k => $v) {
+               foreach ($treeArr as $k => $v) {
                        $classAttr = $v['row']['_CSSCLASS'];
                        $uid       = $v['row']['uid'];
                        $idAttr = htmlspecialchars($this->domIdPrefix.$this->getId($v['row']).'_'.$v['bank']);
                        $itemHTML  = '';
 
-                       // if this item is the start of a new level,
-                       // then a new level <ul> is needed, but not in ajax mode
+                               // If this item is the start of a new level,
+                               // then a new level <ul> is needed, but not in ajax mode
                        if($v['isFirst'] && !($doCollapse) && !($doExpand && $expandedPageUid == $uid)) {
                                $itemHTML = '<ul>';
                        }
 
-                       // add CSS classes to the list item
-                       if($v['hasSub']) { $classAttr .= ($classAttr) ? ' expanded': 'expanded'; }
-                       if($v['isLast']) { $classAttr .= ($classAttr) ? ' last' : 'last';        }
+                               // Add CSS classes to the list item
+                       if ($v['hasSub']) {
+                               $classAttr .= ($classAttr) ? ' expanded' : 'expanded';
+                       }
+                       if ($v['isLast']) {
+                               $classAttr .= ($classAttr) ? ' last' : 'last';
+                       }
 
-                       $itemHTML .='
+                       $itemHTML .= '
                                <li id="'.$idAttr.'"'.($classAttr ? ' class="'.$classAttr.'"' : '').'><div class="treeLinkItem">'.
                                        $v['HTML'].
                                        $this->wrapTitle($this->getTitleStr($v['row'], $titleLen), $v['row'], $v['bank'])."</div>\n";
 
 
-                       if(!$v['hasSub']) { $itemHTML .= '</li>'; }
-
-                       // we have to remember if this is the last one
-                       // on level X so the last child on level X+1 closes the <ul>-tag
-                       if($v['isLast'] && !($doExpand && $expandedPageUid == $uid)) { $closeDepth[$v['invertedDepth']] = 1; }
+                       if (!$v['hasSub']) {
+                               $itemHTML .= '</li>';
+                       }
 
+                               // We have to remember if this is the last one
+                               // on level X so the last child on level X+1 closes the <ul>-tag
+                       if ($v['isLast'] && !($doExpand && $expandedPageUid == $uid)) {
+                               $closeDepth[$v['invertedDepth']] = 1;
+                       }
 
-                       // if this is the last one and does not have subitems, we need to close
-                       // the tree as long as the upper levels have last items too
-                       if($v['isLast'] && !$v['hasSub'] && !$doCollapse && !($doExpand && $expandedPageUid == $uid)) {
+                               // If this is the last one and does not have subitems, we need to close
+                               // the tree as long as the upper levels have last items too
+                       if ($v['isLast'] && !$v['hasSub'] && !$doCollapse && !($doExpand && $expandedPageUid == $uid)) {
                                for ($i = $v['invertedDepth']; $closeDepth[$i] == 1; $i++) {
                                        $closeDepth[$i] = 0;
                                        $itemHTML .= '</ul></li>';
                                }
                        }
 
-                       // ajax request: collapse
-                       if($doCollapse && $collapsedPageUid == $uid) {
+                               // Ajax request: collapse
+                       if ($doCollapse && $collapsedPageUid == $uid) {
                                $this->ajaxStatus = TRUE;
                                return $itemHTML;
                        }
 
                        // ajax request: expand
-                       if($doExpand && $expandedPageUid == $uid) {
+                       if ($doExpand && $expandedPageUid == $uid) {
                                $ajaxOutput .= $itemHTML;
                                $invertedDepthOfAjaxRequestedItem = $v['invertedDepth'];
-                       } elseif($invertedDepthOfAjaxRequestedItem) {
-                               if($v['invertedDepth'] < $invertedDepthOfAjaxRequestedItem) {
+                       } elseif ($invertedDepthOfAjaxRequestedItem) {
+                               if ($v['invertedDepth'] < $invertedDepthOfAjaxRequestedItem) {
                                        $ajaxOutput .= $itemHTML;
                                } else {
                                        $this->ajaxStatus = TRUE;
@@ -269,26 +275,25 @@ class webPageTree extends t3lib_browseTree {
                        $out .= $itemHTML;
                }
 
-               if($ajaxOutput) {
+               if ($ajaxOutput) {
                        $this->ajaxStatus = TRUE;
                        return $ajaxOutput;
                }
 
-               // finally close the first ul
+                       // Finally close the first ul
                $out .= '</ul>';
                return $out;
        }
 
-
        /**
         * Generate the plus/minus icon for the browsable tree.
         *
-        * @param       array           record for the entry
-        * @param       integer         The current entry number
-        * @param       integer         The total number of entries. If equal to $a, a "bottom" element is returned.
-        * @param       integer         The number of sub-elements to the current element.
-        * @param       boolean         The element was expanded to render subelements if this flag is set.
-        * @return      string          Image tag with the plus/minus icon.
+        * @param array $row Record for the entry
+        * @param integer $a The current entry number
+        * @param integer $c The total number of entries. If equal to $a, a "bottom" element is returned.
+        * @param integer $nextCount The number of sub-elements to the current element.
+        * @param boolean $exp The element was expanded to render subelements if this flag is set.
+        * @return string Image tag with the plus/minus icon.
         * @access private
         * @see t3lib_pageTree::PMicon()
         */
@@ -304,18 +309,17 @@ class webPageTree extends t3lib_browseTree {
                return $icon;
        }
 
-
        /**
         * Wrap the plus/minus icon in a link
         *
-        * @param       string          HTML string to wrap, probably an image tag.
-        * @param       string          Command for 'PM' get var
-        * @return      string          Link-wrapped input string
+        * @param string $icon HTML string to wrap, probably an image tag.
+        * @param string $cmd Command for 'PM' get var
+        * @return boolean $isExpand Link-wrapped input string
         * @access private
         */
        function PMiconATagWrap($icon, $cmd, $isExpand = TRUE) {
                if ($this->thisScript) {
-                               // activate dynamic ajax-based tree
+                               // Activate dynamic ajax-based tree
                        $js = htmlspecialchars('Tree.load(\''.$cmd.'\', '.intval($isExpand).', this);');
                        return '<a class="pm" onclick="'.$js.'">'.$icon.'</a>';
                } else {
@@ -323,12 +327,11 @@ class webPageTree extends t3lib_browseTree {
                }
        }
 
-
        /**
         * Will create and return the HTML code for a browsable tree
         * Is based on the mounts found in the internal array ->MOUNTS (set in the constructor)
         *
-        * @return      string          HTML code for the browsable tree
+        * @return string HTML code for the browsable tree
         */
        function getBrowsableTree() {
 
@@ -340,7 +343,7 @@ class webPageTree extends t3lib_browseTree {
                $treeArr = array();
 
                        // Traverse mounts:
-               foreach($this->MOUNTS as $idx => $uid)  {
+               foreach ($this->MOUNTS as $idx => $uid)  {
 
                                // Set first:
                        $this->bank = $idx;
@@ -353,18 +356,18 @@ class webPageTree extends t3lib_browseTree {
 
                                // Set PM icon for root of mount:
                        $cmd = $this->bank . '_' . ($isOpen? '0_' : '1_') . $uid . '_' . $this->treeName;
-                               // only, if not for uid 0
+                               // Only, if not for uid 0
                        if ($uid) {
                                $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . ($isOpen ? 'minus' : 'plus' ) . 'only.gif') . ' alt="" />';
                                $firstHtml = $this->PMiconATagWrap($icon, $cmd, !$isOpen);
                        }
 
                                // Preparing rootRec for the mount
-                       if ($uid)   {
+                       if ($uid) {
                                $rootRec = $this->getRecord($uid);
                                $firstHtml.=$this->getIcon($rootRec);
                        } else {
-                               // Artificial record for the tree root, id=0
+                                       // Artificial record for the tree root, id=0
                                $rootRec = $this->getRootRecord($uid);
                                $firstHtml.=$this->getRootIcon($rootRec);
                        }
@@ -379,26 +382,28 @@ class webPageTree extends t3lib_browseTree {
                                        // If the mount is expanded, go down:
                                if ($isOpen) {
                                                // Set depth:
-                                       if ($this->addSelfId) { $this->ids[] = $uid; }
+                                       if ($this->addSelfId) {
+                                               $this->ids[] = $uid;
+                                       }
                                        $this->getTree($uid, 999, '', $rootRec['_SUBCSSCLASS']);
                                }
                                        // Add tree:
-                               $treeArr=array_merge($treeArr, $this->tree);
+                               $treeArr = array_merge($treeArr, $this->tree);
                        }
                }
                return $this->printTree($treeArr);
        }
 
-
        /**
         * Fetches the data for the tree
         *
-        * @param       integer         item id for which to select subitems (parent id)
-        * @param       integer         Max depth (recursivity limit)
-        * @param       string          ? (internal)
-        * @return      integer         The count of items on the level
+        * @param integer $uid Item id for which to select subitems (parent id)
+        * @param integer $depth Max depth (recursivity limit)
+        * @param string $blankLineCode ? (internal)
+        * @param string $subCSSclass
+        * @return integer The count of items on the level
         */
-       function getTree($uid, $depth=999, $blankLineCode='', $subCSSclass='') {
+       function getTree($uid, $depth = 999, $blankLineCode = '', $subCSSclass = '') {
 
                        // Buffer for id hierarchy is reset:
                $this->buffer_idH = array();
@@ -437,12 +442,12 @@ class webPageTree extends t3lib_browseTree {
                                asort($outOfMenuPagesTextIndex);
                                $label_shownAlphabetically = ' (alphabetic)';
                        }
-                       foreach($outOfMenuPagesTextIndex as $idx => $txt) {
+                       foreach ($outOfMenuPagesTextIndex as $idx => $txt) {
                                $outOfMenuPages_alphabetic[] = $outOfMenuPages[$idx];
                        }
 
                                // Merge:
-                       $outOfMenuPages_alphabetic[0]['_FIRST_NOT_IN_MENU']=TRUE;
+                       $outOfMenuPages_alphabetic[0]['_FIRST_NOT_IN_MENU'] = TRUE;
                        $allRows = array_merge($inMenuPages, $outOfMenuPages_alphabetic);
                } else {
                        $allRows = $inMenuPages;
@@ -453,16 +458,20 @@ class webPageTree extends t3lib_browseTree {
                        $a++;
 
                        $newID = $row['uid'];
-                       $this->tree[]=array();    // Reserve space.
+                               // Reserve space.
+                       $this->tree[] = array();
                        end($this->tree);
-                       $treeKey = key($this->tree);    // Get the key for this space
-                       $LN = ($a==$c) ? 'blank' : 'line';
+                               // Get the key for this space
+                       $treeKey = key($this->tree);
+                       $LN = ($a == $c) ? 'blank' : 'line';
 
                                // If records should be accumulated, do so
-                       if ($this->setRecs) { $this->recs[$row['uid']] = $row; }
+                       if ($this->setRecs) {
+                               $this->recs[$row['uid']] = $row;
+                       }
 
                                // Accumulate the id of the element in the internal arrays
-                       $this->ids[]=$idH[$row['uid']]['uid'] = $row['uid'];
+                       $this->ids[] = $idH[$row['uid']]['uid'] = $row['uid'];
                        $this->ids_hierarchy[$depth][] = $row['uid'];
 
                                // Make a recursive call to the next level
@@ -473,11 +482,15 @@ class webPageTree extends t3lib_browseTree {
                                        $blankLineCode.','.$LN,
                                        $row['_SUBCSSCLASS']
                                );
-                               if (count($this->buffer_idH)) { $idH[$row['uid']]['subrow']=$this->buffer_idH; }
-                               $exp = 1; // Set "did expand" flag
+                               if (count($this->buffer_idH)) {
+                                       $idH[$row['uid']]['subrow']=$this->buffer_idH;
+                               }
+                                       // Set "did expand" flag
+                               $exp = 1;
                        } else {
                                $nextCount = $this->getCount($newID);
-                               $exp = 0; // Clear "did expand" flag
+                                       // Clear "did expand" flag
+                               $exp = 0;
                        }
 
                                // Set HTML-icons, if any:
@@ -488,8 +501,8 @@ class webPageTree extends t3lib_browseTree {
                                        $HTML = '';
                                }
 
-                               $HTML.= $this->PMicon($row, $a, $c, $nextCount, $exp);
-                               $HTML.= $this->wrapStop($this->getIcon($row), $row);
+                               $HTML .= $this->PMicon($row, $a, $c, $nextCount, $exp);
+                               $HTML .= $this->wrapStop($this->getIcon($row), $row);
                        }
 
                                // Finally, add the row/HTML content to the ->tree array in the reserved key.
@@ -497,7 +510,7 @@ class webPageTree extends t3lib_browseTree {
                                'row'    => $row,
                                'HTML'   => $HTML,
                                'hasSub' => $nextCount && $this->expandNext($newID),
-                               'isFirst'=> $a==1,
+                               'isFirst'=> $a == 1,
                                'isLast' => FALSE,
                                'invertedDepth'=> $depth,
                                'blankLineCode'=> $blankLineCode,
@@ -505,7 +518,9 @@ class webPageTree extends t3lib_browseTree {
                        );
                }
 
-               if($a) { $this->tree[$treeKey]['isLast'] = TRUE; }
+               if ($a) {
+                       $this->tree[$treeKey]['isLast'] = TRUE;
+               }
 
                $this->getDataFree($res);
                $this->buffer_idH = $idH;
index bb26c13..db23768 100755 (executable)
@@ -8,5 +8,4 @@
 ./cli_dispatch.phpsh lowlevel_cleaner deleted -r -v 1 -s
 ./cli_dispatch.phpsh lowlevel_cleaner missing_relations -r -v 2 -s --refindex ignore
 ./cli_dispatch.phpsh lowlevel_cleaner cleanflexform -r -v 2 -s
-./cli_dispatch.phpsh lowlevel_cleaner rte_images -r -v 2 -s --refindex ignore
-
+./cli_dispatch.phpsh lowlevel_cleaner rte_images -r -v 2 -s --refindex ignore
\ No newline at end of file
index 2c74f48..db1e9b1 100755 (executable)
@@ -8,5 +8,4 @@
 ./cli_dispatch.phpsh lowlevel_cleaner deleted -r -v 1 -s --AUTOFIX --YES
 ./cli_dispatch.phpsh lowlevel_cleaner missing_relations -r -v 2 -s --AUTOFIX --YES --refindex update
 ./cli_dispatch.phpsh lowlevel_cleaner cleanflexform -r -v 2 -s --AUTOFIX --YES
-./cli_dispatch.phpsh lowlevel_cleaner rte_images -r -v 2 -s --refindex ignore
-
+./cli_dispatch.phpsh lowlevel_cleaner rte_images -r -v 2 -s --refindex ignore
\ No newline at end of file
index 9cc1f47..0a286ca 100755 (executable)
@@ -77,7 +77,7 @@ if (TYPO3_extTableDef_script) {
 }
 Typo3_Bootstrap::runExtTablesPostProcessingHooks();
 
-// TODO: Check if we really need the sprite manager on the command line
+       // TODO: Check if we really need the sprite manager on the command line
 Typo3_Bootstrap::initializeSpriteManager(TRUE);
 
 Typo3_Bootstrap::initializeBackendUser();
index 8757b07..65a4d12 100644 (file)
@@ -24,6 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * New database item menu
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  * XHTML compliant
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
-
-$BACK_PATH='';
+$BACK_PATH = '';
 require('init.php');
 require('template.php');
 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
 
-
 /**
  * Extension for the tree class that generates the tree of pages in the page-wizard mode
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -57,9 +54,9 @@ class localPageTree extends t3lib_pageTree {
        /**
         * Inserting uid-information in title-text for an icon
         *
-        * @param       string          Icon image
-        * @param       array           Item row
-        * @return      string          Wrapping icon image.
+        * @param string $icon Icon image
+        * @param array $row Item row
+        * @return string Wrapping icon image.
         */
        function wrapIcon($icon, $row) {
                return $this->addTagAttributes($icon, ' title="id='.htmlspecialchars($row['uid']).'"');
@@ -69,24 +66,18 @@ class localPageTree extends t3lib_pageTree {
         * Determines whether to expand a branch or not.
         * Here the branch is expanded if the current id matches the global id for the listing/new
         *
-        * @param       integer         The ID (page id) of the element
-        * @return      boolean         Returns TRUE if the IDs matches
+        * @param integer $id The ID (page id) of the element
+        * @return boolean Returns TRUE if the IDs matches
         */
        function expandNext($id) {
-               return $id==$GLOBALS['SOBE']->id ? 1 : 0;
+               return $id == $GLOBALS['SOBE']->id ? 1 : 0;
        }
 }
 
-
-
-
-
-
-
 /**
  * Script class for 'db_new'
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -113,12 +104,16 @@ class SC_db_new {
        var $R_URI;
 
                // Internal, static: GPvar
-       var $id;                        // see init()
-       var $returnUrl;         // Return url.
-       var $pagesOnly;         // pagesOnly flag.
+               // see init()
+       var $id;
+               // Return url.
+       var $returnUrl;
+               // pagesOnly flag.
+       var $pagesOnly;
 
                // Internal
-       var $perms_clause;      // see init()
+               // see init()
+       var $perms_clause;
 
        /**
         * Document template object
@@ -126,27 +121,29 @@ class SC_db_new {
         * @var mediumDoc
         */
        var $doc;
-       var $content;           // Accumulated HTML output
+               // Accumulated HTML output
+       var $content;
        var $tRows;
 
        /**
         * Constructor function for the class
         *
-        * @return      void
+        * @return void
         */
        function init() {
 
-                       // page-selection permission clause (reading)
+                       // Page-selection permission clause (reading)
                $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
 
-                       // this will hide records from display - it has nothing to do with user rights!!
+                       // This will hide records from display - it has nothing to do with user rights!!
                if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
                        if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
                                $this->perms_clause .= ' AND pages.uid NOT IN ('.$pidList.')';
                        }
                }
                        // Setting GPvars:
-               $this->id = intval(t3lib_div::_GP('id'));       // The page id to operate from
+                       // The page id to operate from
+               $this->id = intval(t3lib_div::_GP('id'));
                $this->returnUrl = t3lib_div::sanitizeLocalUrl(t3lib_div::_GP('returnUrl'));
                $this->pagesOnly = t3lib_div::_GP('pagesOnly');
 
@@ -154,14 +151,14 @@ class SC_db_new {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
                $this->doc->setModuleTemplate('templates/db_new.html');
-               $this->doc->JScode='';
+               $this->doc->JScode = '';
 
                        // Setting up the context sensitive menu:
                $this->doc->getContextMenuCode();
 
                        // Creating content
-               $this->content='';
-               $this->content.=$this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle'));
+               $this->content = '';
+               $this->content .= $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle'));
 
                        // Id a positive id is supplied, ask for the page record with permission information contained:
                if ($this->id > 0) {
@@ -200,7 +197,7 @@ class SC_db_new {
        /**
         * Main processing, creating the list of new record tables to select from
         *
-        * @return      void
+        * @return void
         */
        function main() {
 
@@ -224,7 +221,6 @@ class SC_db_new {
                                $this->newPagesAfter=0;
                        }
 
-
                                // Set header-HTML and return_url
                        if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
                                $iconImgTag = t3lib_iconWorks::getSpriteIconForRecord('pages', $this->pageinfo, array('title' => htmlspecialchars($this->pageinfo['_thePath'])));
@@ -239,16 +235,17 @@ class SC_db_new {
                        $this->R_URI = $this->returnUrl;
 
                                // GENERATE the HTML-output depending on mode (pagesOnly is the page wizard)
-                       if (!$this->pagesOnly)  {       // Regular new element:
+                               // Regular new element:
+                       if (!$this->pagesOnly) {
                                $this->regularNew();
-                       } elseif ($this->showNewRecLink('pages')) {     // Pages only wizard
+                       } elseif ($this->showNewRecLink('pages')) { // Pages only wizard
                                $this->pagesOnly();
                        }
 
                                // Add all the content to an output section
-                       $this->content.=$this->doc->section('', $this->code);
+                       $this->content .= $this->doc->section('', $this->code);
 
-                                                       // Setting up the buttons and markers for docheader
+                               // Setting up the buttons and markers for docheader
                        $docHeaderButtons = $this->getButtons();
                        $markers['CSH'] = $docHeaderButtons['csh'];
 
@@ -256,8 +253,8 @@ class SC_db_new {
 
                                // Build the <body> for the module
                        $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle'));
-                       $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
-                       $this->content.= $this->doc->endPage();
+                       $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
+                       $this->content .= $this->doc->endPage();
                        $this->content = $this->doc->insertStylesAndJS($this->content);
                }
        }
@@ -265,7 +262,7 @@ class SC_db_new {
        /**
         * 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() {
                $buttons = array(
@@ -276,8 +273,8 @@ class SC_db_new {
                        'record_list' => ''
                );
 
-
-               if (!$this->pagesOnly)  {       // Regular new element:
+                       // Regular new element:
+               if (!$this->pagesOnly) {
                                // New page
                        if ($this->showNewRecLink('pages')) {
                                $buttons['new_page'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:newPage', 1) . '">' .
@@ -286,7 +283,7 @@ class SC_db_new {
                        }
                                // CSH
                        $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH'], '', TRUE);
-               } elseif($this->showNewRecLink('pages')) {      // Pages only wizard
+               } elseif ($this->showNewRecLink('pages')) {     // Pages only wizard
                                // CSH
                        $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH'], '', TRUE);
                }
@@ -315,15 +312,13 @@ class SC_db_new {
                        );
                }
 
-
-
                return $buttons;
        }
 
        /**
         * Creates the position map for pages wizard
         *
-        * @return      void
+        * @return void
         */
        function pagesOnly() {
                $numberOfPages = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', 'pages', '1=1' . t3lib_BEfunc::deleteClause('pages'));
@@ -335,7 +330,7 @@ class SC_db_new {
                        /** @var t3lib_positionMap $positionMap */
                        $this->code .= $positionMap->positionTree($this->id, $this->pageinfo, $this->perms_clause, $this->R_URI);
                } else {
-                       // No pages yet, no need to prompt for position, redirect to page creation.
+                               // No pages yet, no need to prompt for position, redirect to page creation.
                        $javascript = t3lib_BEfunc::editOnClick('returnUrl=%2Ftypo3%2Fdb_new.php%3Fid%3D0%26pagesOnly%3D1&edit[pages][0]=new&returnNewPageId=1');
                        $startPos = strpos($javascript, 'href=\'') + 6;
                        $endPos = strpos($javascript, '\';');
@@ -348,7 +343,7 @@ class SC_db_new {
        /**
         * Create a regular new element (pages and records)
         *
-        * @return      void
+        * @return void
         */
        function regularNew() {
 
@@ -371,7 +366,7 @@ class SC_db_new {
 
                        // Enabled option for the position of a new page
                $this->newPagesSelectPosition = !empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageSelectPosition']);
-                       // pseudo-boolean (0/1) for backward compatibility
+                       // Pseudo-boolean (0/1) for backward compatibility
                $this->newPagesInto = (!empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageInside']) ? 1 : 0);
                $this->newPagesAfter = (!empty($pageTS['mod.']['wizards.']['newRecord.']['pages.']['show.']['pageAfter']) ? 1 : 0);
 
@@ -404,7 +399,7 @@ class SC_db_new {
                        );
                }
 
-                               // New pages AFTER this pages
+                       // New pages AFTER this pages
                if ($this->newPagesAfter
                        && $this->isTableAllowedForThisPage($this->pidInfo, 'pages')
                        && $GLOBALS['BE_USER']->check('tables_modify', 'pages')
@@ -417,7 +412,6 @@ class SC_db_new {
                                        'pages',
                                        -$this->id
                                );
-
                }
 
                        // New pages at selection position
@@ -464,7 +458,7 @@ class SC_db_new {
                if ($this->newContentInto) {
                        if (is_array($GLOBALS['TCA'])) {
                                $groupName = '';
-                               foreach($GLOBALS['TCA'] as $table => $v) {
+                               foreach ($GLOBALS['TCA'] as $table => $v) {
                                        $count = count($GLOBALS['TCA'][$table]);
                                        $counter = 1;
                                        if ($table != 'pages'
@@ -499,7 +493,7 @@ class SC_db_new {
                                                                // Half-line added:
                                                        $rowContent.= '<br />' . $halfLine;
                                                }  else {
-                                                       // get the title
+                                                               // Get the title
                                                        if ($v['ctrl']['readOnly'] || $v['ctrl']['hideTable'] || $v['ctrl']['is_static']) {
                                                                continue;
                                                        }
@@ -509,16 +503,16 @@ class SC_db_new {
                                                        $nameParts = explode('_', $table);
                                                        $thisTitle = '';
                                                        if ($nameParts[0] == 'tx' || $nameParts[0] == 'tt') {
-                                                               // try to extract extension name
+                                                                       // Try to extract extension name
                                                                if (substr($v['ctrl']['title'], 0, 8) == 'LLL:EXT:') {
                                                                        $_EXTKEY = substr($v['ctrl']['title'], 8);
                                                                        $_EXTKEY = substr($_EXTKEY, 0, strpos($_EXTKEY, '/'));
                                                                        if ($_EXTKEY != '') {
-                                                                               // first try to get localisation of extension title
+                                                                                       // First try to get localisation of extension title
                                                                                $temp = explode(':', substr($v['ctrl']['title'], 9 + strlen($_EXTKEY)));
                                                                                $langFile = $temp[0];
                                                                                $thisTitle = $GLOBALS['LANG']->sL('LLL:EXT:' . $_EXTKEY . '/' . $langFile . ':extension.title');
-                                                                               // if no localisation available, read title from ext_emconf.php
+                                                                                       // If no localisation available, read title from ext_emconf.php
                                                                                if (!$thisTitle && is_file(t3lib_extMgm::extPath($_EXTKEY) . 'ext_emconf.php')) {
                                                                                        include(t3lib_extMgm::extPath($_EXTKEY) . 'ext_emconf.php');
                                                                                        $thisTitle = $EM_CONF[$_EXTKEY]['title'];
@@ -547,7 +541,6 @@ class SC_db_new {
 
                                                }
 
-
                                                        // Compile table row:
                                                if ($table == 'tt_content') {
                                                        $startRows[] = '
@@ -565,7 +558,7 @@ class SC_db_new {
                        }
                }
 
-                       // user sort
+                       // User sort
                if (isset($pageTS['mod.']['wizards.']['newRecord.']['order'])) {
                        $this->newRecordSortList = t3lib_div::trimExplode(',', $pageTS['mod.']['wizards.']['newRecord.']['order'], TRUE);
                }
@@ -592,7 +585,7 @@ class SC_db_new {
                }
 
                        // end of tree
-               $finalRows[]='
+               $finalRows[] = '
                        <tr>
                                <td><img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/ol/stopper.gif', 'width="18" height="16"') . ' alt="" /></td>
                                <td></td>
@@ -601,7 +594,7 @@ class SC_db_new {
 
 
                        // Make table:
-               $this->code.='
+               $this->code .= '
                        <table border="0" cellpadding="0" cellspacing="0" id="typo3-newRecord">
                        ' . implode('', $finalRows) . '
                        </table>
@@ -609,31 +602,31 @@ class SC_db_new {
        }
 
        /**
-        * user array sort function used by regularNew
+        * User array sort function used by regularNew
         *
-        * @param       string          first array element for compare
-        * @param       string          first array element for compare
-        * @return      int                     -1 for lower, 0 for equal, 1 for greater
+        * @param string $a First array element for compare
+        * @param string $b First array element for compare
+        * @return integer -1 for lower, 0 for equal, 1 for greater
         */
        function sortNewRecordsByConfig($a, $b) {
                if (count($this->newRecordSortList)) {
                        if (in_array($a, $this->newRecordSortList) && in_array($b, $this->newRecordSortList)) {
-                                       // both are in the list, return relative to position in array
+                                       // Both are in the list, return relative to position in array
                                $sub = array_search($a, $this->newRecordSortList) - array_search($b, $this->newRecordSortList);
                                $ret = $sub < 0 ? -1 : $sub == 0 ? 0 : 1;
                        } elseif (in_array($a, $this->newRecordSortList)) {
-                                       // first element is in array, put to top
+                                       // First element is in array, put to top
                                $ret = -1;
                        } elseif (in_array($b, $this->newRecordSortList)) {
-                                       // second element is in array, put first to bottom
+                                       // Second element is in array, put first to bottom
                                $ret = 1;
                        } else {
-                                       // no element is in array, return alphabetic order
+                                       // No element is in array, return alphabetic order
                                $ret = strnatcasecmp($this->tRows[$a]['title'], $this->tRows[$b]['title']);
                }
                        return $ret;
                } else {
-                               // return alphabetic order
+                               // Return alphabetic order
                        return strnatcasecmp($this->tRows[$a]['title'], $this->tRows[$b]['title']);
                }
        }
@@ -641,7 +634,7 @@ class SC_db_new {
        /**
         * Ending page output and echo'ing content to browser.
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -650,11 +643,11 @@ class SC_db_new {
        /**
         * Links the string $code to a create-new form for a record in $table created on page $pid
         *
-        * @param       string          Link text
-        * @param       string          Table name (in which to create new record)
-        * @param       integer         PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative)
-        * @param       boolean         If $addContentTable is set, then a new contentTable record is created together with pages
-        * @return      string          The link.
+        * @param string $linkText Link text
+        * @param string $table Table name (in which to create new record)
+        * @param integer $pid PID value for the "&edit['.$table.']['.$pid.']=new" command (positive/negative)
+        * @param boolean $addContentTable If $addContentTable is set, then a new contentTable record is created together with pages
+        * @return string The link.
         */
        function linkWrap($linkText, $table, $pid, $addContentTable = FALSE) {
                $parameters = '&edit[' . $table . '][' . $pid . ']=new';
@@ -677,9 +670,9 @@ class SC_db_new {
        /**
         * Returns TRUE if the tablename $checkTable is allowed to be created on the page with record $pid_row
         *
-        * @param       array           Record for parent page.
-        * @param       string          Table name to check
-        * @return      boolean         Returns TRUE if the tablename $checkTable is allowed to be created on the page with record $pid_row
+        * @param array $pid_row Record for parent page.
+        * @param string $checkTable Table name to check
+        * @return boolean Returns TRUE if the tablename $checkTable is allowed to be created on the page with record $pid_row
         */
        function isTableAllowedForThisPage($pid_row, $checkTable) {
                if (!is_array($pid_row)) {
@@ -690,7 +683,7 @@ class SC_db_new {
                        }
                }
                        // be_users and be_groups may not be created anywhere but in the root.
-               if ($checkTable=='be_users' || $checkTable=='be_groups') {
+               if ($checkTable == 'be_users' || $checkTable == 'be_groups') {
                        return FALSE;
                }
                        // Checking doktype:
@@ -698,7 +691,8 @@ class SC_db_new {
                if (!$allowedTableList = $GLOBALS['PAGES_TYPES'][$doktype]['allowedTables']) {
                        $allowedTableList = $GLOBALS['PAGES_TYPES']['default']['allowedTables'];
                }
-               if (strstr($allowedTableList, '*') || t3lib_div::inList($allowedTableList, $checkTable))        {               // If all tables or the table is listed as a allowed type, return TRUE
+                       // If all tables or the table is listed as a allowed type, return TRUE
+               if (strstr($allowedTableList, '*') || t3lib_div::inList($allowedTableList, $checkTable)) {
                        return TRUE;
                }
        }
@@ -711,12 +705,12 @@ class SC_db_new {
         * If $table tablename is found in $allowedNewTables and $deniedNewTables, $deniedNewTables
         * has priority over $allowedNewTables.
         *
-        * @param       string          Table name to test if in allowedTables
-        * @param       array           Array of new tables that are allowed.
-        * @param       array           Array of new tables that are not allowed.
-        * @return      boolean         Returns TRUE if a link for creating new records should be displayed for $table
+        * @param string $table Table name to test if in allowedTables
+        * @param array $allowedNewTables Array of new tables that are allowed.
+        * @param array $deniedNewTables Array of new tables that are not allowed.
+        * @return boolean Returns TRUE if a link for creating new records should be displayed for $table
         */
-       function showNewRecLink($table, array $allowedNewTables=array(), array $deniedNewTables=array()) {
+       function showNewRecLink($table, array $allowedNewTables = array(), array $deniedNewTables = array()) {
                $allowedNewTables = ($allowedNewTables ? $allowedNewTables : $this->allowedNewTables);
                $deniedNewTables = ($deniedNewTables ? $deniedNewTables : $this->deniedNewTables);
                        // No deny/allow tables are set:
@@ -732,7 +726,7 @@ class SC_db_new {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_db_new');
 $SOBE->init();
 $SOBE->main();
index 87d3fa9..bedd375 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Dummy document - displays nothing but background color.
  *
  * Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
  * XHTML compliant content
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 require ('init.php');
 require ('template.php');
 
-
-
-
-
-
-
-
-
 /**
  * Script Class, creating the content for the dummy script - which is just blank output.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -57,27 +50,27 @@ class SC_dummy {
        /**
         * Create content for the dummy script - outputting a blank page.
         *
-        * @return      void
+        * @return void
         */
        function main() {
                        // Start page
-               $this->content.=$GLOBALS['TBE_TEMPLATE']->startPage('Dummy document');
+               $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage('Dummy document');
 
                        // End page:
-               $this->content.=$GLOBALS['TBE_TEMPLATE']->endPage();
+               $this->content .= $GLOBALS['TBE_TEMPLATE']->endPage();
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_dummy');
 $SOBE->main();
 $SOBE->printContent();
index 843de01..f8a5104 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Web>File: Editing documents
  *
  * Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj
  * XHTML compliant (except textarea field)
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 $GLOBALS['BACK_PATH'] = '';
 require('init.php');
 require('template.php');
 
-
 /**
  * Script Class for rendering the file editing screen
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_file_edit {
-       var $content;           // Module content accumulated.
+               // Module content accumulated.
+       var $content;
 
        var $title;
 
@@ -58,9 +59,12 @@ class SC_file_edit {
        var $doc;
 
                // Internal, static: GPvar
-       var $origTarget;                // Original input target
-       var $target;                    // The original target, but validated.
-       var $returnUrl;         // Return URL of list module.
+               // Original input target
+       var $origTarget;
+               // The original target, but validated.
+       var $target;
+               // Return URL of list module.
+       var $returnUrl;
 
        /**
         * the file that is being edited on
@@ -101,7 +105,7 @@ class SC_file_edit {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->setModuleTemplate('templates/file_edit.html');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->JScode=$this->doc->wrapScriptTags('
+               $this->doc->JScode = $this->doc->wrapScriptTags('
                        function backToList() { //
                                top.goToModule("file_list");
                        }
@@ -112,15 +116,15 @@ class SC_file_edit {
        /**
         * Main function, redering the actual content of the editing page
         *
-        * @return      void
+        * @return void
         */
        function main() {
-               //TODO: change locallang*.php to locallang*.xml
+                       //TODO: change locallang*.php to locallang*.xml
                $docHeaderButtons = $this->getButtons();
 
                $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
 
-                       // hook before compiling the output
+                       // Hook before compiling the output
                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
                        $preOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'];
                        if (is_array($preOutputProcessingHook)) {
@@ -144,11 +148,11 @@ class SC_file_edit {
                                // Read file content to edit:
                        $fileContent = $this->fileObject->getContents();
 
-                               // making the formfields
+                               // Making the formfields
                        $hValue = 'file_edit.php?target='.rawurlencode($this->origTarget).'&returnUrl='.rawurlencode($this->returnUrl);
 
                                // Edit textarea:
-                       $code.='
+                       $code .= '
                                <div id="c-edit">
                                        <textarea rows="30" name="file[editfile][0][data]" wrap="off"'.$this->doc->formWidthText(48, 'width:98%;height:80%', 'off').' class="fixed-font enable-tab">'.
                                        t3lib_div::formatForTextarea($fileContent).
@@ -160,7 +164,7 @@ class SC_file_edit {
 
                                // Make shortcut:
                        if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
-                               $this->MCONF['name']='xMOD_file_edit.php';
+                               $this->MCONF['name'] = 'xMOD_file_edit.php';
                                $docHeaderButtons['shortcut'] = $this->doc->makeShortcutIcon('target', '', $this->MCONF['name'], 1);
                        } else {
                                $docHeaderButtons['shortcut'] = '';
@@ -170,10 +174,10 @@ class SC_file_edit {
                }
 
                        // Ending of section and outputting editing form:
-               $pageContent.= $this->doc->sectionEnd();
-               $pageContent.=$code;
+               $pageContent .= $this->doc->sectionEnd();
+               $pageContent .= $code;
 
-                               // hook after compiling the output
+                       // Hook after compiling the output
                if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'])) {
                        $postOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'];
                        if (is_array($postOutputProcessingHook)) {
@@ -196,17 +200,15 @@ class SC_file_edit {
                        'CONTENT' => $pageContent,
                );
 
-               $this->content.= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
-
-
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
@@ -240,7 +242,7 @@ class SC_file_edit {
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_file_edit');
 $SOBE->init();
 $SOBE->main();
index f6f0b17..83093c7 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Web>File: Create new folders in the filemounts
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
 $BACK_PATH = '';
 require('init.php');
 require('template.php');
 
-
 /**
  * Script Class for the create-new script; Displays a form for creating up to 10 folders or one new text file
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 class SC_file_newfolder {
 
                // External, static:
-       var $folderNumber=10;
+       var $folderNumber = 10;
 
                // Internal, static:
        /**
@@ -58,30 +56,31 @@ class SC_file_newfolder {
         * @var smallDoc
         */
        var $doc;
-
-       var $title;                     // Name of the filemount
+               // Name of the filemount
+       var $title;
 
                // Internal, static (GPVar):
        var $number;
-       var $target;            // Set with the target path inputted in &target
+               // Set with the target path inputted in &target
+       var $target;
 
        /**
-        * the folder object which is  the target directory
+        * The folder object which is  the target directory
         *
         * @var t3lib_file_Folder $folderObject
         */
        protected $folderObject;
-       var $returnUrl;         // Return URL of list module.
+               // Return URL of list module.
+       var $returnUrl;
 
                // Internal, dynamic:
-       var $content;           // Accumulating content
-
-
+               // Accumulating content
+       var $content;
 
        /**
         * Constructor function for class
         *
-        * @return      void
+        * @return void
         */
        function init() {
                        // Initialize GPvars:
@@ -109,7 +108,7 @@ class SC_file_newfolder {
                $this->doc = t3lib_div::makeInstance('template');
                $this->doc->setModuleTemplate('templates/file_newfolder.html');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
-               $this->doc->JScode=$this->doc->wrapScriptTags('
+               $this->doc->JScode = $this->doc->wrapScriptTags('
                        var path = "' . $this->target . '";
 
                        function reload(a) {    //
@@ -129,18 +128,17 @@ class SC_file_newfolder {
        /**
         * Main function, rendering the main module content
         *
-        * @return      void
+        * @return void
         */
        function main() {
 
-                       // start content compilation
+                       // Start content compilation
                $this->content .= $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle'));
 
-
                        // Make page header:
-               $pageContent='';
-               $pageContent.=$this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle'));
-               $pageContent.=$this->doc->spacer(5);
+               $pageContent = '';
+               $pageContent .= $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.pagetitle'));
+               $pageContent .= $this->doc->spacer(5);
                $pageContent.=$this->doc->divider(5);
 
 
@@ -153,32 +151,32 @@ class SC_file_newfolder {
                                $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.number_of_folders') .
                                '</label>
                                <select name="number" id="number-of-new-folders" onchange="reload(this.options[this.selectedIndex].value);">';
-               for ($a=1;$a<=$this->folderNumber;$a++) {
+               for ($a = 1; $a <= $this->folderNumber; $a++) {
                        $code .= '<option value="' . $a . '"' .
                                        ($this->number == $a ? ' selected="selected"' : '') .
                                        '>' . $a . '</option>';
                }
-               $code.='
+               $code .= '
                                </select>
                        </div>
                        ';
 
                        // Making the number of new-folder boxes needed:
-               $code.='
+               $code .= '
                        <div id="c-createFolders">
                ';
-               for ($a=0;$a<$this->number;$a++) {
-                       $code.='
+               for ($a = 0; $a < $this->number; $a++) {
+                       $code .= '
                                        <input'.$this->doc->formWidth(20).' type="text" name="file[newfolder]['.$a.'][data]" onchange="changed=true;" />
                                        <input type="hidden" name="file[newfolder][' . $a . '][target]" value="' . htmlspecialchars($this->target) . '" /><br />
                                ';
                }
-               $code.='
+               $code .= '
                        </div>
                ';
 
                        // Making submit button for folder creation:
-               $code.='
+               $code .= '
                        <div id="c-submitFolders">
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.submit', 1) . '" />
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.cancel', 1) . '" onclick="backToList(); return false;" />
@@ -187,18 +185,16 @@ class SC_file_newfolder {
                        ';
 
                        // CSH:
-               $code.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_newfolder', $GLOBALS['BACK_PATH'], '<br />');
-
-               $pageContent.= $code;
-
+               $code .= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_newfolder', $GLOBALS['BACK_PATH'], '<br />');
 
+               $pageContent .= $code;
 
                        // Add spacer:
-               $pageContent.= $this->doc->spacer(10);
+               $pageContent .= $this->doc->spacer(10);
 
                        // Switching form tags:
-               $pageContent.= $this->doc->sectionEnd();
-               $pageContent.= '</form><form action="tce_file.php" method="post" name="editform2">';
+               $pageContent .= $this->doc->sectionEnd();
+               $pageContent .= '</form><form action="tce_file.php" method="post" name="editform2">';
 
                        // Create a list of allowed file extensions with the nice format "*.jpg, *.gif" etc.
                $fileExtList = array();
@@ -209,7 +205,7 @@ class SC_file_newfolder {
                        }
                }
                        // Add form fields for creation of a new, blank text file:
-               $code='
+               $code = '
                        <div id="c-newFile">
                                <p>[' . htmlspecialchars(implode(', ', $fileExtList)) . ']</p>
                                <input'.$this->doc->formWidth(20).' type="text" name="file[newfile][0][data]" onchange="changed=true;" />
@@ -218,7 +214,7 @@ class SC_file_newfolder {
                        ';
 
                        // Submit button for creation of a new file:
-               $code.='
+               $code .= '
                        <div id="c-submitFiles">
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.newfile_submit', 1) . '" />
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.cancel', 1) . '" onclick="backToList(); return false;" />
@@ -242,8 +238,8 @@ class SC_file_newfolder {
                        'PATH' => $this->title,
                );
 
-               $this->content.= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
+               $this->content .= $this->doc->endPage();
 
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
@@ -251,14 +247,14 @@ class SC_file_newfolder {
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_file_newfolder');
 $SOBE->init();
 $SOBE->main();
index 8a10733..ff867d7 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Web>File: Renaming files and folders
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
-
-
 $BACK_PATH = '';
 require('init.php');
 require('template.php');
 
-
-
 /**
  * Script Class for the rename-file form.
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -56,23 +53,25 @@ class SC_file_rename {
         * @var smallDoc
         */
        var $doc;
-       var $title;                     // Name of the filemount
+               // Name of the filemount
+       var $title;
 
                // Internal, static (GPVar):
-       var $target;            // Set with the target path inputted in &target
+               // Set with the target path inputted in &target
+       var $target;
 
        /**
-        * the file or folder object that should be renamed
+        * The file or folder object that should be renamed
         *
         * @var t3lib_file_ResourceInterface $fileOrFolderObject
         */
        protected $fileOrFolderObject;
-
-       var $returnUrl;         // Return URL of list module.
+               // Return URL of list module.
+       var $returnUrl;
 
                // Internal, dynamic:
-       var $content;           // Accumulating content
-
+               // Accumulating content
+       var $content;
 
        /**
         * Constructor function for class
@@ -95,7 +94,7 @@ class SC_file_rename {
                        throw new RuntimeException($title . ': ' . $message, 1294586844);
                }
 
-                       // if a folder should be renamed, AND the returnURL should go to the old directory name, the redirect is forced
+                       // If a folder should be renamed, AND the returnURL should go to the old directory name, the redirect is forced
                        // so the redirect will NOT end in a error message
                        // this case only happens if you select the folder itself in the foldertree and then use the clickmenu to
                        // rename the folder
@@ -107,8 +106,6 @@ class SC_file_rename {
                        }
                }
 
-
-
                        // Setting icon and title
                $icon = t3lib_iconWorks::getSpriteIcon('apps-filetree-root');
                $this->title = $icon . htmlspecialchars($this->fileOrFolderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileOrFolderObject->getIdentifier());
@@ -127,11 +124,10 @@ class SC_file_rename {
        /**
         * Main function, rendering the content of the rename form
         *
-        * @return      void
+        * @return void
         */
        function main() {
-               //TODO: change locallang*.php to locallang*.xml
-
+                       //TODO: change locallang*.php to locallang*.xml
                        // Make page header:
                $this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.pagetitle'));
 
@@ -156,7 +152,7 @@ class SC_file_rename {
                ';
 
                        // Making submit button:
-               $code.='
+               $code .= '
                        <div id="c-submit">
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.submit', 1) . '" />
                                <input type="submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.cancel', 1) . '" onclick="backToList(); return false;" />
@@ -180,22 +176,22 @@ class SC_file_rename {
                        'PATH' => $this->title,
                );
 
-               $this->content.= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
-               $this->content.= $this->doc->endPage();
+               $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
+               $this->content .= $this->doc->endPage();
                $this->content = $this->doc->insertStylesAndJS($this->content);
        }
 
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_file_rename');
 $SOBE->init();
 $SOBE->main();
index 29eb855..8e1ec9d 100644 (file)
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * Web>File: Upload of files
  *
  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
 
 $BACK_PATH = '';
@@ -37,11 +38,10 @@ require('init.php');
 require('template.php');
 $LANG->includeLLFile('EXT:lang/locallang_misc.xml');
 
-
 /**
  * Script Class for display up to 10 upload fields
  *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
@@ -54,18 +54,21 @@ class SC_file_upload {
         * @var smallDoc
         */
        var $doc;
-
-       var $title;                     // Name of the filemount
+               // Name of the filemount
+       var $title;
 
                // Internal, static (GPVar):
-       var $target;            // Set with the target path inputted in &target
-       var $returnUrl;         // Return URL of list module.
+               // Set with the target path inputted in &target
+       var $target;
+               // Return URL of list module.
+       var $returnUrl;
 
                // Internal, dynamic:
-       var $content;           // Accumulating content
+               // Accumulating content
+       var $content;
 
        /**
-        * the folder object which is the target directory for the upload
+        * The folder object which is the target directory for the upload
         *
         * @var t3lib_file_Folder $folderObject
         */
@@ -84,7 +87,7 @@ class SC_file_upload {
                        $this->returnUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . t3lib_extMgm::extRelPath('filelist') . 'mod1/file_list.php?id=' . rawurlencode($this->target);
                }
 
-                       // create the folder object
+                       // Create the folder object
                if ($this->target) {
                        $this->folderObject = t3lib_file_Factory::getInstance()->retrieveFileOrFolderObject($this->target);
                }
@@ -108,11 +111,10 @@ class SC_file_upload {
                $this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
        }
 
-
        /**
         * Main function, rendering the upload file form fields
         *
-        * @return      void
+        * @return void
         */
        function main() {
                        // Make page header:
@@ -124,7 +126,6 @@ class SC_file_upload {
                        $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.pagetitle')) .
                        $this->doc->section('', $form);
 
-
                        // Header Buttons
                $docHeaderButtons = array(
                        'csh' => t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH'])
@@ -142,7 +143,6 @@ class SC_file_upload {
                $this->content  = $this->doc->insertStylesAndJS($this->content);
        }
 
-
        /**
         * This function renders the upload form
         *
@@ -186,18 +186,17 @@ class SC_file_upload {
                return $content;
        }
 
-
        /**
         * Outputting the accumulated content to screen
         *
-        * @return      void
+        * @return void
         */
        function printContent() {
                echo $this->content;
        }
 }
 
-// Make instance:
+       // Make instance:
 $SOBE = t3lib_div::makeInstance('SC_file_upload');
 $SOBE->init();
 $SOBE->main();