public function moveBlockUp( $currentIndex )
    {
        $array =& $this->attributes['blocks'];

        $newIndex = $currentIndex - 1;

        if ( $newIndex < 0 || $newIndex >= count( $array ) )
            return false;

        $tmpItem = $array[$newIndex];

        $array[$newIndex] =& $array[$currentIndex];
        $array[$currentIndex] =& $tmpItem;

        if ( $tmpItem->toBeRemoved() )
            $this->moveBlockUp( $newIndex );

        return true;
    }
public function moveBlockUp( $currentIndex )
    {
        $array =& $this->attributes['blocks'];

        $newIndex = $currentIndex - 1;

        if ( $newIndex < 0 || $newIndex >= count( $array ) )
            return false;

        $tmpItem = $array[$newIndex];

        $array[$newIndex] =& $array[$currentIndex];
        $array[$currentIndex] =& $tmpItem;

        if ( $tmpItem->toBeRemoved() )
            $this->moveBlockUp( $newIndex );

        return true;
    }
public function moveBlockUp ( $ currentIndex ) { $ array = & $ this -> attributes [ 'blocks' ] ; $ newIndex = $ currentIndex - 1 ; if ( $ newIndex < 0 || $ newIndex >= count ( $ array ) ) return false ; $ tmpItem = $ array [ $ newIndex ] ; $ array [ $ newIndex ] = & $ array [ $ currentIndex ] ; $ array [ $ currentIndex ] = & $ tmpItem ; if ( $ tmpItem -> toBeRemoved ( ) ) $ this -> moveBlockUp ( $ newIndex ) ; return true ; }
Move current block position up

@param integer $currentIndex
@return bool
Move current block position up