framework/web/CSort.php
public function getDirections()
	{
		if($this->_directions===null)
		{
			$this->_directions=array();
			if(isset($_GET[$this->sortVar]) && is_string($_GET[$this->sortVar]))
			{
				$attributes=explode($this->separators[0],$_GET[$this->sortVar]);
				foreach($attributes as $attribute)
				{
					if(($pos=strrpos($attribute,$this->separators[1]))!==false)
					{
						$descending=substr($attribute,$pos+1)===$this->descTag;
						if($descending)
							$attribute=substr($attribute,0,$pos);
					}
					else
						$descending=false;

					if(($this->resolveAttribute($attribute))!==false)
					{
						$this->_directions[$attribute]=$descending;
						if(!$this->multiSort)
							return $this->_directions;
					}
				}
			}
			if($this->_directions===array() && is_array($this->defaultOrder))
				$this->_directions=$this->defaultOrder;
		}
		return $this->_directions;
	}
public function getDirections()
	{
		if($this->_directions===null)
		{
			$this->_directions=array();
			if(isset($_GET[$this->sortVar]) && is_string($_GET[$this->sortVar]))
			{
				$attributes=explode($this->separators[0],$_GET[$this->sortVar]);
				foreach($attributes as $attribute)
				{
					if(($pos=strrpos($attribute,$this->separators[1]))!==false)
					{
						$descending=substr($attribute,$pos+1)===$this->descTag;
						if($descending)
							$attribute=substr($attribute,0,$pos);
					}
					else
						$descending=false;

					if(($this->resolveAttribute($attribute))!==false)
					{
						$this->_directions[$attribute]=$descending;
						if(!$this->multiSort)
							return $this->_directions;
					}
				}
			}
			if($this->_directions===array() && is_array($this->defaultOrder))
				$this->_directions=$this->defaultOrder;
		}
		return $this->_directions;
	}
public function getDirections ( ) { if ( $ this -> _directions === null ) { $ this -> _directions = array ( ) ; if ( isset ( $ _GET [ $ this -> sortVar ] ) && is_string ( $ _GET [ $ this -> sortVar ] ) ) { $ attributes = explode ( $ this -> separators [ 0 ] , $ _GET [ $ this -> sortVar ] ) ; foreach ( $ attributes as $ attribute ) { if ( ( $ pos = strrpos ( $ attribute , $ this -> separators [ 1 ] ) ) !== false ) { $ descending = substr ( $ attribute , $ pos + 1 ) === $ this -> descTag ; if ( $ descending ) $ attribute = substr ( $ attribute , 0 , $ pos ) ; } else $ descending = false ; if ( ( $ this -> resolveAttribute ( $ attribute ) ) !== false ) { $ this -> _directions [ $ attribute ] = $ descending ; if ( ! $ this -> multiSort ) return $ this -> _directions ; } } } if ( $ this -> _directions === array ( ) && is_array ( $ this -> defaultOrder ) ) $ this -> _directions = $ this -> defaultOrder ; } return $ this -> _directions ; }
Returns the currently requested sort information.
@return array sort directions indexed by attribute names.
Sort direction can be either CSort::SORT_ASC for ascending order or
CSort::SORT_DESC for descending order.
Returns the currently requested sort information .