[TYPO3-core] RFC #8264: "+" (plus) signs are replaced by spaces

Oliver Klee typo3-german-02 at oliverklee.de
Sat Jun 7 19:20:13 CEST 2008


Hi Tobias,

please take the new coding guidelines into account ... stuff like this:

Index: typo3/sysext/t3editor/ext_tables.php
===================================================================
--- typo3/sysext/t3editor/ext_tables.php	(revision 0)
+++ typo3/sysext/t3editor/ext_tables.php	(revision 0)
@@ -0,0 +1,12 @@
+<?php
+
+if (!defined('TYPO3_MODE'))     die('Access denied.');

Please put the body of the "if" on a separate line and use {} around it.

+if(TYPO3_MODE == 'BE') {

Please add a space after the if.

+        $t3editorPath = t3lib_extMgm::extPath('t3editor');
+
+                // register AJAX calls
+ 
$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['tx_t3editor::saveCode']   = 
$t3editorPath.'class.tx_t3editor.php:tx_t3editor->saveCode';

Please line up the comment with the code. Please use spaces around the 
concatenation dots.

Index: typo3/sysext/t3editor/class.tx_t3editor.php
===================================================================

  	public $isEnabled;
-
-
+	
  	/**

Please delete all trailing whitespace.

-	public function getCodeEditor($name, $class='', $content='', 
$additionalParams='', $alt='') {
+	public function getCodeEditor($name, $class='', $content='', 
$additionalParams='', $alt='', $hiddenfields = array()) {

You can use type hinting for $hiddenFields.

Please use spaces around the = .

+			if (is_array($hiddenfields) && count($hiddenfields)) {
+				foreach ($hiddenfields as $name => $value) {
+					$code.= '<input type="hidden" name="' . $name . '" value="' . 
$value . '" />';
+				}
+			}

If you use type hinting, you don't need the is_array here any more.

Please use spaces around the .= .

'width:98%;height:60%', 'off'),
-						'Template: '.htmlspecialchars($parameters['tplRow']['title']).': 
Constants' // title
+						'Template: '.htmlspecialchars($parameters['tplRow']['title']).': 
Constants', // title
+						array( // hidden fields
+							'pageId' => intval($pObj->pObj->id),
+							't3editor_savetype' => 'tx_tstemplateinfo',
+						)

Please don't use end-line comments.

+	/**
+	 * Save the content from t3editor retrieved via Ajax
+	 *
+	 * new Ajax.Request('/dev/t3e/dummy/typo3/ajax.php', 
{parameters:{ajaxID:'tx_t3editor::saveCode',t3editor_savetype:'tstemplateinfo'}});
+	 *
+	 * @param array	params	Parameters (not used yet)
+	 * @param TYPO3AJAX ajaxObj	AjaxObject to handle response
+	 */
+	public function saveCode($params, $ajaxObj) {

Please make sure that all lines are shorter than 80 characters.

Please use type hinting for the function parameters.


Regards,


Oliver


More information about the TYPO3-team-core mailing list