* adjust onlybody.

This commit is contained in:
wangyidong
2012-08-30 08:24:36 +00:00
parent e707d6d314
commit f9f59a8a9a

View File

@@ -82,8 +82,17 @@ class html
*/
static public function a($href = '', $title = '', $target = "_self", $misc = '', $newline = true)
{
global $config;
if(empty($title)) $title = $href;
$newline = $newline ? "\n" : '';
//if page has onlybody param then add this param in all link. the param hide header and footer.
if(strpos($href, 'onlybody=yes') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')
{
$onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes";
$href .= $onlybody;
}
if($target == '_self') return "<a href='$href' $misc>$title</a>$newline";
return "<a href='$href' target='$target' $misc>$title</a>$newline";
}
@@ -449,6 +458,13 @@ EOT;
*/
public static function linkButton($label = '', $link = '', $misc = '')
{
global $config;
//if page has onlybody param then add this param in all link. the param hide header and footer.
if(strpos($href, 'onlybody=') === false and isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes')
{
$onlybody = $config->requestType == 'PATH_INFO' ? "?onlybody=yes" : "&onlybody=yes";
$link .= $onlybody;
}
return " <input type='button' value='$label' class='button-c' $misc onclick='location.href=\"$link\"' /> ";
}