<?php
/**
 * View helper for url.
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */

/**
 * Gets url from application defined by router. Simple wrapper for
 * original helper from framework, which decorates final url by current
 * application language.
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */
class HomeWebApp_View_Helper_Url extends Zend_View_Helper_Url
{
    public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
    {
        return MKLib_UrlLangDecorator::getUrl(
            parent::url($urlOptions, $name, $reset, $encode),
                Zend_Controller_Front::getInstance()
                    ->getParam('bootstrap')
                    ->getPluginResource('locale')
                    ->getLocale()
                    ->getLanguage()
        );
    }
}
