euromark 12 years ago
parent
commit
f19ef6f3ba

+ 3 - 3
Console/Command/PhpTagShell.php

@@ -16,8 +16,8 @@ class PhpTagShell extends AppShell {
 	public $autoCorrectAll = false;
 	# each report: [0] => found, [1] => corrected
 	public $report = array(
-		'leading'=>array(0, 0),
-		'trailing'=>array(0, 0)
+		'leading' => array(0, 0),
+		'trailing' => array(0, 0)
 	);
 
 	/**
@@ -85,7 +85,7 @@ class PhpTagShell extends AppShell {
 				}
 
 				if ($action === 'q') {
-					die('Abort... Done');
+					$this->error('Abort... Done');
 				} elseif ($action === 'y') {
 					$res = $c;
 					if (in_array('leading', $error)) {

+ 22 - 0
Controller/MyController.php

@@ -20,6 +20,9 @@ class MyController extends Controller {
 
 	/**
 	 * Add headers for IE8 etc to fix caching issues in those stupid browsers
+	 *
+	 * @overwrite to fix IE cacheing issues
+	 * @return void
 	 * 2012-12-25 ms
 	 */
 	public function disableCache() {
@@ -37,6 +40,7 @@ class MyController extends Controller {
 	 * If you use another setup (like localhost/app/webroot) where you use multiple htaccess files or rewrite
 	 * rules you need to raise it accordingly.
 	 *
+	 * @overwrite to fix encoding issues on Apache with mod_rewrite
 	 * @param string|array $url A string or array-based URL
 	 * @param integer $status Optional HTTP status code (eg: 404)
 	 * @param boolean $exit If true, exit() will be called after the redirect
@@ -59,6 +63,24 @@ class MyController extends Controller {
 	}
 
 	/**
+	 * Handles automatic pagination of model records.
+	 *
+	 * @overwrite to support defaults like limit, querystring settings
+	 * @param Model|string $object Model to paginate (e.g: model instance, or 'Model', or 'Model.InnerModel')
+	 * @param string|array $scope Conditions to use while paginating
+	 * @param array $whitelist List of allowed options for paging
+	 * @return array Model query results
+	 */
+	public function paginate($object = null, $scope = array(), $whitelist = array()) {
+		if ($defaultSettings = (array)Configure::read('Paginator')) {
+			$this->paginate += $defaultSettings;
+		}
+		return parent::paginate($object, $scope, $whitelist);
+	}
+
+	/**
+	 * Additionally encode string to match the htaccess files processing it.
+	 *
 	 * @param mixed Url piece
 	 * @param int $run How many times does the value have to be escaped
 	 * @return mixed Escaped piece

+ 6 - 8
Model/MyModel.php

@@ -953,16 +953,18 @@ class MyModel extends Model {
 
 		foreach ($data as $key => $value) {
 			$fieldName = $key;
-			$fieldValue = $value; // equals: $this->data[$this->alias][$fieldName]
+			$fieldValue = $value;
+			break;
 		}
 
-		$conditions = array($this->alias . '.' . $fieldName => $fieldValue, // Model.field => $this->data['Model']['field']
+		$conditions = array(
+			$this->alias . '.' . $fieldName => $fieldValue,
 			$this->alias . '.id !=' => $id);
 
 		# careful, if fields is not manually filled, the options will be the second param!!! big problem...
 		$fields = (array)$fields;
 		if (!array_key_exists('allowEmpty', $fields)) {
-			foreach ((array)$fields as $dependingField) {
+			foreach ($fields as $dependingField) {
 				if (isset($this->data[$this->alias][$dependingField])) { // add ONLY if some content is transfered (check on that first!)
 					$conditions[$this->alias . '.' . $dependingField] = $this->data[$this->alias][$dependingField];
 
@@ -984,11 +986,7 @@ class MyModel extends Model {
 			$this->recursive = 0;
 		}
 		$res = $this->find('first', array('fields' => array($this->alias . '.id'), 'conditions' => $conditions));
-		if (!empty($res)) {
-			return false;
-		}
-
-		return true;
+		return empty($res);
 	}
 
 	/**

+ 18 - 18
Test/Case/Lib/Utility/TimeLibTest.php

@@ -108,7 +108,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testParseLocalizedDate() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$ret = TimeLib::parseLocalizedDate('15-Feb-2009', 'j-M-Y', 'start');
 		//$this->debug($ret);
@@ -144,7 +144,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testPeriod() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$values = array(
 			array(__('Today'), array(date(FORMAT_DB_DATETIME, mktime(0, 0, 0, date('m'), date('d'), date('Y'))), date(FORMAT_DB_DATETIME, mktime(23, 59, 59, date('m'), date('d'), date('Y'))))),
 
@@ -168,7 +168,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testPeriodAsSql() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$values = array(
 			array(__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
 			array(__('Yesterday').' '.__('until').' '.__('Today'), "(Model.field >= '".date(FORMAT_DB_DATE, time()-DAY)." 00:00:00') AND (Model.field <= '".date(FORMAT_DB_DATE)." 23:59:59')"),
@@ -186,7 +186,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testDifference() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$values = array(
 			array('2010-02-23 11:11:11', '2010-02-23 11:12:01', 50),
 			array('2010-02-23 11:11:11', '2010-02-24 11:12:01', DAY+50)
@@ -199,7 +199,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testAgeBounds() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$values = array(
 			array(20, 20, array('min'=>'1990-07-07', 'max'=>'1991-07-06')),
 			array(10, 30, array('min'=>'1980-07-07', 'max'=>'2001-07-06')),
@@ -219,7 +219,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testAgeByYear() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		# year only
 		$is = TimeLib::ageByYear(2000);
@@ -246,7 +246,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testDaysInMonth() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$ret = TimeLib::daysInMonth('2004', '3');
 		$this->assertEquals($ret, 31);
@@ -262,7 +262,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testDay() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$ret = TimeLib::day('0');
 		$this->assertEquals(__('Sunday'), $ret);
 
@@ -283,7 +283,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testMonth() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$ret = TimeLib::month('11');
 		$this->assertEquals(__('November'), $ret);
 
@@ -298,20 +298,20 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testDays() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$ret = TimeLib::days();
 		$this->assertTrue(count($ret) === 7);
 	}
 
 	public function testMonths() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$ret = TimeLib::months();
 		$this->assertTrue(count($ret) === 12);
 	}
 
 
 	public function testRelLengthOfTime() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$ret = TimeLib::relLengthOfTime('1990-11-20');
 		//pr($ret);
@@ -321,7 +321,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testLengthOfTime() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$ret = TimeLib::lengthOfTime(60);
 		//pr($ret);
@@ -335,7 +335,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testFuzzyFromOffset() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$ret = TimeLib::fuzzyFromOffset(MONTH);
 		//pr($ret);
@@ -359,7 +359,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testCweekDay() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		# wednesday
 		$ret = TimeLib::cweekDay(51, 2011, 2);
@@ -370,7 +370,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testCweeks() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$ret = TimeLib::cweeks('2004');
 		$this->assertEquals($ret, 53);
 
@@ -390,7 +390,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testCweekBeginning() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$values = array(
 			'2001' => 978303600, # Mon 01.01.2001, 00:00
 			'2006' => 1136156400, # Mon 02.01.2006, 00:00
@@ -423,7 +423,7 @@ class TimeLibTest extends MyCakeTestCase {
 	}
 
 	public function testCweekEnding() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 
 		$values = array(
 			'2001' => 1009753199, # Sun 30.12.2001, 23:59:59

+ 20 - 22
Test/Case/Model/MyModelTest.php

@@ -70,7 +70,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * test auto inc value of the current table
 	 */
 	public function testGetNextAutoIncrement() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$is = $this->App->getNextAutoIncrement();
 		$this->out(returns($is));
 
@@ -188,7 +188,7 @@ class MyModelTest extends MyCakeTestCase {
 	}
 
 	public function testValidateIdentical() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$this->App->data = array($this->App->alias=>array('y'=>'efg'));
 		$is = $this->App->validateIdentical(array('x'=>'efg'), 'y');
 		$this->assertTrue($is);
@@ -208,7 +208,7 @@ class MyModelTest extends MyCakeTestCase {
 
 
 	public function testValidateKey() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		//$this->App->data = array($this->App->alias=>array('y'=>'efg'));
 		$testModel = new AppTestModel();
 
@@ -255,7 +255,7 @@ class MyModelTest extends MyCakeTestCase {
 
 
 	public function testValidateEnum() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		//$this->App->data = array($this->App->alias=>array('y'=>'efg'));
 		$testModel = new AppTestModel();
 		$is = $testModel->validateEnum(array('x'=>'1'), true);
@@ -272,7 +272,7 @@ class MyModelTest extends MyCakeTestCase {
 	}
 
 	public function testGuaranteeFields() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$res = $this->App->guaranteeFields(array());
 		//debug($res);
 		$this->assertTrue(empty($res));
@@ -289,7 +289,7 @@ class MyModelTest extends MyCakeTestCase {
 	}
 
 	public function testSet() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array($this->modelName=>array('x'=>'hey'), 'OtherModel'=>array('y'=>''));
 		$this->App->data = array();
 
@@ -305,7 +305,7 @@ class MyModelTest extends MyCakeTestCase {
 	}
 
 	public function testValidateWithGuaranteeFields() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array($this->modelName=>array('x'=>'hey'), 'OtherModel'=>array('y'=>''));
 
 		$data = $this->App->guaranteeFields(array('x', 'z'), $data);
@@ -321,7 +321,7 @@ class MyModelTest extends MyCakeTestCase {
 
 	// not really working?
 	public function testBlacklist() {
-		$this->out($this->_header(__FUNCTION__));
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array($this->modelName=>array('name'=>'e', 'x'=>'hey'), 'OtherModel'=>array('y'=>''));
 
 		$schema = $this->App->schema();
@@ -337,9 +337,8 @@ class MyModelTest extends MyCakeTestCase {
 		//$this->assertEquals($data, array($this->modelName=>array('x'=>'hey', 'z'=>''), 'OtherModel'=>array('y'=>'')));
 	}
 
-
-	public function testAppInvalidate() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testInvalidate() {
+		$this->out($this->_header(__FUNCTION__), true);
 		$this->App->create();
 		$this->App->invalidate('fieldx', __('e %s f', 33));
 		$res = $this->App->validationErrors;
@@ -378,8 +377,8 @@ class MyModelTest extends MyCakeTestCase {
 
 	}
 
-	public function testAppValidateDate() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testValidateDate() {
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array('field' => '2010-01-22');
 		$res = $this->App->validateDate($data);
 		//debug($res);
@@ -457,8 +456,8 @@ class MyModelTest extends MyCakeTestCase {
 		$this->assertTrue($res);
 	}
 
-	public function testAppValidateDatetime() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testValidateDatetime() {
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array('field' => '2010-01-22 11:11:11');
 		$res = $this->App->validateDatetime($data);
 		//debug($res);
@@ -528,8 +527,8 @@ class MyModelTest extends MyCakeTestCase {
 
 	}
 
-	public function testAppValidateTime() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testValidateTime() {
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array('field' => '11:21:11');
 		$res = $this->App->validateTime($data);
 		//debug($res);
@@ -553,8 +552,8 @@ class MyModelTest extends MyCakeTestCase {
 		$this->assertFalse($res);
 	}
 
-	public function testAppValidateUrl() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testValidateUrl() {
+		$this->out($this->_header(__FUNCTION__), true);
 		$data = array('field' => 'www.dereuromark.de');
 		$res = $this->App->validateUrl($data, array('allowEmpty'=>true));
 		$this->assertTrue($res);
@@ -613,8 +612,8 @@ class MyModelTest extends MyCakeTestCase {
 		$this->assertTrue($res);
 	}
 
-	public function testAppValidateUnique() {
-		$this->out($this->_header(__FUNCTION__));
+	public function testValidateUnique() {
+		$this->out($this->_header(__FUNCTION__), true);
 		//die(returns($this->Model->schema()));
 		$this->Model->validate['title'] = array(
 			'validateUnique' => array(
@@ -636,7 +635,6 @@ class MyModelTest extends MyCakeTestCase {
 		$res = $this->Model->save($data);
 		$this->assertFalse($res);
 
-
 		$this->Model->validate['title'] = array(
 			'validateUnique' => array(
 				'rule' => array('validateUnique', array('published')),

+ 26 - 0
Test/Case/View/Helper/CommonHelperTest.php

@@ -66,6 +66,32 @@ class CommonHelperTest extends MyCakeTestCase {
 
 	}
 
+	public function testAsp() {
+		$res = $this->Common->asp('House', 2, true);
+		$expected = __('Houses');
+		$this->assertEquals($expected, $res);
+
+		$res = $this->Common->asp('House', 1, true);
+		$expected = __('House');
+		$this->assertEquals($expected, $res);
+	}
+
+	public function testSp() {
+		$res = $this->Common->sp('House', 'Houses', 0, true);
+		$expected = __('Houses');
+		$this->assertEquals($expected, $res);
+
+		$res = $this->Common->sp('House', 'Houses', 2, true);
+		$this->assertEquals($expected, $res);
+
+		$res = $this->Common->sp('House', 'Houses', 1, true);
+		$expected = __('House');
+		$this->assertEquals($expected, $res);
+
+		$res = $this->Common->sp('House', 'Houses', 1);
+		$expected = 'House';
+		$this->assertEquals($expected, $res);
+	}
 
 /**
  * tearDown method

+ 50 - 112
View/Helper/CommonHelper.php

@@ -12,9 +12,6 @@ class CommonHelper extends AppHelper {
 		'Tools.Jquery' //Used by showDebug
 	);
 
-
-/*** Layout Stuff ***/
-
 	/**
 	 * Convenience function for clean ROBOTS allowance
 	 *
@@ -75,6 +72,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
+	 * Convenience method to output meta keywords
+	 *
 	 * @param string|array $keywords
 	 * @param string $language (iso2: de, en-us, ...)
 	 * @param bool $escape
@@ -99,8 +98,10 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * convinience function for "canonical" SEO links
+	 * Convenience function for "canonical" SEO links
 	 *
+	 * @param mixed $url
+	 * @param boolean $full
 	 * @return string $htmlMarkup
 	 * 2010-03-03 ms
 	 */
@@ -111,7 +112,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * convinience function for "alternate" SEO links
+	 * Convenience function for "alternate" SEO links
+	 *
 	 * @param mixed $url
 	 * @param mixed $lang (lang(iso2) or array of langs)
 	 * lang: language (in ISO 6391-1 format) + optionally the region (in ISO 3166-1 Alpha 2 format)
@@ -143,7 +145,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * convinience function for META Tags
+	 * Convenience function for META Tags
+	 *
 	 * @param STRING type
 	 * @param STRING content
 	 * @return string $htmlMarkup
@@ -162,9 +165,9 @@ class CommonHelper extends AppHelper {
 		return sprintf($tags['meta'], $title, $this->url($url));
 	}
 
-
 	/**
-	 * convinience function for META Tags
+	 * Convenience function for META Tags
+	 *
 	 * @param STRING type
 	 * @param STRING content
 	 * @return string $htmlMarkup
@@ -224,7 +227,6 @@ class CommonHelper extends AppHelper {
 		return $this->Html->script('/js.php?'.$string, $options);
 	}
 
-
 	/**
 	 * special css tag generator with the option to add '?...' to the link (for caching prevention)
 	 * IN USAGE
@@ -323,10 +325,10 @@ class CommonHelper extends AppHelper {
 		return $args[($i++ % count($args))];
 	}
 
-
 	/**
-	 * check if session works due to allowed cookies
+	 * Check if session works due to allowed cookies
 	 *
+	 * @param boolean Success
 	 * 2009-06-29 ms
 	 */
 	public function sessionCheck() {
@@ -340,36 +342,39 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * display warning if cookies are disallowed (and session won't work)
+	 * Display warning if cookies are disallowed (and session won't work)
+	 *
+	 * @return string HTML
 	 * 2009-06-29 ms
 	 */
 	public function sessionCheckAlert() {
-		if (!$this->sessionCheck()) {
-			return '<div class="cookieWarning">'.__('Please enable cookies').'</div>';
+		if ($this->sessionCheck()) {
+			return '';
 		}
-		return '';
+		return '<div class="cookieWarning">'.__('Please enable cookies').'</div>';
 	}
 
 	/**
-	 * //TODO: move boostrap
-	 * auto-pluralizing a word using the Inflection class
-	 * @param string $s = the string to be pl.
-	 * @param int $c = the count
-	 * @return $string "member" or "members" OR "Mitglied"/"Mitglieder" if autoTranslate TRUE
+	 * Auto-pluralizing a word using the Inflection class
+	 * //TODO: move to lib or bootstrap
+	 *
+	 * @param string $singular The string to be pl.
+	 * @param int $count
+	 * @return string "member" or "members" OR "Mitglied"/"Mitglieder" if autoTranslate TRUE
 	 * 2009-07-23 ms
 	 */
-	public function asp($s, $c, $autoTranslate = false) {
-		if ((int)$c !== 1) {
-			$p = Inflector::pluralize($s);
+	public function asp($singular, $count, $autoTranslate = false) {
+		if ((int)$count !== 1) {
+			$pural = Inflector::pluralize($singular);
 		} else {
-			$p = null; # no pluralization necessary
+			$pural = null; # no pluralization necessary
 		}
-		return $this->sp($s, $p, $c, $autoTranslate);
+		return $this->sp($singular, $pural, $count, $autoTranslate);
 	}
 
 	/**
-	 * //TODO: move boostrap
-	 * manual pluralizing a word using the Inflection class
+	 * Manual pluralizing a word using the Inflection class
+	 * //TODO: move to lib or bootstrap
 	 *
 	 * @param string $singular
 	 * @param string $plural
@@ -377,27 +382,30 @@ class CommonHelper extends AppHelper {
 	 * @return string $result
 	 * 2009-07-23 ms
 	 */
-	public function sp($s, $p, $c, $autoTranslate = false) {
-		if ((int)$c !== 1) {
-			$ret = $p;
+	public function sp($singular, $plural, $count, $autoTranslate = false) {
+		if ((int)$count !== 1) {
+			$result = $plural;
 		} else {
-				$ret = $s;
+			$result = $singular;
 		}
 
 		if ($autoTranslate) {
-			$ret = __($ret);
+			$result = __($result);
 		}
-		return $ret;
+		return $result;
 	}
 
 	/**
-	 * Show FlashMessages
-	 * @param boolean unsorted true/false [default:FALSE = sorted by priority]
+	 * Show flash messages
+	 *
 	 * TODO: export div wrapping method (for static messaging on a page)
 	 * TODO: sorting
+	 *
+	 * @param boolean unsorted true/false [default:FALSE = sorted by priority]
+	 * @return string HTML
 	 * 2010-11-22 ms
 	 */
-	public function flash($unsorted = false, $backwardsComp = true) {
+	public function flash($unsorted = false) {
 		// Get the messages from the session
 		$messages = (array)$this->Session->read('messages');
 		$cMessages = (array)Configure::read('messages');
@@ -432,7 +440,10 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * output a single flashMessage
+	 * Output a single flashMessage
+	 *
+	 * @param string $message
+	 * @return string HTML
 	 * 2010-11-22 ms
 	 */
 	public function flashMessage($msg, $type = 'info', $escape = true) {
@@ -453,7 +464,7 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
-	 * add a message on the fly
+	 * Add a message on the fly
 	 *
 	 * @param string $msg
 	 * @param string $class
@@ -465,8 +476,8 @@ class CommonHelper extends AppHelper {
 	}
 
 	/**
+	 * Escape text with some more automagic
 	 * TODO: move into TextExt?
-	 * escape text with some more automagic
 	 *
 	 * @param string $text
 	 * @param array $options
@@ -509,8 +520,6 @@ class CommonHelper extends AppHelper {
 		return $text;
 	}
 
-
-
 	/**
 	 * prevents site being opened/included by others/websites inside frames
 	 * 2009-01-08 ms
@@ -743,75 +752,4 @@ piwikTracker.enableLinkTracking();
 		return $ret;
 	}
 
-	/**
-	 * @deprecated
-	 */
-	public function showDebug() {
-		$output = '';
-		$groupout = '';
-		foreach (debugTab::$content as $group => $debug) {
-			if (is_int($group)) {
-				$output .= '<div class="common-debug">';
-				$output .= "<span style=\"cursor:pointer\" onclick=\"$(this).parent().children('pre').slideToggle('fast');\"><strong>" . h($debug['file']) . '</strong>';
-				$output .= ' (line <strong>' . $debug['line'] . '</strong>)</span>';
-				if ($debug['display'])
-					$debug['display'] = 'block';
-				else
-					$debug['display'] = 'none';
-				$output .= "\n<pre style=\"display:" . $debug['display'] . "\" class=\"cake-debug\">\n";
-				$output .= h($debug['debug']);
-				$output .= "\n</pre>\n</div>";
-			}
-		}
-		foreach (debugTab::$groups as $group => $data) {
-			$groupout .= '<div class="common-debug">';
-			$groupout .= "<span style=\"cursor:pointer\" onclick=\"$(this).parent().children('div').slideToggle('fast');\"><strong>" . h($group) . '</strong></span>';
-			foreach ($data as $debug) {
-				$groupout .= "<div style=\"display:none\"><br/><span style=\"cursor:pointer\" onclick=\"$(this).parent().children('pre').slideToggle('fast');\"><strong>" . h($debug['file']) . '</strong></span>';
-				$groupout .= ' (line <strong>' . h($debug['line']) . '</strong>)</span>';
-				if ($debug['display'])
-					$debug['display'] = 'block';
-				else
-					$debug['display'] = 'none';
-				$groupout .= "\n<pre style=\"display:" . $debug['display'] . "\" class=\"cake-debug\">\n";
-				$groupout .= h($debug['debug']);
-				$groupout .= "\n</pre>\n</div>";
-			}
-			$groupout .= "\n</div>";
-		}
-		return $groupout . $output;
-	}
-
-	/**
-	 * Creates an HTML link.
-	 *
-	 * If $url starts with "http://" this is treated as an external link. Else,
-	 * it is treated as a path to controller/action and parsed with the
-	 * HtmlHelper::url() method.
-	 *
-	 * If the $url is empty, $title is used instead.
-	 *
-	 * @param string $title The content to be wrapped by <a> tags.
-	 * @param mixed $url Cake-relative URL or array of URL parameters, or external URL (starts with http://)
-	 * @param array $htmlAttributes Array of HTML attributes.
-	 * @param string $confirmMessage JavaScript confirmation message.
-	 * @param boolean $escapeTitle	Whether or not $title should be HTML escaped.
-	 * @return string	An <a /> element.
-	 * @deprecated?
-	 * // core-hack! $rel = null | !!!!!!!!! Somehow causes trouble with routing functionality of this helper function... careful!
-	 */
-	public function link($title, $url = null, $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true, $rel = null) {
-		if ($url !== null) {
-			/** core-hack $rel (relative to current position/routing) **/
-			if ($rel === true || !is_array($url)) {
-				// leave it as it is
-			} else {
-				$defaultArray = array('admin'=>false, 'prefix'=>0);
-				$url = array_merge($defaultArray, $url);
-			}
-			/** core-hack END **/
-			return $this->Html->link($title, $url, $htmlAttributes, $confirmMessage, $escapeTitle);
-		}
-	}
-
 }