make common description editor work even when no referer is set

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@597 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
cweiske 2010-01-16 11:15:06 +00:00
parent 9340fde0fa
commit 50f41d57f7

View file

@ -60,19 +60,23 @@ if (POST_CONFIRM) {
&& $cdservice->addTagDescription($tag, stripslashes(POST_DESCRIPTION), $currentUser->getId(), time())
) {
$tplVars['msg'] = T_('Tag common description updated');
header('Location: '. POST_REFERRER);
if (POST_REFERRER) {
header('Location: '. POST_REFERRER);
}
} else {
$tplVars['error'] = T_('Failed to update the tag common description');
$template = 'error.500.tpl';
}
} else if (POST_CANCEL) {
header('Location: '. POST_REFERRER);
} else {
$tplVars['subtitle'] = T_('Edit Tag Common Description') .': '. $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag;
$tplVars['referrer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$tplVars['tag'] = $tag;
$tplVars['description'] = $cdservice->getLastTagDescription($tag);
if (POST_REFERRER) {
header('Location: '. POST_REFERRER);
}
}
$tplVars['subtitle'] = T_('Edit Tag Common Description') .': '. $tag;
$tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag;
$tplVars['referrer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
$tplVars['tag'] = $tag;
$tplVars['description'] = $cdservice->getLastTagDescription($tag);
$templateservice->loadTemplate($template, $tplVars);
?>