Savant_Plugin_ahref.php from Brim at Krugle
Show Savant_Plugin_ahref.php syntax highlighted
<?php
/**
*
* Output an HTML <a href="">...</a> tag.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* @license http://www.gnu.org/copyleft/lesser.html LGPL
*
* @author Paul M. Jones <pmjones@ciaweb.net>
*
* @package Savant
*
* @version $Id: Savant_Plugin_ahref.php 13 2005-02-09 11:58:38Z barrel $
*
* @access public
*
* @param object &$savant A reference to the calling Savant object.
*
* @param string $href The URL for the resulting <a href="">...</a> tag.
*
* @param string $text The text surrounded by the <a>...</a> tag set.
*
* @param string $extra Any "extra" HTML code to place within the <a>
* opening tag.
*
* @return string
*
*/
require_once 'ext/Savant/Savant/Plugin.php';
class Savant_Plugin_ahref extends Savant_Plugin {
function ahref(&$savant, $href, $text, $extra = null)
{
$output = '<a href="' . $href . '"';
if (! is_null($extra)) {
$output .= ' ' . $extra;
}
$output .= '>' . $text . '</a>';
return $output;
}
}
?>
See more files for this project here