<?php

function wikiplugin_a_help() {
        return tra("Puts an anchor and links to the anchor onto a wiki page").":<br :>~np~{A(a=anchorname)}{A}~/np~ for the anchor<br />~np~{A(a=anchorname)}link text{A}~/np~ for the links to the anchor";
}

function wikiplugin_a($data, $params)
{
        global $tikilib;
        extract ($params, EXTR_SKIP);


	if (!isset($a)) {
		$a='';
		return ("<b>missing parameter for a</b><br />");
        }

	$start="~np~<A ";
	$close=">";
	$end="</A>~/np~";

	$ret='';
	$ret.=$start;

	   if (!$data=="") {
	$ret.="href=\"#$a\"";
	$ret.=$close;
	$ret.=$data;
	$ret.=$end;

	   } else {
	$ret.="name=\"$a\"";
	$ret.=$close;
	$ret.=$end;

}

return $ret;

}

?>
