<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/

/**
 * Class Francis_Response_Service
 *
 * Processes responses from action controller
 */
class Francis_Response_Service {
    /**
     * Main response handling function
     *
     * @param Francis_Response_Abstract $response  General action controller response
     */
    public static function processResponse( Francis_Response_Abstract $response ) {

        // If response is an html response
        // @todo Switch case on getType()
        if ( $response instanceof Francis_Response_Html ) {

            // Output html
            echo $response->getHtml();
        } else if ( $response instanceof Francis_Response_Redirect) {

            // Redirect to given URL is set
            $url = $response->getUrl();
            if ( is_string( $url ) ) {
                //RM_Admin_Utils_Helper::redirect( $url );
            }
        }
    }
}