euromark 12 年 前
コミット
fe41724b75

+ 32 - 29
View/Helper/DatetimeHelper.php

@@ -1,20 +1,17 @@
 <?php
 
-//App::uses('TimeLib', 'Tools.Utility');
 App::uses('TimeHelper', 'View/Helper');
 
 /**
- * TODO: make extend TimeLib some day?
+ * Wrapper for TimeHelper and TimeLib
  */
 class DatetimeHelper extends TimeHelper {
 
 	public $helpers = array('Html');
 
-	//public $Time;
+	public $userOffset = null;
 
-	protected $userOffset = null;
-
-	protected $daylightSavings = false;
+	public $daylightSavings = false;
 
 	public function __construct($View = null, $settings = array()) {
 		$settings = Set::merge(array('engine' => 'Tools.TimeLib'), $settings);
@@ -30,22 +27,6 @@ class DatetimeHelper extends TimeHelper {
 	}
 
 	/**
-	 * EXPERIMENTAL!!!
-	 * @param
-	 * @param
-	 * @return integer offset
-	 */
-	public function tzOffset($gmtoffset, $isDst) {
-		//global $gmtoffset, $isDst;
-
-		extract(getdate());
-		$serveroffset = gmmktime(0, 0, 0, $mon, $mday, $year) - mktime(0, 0, 0, $mon, $mday, $year);
-		$offset = $gmtoffset - $serveroffset;
-
-		return $offset + ($isDst ? 3600 : 0);
-	}
-
-	/**
 	 * @param string date (from db)
 	 * @return integer age on success, mixed $default otherwise
 	 */
@@ -80,15 +61,15 @@ class DatetimeHelper extends TimeHelper {
 
 	/**
 	 * Returns red/specialGreen/green date depending on the current day
+	 * // TODO refactor!
+	 *
 	 * @param date in DB Format (xxxx-xx-xx)
 	 * ...
 	 * @param array $options
 	 * @param array $attr: html attributes
 	 * @return nicely formatted date
-	 * 2009-07-25 ms
-	 * // TODO refactor!
 	 */
-	public function published($dateString = null, $userOffset = null, $options=array(), $attr=array()) {
+	public function published($dateString = null, $userOffset = null, $options = array(), $attr = array()) {
 		$date = $dateString ? $this->fromString($dateString, $userOffset) : null; // time() ?
 		$niceDate = '';
 		$when = null;
@@ -158,8 +139,9 @@ class DatetimeHelper extends TimeHelper {
 	}
 
 	/**
+	 * For birthdays etc
+	 *
 	 * @deprecated - use TimeLib::isInRange()
-	 * for birthdays etc
 	 * @param date
 	 * @param string days with +-
 	 * @param options
@@ -180,16 +162,37 @@ class DatetimeHelper extends TimeHelper {
 	}
 
 	/**
-	 * Takes time as hh:mm:ss
+	 * Takes time as hh:mm:ss,
 	 * returns hh:mm
-	 * @param badTime
-	 * returns niceTime
 	 * TODO: move to lib, but more generic
+	 *
+	 * @param badTime
+	 * @return string Nice time
 	 */
 	public function niceTime($badTime) {
 		return substr($badTime, 0, 5);
 	}
 
+	/**
+	 * EXPERIMENTAL!!!
+	 * @param
+	 * @param
+	 * @return integer offset
+	 */
+	public function tzOffset($gmtoffset, $isDst) {
+		//global $gmtoffset, $isDst;
+		extract(getdate());
+		$serveroffset = gmmktime(0, 0, 0, $mon, $mday, $year) - mktime(0, 0, 0, $mon, $mday, $year);
+		$offset = $gmtoffset - $serveroffset;
+
+		return $offset + ($isDst ? 3600 : 0);
+	}
+
+	/**
+	 * DatetimeHelper::timezones()
+	 *
+	 * @return array
+	 */
 	public function timezones() {
 		$timezones = array(
 			'America/Adak' => '(GMT-10:00) America/Adak (Hawaii-Aleutian Standard Time)',

+ 1 - 0
View/Helper/DiffHelper.php

@@ -84,6 +84,7 @@ class DiffHelper extends AppHelper {
 	 * @param string $string Either context or unified diff snippet
 	 * @param array $options
 	 * - mode (autodetect, context, unified)
+	 * @return string
 	 */
 	public function reverse($string, $options = array()) {
 		$string = $this->Diff->reverse($string, $options);

+ 2 - 0
View/Helper/FlattrHelper.php

@@ -25,8 +25,10 @@ class FlattrHelper extends AppHelper {
 
 	/**
 	 * Display the FlattrButton
+	 *
 	 * @param mixed $url (unique! necessary)
 	 * @param array $options
+	 * @return string
 	 */
 	public function button($url, $options = array(), $attr = array()) {
 		if (empty($options['uid'])) {

+ 58 - 86
View/Helper/GoogleMapV3Helper.php

@@ -105,7 +105,7 @@ class GoogleMapV3Helper extends AppHelper {
 
 	public $map = '';
 
-	protected $_mapIds = array(); # remember already used ones (valid xhtml contains ids not more than once)
+	protected $_mapIds = array(); // Remember already used ones (valid xhtml contains ids not more than once)
 
 	/**
 	 * Default settings
@@ -113,9 +113,9 @@ class GoogleMapV3Helper extends AppHelper {
 	 * @var array
 	 */
 	protected $_defaultOptions = array(
-		'zoom' => null, # global, both map and staticMap
-		'lat' => null, # global, both map and staticMap
-		'lng' => null, # global, both map and staticMap
+		'zoom' => null, // global, both map and staticMap
+		'lat' => null, // global, both map and staticMap
+		'lng' => null, // global, both map and staticMap
 		'type' => self::TYPE_ROADMAP,
 		'map' => array(
 			'api' => null,
@@ -125,26 +125,18 @@ class GoogleMapV3Helper extends AppHelper {
 			'scaleControl' => true,
 			'scrollwheel' => false,
 			'keyboardShortcuts' => true,
-			//'zoom' => 5, # deprecated as default value, uses global one if missing
-			//'type' => 'R', # deprecated as default value, uses global one if missing
-			//'lat' => 51, # deprecated as default value, uses global one if missing
-			//'lng' => 11, # deprecated as default value, uses global one if missing
 			'typeOptions' => array(),
 			'navOptions' => array(),
 			'scaleOptions' => array(),
-			'defaultLat' => 51, # only last fallback, use Configure::write('Google.lat', ...); to define own one
-			'defaultLng' => 11, # only last fallback, use Configure::write('Google.lng', ...); to define own one
+			'defaultLat' => 51, // only last fallback, use Configure::write('Google.lat', ...); to define own one
+			'defaultLng' => 11, // only last fallback, use Configure::write('Google.lng', ...); to define own one
 			'defaultZoom' => 5,
 		),
 		'staticMap' => array(
 			'size' => '300x300',
-			//'type' =>'R', # deprecated as default value, uses global one if missing
-			//'zoom' => 12 # deprecated as default value, uses global one if missing
-			//'lat' => 51, # deprecated as default value, uses global one if missing
-			//'lng' => 11, # deprecated as default value, uses global one if missing
 			'format' => 'png',
 			'mobile' => false,
-			//'shadow' => true # for icons
+			//'shadow' => true // for icons
 		),
 		'geolocate' => false,
 		'sensor' => false,
@@ -154,7 +146,7 @@ class GoogleMapV3Helper extends AppHelper {
 		//'showInfoWindow' => true,
 		'infoWindow' => array(
 			'content' => '',
-			'useMultiple' => false, # Using single infowindow object for all
+			'useMultiple' => false, // Using single infowindow object for all
 			'maxWidth' => 300,
 			'lat' => null,
 			'lng' => null,
@@ -164,15 +156,15 @@ class GoogleMapV3Helper extends AppHelper {
 		),
 		'marker' => array(
 			//'autoCenter' => true,
-			'animation' => null, # BOUNCE or DROP  https://developers.google.com/maps/documentation/javascript/3.exp/reference#Animation
-			'icon' => null, # => default (red marker) //http://google-maps-icons.googlecode.com/files/home.png
+			'animation' => null, // BOUNCE or DROP  https://developers.google.com/maps/documentation/javascript/3.exp/reference#Animation
+			'icon' => null, // => default (red marker) //http://google-maps-icons.googlecode.com/files/home.png
 			'title' => null,
 			'shadow' => null,
 			'shape' => null,
 			'zIndex' => null,
 			'draggable' => false,
 			'cursor' => null,
-			'directions' => false, # add form with directions
+			'directions' => false, // add form with directions
 			'open' => false, // New in 1.5
 		),
 		'div' => array(
@@ -201,15 +193,15 @@ class GoogleMapV3Helper extends AppHelper {
 			'geolocate' => null //TODO
 		),
 		'plugins' => array(
-			'keydragzoom' => false, # http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/
-			'markermanager' => false, # http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/
-			'markercluster' => false, # http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/
+			'keydragzoom' => false, // http://google-maps-utility-library-v3.googlecode.com/svn/tags/keydragzoom/
+			'markermanager' => false, // http://google-maps-utility-library-v3.googlecode.com/svn/tags/markermanager/
+			'markercluster' => false, // http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/
 		),
-		'autoCenter' => false, # try to fit all markers in (careful, all zooms values are omitted)
-		'autoScript' => false, # let the helper include the necessary js script links
-		'inline' => false, # for scripts
+		'autoCenter' => false, // try to fit all markers in (careful, all zooms values are omitted)
+		'autoScript' => false, // let the helper include the necessary js script links
+		'inline' => false, // for scripts
 		'localImages' => false,
-		'https' => null # auto detect
+		'https' => null // auto detect
 	);
 
 	protected $_currentOptions = array();
@@ -223,7 +215,6 @@ class GoogleMapV3Helper extends AppHelper {
 	public function __construct($View = null, $settings = array()) {
 		parent::__construct($View, $settings);
 
-		# read constum config settings
 		$google = (array)Configure::read('Google');
 		if (!empty($google['api'])) {
 			$this->_defaultOptions['map']['api'] = $google['api'];
@@ -247,7 +238,7 @@ class GoogleMapV3Helper extends AppHelper {
 		if (!empty($google['staticSize'])) {
 			$this->_defaultOptions['staticMap']['size'] = $google['staticSize'];
 		}
-		# the following are convience defaults - if not available the map lat/lng/zoom defaults will be used
+		// the following are convience defaults - if not available the map lat/lng/zoom defaults will be used
 		if (!empty($google['staticZoom'])) {
 			$this->_defaultOptions['staticMap']['zoom'] = $google['staticZoom'];
 		}
@@ -287,11 +278,6 @@ class GoogleMapV3Helper extends AppHelper {
 		if (!empty($language)) {
 			$url .= '&language=' . $language;
 		}
-		/*
-		if (!empty($this->key)) {
-			$url .= '&key=' . $this->key;
-		}
-		*/
 		if (!empty($api)) {
 			$this->_currentOptions['map']['api'] = $api;
 		}
@@ -333,7 +319,6 @@ class GoogleMapV3Helper extends AppHelper {
 	 * @return void
 	 */
 	public function reset($full = true) {
-		//self::$MAP_COUNT
 		self::$markerCount = self::$infoWindowCount = 0;
 		$this->markers = $this->infoWindows = array();
 		if ($full) {
@@ -343,19 +328,22 @@ class GoogleMapV3Helper extends AppHelper {
 
 	/**
 	 * Set the controls of current map
-	 * @param array $controls:
+	 *
+	 * Control options
 	 * - zoom, scale, overview: TRUE/FALSE
 	 *
 	 * - map: FALSE, small, large
 	 * - type: FALSE, normal, menu, hierarchical
 	 * TIP: faster/shorter by using only the first character (e.g. "H" for "hierarchical")
 	 *
+	 * @param array $options
+	 * @return void
 	 */
 	public function setControls($options = array()) {
-		if (!empty($options['streetView'])) {
+		if (isset($options['streetView'])) {
 			$this->_currentOptions['map']['streetViewControl'] = $options['streetView'];
 		}
-		if (!empty($options['zoom'])) {
+		if (isset($options['zoom'])) {
 			$this->_currentOptions['map']['scaleControl'] = $options['zoom'];
 		}
 		if (isset($options['scrollwheel'])) {
@@ -364,25 +352,7 @@ class GoogleMapV3Helper extends AppHelper {
 		if (isset($options['keyboardShortcuts'])) {
 			$this->_currentOptions['map']['keyboardShortcuts'] = $options['keyboardShortcuts'];
 		}
-		/*
-		if (!empty($options['map'])) {
-			if ($options['map'] === 'l' || $options['map'] === 'large') {
-				$this->setMapControl('GLargeMapControl()');
-			} else {
-				$this->setMapControl('GSmallMapControl()');
-			}
-		}
-		*/
-		if (!empty($options['type'])) {
-			/*
-			if ($options['type'] === 'm' || $options['type'] === 'menu') {
-				$this->setMapControl('GMenuMapTypeControl()');
-			} elseif ($options['type'] === 'h' || $options['type'] === 'hierarchical') {
-				$this->setMapControl('GHierarchicalMapTypeControl()');
-			} else {
-				$this->setMapControl('GMapTypeControl()');
-			}
-			*/
+		if (isset($options['type'])) {
 			$this->_currentOptions['map']['type'] = $options['type'];
 		}
 	}
@@ -408,17 +378,17 @@ class GoogleMapV3Helper extends AppHelper {
 
 		$result = '';
 
-		# autoinclude js?
+		// autoinclude js?
 		if (!empty($this->_currentOptions['autoScript']) && !$this->_apiIncluded) {
 			$res = $this->Html->script($this->apiUrl(), array('inline' => $this->_currentOptions['inline']));
 
 			if ($this->_currentOptions['inline']) {
 				$result .= $res . PHP_EOL;
 			}
-			# usually already included
+			// usually already included
 			//http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
 		}
-		# still not very common: http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/basics.html
+		// still not very common: http://code.google.com/intl/de-DE/apis/maps/documentation/javascript/basics.html
 		if (false && !empty($this->_currentOptions['autoScript']) && !$this->_gearsIncluded) {
 			$res = $this->Html->script($this->gearsUrl(), array('inline' => $this->_currentOptions['inline']));
 			if ($this->_currentOptions['inline']) {
@@ -467,9 +437,11 @@ class GoogleMapV3Helper extends AppHelper {
 	}
 
 	/**
+	 * Generate a new LatLng object with the current lat and lng.
+	 *
 	 * @return string
 	 */
-	public function _initialLocation() {
+	protected function _initialLocation() {
 		if ($this->_currentOptions['map']['lat'] && $this->_currentOptions['map']['lng']) {
 			return "new google.maps.LatLng(" . $this->_currentOptions['map']['lat'] . ", " . $this->_currentOptions['map']['lng'] . ")";
 		}
@@ -623,7 +595,7 @@ function geocodeAddress(address) {
 			'label' => __('Enter your address'),
 			'submit' => __('Get directions'),
 			'escape' => true,
-			'zoom' => null, # auto
+			'zoom' => null, // auto
 		);
 		if ($directions === true) {
 			$options['to'] = $markerOptions['lat'] . ',' . $markerOptions['lng'];
@@ -1352,38 +1324,38 @@ var iconShape = {
 			//'visible' => null,
 			//'type' => null,
 		));
-		# do we want zoom to auto-correct itself?
+		// do we want zoom to auto-correct itself?
 		if (!isset($options['zoom']) && !empty($mapOptions['markers'])|| !empty($mapOptions['paths']) || !empty($mapOptions['visible'])) {
 			$options['zoom'] = 'auto';
 		}
 
-		# a position on the map that is supposed to stay visible at all cost
+		// a position on the map that is supposed to stay visible at all cost
 		if (!empty($mapOptions['visible'])) {
 			$params['visible'] = urlencode($mapOptions['visible']);
 		}
 
-		# center and zoom are not necccessary if path, visible or markers are given
+		// center and zoom are not necccessary if path, visible or markers are given
 		if (!isset($options['center']) || $options['center'] === false) {
-			# dont use it
+			// dont use it
 		} elseif ($options['center'] === true && $mapOptions['lat'] !== null && $mapOptions['lng'] !== null) {
 			$params['center'] = urlencode((string)$mapOptions['lat'] . ',' . (string)$mapOptions['lng']);
 		} elseif (!empty($options['center'])) {
 			$params['center'] = urlencode($options['center']);
 		} /*else {
-			# try to read from markers array???
+			// try to read from markers array???
 			if (isset($options['markers']) && count($options['markers']) == 1) {
 				//pr ($options['markers']);
 			}
 		}*/
 
 		if (!isset($options['zoom']) || $options['zoom'] === false) {
-			# dont use it
+			// dont use it
 		} else {
 			if ($options['zoom'] === 'auto') {
 				if (!empty($options['markers']) && strpos($options['zoom'], '|') !== false) {
-					# let google find the best zoom value itself
+					// let google find the best zoom value itself
 				} else {
-					# do something here?
+					// do something here?
 				}
 			} else {
 				$params['zoom'] = $options['zoom'];
@@ -1397,8 +1369,8 @@ var iconShape = {
 		}
 		$params['maptype'] = strtolower($params['maptype']);
 
-		# old: {latitude},{longitude},{color}{alpha-character}
-		# new: @see staticMarkers()
+		// old: {latitude},{longitude},{color}{alpha-character}
+		// new: @see staticMarkers()
 		if (!empty($options['markers'])) {
 			$params['markers'] = $options['markers'];
 		}
@@ -1407,7 +1379,7 @@ var iconShape = {
 			$params['path'] = $options['paths'];
 		}
 
-		# valXval
+		// valXval
 		if (!empty($options['size'])) {
 			$params['size'] = $options['size'];
 		}
@@ -1440,10 +1412,10 @@ var iconShape = {
 	public function staticPaths($pos = array()) {
 		$defaults = array(
 			'color' => 'blue',
-			'weight' => 5 # pixel
+			'weight' => 5 // pixel
 		);
 
-		# not a 2-level array? make it one
+		// not a 2-level array? make it one
 		if (!isset($pos[0])) {
 			$pos = array($pos);
 		}
@@ -1455,7 +1427,7 @@ var iconShape = {
 			$markers = $options['path'];
 			unset($options['path']);
 
-			# prepare color
+			// prepare color
 			if (!empty($options['color'])) {
 				$options['color'] = $this->_prepColor($options['color']);
 			}
@@ -1466,7 +1438,7 @@ var iconShape = {
 			}
 			foreach ($markers as $key => $pos) {
 				if (is_array($pos)) {
-					# lat/lng?
+					// lat/lng?
 					$pos = $pos['lat'] . ',' . $pos['lng'];
 				}
 				$path[] = $pos;
@@ -1509,16 +1481,16 @@ var iconShape = {
 			'size' => ''
 		);
 
-		# not a 2-level array? make it one
+		// not a 2-level array? make it one
 		if (!isset($pos[0])) {
 			$pos = array($pos);
 		}
 
-		# new in staticV2: separate styles! right now just merged
+		// new in staticV2: separate styles! right now just merged
 		foreach ($pos as $p) {
 			$p = array_merge($defaults, $style, $p);
 
-			# adress or lat/lng?
+			// adress or lat/lng?
 			if (!empty($p['lat']) && !empty($p['lng'])) {
 				$p['address'] = $p['lat'] . ',' . $p['lng'];
 			} else {
@@ -1528,12 +1500,12 @@ var iconShape = {
 
 			$values = array();
 
-			# prepare color
+			// prepare color
 			if (!empty($p['color'])) {
 				$p['color'] = $this->_prepColor($p['color']);
 				$values[] = 'color:' . $p['color'];
 			}
-			# label? A-Z0-9
+			// label? A-Z0-9
 			if (!empty($p['label'])) {
 				$values[] = 'label:' . strtoupper($p['label']);
 			}
@@ -1575,8 +1547,8 @@ var iconShape = {
 	}
 
 	/**
-	 * # to 0x
-	 * or # added
+	 * // to 0x
+	 * or // added
 	 *
 	 * @param string $color: FFFFFF, #FFFFFF, 0xFFFFFF or blue
 	 * @return string color
@@ -1649,7 +1621,7 @@ http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/
 		var fluster' . self::$mapCount . ' = new Fluster2(' . $this->name() . ');
 		';
 
-		# styles
+		// styles
 		'fluster' . self::$mapCount . '.styles = {}';
 
 		$this->map .= $js;
@@ -1695,11 +1667,11 @@ function Fluster2ProjectionOverlay(map) {google.maps.OverlayView.call(this);this
 		$res = 6371.04 * acos(sin($pointY['lat'])*sin($pointX['lat'])+cos($pointY['lat'])*cos($pointX['lat'])*cos($pointY['lng'] - $pointX['lng']));
 		*/
 
-		# seems to be the only working one (although slightly incorrect...)
+		// seems to be the only working one (although slightly incorrect...)
 		$res = 69.09 * rad2deg(acos(sin(deg2rad($pointX['lat'])) * sin(deg2rad($pointY['lat'])) +
 			cos(deg2rad($pointX['lat'])) * cos(deg2rad($pointY['lat'])) * cos(deg2rad($pointX['lng'] - $pointY['lng']))));
 
-		# Miles to KM
+		// Miles to KM
 		$res *= 1.609344;
 
 		return ceil($res);

+ 3 - 34
View/Helper/MyHelper.php

@@ -11,15 +11,10 @@ App::uses('UrlCacheManager', 'Tools.Routing');
  */
 class MyHelper extends Helper {
 
-	public function __construct($View = null, $settings = array()) {
-		if (class_exists('Packages')) {
-			Packages::initialize($this, __CLASS__);
-		}
-		parent::__construct($View, $settings);
-	}
-
 	/**
-	 * Manually load helpers
+	 * Manually load helpers.
+	 *
+	 * Also makes sure callbacks are triggered.
 	 *
 	 * @param array $helpers (either strings, or [string => array(config...)])
 	 * @param boolean $callbacks - trigger missed callbacks
@@ -48,32 +43,6 @@ class MyHelper extends Helper {
 	}
 
 	/**
-	 * //TODO: remove
-	 * Not a very good solution, as it takes a lot of resources, file lookups.
-	 *
-	 * Problems: what if inside plugin webroot? not easy to do...
-	 */
-	public function imageIfExists($path, $options = array(), $default = '---') {
-		if (startsWith($path, '/')) {
-			/*
-			$completePath = Router::url($path);
-			//echo (returns(file_exists($completePath)));
-			//die($completePath);
-			# problem with plugin files!!! needs "webroot" added after plugin name
-			if (!file_exists($completePath)) {
-				return $default;
-			}
-			*/
-		} else {
-			$completePath = Router::url($path);
-		}
-		if (!empty($completePath) && !file_exists($completePath)) {
-			return $default;
-		}
-		return $this->image($path, $options);
-	}
-
-	/**
 	 * Display image tag from blob content.
 	 * Enhancement for HtmlHelper. Defaults to png image
 	 *

+ 5 - 0
View/Helper/TextExtHelper.php

@@ -336,6 +336,7 @@ class TextExtHelper extends TextHelper {
 
 	/**
 	 * Transforming int values into ordinal numbers (1st, 3rd, etc.)
+	 *
 	 * @param $num (INT) - the number to be suffixed.
 	 * @param $sup (BOOL) - whether to wrap the suffix in a superscript (<sup>) tag on output.
 	 * @return string ordinal
@@ -362,8 +363,10 @@ class TextExtHelper extends TextHelper {
 
 	/**
 	 * Syntax highlighting using php internal highlighting
+	 *
 	 * @param string $filename
 	 * @param boolean $return (else echo directly)
+	 * @return string
 	 */
 	public static function highlightFile($file, $return = true) {
 		return highlight_file($file, $return);
@@ -371,8 +374,10 @@ class TextExtHelper extends TextHelper {
 
 	/**
 	 * Syntax highlighting using php internal highlighting
+	 *
 	 * @param string $contentstring
 	 * @param boolean $return (else echo directly)
+	 * @return string
 	 */
 	public static function highlightString($string, $return = true) {
 		return highlight_string($string, $return);

+ 2 - 0
View/Helper/TreeHelper.php

@@ -121,6 +121,7 @@ class TreeHelper extends AppHelper {
 	 * @param array $data data to loop on
 	 * @param array $settings
 	 * @return string html representation of the passed data
+	 * @throws CakeException
 	 */
 	public function generate($data, $settings = array()) {
 		if (!$data) {
@@ -522,6 +523,7 @@ class TreeHelper extends AppHelper {
 	 * @param array $treePath
 	 * @param integer $level
 	 * @return void
+	 * @throws CakeException
 	 */
 	protected function _markUnrelatedAsHidden(&$tree, $path, $level = 0) {
 		extract($this->_settings);