allow template to overwrite link and redirect_link methods

This commit is contained in:
Ralf Becker 2010-06-01 21:38:00 +00:00
parent a3bb4afe1b
commit b9f98321f5
2 changed files with 39 additions and 3 deletions

View File

@ -440,7 +440,7 @@ class egw extends egw_minimal
*/
static function link($url = '', $extravars = '')
{
return $GLOBALS['egw']->session->link($url, $extravars);
return $GLOBALS['egw']->framework->link($url, $extravars);
}
/**
@ -452,7 +452,7 @@ class egw extends egw_minimal
*/
static function redirect_link($url = '',$extravars='')
{
self::redirect($GLOBALS['egw']->session->link($url, $extravars));
return $GLOBALS['egw']->framework->redirect_link($url, $extravars);
}
/**

View File

@ -65,7 +65,7 @@ abstract class egw_framework
*
* @return egw_framework
*/
function egw_framework($template)
function __construct($template)
{
$this->template = $template;
@ -75,6 +75,42 @@ abstract class egw_framework
}
}
/**
* PHP4-Constructor
*
* The constructor instanciates the class in $GLOBALS['egw']->framework, from where it should be used
*
* @deprecated use __construct()
*/
function egw_framework($template)
{
self::__construct($template);
}
/**
* Link url generator
*
* @param string $string The url the link is for
* @param string/array $extravars Extra params to be passed to the url
* @return string The full url after processing
*/
static function link($url = '', $extravars = '')
{
return $GLOBALS['egw']->session->link($url, $extravars);
}
/**
* Redirects direct to a generated link
*
* @param string $string The url the link is for
* @param string/array $extravars Extra params to be passed to the url
* @return string The full url after processing
*/
static function redirect_link($url = '',$extravars='')
{
egw::redirect(self::link($url, $extravars));
}
/**
* Renders an applicaton page with the complete eGW framework (header, navigation and menu)
*